text: !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.XMPP=e()}}(function(){var e;return function e(t,n,r){function s(o,a){if(!n[o]){if(!t[o]){var c="function"==typeof require&&require;if(!a&&c)return c(o,!0);if(i)return i(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var d=n[o]={exports:{}};t[o][0].call(d.exports,function(e){var n=t[o][1][e];return s(n?n:e)},d,d.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)s(r[o]);return s}({"/Users/pedrogutierrez/Projects/stanza.io/index.js":[function(e,t,n){"use strict";n.VERSION="8.0.1",n.JID=e("xmpp-jid").JID,n.Client=e("./lib/client"),n.createClient=function(t){var r=new n.Client(t);return r.use(e("./lib/plugins")),r}},{"./lib/client":"/Users/pedrogutierrez/Projects/stanza.io/lib/client.js","./lib/plugins":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/index-browser.js","xmpp-jid":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-jid/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/lib/client.js":[function(e,t,n){"use strict";function timeoutRequest(e,t,n){var r;return Promise.race([e,new Promise(function(e,s){r=setTimeout(function(){s({id:t,type:"error",error:{condition:"timeout"}})},n)})]).then(function(e){return clearTimeout(r),e})}function Client(t){var n=this;a.call(this),t=t||{},this._initConfig(t),this.stanzas=o.getGlobalJXT(),this.jid=new d,this.stanzas=o.createRegistry(),this.stanzas.use(e("jxt-xmpp-types")),this.stanzas.use(e("jxt-xmpp")),this.use(e("./plugins/features")),this.use(e("./plugins/sasl")),this.use(e("./plugins/smacks")),this.use(e("./plugins/bind")),this.use(e("./plugins/session")),this.sm=new l(this),this.transports={},this.use(e("./plugins/websocket")),this.use(e("./plugins/oldwebsocket")),this.use(e("./plugins/bosh")),this.on("stream:data",function(e){var t=e.toJSON();if("iq"===e._name&&(t._xmlChildCount=0,r(e.xml.childNodes,function(e){1===e.nodeType&&(t._xmlChildCount+=1)})),n.emit(e._eventname||e._name,t),"message"===e._name||"presence"===e._name||"iq"===e._name)n.sm.handle(t),n.emit("stanza",t);else{if("smAck"===e._name)return n.sm.process(t);if("smRequest"===e._name)return n.sm.ack()}t.id&&(n.emit("id:"+t.id,t),n.emit(e._name+":id:"+t.id,t))}),this.on("disconnected",function(){n.transport&&(n.transport.off("*"),delete n.transport),n.releaseGroup("connection")}),this.on("iq",function(e){var t=e.type,r=e._xmlChildCount;delete e._xmlChildCount;var s=Object.keys(e).filter(function(e){return"id"!==e&&"to"!==e&&"from"!==e&&"lang"!==e&&"type"!==e&&"errorReply"!==e&&"resultReply"!==e});if("get"===e.type||"set"===e.type){if(1!==r)return n.sendIq(e.errorReply({error:{type:"modify",condition:"bad-request"}}));if(!s.length)return n.sendIq(e.errorReply({error:{type:"cancel",condition:"feature-not-implemented"}}));var i="iq:"+t+":"+s[0];n.callbacks[i]?n.emit(i,e):n.sendIq(e.errorReply({error:{type:"cancel",condition:"feature-not-implemented"}}))}}),this.on("message",function(e){Object.keys(e.$body||{}).length&&("chat"===e.type||"normal"===e.type?n.emit("chat",e):"groupchat"===e.type&&n.emit("groupchat",e)),"error"===e.type&&n.emit("message:error",e)}),this.on("presence",function(e){var t=e.type||"available";"error"===t&&(t="presence:error"),n.emit(t,e)})}var r=e("lodash.foreach"),s=e("lodash.assign"),i=e("lodash.isarray"),o=e("jxt"),a=e("wildemitter"),c=e("util"),u=e("uuid"),d=e("xmpp-jid").JID,l=e("./sm"),p=e("hostmeta"),f=e("saslmechanisms"),m={external:e("sasl-external"),"scram-sha-1":e("sasl-scram-sha-1"),"digest-md5":e("alt-sasl-digest-md5"),"x-oauth2":e("sasl-x-oauth2"),plain:e("sasl-plain"),anonymous:e("sasl-anonymous")};c.inherits(Client,a),Object.defineProperty(Client.prototype,"stream",{get:function(){return this.transport?this.transport.stream:void 0}}),Client.prototype._initConfig=function(e){var t=this,n=this.config||{};this.config=s({useStreamManagement:!0,transports:["websocket","bosh"],sasl:["external","scram-sha-1","digest-md5","plain","anonymous"]},n,e),i(this.config.sasl)||(this.config.sasl=[this.config.sasl]),this.SASLFactory=new f,this.config.sasl.forEach(function(e){if("string"==typeof e){var n=m[e.toLowerCase()];n&&t.SASLFactory.use(n)}else t.SASLFactory.use(e)}),this.config.jid=new d(this.config.jid),this.config.server||(this.config.server=this.config.jid.domain),this.config.password&&(this.config.credentials=this.config.credentials||{},this.config.credentials.password=this.config.password,delete this.config.password),this.config.transport&&(this.config.transports=[this.config.transport]),i(this.config.transports)||(this.config.transports=[this.config.transports])},Client.prototype.use=function(e){e(this,this.stanzas,this.config)},Client.prototype.nextId=function(){return u.v4()},Client.prototype.discoverBindings=function(e,t){p(e,function(e,n){if(e)return t(e,[]);var r={websocket:[],bosh:[]},s=n.links||[];s.forEach(function(e){e.href&&"urn:xmpp:alt-connections:websocket"===e.rel&&r.websocket.push(e.href),e.href&&"urn:xmpp:altconnect:websocket"===e.rel&&r.websocket.push(e.href),e.href&&"urn:xmpp:alt-connections:xbosh"===e.rel&&r.bosh.push(e.href),e.href&&"urn:xmpp:altconnect:bosh"===e.rel&&r.bosh.push(e.href)}),t(!1,r)})},Client.prototype._getConfiguredCredentials=function(){var e=this.config.credentials||{},t=new d(this.config.jid),n=e.username||t.local,r=e.server||t.domain,i={username:n,password:this.config.password,server:r,host:r,realm:r,serviceType:"xmpp",serviceName:r},o=s(i,e);return o},Client.prototype.getCredentials=function(e){return e(null,this._getConfiguredCredentials())},Client.prototype.connect=function(e,t){var n=this;if(this._initConfig(e),t&&t.name&&t.url){var r=n.transport=new n.transports[t.name](n.sm,n.stanzas);return r.on("*",function(e,t){n.emit(e,t)}),r.connect(n.config)}return!t&&1===n.config.transports.length&&(t={},t.name=n.config.transports[0],"websocket"!==t.name&&"old-websocket"!==t.name||(t.url=n.config.wsURL),"bosh"===t.name&&(t.url=n.config.boshURL),t.name&&t.url)?n.connect(null,t):n.discoverBindings(n.config.server,function(e,t){if(e)return console.error("Could not find https://"+n.config.server+"/.well-known/host-meta file to discover connection endpoints for the requested transports."),n.disconnect();for(var r=0,s=n.config.transports.length;r<s;r++){var i=n.config.transports[r];console.log("Checking for %s endpoints",i);for(var o=0,a=(t[i]||[]).length;o<a;o++){var c=t[i][o];if(0===c.indexOf("wss://")||0===c.indexOf("https://"))return"websocket"===i?n.config.wsURL=c:n.config.boshURL=c,console.log("Using %s endpoint: %s",i,c),n.connect(null,{name:i,url:c});console.warn("Discovered unencrypted %s endpoint (%s). Ignoring",i,c)}}return console.error("No endpoints found for the requested transports."),n.disconnect()})},Client.prototype.disconnect=function(){this.sessionStarted&&(this.releaseGroup("session"),this.sm.started||this.emit("session:end")),this.sessionStarted=!1,this.releaseGroup("connection"),this.transport?this.transport.disconnect():this.emit("disconnected")},Client.prototype.send=function(e){this.sm.track(e),this.transport&&this.transport.send(e)},Client.prototype.sendMessage=function(e){e=e||{},e.id||(e.id=this.nextId());var t=this.stanzas.getMessage(),n=new t(e);return this.emit("message:sent",n.toJSON()),this.send(n),e.id},Client.prototype.sendPresence=function(e){e=e||{},e.id||(e.id=this.nextId());var t=this.stanzas.getPresence();return this.send(new t(e)),e.id},Client.prototype.sendIq=function(e,t){var n,r,s,i,o=this;e=e||{},e.id||(e.id=this.nextId());var a=this.stanzas.getIq(),c=e.toJSON?e:new a(e);return"error"===e.type||"result"===e.type?void this.send(c):(i=new d(e.to),s={},s[""]=!0,s[i.full]=!0,s[i.bare]=!0,s[i.domain]=!0,s[o.jid.bare]=!0,s[o.jid.domain]=!0,r="iq:id:"+e.id,n=new Promise(function(e,t){var n=function(i){s[i.from.full]&&("result"!==i.type&&"error"!==i.type||(o.off(r,n),i.error?t(i):e(i)))};o.on(r,"session",n)}),this.send(c),timeoutRequest(n,e.id,1e3*(o.config.timeout||15)).then(function(e){return t&&t(null,e),e},function(e){if(t)return t(e);throw e}))},Client.prototype.sendStreamError=function(e){e=e||{};var t=this.stanzas.getStreamError(),n=new t(e);this.emit("stream:error",n.toJSON()),this.send(n),this.disconnect()},t.exports=Client},{"./plugins/bind":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/bind.js","./plugins/bosh":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/bosh.js","./plugins/features":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/features.js","./plugins/oldwebsocket":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/oldwebsocket.js","./plugins/sasl":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/sasl.js","./plugins/session":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/session.js","./plugins/smacks":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/smacks.js","./plugins/websocket":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/websocket.js","./sm":"/Users/pedrogutierrez/Projects/stanza.io/lib/sm.js","alt-sasl-digest-md5":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/alt-sasl-digest-md5/index.js",hostmeta:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/hostmeta/index.js",jxt:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt/index.js","jxt-xmpp":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/index.js","jxt-xmpp-types":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp-types/lib/index.js","lodash.assign":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.assign/index.js","lodash.foreach":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.foreach/index.js","lodash.isarray":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.isarray/index.js","sasl-anonymous":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sasl-anonymous/main.js","sasl-external":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sasl-external/main.js","sasl-plain":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sasl-plain/main.js","sasl-scram-sha-1":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sasl-scram-sha-1/index.js","sasl-x-oauth2":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sasl-x-oauth2/main.js",saslmechanisms:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/saslmechanisms/main.js",util:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/util/util.js",uuid:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/uuid/uuid.js",wildemitter:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/wildemitter/wildemitter.js","xmpp-jid":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-jid/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/attention.js":[function(e,t,n){"use strict";t.exports=function(e){e.disco.addFeature("urn:xmpp:attention:0"),e.getAttention=function(t,n){n=n||{},n.to=t,n.type="headline",n.attention=!0,e.sendMessage(n)},e.on("message",function(t){t.attention&&e.emit("attention",t)})}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/avatar.js":[function(e,t,n){"use strict";t.exports=function(e){e.disco.addFeature("urn:xmpp:avatar:metadata+notify"),e.on("pubsub:event",function(t){t.event.updated&&"urn:xmpp:avatar:metadata"===t.event.updated.node&&e.emit("avatar",{jid:t.from,source:"pubsub",avatars:t.event.updated.published[0].avatars})}),e.on("presence",function(t){t.avatarId&&e.emit("avatar",{jid:t.from,source:"vcard",avatars:[{id:t.avatarId}]})}),e.publishAvatar=function(e,t,n){return this.publish("","urn:xmpp:avatar:data",{id:e,avatarData:t},n)},e.useAvatars=function(e,t){return this.publish("","urn:xmpp:avatar:metadata",{id:"current",avatars:e},t)},e.getAvatar=function(e,t,n){return this.getItem(e,"urn:xmpp:avatar:data",t,n)}}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/bind.js":[function(e,t,n){"use strict";var r=e("xmpp-jid").JID;t.exports=function(e,t,n){e.registerFeature("bind",300,function(e,t){var s=this;s.sendIq({type:"set",bind:{resource:n.resource}},function(n,i){if(n)return s.emit("session:error",n),t("disconnect","JID binding failed");s.features.negotiated.bind=!0,s.jid=new r(i.bind.jid),s.emit("session:bound",s.jid);var o=!e.session||e.session&&e.session.optional;return!s.sessionStarted&&o&&(s.sessionStarted=!0,s.emit("session:started",s.jid)),t()})}),e.on("disconnected",function(){e.sessionStarted=!1,e.features.negotiated.bind=!1})}},{"xmpp-jid":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-jid/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/blocking.js":[function(e,t,n){"use strict";t.exports=function(e){e.disco.addFeature("urn:xmpp:blocking"),e.block=function(t,n){return e.sendIq({type:"set",block:{jids:[t]}},n)},e.unblock=function(t,n){return e.sendIq({type:"set",unblock:{jids:[t]}},n)},e.getBlocked=function(t){return e.sendIq({type:"get",blockList:!0},t)},e.on("iq:set:block",function(t){e.emit("block",{jids:t.block.jids||[]}),e.sendIq(t.resultReply())}),e.on("iq:set:unblock",function(t){e.emit("unblock",{jids:t.unblock.jids||[]}),e.sendIq(t.resultReply())})}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/bob.js":[function(e,t,n){"use strict";t.exports=function(e){e.disco.addFeature("urn:xmpp:bob"),e.getBits=function(t,n,r){return e.sendIq({to:t,type:"get",bob:{cid:n}},r)}}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/bookmarks.js":[function(e,t,n){"use strict";var r=e("lodash.assign"),s=e("lodash.filter"),i=e("xmpp-jid").JID;t.exports=function(e){e.getBookmarks=function(e){return this.getPrivateData({bookmarks:!0},e)},e.setBookmarks=function(e,t){return this.setPrivateData({bookmarks:e},t)},e.addBookmark=function(t,n){return t.jid=new i(t.jid),this.getBookmarks().then(function(n){var i=n.privateStorage.bookmarks.conferences||[],o=s(i,function(e){return e.jid.bare===t.jid.bare});return o.length?r(o[0],t):i.push(t),e.setBookmarks({conferences:i})}).then(function(e){return n&&n(null,e),e},function(e){if(!n)throw e;n(e)})},e.removeBookmark=function(t,n){return t=new i(t),this.getBookmarks().then(function(n){var r=n.privateStorage.bookmarks.conferences||[];return r=s(r,function(e){return t.bare!==e.jid.bare}),e.setBookmarks({conferences:r})}).then(function(e){n&&n(null,e)},function(e){if(!n)throw e;n(e)})}}},{"lodash.assign":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.assign/index.js","lodash.filter":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.filter/index.js","xmpp-jid":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-jid/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/bosh.js":[function(e,t,n){"use strict";var r=e("../transports/bosh");t.exports=function(e){e.transports.bosh=r}},{"../transports/bosh":"/Users/pedrogutierrez/Projects/stanza.io/lib/transports/bosh.js"}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/carbons.js":[function(e,t,n){"use strict";t.exports=function(e){e.disco.addFeature("urn:xmpp:carbons:2"),e.enableCarbons=function(e){return this.sendIq({type:"set",enableCarbons:!0},e)},e.disableCarbons=function(e){return this.sendIq({type:"set",disableCarbons:!0},e)},e.on("message",function(t){return t.carbonSent?e.emit("carbon:sent",t):t.carbonReceived?e.emit("carbon:received",t):void 0}),e.on("carbon:*",function(t,n){var r=t.split(":")[1];if(n.from.bare===e.jid.bare){var s,i;"received"===r?(s=n.carbonReceived.forwarded.message,i=n.carbonReceived.forwarded.delay):(s=n.carbonSent.forwarded.message,i=n.carbonSent.forwarded.delay),s.delay||(i?s.delay.stamp=i.stamp:s.delay={stamp:new Date(Date.now())}),s.carbon=!0,s.from.bare===e.jid.bare?e.emit("message:sent",s):e.emit("message",s)}})}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/chatstates.js":[function(e,t,n){"use strict";t.exports=function(e){e.disco.addFeature("http://jabber.org/protocol/chatstates"),e.on("message",function(t){t.chatState&&(e.emit("chat:state",{to:t.to,from:t.from,chatState:t.chatState}),e.emit("chatState",{to:t.to,from:t.from,chatState:t.chatState}))})}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/command.js":[function(e,t,n){"use strict";var r="http://jabber.org/protocol/commands";t.exports=function(e){e.disco.addFeature(r),e.disco.addItem({name:"Ad-Hoc Commands",node:r}),e.getCommands=function(t,n){return e.getDiscoItems(t,r,n)}}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/correction.js":[function(e,t,n){"use strict";t.exports=function(e){e.disco.addFeature("urn:xmpp:message-correct:0"),e.on("message",function(t){t.replace&&(e.emit("replace",t),e.emit("replace:"+t.id,t))})}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/csi.js":[function(e,t,n){"use strict";t.exports=function(e,t){var n=t.getDefinition("active","urn:xmpp:csi"),r=t.getDefinition("inactive","urn:xmpp:csi");e.registerFeature("clientStateIndication",400,function(e,t){this.features.negotiated.clientStateIndication=!0,t()}),e.markActive=function(){this.features.negotiated.clientStateIndication&&this.send(new n)},e.markInactive=function(){this.features.negotiated.clientStateIndication&&this.send(new r)}}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/dataforms.js":[function(e,t,n){"use strict";t.exports=function(e){e.disco.addFeature("jabber:x:data"),e.disco.addFeature("urn:xmpp:media-element"),e.disco.addFeature("http://jabber.org/protocol/xdata-validate"),e.disco.addFeature("http://jabber.org/protocol/xdata-layout"),e.on("message",function(t){t.form&&e.emit("dataform",t)})}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/delayed.js":[function(e,t,n){"use strict";t.exports=function(e){e.disco.addFeature("urn:xmpp:delay")}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/disco.js":[function(e,t,n){(function(n){"use strict";function generateVerString(e,t){var i="",a=e.features.sort(),c=[],u={},d=[];r(e.identities,function(e){c.push([e.category||"",e.type||"",e.lang||"",e.name||""].join("/"))}),c.sort();var l=c.length,p=a.length;if(c=s(c,!0),a=s(a,!0),p!==a.length||l!==c.length)return!1;i+=c.join("<")+"<",i+=a.join("<")+"<";var f=!1;if(r(e.extensions,function(e){for(var t=e.fields,n=0,r=t.length;n<r;n++)if("FORM_TYPE"===t[n].name&&"hidden"===t[n].type){var s=t[n].value;return u[s]?void(f=!0):(u[s]=e,void d.push(s))}}),f)return!1;d.sort(),r(d,function(e){var t=u[e],n={},s=[];i+="<"+e,r(t.fields,function(e){var t=e.name;if("FORM_TYPE"!==t){var r=e.value||"";"object"!=typeof r&&(r=r.split("\n")),n[t]=r.sort(),s.push(t)}}),s.sort(),r(s,function(e){i+="<"+e,r(n[e],function(e){i+="<"+e})})});var m=o.createHash(t).update(new n(i,"utf8")).digest("base64"),h=4-m.length%4;4===h&&(h=0);for(var g=0;g<h;g++)m+="=";return m}function verifyVerString(e,t,n){var r=generateVerString(e,t);return r&&r===n}function Disco(){this.features={},this.identities={},this.extensions={},this.items={},this.caps={}}var r=e("lodash.foreach"),s=e("lodash.uniq"),i=e("xmpp-jid").JID,o=e("iana-hashes");Disco.prototype={constructor:{value:Disco},addFeature:function(e,t){t=t||"",this.features[t]||(this.features[t]=[]),this.features[t].push(e)},addIdentity:function(e,t){t=t||"",this.identities[t]||(this.identities[t]=[]),this.identities[t].push(e)},addItem:function(e,t){t=t||"",this.items[t]||(this.items[t]=[]),this.items[t].push(e)},addExtension:function(e,t){t=t||"",this.extensions[t]||(this.extensions[t]=[]),this.extensions[t].push(e)}},t.exports=function(e){e.disco=new Disco(e),e.disco.addFeature("http://jabber.org/protocol/disco#info"),e.disco.addFeature("http://jabber.org/protocol/disco#items"),e.disco.addIdentity({category:"client",type:"web"}),e.registerFeature("caps",100,function(t,n){this.emit("disco:caps",{from:new i(e.jid.domain||e.config.server),caps:t.caps}),this.features.negotiated.caps=!0,n()}),e.getDiscoInfo=function(e,t,n){return this.sendIq({to:e,type:"get",discoInfo:{node:t}},n)},e.getDiscoItems=function(e,t,n){return this.sendIq({to:e,type:"get",discoItems:{node:t}},n)},e.updateCaps=function(){var t=this.config.capsNode||"https://stanza.io",n=JSON.parse(JSON.stringify({identities:this.disco.identities[""],features:this.disco.features[""],extensions:this.disco.extensions[""]})),r=generateVerString(n,"sha-1");return this.disco.caps={node:t,hash:"sha-1",ver:r},t=t+"#"+r,this.disco.features[t]=n.features,this.disco.identities[t]=n.identities,this.disco.extensions[t]=n.extensions,e.getCurrentCaps()},e.getCurrentCaps=function(){var t=e.disco.caps;if(!t.ver)return{ver:null,discoInfo:null};var n=t.node+"#"+t.ver;return{ver:t.ver,discoInfo:{identities:e.disco.identities[n],features:e.disco.features[n],extensions:e.disco.extensions[n]}}},e.on("presence",function(t){t.caps&&e.emit("disco:caps",t)}),e.on("iq:get:discoInfo",function(t){var n=t.discoInfo.node||"",r=t.discoInfo.node||"";n===e.disco.caps.node+"#"+e.disco.caps.ver&&(r=n,n=""),e.sendIq(t.resultReply({discoInfo:{node:r,identities:e.disco.identities[n]||[],features:e.disco.features[n]||[],extensions:e.disco.extensions[n]||[]}}))}),e.on("iq:get:discoItems",function(t){var n=t.discoItems.node;e.sendIq(t.resultReply({discoItems:{node:n,items:e.disco.items[n]||[]}}))}),e.verifyVerString=verifyVerString,e.generateVerString=generateVerString,e.updateCaps()}}).call(this,e("buffer").Buffer)},{buffer:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/index.js","iana-hashes":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/iana-hashes/index.js","lodash.foreach":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.foreach/index.js","lodash.uniq":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.uniq/index.js","xmpp-jid":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-jid/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/escaping.js":[function(e,t,n){"use strict";t.exports=function(e){e.disco.addFeature("jid\\20escaping")}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/extdisco.js":[function(e,t,n){"use strict";t.exports=function(e){e.disco.addFeature("urn:xmpp:extdisco:1"),e.getServices=function(e,t,n){return this.sendIq({type:"get",to:e,services:{type:t}},n)},e.getServiceCredentials=function(e,t,n){return this.sendIq({type:"get",to:e,credentials:{service:{host:t}}},n)}}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/features.js":[function(e,t,n){"use strict";var r=e("async");t.exports=function(e){e.features={negotiated:{},order:[],handlers:{}},e.registerFeature=function(t,n,r){this.features.order.push({priority:n,name:t}),this.features.order.sort(function(e,t){return e.priority<t.priority?-1:e.priority>t.priority?1:0}),this.features.handlers[t]=r.bind(e)},e.on("streamFeatures",function(t){var n=[],s=e.features.negotiated,i=e.features.handlers;e.features.order.forEach(function(e){var r=e.name;t[r]&&i[r]&&!s[r]&&n.push(function(e){s[r]?e():i[r](t,e)})}),r.series(n,function(t,n){"restart"===t?e.transport.restart():"disconnect"===t&&(e.emit("stream:error",{condition:"policy-violation",text:"Failed to negotiate stream features: "+n}),e.disconnect())})})}},{async:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/async/lib/async.js"}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/forwarding.js":[function(e,t,n){"use strict";t.exports=function(e){e.disco.addFeature("urn:xmpp:forward:0")}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/geoloc.js":[function(e,t,n){"use strict";t.exports=function(e){e.disco.addFeature("http://jabber.org/protocol/geoloc"),e.disco.addFeature("http://jabber.org/protocol/geoloc+notify"),e.on("pubsub:event",function(t){t.event.updated&&"http://jabber.org/protocol/geoloc"===t.event.updated.node&&e.emit("geoloc",{jid:t.from,geoloc:t.event.updated.published[0].geoloc})}),e.publishGeoLoc=function(e,t){return this.publish("","http://jabber.org/protocol/geoloc",{geoloc:e},t)}}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/hashes.js":[function(e,t,n){"use strict";var r=e("iana-hashes");t.exports=function(e){e.disco.addFeature("urn:xmpp:hashes:1");var t=r.getHashes();t.forEach(function(t){e.disco.addFeature("urn:xmpp:hash-function-text-names:"+t)})}},{"iana-hashes":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/iana-hashes/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/idle.js":[function(e,t,n){"use strict";t.exports=function(e){e.disco.addFeature("urn:xmpp:idle:1")}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/index-browser.js":[function(e,t,n){"use strict";t.exports=function(t){t.use(e("./disco")),t.use(e("./attention")),t.use(e("./avatar")),t.use(e("./blocking")),t.use(e("./bob")),t.use(e("./bookmarks")),t.use(e("./carbons")),t.use(e("./chatstates")),t.use(e("./command")),t.use(e("./correction")),t.use(e("./csi")),t.use(e("./dataforms")),t.use(e("./delayed")),t.use(e("./escaping")),t.use(e("./extdisco")),t.use(e("./forwarding")),t.use(e("./geoloc")),t.use(e("./hashes")),t.use(e("./idle")),t.use(e("./invisible")),t.use(e("./jidprep")),t.use(e("./jingle")),t.use(e("./json")),t.use(e("./keepalive")),t.use(e("./logging")),t.use(e("./mam")),t.use(e("./muc")),t.use(e("./mood")),t.use(e("./nick")),t.use(e("./oob")),t.use(e("./ping")),t.use(e("./private")),t.use(e("./psa")),t.use(e("./pubsub")),t.use(e("./reach")),t.use(e("./receipts")),t.use(e("./register")),t.use(e("./roster")),t.use(e("./rtt")),t.use(e("./shim")),t.use(e("./time")),t.use(e("./vcard")),t.use(e("./version"))}},{"./attention":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/attention.js","./avatar":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/avatar.js","./blocking":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/blocking.js","./bob":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/bob.js","./bookmarks":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/bookmarks.js","./carbons":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/carbons.js","./chatstates":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/chatstates.js","./command":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/command.js","./correction":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/correction.js","./csi":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/csi.js","./dataforms":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/dataforms.js","./delayed":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/delayed.js","./disco":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/disco.js","./escaping":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/escaping.js","./extdisco":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/extdisco.js","./forwarding":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/forwarding.js","./geoloc":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/geoloc.js","./hashes":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/hashes.js","./idle":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/idle.js","./invisible":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/invisible.js","./jidprep":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/jidprep.js","./jingle":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/jingle.js","./json":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/json.js","./keepalive":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/keepalive.js","./logging":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/logging.js","./mam":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/mam.js","./mood":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/mood.js","./muc":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/muc.js","./nick":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/nick.js","./oob":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/oob.js","./ping":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/ping.js","./private":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/private.js","./psa":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/psa.js","./pubsub":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/pubsub.js","./reach":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/reach.js","./receipts":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/receipts.js","./register":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/register.js","./roster":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/roster.js","./rtt":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/rtt.js","./shim":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/shim.js","./time":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/time.js","./vcard":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/vcard.js","./version":"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/version.js"}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/invisible.js":[function(e,t,n){"use strict";t.exports=function(e){e.goInvisible=function(e){return this.sendIq({type:"set",invisible:!0},e)},e.goVisible=function(e){return this.sendIq({type:"set",visible:!0},e)}}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/jidprep.js":[function(e,t,n){"use strict";t.exports=function(e){e.prepJID=function(t,n){return e.sendIq({to:e.jid.domain,type:"get",jidPrep:t},n)}}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/jingle.js":[function(e,t,n){"use strict";var r=e("jingle");t.exports=function(e){var t=e.jingle=new r;t.capabilities.forEach(function(t){e.disco.addFeature(t)});var n=["outgoing","incoming","accepted","terminated","ringing","mute","unmute","hold","resumed"];n.forEach(function(n){t.on(n,function(t,r){e.emit("jingle:"+n,t,r)})}),t.on("createdSession",function(t){e.emit("jingle:created",t)}),t.on("peerStreamAdded",function(t,n){e.emit("jingle:remotestream:added",t,n)}),t.on("peerStreamRemoved",function(t,n){e.emit("jingle:remotestream:removed",t,n)}),t.on("send",function(t){e.sendIq(t,function(t){t&&e.emit("jingle:error",t)})}),e.on("session:bound",function(e){t.jid=e,t.selfID=e.full}),e.on("iq:set:jingle",function(e){t.process(e)}),e.on("unavailable",function(e){var n=e.from.full;t.endPeerSessions(n,!0)}),e.discoverICEServers=function(t){return this.getServices(e.config.server).then(function(t){for(var n=t.services.services,r=[],s=0;s<n.length;s++){var i=n[s],o={};"stun"===i.type||"stuns"===i.type?(o.url=i.type+":"+i.host,i.port&&(o.url+=":"+i.port),r.push(o),e.jingle.addICEServer(o)):"turn"!==i.type&&"turns"!==i.type||(o.url=i.type+":"+i.host,i.port&&(o.url+=":"+i.port),i.transport&&"udp"!==i.transport&&(o.url+="?transport="+i.transport),i.username&&(o.username=i.username),i.password&&(o.credential=i.password),r.push(o),e.jingle.addICEServer(o))}return r}).then(function(e){return t&&t(null,e),e},function(e){if(!t)throw e;t(e)})}}},{jingle:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jingle/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/json.js":[function(e,t,n){"use strict";t.exports=function(e){e.disco.addFeature("urn:xmpp:json:0")}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/keepalive.js":[function(e,t,n){"use strict";function timeoutPromise(e,t){var n;return Promise.race([e,new Promise(function(e,r){n=setTimeout(function(){r()},t)})]).then(function(e){return clearTimeout(n),e})}function checkConnection(e,t){return timeoutPromise(new Promise(function(t,n){e.sm.started?(e.once("stream:management:ack",t),e.sm.request()):e.ping().then(t).catch(function(e){e.error&&"timeout"!==e.error.condition?t():n()})}),1e3*t||15e3)}t.exports=function(e){e.enableKeepAlive=function(t){function keepalive(){e.sessionStarted&&checkConnection(e,t.timeout).catch(function(){e.emit("stream:error",{condition:"connection-timeout",text:"Server did not respond in "+t.timeout+" seconds"}),e.transport.hasStream=!1,e.transport.disconnect()})}t=t||{},t.interval=t.interval||300,t.timeout=t.timeout||15,e._keepAliveInterval=setInterval(keepalive,1e3*t.interval)},e.disableKeepAlive=function(){e._keepAliveInterval&&(clearInterval(e._keepAliveInterval),
  delete e._keepAliveInterval)},e.on("disconnected",function(){e.disableKeepAlive()})}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/logging.js":[function(e,t,n){"use strict";t.exports=function(e){e.disco.addFeature("","urn:xmpp:eventlog"),e.sendLog=function(t,n){e.sendMessage({to:t,type:"normal",log:n})}}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/mam.js":[function(e,t,n){"use strict";function timeoutPromise(e,t,n){var r;return Promise.race([e,new Promise(function(e,s){r=setTimeout(function(){s({id:t,type:"error",error:{condition:"timeout"}})},n)})]).then(function(e){return clearTimeout(r),e})}var r=e("xmpp-jid").JID;t.exports=function(e){e.disco.addFeature("urn:xmpp:mam:0"),e.getHistorySearchForm=function(t,n){return e.sendIq({to:t,type:"get",mam:!0},n)},e.searchHistory=function(t,n){var s=this,i=this.nextId();t=t||{},t.queryid=i;var o=t.jid||t.to||"";delete t.jid,delete t.to,t.form||(t.form={}),t.form.type="submit";var a=t.form.fields=t.form.fields||[],c=["FORM_TYPE","with","start","end"];c.forEach(function(e){if(t[e]||"FORM_TYPE"===e){var n=t[e],r="start"===e||"end"===e;r&&"string"!=typeof n&&(n=n.toISOString()),"FORM_TYPE"===e&&(n="urn:xmpp:mam:0");for(var s=!1,i=0,o=a.length;i<o;i++)a[i].name!==e;s||a.push({name:e,value:n}),delete t[e]}});var u=new r(o||e.jid.bare),d={};d[""]=!0,d[u.full]=!0,d[u.bare]=!0,d[u.domain]=!0,d[e.jid.bare]=!0,d[e.jid.domain]=!0;var l=[];this.on("mam:item:"+i,"session",function(e){d[e.from.full]&&l.push(e.mamItem)});var p=new Promise(function(e){s.once("mam:result:"+i,"session",function(t){d[t.from.full]&&(t.mamResult.items=l,e(t))})}),f=this.sendIq({type:"set",to:o,id:i,mam:t});timeoutPromise(Promise.all([f,p]),i,1e3*s.config.timeout||15e3).then(function(e){var t=e[1];return s.off("mam:item:"+i),s.off("mam:result:"+i),n&&n(null,t),t},function(e){if(s.off("mam:item:"+i),s.off("mam:result:"+i),!n)throw e;n(e)})},e.getHistoryPreferences=function(e){return this.sendIq({type:"get",mamPrefs:!0},e)},e.setHistoryPreferences=function(e,t){return this.sendIq({type:"set",mamPrefs:e},t)},e.on("message",function(t){t.mamItem&&e.emit("mam:item:"+t.mamItem.queryid,t),t.mamResult&&e.emit("mam:result:"+t.mamResult.queryid,t)})}},{"xmpp-jid":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-jid/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/mood.js":[function(e,t,n){"use strict";var r="http://jabber.org/protocol/mood";t.exports=function(e){e.disco.addFeature(r),e.disco.addFeature(r+"+notify"),e.on("pubsub:event",function(t){t.event.updated&&t.event.updated.node===r&&e.emit("mood",{jid:t.from,mood:t.event.updated.published[0].mood})}),e.publishMood=function(e,t,n){return this.publish("",r,{mood:{value:e,text:t}},n)}}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/muc.js":[function(e,t,n){"use strict";var r=e("lodash.foreach"),s=e("xmpp-jid").JID;t.exports=function(e){function rejoinRooms(){r(e.joinedRooms,function(t,n){e.joinedRooms[n]=!1,e.joinRoom(n,t)})}e.disco.addFeature("http://jabber.org/protocol/muc"),e.disco.addFeature("jabber:x:conference"),e.disco.addFeature("urn:xmpp:hats:0"),e.joinedRooms={},e.on("session:started",rejoinRooms),e.on("stream:management:resumed",rejoinRooms),e.on("message",function(t){t.muc?(t.muc.invite&&e.emit("muc:invite",{from:t.muc.invite.from,room:t.from,reason:t.muc.invite.reason,password:t.muc.password,thread:t.muc.invite.thread,type:"mediated"}),t.muc.destroyed&&e.emit("muc:destroyed",{room:t.from,newRoom:t.muc.destroyed.jid,reason:t.muc.destroyed.reason,password:t.muc.destroyed.password}),t.muc.decline&&e.emit("muc:declined",{room:t.from,from:t.muc.decline.from,reason:t.muc.decline.reason})):t.mucInvite&&e.emit("muc:invite",{from:t.from,room:t.mucInvite.jid,reason:t.mucInvite.reason,password:t.mucInvite.password,thread:t.mucInvite.thread,type:"direct"}),"groupchat"===t.type&&t.subject&&e.emit("muc:subject",t)}),e.on("presence",function(t){if(t.joinMuc&&"error"===t.type)e.emit("muc:error",t);else if(t.muc){var n=t.muc.codes&&t.muc.codes.indexOf("110")>=0;"error"===t.type?e.emit("muc:error",t):"unavailable"===t.type?(e.emit("muc:unavailable",t),n&&(e.emit("muc:leave",t),delete e.joinedRooms[t.from.bare])):(e.emit("muc:available",t),n&&!e.joinedRooms[t.from.bare]&&(e.emit("muc:join",t),e.joinedRooms[t.from.bare]=t.from.resource))}}),e.joinRoom=function(e,t,n){n=n||{},n.to=e+"/"+t,n.caps=this.disco.caps,n.joinMuc=n.joinMuc||{},this.sendPresence(n)},e.leaveRoom=function(e,t,n){n=n||{},n.to=e+"/"+t,n.type="unavailable",this.sendPresence(n)},e.ban=function(t,n,r,s){e.setRoomAffiliation(t,n,"outcast",r,s)},e.kick=function(t,n,r,s){e.setRoomRole(t,n,"none",r,s)},e.invite=function(t,n){e.sendMessage({to:t,muc:{invites:n}})},e.directInvite=function(t,n){n.jid=t,e.sendMessage({to:n.to,mucInvite:n})},e.declineInvite=function(t,n,r){e.sendMessage({to:t,muc:{decline:{to:n,reason:r}}})},e.changeNick=function(t,n){e.sendPresence({to:new s(t).bare+"/"+n})},e.setSubject=function(t,n){e.sendMessage({to:t,type:"groupchat",subject:n})},e.discoverReservedNick=function(t,n){e.getDiscoInfo(t,"x-roomuser-item",function(e,t){if(e)return n(e);var r=t.discoInfo.identities[0]||{};n(null,r.name)})},e.requestRoomVoice=function(t){e.sendMessage({to:t,form:{fields:[{name:"FORM_TYPE",value:"http://jabber.org/protocol/muc#request"},{name:"muc#role",type:"text-single",value:"participant"}]}})},e.setRoomAffiliation=function(e,t,n,r,s){return this.sendIq({type:"set",to:e,mucAdmin:{jid:t,affiliation:n,reason:r}},s)},e.setRoomRole=function(e,t,n,r,s){return this.sendIq({type:"set",to:e,mucAdmin:{nick:t,role:n,reason:r}},s)},e.getRoomMembers=function(e,t,n){return this.sendIq({type:"get",to:e,mucAdmin:t},n)},e.getRoomConfig=function(e,t){return this.sendIq({to:e,type:"get",mucOwner:!0},t)},e.configureRoom=function(e,t,n){return t.type||(t.type="submit"),this.sendIq({to:e,type:"set",mucOwner:{form:t}},n)},e.destroyRoom=function(e,t,n){return this.sendIq({to:e,type:"set",mucOwner:{destroy:t}},n)},e.getUniqueRoomName=function(e,t){return this.sendIq({type:"get",to:e,mucUnique:!0},t)}}},{"lodash.foreach":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.foreach/index.js","xmpp-jid":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-jid/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/nick.js":[function(e,t,n){"use strict";var r="http://jabber.org/protocol/nick";t.exports=function(e){e.disco.addFeature(r),e.disco.addFeature(r+"+notify"),e.on("pubsub:event",function(t){t.event.updated&&t.event.updated.node===r&&e.emit("nick",{jid:t.from,nick:t.event.updated.published[0].nick})}),e.publishNick=function(e,t){return this.publish("",r,{nick:e},t)}}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/oldwebsocket.js":[function(e,t,n){"use strict";var r=e("../transports/old-websocket");t.exports=function(e){e.transports["old-websocket"]=r}},{"../transports/old-websocket":"/Users/pedrogutierrez/Projects/stanza.io/lib/transports/old-websocket.js"}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/oob.js":[function(e,t,n){"use strict";t.exports=function(e){e.disco.addFeature("jabber:x:oob")}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/ping.js":[function(e,t,n){"use strict";t.exports=function(e){e.disco.addFeature("urn:xmpp:ping"),e.on("iq:get:ping",function(t){e.sendIq(t.resultReply())}),e.ping=function(e,t){return this.sendIq({to:e,type:"get",ping:!0},t)}}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/private.js":[function(e,t,n){"use strict";t.exports=function(e){e.getPrivateData=function(e,t){return this.sendIq({type:"get",privateStorage:e},t)},e.setPrivateData=function(e,t){return this.sendIq({type:"set",privateStorage:e},t)}}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/psa.js":[function(e,t,n){"use strict";t.exports=function(e){e.disco.addFeature("urn:xmpp:psa")}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/pubsub.js":[function(e,t,n){"use strict";t.exports=function(e){e.on("message",function(t){if(t.event){if(e.emit("pubsub:event",t),e.emit("pubsubEvent",t),t.event.updated){var n=t.event.updated.published,r=t.event.updated.retracted;n&&n.length&&e.emit("pubsub:published",t),r&&r.length&&e.emit("pubsub:retracted",t)}t.event.purged&&e.emit("pubsub:purged",t),t.event.deleted&&e.emit("pubsub:deleted",t),t.event.subscriptionChanged&&e.emit("pubsub:subscription",t),t.event.configurationChanged&&e.emit("pubsub:config",t)}t.pubsub&&t.pubsub.affiliations&&e.emit("pubsub:affiliation",t)}),e.subscribeToNode=function(t,n,r){return"string"==typeof n&&(n={node:n}),n.jid=n.jid||e.jid,this.sendIq({type:"set",to:t,pubsub:{subscribe:n}},r)},e.unsubscribeFromNode=function(t,n,r){return"string"==typeof n&&(n={node:n}),n.jid=n.jid||e.jid.bare,this.sendIq({type:"set",to:t,pubsub:{unsubscribe:n}},r)},e.publish=function(e,t,n,r){return this.sendIq({type:"set",to:e,pubsub:{publish:{node:t,item:n}}},r)},e.getItem=function(e,t,n,r){return this.sendIq({type:"get",to:e,pubsub:{retrieve:{node:t,item:n}}},r)},e.getItems=function(e,t,n,r){return n=n||{},n.node=t,this.sendIq({type:"get",to:e,pubsub:{retrieve:{node:t,max:n.max},rsm:n.rsm}},r)},e.retract=function(e,t,n,r,s){return this.sendIq({type:"set",to:e,pubsub:{retract:{node:t,notify:r,id:n}}},s)},e.purgeNode=function(e,t,n){return this.sendIq({type:"set",to:e,pubsubOwner:{purge:t}},n)},e.deleteNode=function(e,t,n){return this.sendIq({type:"set",to:e,pubsubOwner:{del:t}},n)},e.createNode=function(e,t,n,r){var s={type:"set",to:e,pubsub:{create:t}};return n&&(s.pubsub.config={form:n}),this.sendIq(s,r)},e.getSubscriptions=function(e,t,n){return t=t||{},this.sendIq({type:"get",to:e,pubsub:{subscriptions:t}},n)},e.getAffiliations=function(e,t,n){return t=t||{},this.sendIq({type:"get",to:e,pubsub:{affiliations:t}},n)},e.getNodeSubscribers=function(e,t,n,r){return n=n||{},n.node=t,this.sendIq({type:"get",to:e,pubsubOwner:{subscriptions:n}},r)},e.updateNodeSubscriptions=function(e,t,n,r){return this.sendIq({type:"set",to:e,pubsubOwner:{subscriptions:{node:t,list:n}}},r)},e.getNodeAffiliations=function(e,t,n,r){return n=n||{},n.node=t,this.sendIq({type:"get",to:e,pubsubOwner:{affiliations:n}},r)},e.updateNodeAffiliations=function(e,t,n,r){return this.sendIq({type:"set",to:e,pubsubOwner:{affiliations:{node:t,list:n}}},r)}}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/reach.js":[function(e,t,n){"use strict";t.exports=function(e){e.disco.addFeature("urn:xmpp:reach:0"),e.disco.addFeature("urn:xmpp:reach:0+notify"),e.on("pubsub:event",function(t){t.event.updated&&"urn:xmpp:reach:0"===t.event.updated.node&&e.emit("reachability",{jid:t.from,addresses:t.event.updated.published[0].reach})}),e.on("presence",function(t){t.reach&&t.reach.length&&e.emit("reachability",{jid:t.from,addresses:t.reach})}),e.publishReachability=function(e,t){return this.publish("","urn:xmpp:reach:0",{reach:e},t)}}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/receipts.js":[function(e,t,n){"use strict";t.exports=function(e){e.disco.addFeature("urn:xmpp:receipts"),e.on("message",function(t){var n={normal:!0,chat:!0,headline:!0};n[t.type]&&t.requestReceipt&&!t.receipt&&e.sendMessage({to:t.from,type:t.type,receipt:t.id,id:t.id}),t.receipt&&(e.emit("receipt",t),e.emit("receipt:"+t.receipt))})}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/register.js":[function(e,t,n){"use strict";t.exports=function(e){e.getAccountInfo=function(e,t){return this.sendIq({type:"get",to:e,register:!0},t)},e.updateAccount=function(e,t,n){return this.sendIq({type:"set",to:e,register:t},n)},e.deleteAccount=function(e,t){return this.sendIq({type:"set",to:e,register:{remove:!0}},t)}}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/roster.js":[function(e,t,n){"use strict";t.exports=function(e){e.on("iq:set:roster",function(t){var n={};return n[""]=!0,n[e.jid.bare]=!0,n[e.jid.domain]=!0,n[t.from.full]?(e.emit("roster:update",t),void e.sendIq({id:t.id,type:"result"})):e.sendIq(t.errorReply({error:{type:"cancel",condition:"service-unavailable"}}))}),e.getRoster=function(t){var n=this;return t=t||function(){},e.sendIq({type:"get",roster:{ver:n.config.rosterVer}}).then(function(e){if(e.roster){var t=e.roster.ver;t&&(n.config.rosterVer=t,n.emit("roster:ver",t))}return e}).then(function(e){return t&&t(null,e),e},function(e){if(!t)throw e;t(e)})},e.updateRosterItem=function(t,n){return e.sendIq({type:"set",roster:{items:[t]}},n)},e.removeRosterItem=function(t,n){return e.updateRosterItem({jid:t,subscription:"remove"},n)},e.subscribe=function(t){e.sendPresence({type:"subscribe",to:t})},e.unsubscribe=function(t){e.sendPresence({type:"unsubscribe",to:t})},e.acceptSubscription=function(t){e.sendPresence({type:"subscribed",to:t})},e.denySubscription=function(t){e.sendPresence({type:"unsubscribed",to:t})}}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/rtt.js":[function(e,t,n){"use strict";t.exports=function(e){e.disco.addFeature("urn:xmpp:rtt:0"),e.on("message",function(t){t.rtt&&(e.emit("rtt",t),e.emit("rtt:"+t.rtt.event,t))})}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/sasl.js":[function(e,t,n){(function(e){"use strict";var n="urn:ietf:params:xml:ns:xmpp-sasl";t.exports=function(t,r){var s=r.getDefinition("auth",n),i=r.getDefinition("response",n),o=r.getDefinition("abort",n);t.registerFeature("sasl",100,function(t,n){var r=this,a=r.SASLFactory.create(t.sasl.mechanisms);if(!a)return r.releaseGroup("sasl"),r.emit("auth:failed"),n("disconnect","authentication failed");r.on("sasl:success","sasl",function(){r.features.negotiated.sasl=!0,r.releaseGroup("sasl"),r.emit("auth:success",r.config.credentials),n("restart")}),r.on("sasl:challenge","sasl",function(t){return a.challenge(new e(t.value,"base64").toString()),r.getCredentials(function(t,n){if(t)return r.send(new o);var s=a.response(n);s||""===s?r.send(new i({value:new e(s).toString("base64")})):r.send(new i),a.cache&&(Object.keys(a.cache).forEach(function(t){a.cache[t]&&(r.config.credentials[t]=new e(a.cache[t]))}),r.emit("credentials:update",r.config.credentials))})}),r.on("sasl:failure","sasl",function(){r.releaseGroup("sasl"),r.emit("auth:failed"),n("disconnect","authentication failed")}),r.on("sasl:abort","sasl",function(){r.releaseGroup("sasl"),r.emit("auth:failed"),n("disconnect","authentication failed")});var c={mechanism:a.name};return a.clientFirst?r.getCredentials(function(t,n){return t?r.send(new o):(c.value=new e(a.response(n)).toString("base64"),void r.send(new s(c)))}):void r.send(new s(c))}),t.on("disconnected",function(){t.features.negotiated.sasl=!1})}}).call(this,e("buffer").Buffer)},{buffer:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/session.js":[function(e,t,n){"use strict";t.exports=function(e){e.registerFeature("session",1e3,function(e,t){var n=this;return e.session.optional||n.sessionStarted?(n.features.negotiated.session=!0,t()):void n.sendIq({type:"set",session:{}},function(e){return e?t("disconnect","session request failed"):(n.features.negotiated.session=!0,n.sessionStarted||(n.sessionStarted=!0,n.emit("session:started",n.jid)),void t())})}),e.on("disconnected",function(){e.sessionStarted=!1,e.features.negotiated.session=!1})}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/shim.js":[function(e,t,n){"use strict";var r="http://jabber.org/protocol/shim";t.exports=function(e){e.disco.addFeature(r),e.disco.addFeature(r+"#SubID",r)}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/smacks.js":[function(e,t,n){"use strict";t.exports=function(e,t,n){var r=function(e,t){var r=this;return n.useStreamManagement?(r.on("stream:management:enabled","sm",function(e){r.sm.enabled(e),r.features.negotiated.streamManagement=!0,r.releaseGroup("sm"),t()}),r.on("stream:management:resumed","sm",function(e){r.sm.resumed(e),r.features.negotiated.streamManagement=!0,r.features.negotiated.bind=!0,r.sessionStarted=!0,r.releaseGroup("sm"),t("break")}),r.on("stream:management:failed","sm",function(){r.sm.failed(),r.emit("session:end"),r.releaseGroup("session"),r.releaseGroup("sm"),t()}),void(r.sm.id?r.sm.id&&r.sm.allowResume?r.sm.resume():(r.releaseGroup("sm"),t()):r.features.negotiated.bind?r.sm.enable():(r.releaseGroup("sm"),t()))):t()};e.on("disconnected",function(){e.features.negotiated.streamManagement=!1}),e.registerFeature("streamManagement",200,r),e.registerFeature("streamManagement",500,r)}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/time.js":[function(e,t,n){"use strict";t.exports=function(e){e.disco.addFeature("urn:xmpp:time"),e.getTime=function(e,t){return this.sendIq({to:e,type:"get",time:!0},t)},e.on("iq:get:time",function(t){var n=new Date;e.sendIq(t.resultReply({time:{utc:n,tzo:n.getTimezoneOffset()}}))})}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/vcard.js":[function(e,t,n){"use strict";t.exports=function(e){e.disco.addFeature("vcard-temp"),e.getVCard=function(e,t){return this.sendIq({to:e,type:"get",vCardTemp:!0},t)},e.publishVCard=function(e,t){return this.sendIq({type:"set",vCardTemp:e},t)}}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/version.js":[function(e,t,n){"use strict";t.exports=function(e){e.disco.addFeature("jabber:iq:version"),e.on("iq:get:version",function(t){e.sendIq(t.resultReply({version:e.config.softwareVersion||{name:"stanza.io"}}))}),e.getSoftwareVersion=function(e,t){return this.sendIq({to:e,type:"get",version:!0},t)}}},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/plugins/websocket.js":[function(e,t,n){"use strict";var r=e("../transports/websocket");t.exports=function(e){e.transports.websocket=r}},{"../transports/websocket":"/Users/pedrogutierrez/Projects/stanza.io/lib/transports/websocket.js"}],"/Users/pedrogutierrez/Projects/stanza.io/lib/sm.js":[function(e,t,n){"use strict";function mod(e,t){return(e%t+t)%t}function StreamManagement(e){this.client=e,this.id=!1,this.allowResume=!0,this.started=!1,this.inboundStarted=!1,this.outboundStarted=!1,this.lastAck=0,this.handled=0,this.windowSize=1,this.unacked=[],this.pendingAck=!1;var t="urn:xmpp:sm:3";this.stanzas={Enable:e.stanzas.getDefinition("enable",t),Resume:e.stanzas.getDefinition("resume",t),Ack:e.stanzas.getDefinition("a",t),Request:e.stanzas.getDefinition("r",t)}}var r=Math.pow(2,32);StreamManagement.prototype={constructor:{value:StreamManagement},enable:function(){var e=new this.stanzas.Enable;e.resume=this.allowResume,this.client.send(e),this.handled=0,this.outboundStarted=!0},resume:function(){var e=new this.stanzas.Resume({h:this.handled,previd:this.id});this.client.send(e),this.outboundStarted=!0},enabled:function(e){this.id=e.id,this.handled=0,this.inboundStarted=!0},resumed:function(e){this.id=e.previd,e.h&&this.process(e,!0),this.inboundStarted=!0},failed:function(){this.inboundStarted=!1,this.outboundStarted=!1,this.id=!1,this.lastAck=0,this.handled=0,this.unacked=[]},ack:function(){this.client.send(new this.stanzas.Ack({h:this.handled}))},request:function(){this.pendingAck=!0,this.client.send(new this.stanzas.Request)},process:function(e,t){var n=this,s=mod(e.h-this.lastAck,r);this.pendingAck=!1;for(var i=0;i<s&&this.unacked.length>0;i++)this.client.emit("stanza:acked",this.unacked.shift());if(this.lastAck=e.h,t){var o=this.unacked;this.unacked=[],o.forEach(function(e){n.client.send(e)})}this.needAck()&&this.request()},track:function(e){var t=e._name,n={message:!0,presence:!0,iq:!0};this.outboundStarted&&n[t]&&(this.unacked.push(e),this.needAck()&&this.request())},handle:function(){this.inboundStarted&&(this.handled=mod(this.handled+1,r))},needAck:function(){return!this.pendingAck&&this.unacked.length>=this.windowSize}},Object.defineProperties(StreamManagement.prototype,{started:{get:function(){return this.outboundStarted&&this.inboundStarted},set:function(e){e||(this.outboundStarted=!1,this.inboundStarted=!1)}}}),t.exports=StreamManagement},{}],"/Users/pedrogutierrez/Projects/stanza.io/lib/transports/bosh.js":[function(e,t,n){(function(n,r){"use strict";function timeoutPromise(e,t){var n;return Promise.race([e,new Promise(function(e,r){n=setTimeout(function(){r()},t)})]).then(function(e){return clearTimeout(n),e})}function delayPromise(e){return new Promise(function(t){setTimeout(function(){t()},e)})}function makeRequest(e){return new Promise(function(t,n){a(e,function(e,r,s){return e?n(e):t([r,s])})})}function retryRequest(e,t,n){return timeoutPromise(makeRequest(e),1e3*(t||20)).then(function(e){var t=e[0],n=e[1];if(t.statusCode<200||t.statusCode>=400)throw new Error("HTTP Status Error"+t.statusCode);return n}).catch(function(){if(n>0)return delayPromise(1e3).then(function(){return retryRequest(e,t,n-1)});throw new Error("Dead Connection, exceeded retry limit")})}function BOSHConnection(e,t){var n=this;c.call(this),n.sm=e,n.stanzas={BOSH:t.getDefinition("body","http://jabber.org/protocol/httpbind"),StreamError:t.getStreamError()},n.sendQueue=[],n.requests=[],n.maxRequests=2,n.sid="",n.on("raw:incoming",function(e){if(e=e.trim(),""!==e){var r,s;try{r=t.parse(e,n.stanzas.BOSH)}catch(e){return s=new n.stanzas.StreamError({condition:"invalid-xml"}),n.emit("stream:error",s,e),n.send(s),n.disconnect()}n.hasStream||(n.hasStream=!0,n.stream={id:r.sid,lang:r.lang||"en",version:r.version||"1.0",to:r.to,from:r.from},n.sid=r.sid,n.maxRequests=r.requests);var i=r.payload;i.forEach(function(e){e.lang||(e.lang=n.stream.lang),n.emit("stream:data",e)}),"terminate"===r.type&&(n.rid=void 0,n.sid=void 0,n.emit("bosh:terminate",r),n.emit("stream:end"),n.emit("disconnected",n))}})}var s=e("lodash.assign"),i=e("lodash.filter"),o=e("util"),a=e("request"),c=e("wildemitter");o.inherits(BOSHConnection,c),BOSHConnection.prototype.connect=function(e){var t=this;t.config=s({rid:Math.ceil(9999999999*Math.random()),wait:30,maxRetries:5},e),t.hasStream=!1,t.sm.started=!1,t.url=e.boshURL,t.sid=t.config.sid,t.rid=t.config.rid,t.requests=[],t.rid++,t.request(new t.stanzas.BOSH({version:t.config.version||"1.0",to:t.config.server,lang:t.config.lang||"en",wait:t.config.wait,ver:"1.6",hold:1}))},BOSHConnection.prototype.disconnect=function(){this.hasStream?(this.rid++,this.request(new this.stanzas.BOSH({type:"terminate"}))):(this.stream=void 0,this.sid=void 0,this.rid=void 0,this.emit("disconnected",this))},BOSHConnection.prototype.restart=function(){var e=this;e.rid++,e.request(new e.stanzas.BOSH({to:e.config.server,lang:e.config.lang||"en",restart:"true"}))},BOSHConnection.prototype.send=function(e){var t=this;t.hasStream&&(t.sendQueue.push(e),n.nextTick(t.longPoll.bind(t)))},BOSHConnection.prototype.longPoll=function(){var e=0===this.requests.length,t=this.sendQueue.length>0&&this.requests.length<this.maxRequests;if(this.sid&&(e||t)){var n=this.sendQueue;this.sendQueue=[],this.rid++,this.request(new this.stanzas.BOSH({payload:n}))}},BOSHConnection.prototype.request=function(e){var t=this,s={id:t.rid,request:null};e.rid=t.rid,e.sid=t.sid;var o=new r(e.toString(),"utf8").toString();t.emit("raw:outgoing",o),t.requests.push(s);var a=retryRequest({uri:t.url,body:o,method:"POST",strictSSL:!0},1.5*t.config.wait,this.config.maxRetries).catch(function(e){t.hasStream=!1;var n=new t.stanzas.StreamError({condition:"connection-timeout"});t.emit("stream:error",n,e),t.disconnect()});return s.request=a,a.then(function(e){t.emit("raw:incoming",new r(e,"utf8").toString())}),a.then(function(){t.requests=i(t.requests,function(e){return e.id!==s.id}),"terminate"!==e.type&&n.nextTick(function(){n.nextTick(t.longPoll.bind(t))})})},t.exports=BOSHConnection}).call(this,e("_process"),e("buffer").Buffer)},{_process:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/browserify/node_modules/process/browser.js",buffer:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/index.js","lodash.assign":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.assign/index.js","lodash.filter":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.filter/index.js",request:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xhr/index.js",util:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/util/util.js",wildemitter:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/wildemitter/wildemitter.js"}],"/Users/pedrogutierrez/Projects/stanza.io/lib/transports/old-websocket.js":[function(e,t,n){"use strict";function OldWSConnection(e,t){function wrap(e){return[n.streamStart,e,n.streamEnd].join("")}s.call(this,e,t);var n=this;n.on("connected",function(){n.streamStart='<stream:stream xmlns:stream="http://etherx.jabber.org/streams">',n.streamEnd="</stream:stream>"}),n.off("raw:incoming"),n.on("raw:incoming",function(e){var s,i,o;if(e=e.trim(),e=e.replace(/^(\s*<\?.*\?>\s*)*/,""),""!==e){if(e.match(n.streamEnd))return n.disconnect();if(n.hasStream)try{s=t.parse(wrap(e))}catch(e){return o=new this.stanzas.StreamError({condition:"invalid-xml"}),n.emit("stream:error",o,e),n.send(o),n.disconnect()}else{var a=e.match(/^<(\S+:)?(\S+) /);n.streamStart=e,n.streamEnd="</"+(a[1]||"")+a[2]+">",i=!1;try{s=t.parse(e+n.streamEnd)}catch(r){try{s=t.parse(e),i=!0}catch(e){return o=new this.stanzas.StreamError({condition:"invalid-xml"}),n.emit("stream:error",o,e),n.send(o),n.disconnect()}}n.hasStream=!0,n.stream=s,n.emit("stream:start",s)}r(s._extensions,function(e){!e.lang&&n.stream&&(e.lang=n.stream.lang),n.emit("stream:data",e)}),i&&n.emit("stream:end")}})}var r=e("lodash.foreach"),s=e("./websocket"),i=e("util");i.inherits(OldWSConnection,s),OldWSConnection.prototype.startHeader=function(){return["<stream:stream",'xmlns:stream="http://etherx.jabber.org/streams"','xmlns="jabber:client"','version="'+(this.config.version||"1.0")+'"','xml:lang="'+(this.config.lang||"en")+'"','to="'+this.config.server+'">'].join(" ")},OldWSConnection.prototype.closeHeader=function(){return"</stream:stream>"},t.exports=OldWSConnection},{"./websocket":"/Users/pedrogutierrez/Projects/stanza.io/lib/transports/websocket.js","lodash.foreach":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.foreach/index.js",util:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/util/util.js"}],"/Users/pedrogutierrez/Projects/stanza.io/lib/transports/websocket.js":[function(e,t,n){(function(n){"use strict";function WSConnection(e,t){var r=this;s.call(this),r.sm=e,r.closing=!1,r.stanzas={Open:t.getDefinition("open","urn:ietf:params:xml:ns:xmpp-framing",!0),Close:t.getDefinition("close","urn:ietf:params:xml:ns:xmpp-framing",!0),StreamError:t.getStreamError()},r.sendQueue=i.queue(function(e,t){r.conn&&("string"!=typeof e&&(e=e.toString()),e=new n(e,"utf8").toString(),r.emit("raw:outgoing",e),r.conn.readyState===a&&r.conn.send(e)),t()},1),r.on("connected",function(){r.send(r.startHeader())}),r.on("raw:incoming",function(e){var n,s;if(e=e.trim(),""!==e){try{n=t.parse(e)}catch(e){return s=new r.stanzas.StreamError({condition:"invalid-xml"}),r.emit("stream:error",s,e),r.send(s),r.disconnect()}if("openStream"===n._name)return r.hasStream=!0,r.stream=n,r.emit("stream:start",n.toJSON());if("closeStream"===n._name)return r.emit("stream:end"),r.disconnect();!n.lang&&r.stream&&(n.lang=r.stream.lang),r.emit("stream:data",n)}})}var r=e("util"),s=e("wildemitter"),i=e("async"),o=e("faye-websocket")&&e("faye-websocket").Client?e("faye-websocket").Client:window.WebSocket,a=1;r.inherits(WSConnection,s),WSConnection.prototype.connect=function(e){var t=this;t.config=e,t.hasStream=!1,t.closing=!1,t.conn=new o(e.wsURL,"xmpp"),t.conn.onerror=function(e){e.preventDefault(),t.emit("disconnected",t)},t.conn.onclose=function(){t.emit("disconnected",t)},t.conn.onopen=function(){t.sm.started=!1,t.emit("connected",t)},t.conn.onmessage=function(e){t.emit("raw:incoming",new n(e.data,"utf8").toString())}},WSConnection.prototype.startHeader=function(){return new this.stanzas.Open({version:this.config.version||"1.0",lang:this.config.lang||"en",to:this.config.server})},WSConnection.prototype.closeHeader=function(){return new this.stanzas.Close},WSConnection.prototype.disconnect=function(){this.conn&&!this.closing&&this.hasStream?(this.closing=!0,this.send(this.closeHeader())):(this.hasStream=!1,this.stream=void 0,this.conn.readyState===a&&this.conn.close(),this.conn=void 0)},WSConnection.prototype.restart=function(){var e=this;e.hasStream=!1,e.send(this.startHeader())},WSConnection.prototype.send=function(e){this.sendQueue.push(e)},t.exports=WSConnection}).call(this,e("buffer").Buffer)},{async:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/async/lib/async.js",buffer:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/index.js","faye-websocket":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/browser-resolve/empty.js",util:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/util/util.js",wildemitter:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/wildemitter/wildemitter.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/alt-sasl-digest-md5/index.js":[function(e,t,n){function parse(e){for(var t={},n=e.split(/,(?=(?:[^"]|"[^"]*")*$)/),r=0,s=n.length;r<s;r++){var i=/(\w+)=["]?([^"]+)["]?$/.exec(n[r]);i&&(t[i[1]]=i[2])}return t}function genNonce(){return r(16).toString("hex")}function Mechanism(e){e=e||{},this._genNonce=e.genNonce||genNonce}var r=e("randombytes"),s=e("create-hash");Mechanism.Mechanism=Mechanism,Mechanism.prototype.name="DIGEST-MD5",Mechanism.prototype.clientFirst=!1,Mechanism.prototype.response=function(e){if(!this._completed){var t=e.serviceType+"/"+e.host;e.serviceName&&e.host!==e.serviceName&&(t+="/"+e.serviceName);var n=e.realm||this._realm||"",r=this._genNonce(),i="00000001",o="auth",a="";a+='username="'+e.username+'"',n&&(a+=',realm="'+n+'"'),a+=',nonce="'+this._nonce+'"',a+=',cnonce="'+r+'"',a+=",nc="+i,a+=",qop="+o,a+=',digest-uri="'+t+'"';var c=s("md5").update(e.username).update(":").update(n).update(":").update(e.password).digest(),u=s("md5").update(c).update(":").update(this._nonce).update(":").update(r);e.authzid&&u.update(":").update(e.authzid),u=u.digest("hex");var d=s("md5").update("AUTHENTICATE:").update(t);"auth-int"!==o&&"auth-conf"!==o||d.update(":00000000000000000000000000000000"),d=d.digest("hex");var l=s("md5").update(u).update(":").update(this._nonce).update(":").update(i).update(":").update(r).update(":").update(o).update(":").update(d).digest("hex");return a+=",response="+l,"utf-8"===this._charset&&(a+=",charset=utf-8"),e.authzid&&(a+='authzid="'+e.authzid+'"'),a}},Mechanism.prototype.challenge=function(e){var t=parse(e);return this._completed=!!t.rspauth,this._realm=t.realm,this._nonce=t.nonce,this._qop=(t.qop||"auth").split(","),this._stale=t.stale,this._maxbuf=parseInt(t.maxbuf)||65536,this._charset=t.charset,this._algo=t.algorithm,this._cipher=t.cipher,this._cipher&&this._cipher.split(","),this},t.exports=Mechanism},{"create-hash":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/create-hash/browser.js",randombytes:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/randombytes/browser.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/async/lib/async.js":[function(t,n,r){(function(t,r){!function(){function noop(){}function identity(e){return e}function toBool(e){return!!e}function notId(e){return!e}function only_once(e){return function(){if(null===e)throw new Error("Callback was already called.");e.apply(this,arguments),e=null}}function _once(e){return function(){null!==e&&(e.apply(this,arguments),e=null)}}function _isArrayLike(e){return c(e)||"number"==typeof e.length&&e.length>=0&&e.length%1===0}function _arrayEach(e,t){for(var n=-1,r=e.length;++n<r;)t(e[n],n,e)}function _map(e,t){for(var n=-1,r=e.length,s=Array(r);++n<r;)s[n]=t(e[n],n,e);return s}function _range(e){return _map(Array(e),function(e,t){return t})}function _reduce(e,t,n){return _arrayEach(e,function(e,r,s){n=t(n,e,r,s)}),n}function _forEachOf(e,t){_arrayEach(d(e),function(n){t(e[n],n)})}function _indexOf(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1}function _keyIterator(e){var t,n,r=-1;return _isArrayLike(e)?(t=e.length,function next(){return r++,
  r<t?r:null}):(n=d(e),t=n.length,function next(){return r++,r<t?n[r]:null})}function _restParam(e,t){return t=null==t?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),r=Array(n),s=0;s<n;s++)r[s]=arguments[s+t];switch(t){case 0:return e.call(this,r);case 1:return e.call(this,arguments[0],r)}}}function _withoutIndex(e){return function(t,n,r){return e(t,r)}}function _eachOfLimit(e){return function(t,n,r){r=_once(r||noop),t=t||[];var s=_keyIterator(t);if(e<=0)return r(null);var i=!1,o=0,a=!1;!function replenish(){if(i&&o<=0)return r(null);for(;o<e&&!a;){var c=s();if(null===c)return i=!0,void(o<=0&&r(null));o+=1,n(t[c],c,only_once(function(e){o-=1,e?(r(e),a=!0):replenish()}))}}()}}function doParallel(e){return function(t,n,r){return e(i.eachOf,t,n,r)}}function doParallelLimit(e){return function(t,n,r,s){return e(_eachOfLimit(n),t,r,s)}}function doSeries(e){return function(t,n,r){return e(i.eachOfSeries,t,n,r)}}function _asyncMap(e,t,n,r){r=_once(r||noop),t=t||[];var s=_isArrayLike(t)?[]:{};e(t,function(e,t,r){n(e,function(e,n){s[t]=n,r(e)})},function(e){r(e,s)})}function _filter(e,t,n,r){var s=[];e(t,function(e,t,r){n(e,function(n){n&&s.push({index:t,value:e}),r()})},function(){r(_map(s.sort(function(e,t){return e.index-t.index}),function(e){return e.value}))})}function _reject(e,t,n,r){_filter(e,t,function(e,t){n(e,function(e){t(!e)})},r)}function _createTester(e,t,n){return function(r,s,i,o){function done(){o&&o(n(!1,void 0))}function iteratee(e,r,s){return o?void i(e,function(r){o&&t(r)&&(o(n(!0,e)),o=i=!1),s()}):s()}arguments.length>3?e(r,s,iteratee,done):(o=i,i=s,e(r,iteratee,done))}}function _findGetResult(e,t){return t}function _parallel(e,t,n){n=n||noop;var r=_isArrayLike(t)?[]:{};e(t,function(e,t,n){e(_restParam(function(e,s){s.length<=1&&(s=s[0]),r[t]=s,n(e)}))},function(e){n(e,r)})}function _concat(e,t,n,r){var s=[];e(t,function(e,t,r){n(e,function(e,t){s=s.concat(t||[]),r(e)})},function(e){r(e,s)})}function _queue(e,t,n){function _insert(e,t,n,r){if(null!=r&&"function"!=typeof r)throw new Error("task callback must be a function");return e.started=!0,c(t)||(t=[t]),0===t.length&&e.idle()?i.setImmediate(function(){e.drain()}):(_arrayEach(t,function(t){var s={data:t,callback:r||noop};n?e.tasks.unshift(s):e.tasks.push(s),e.tasks.length===e.concurrency&&e.saturated()}),void i.setImmediate(e.process))}function _next(e,t){return function(){r-=1;var n=!1,i=arguments;_arrayEach(t,function(e){_arrayEach(s,function(t,r){t!==e||n||(s.splice(r,1),n=!0)}),e.callback.apply(e,i)}),e.tasks.length+r===0&&e.drain(),e.process()}}if(null==t)t=1;else if(0===t)throw new Error("Concurrency must not be zero");var r=0,s=[],o={tasks:[],concurrency:t,payload:n,saturated:noop,empty:noop,drain:noop,started:!1,paused:!1,push:function(e,t){_insert(o,e,!1,t)},kill:function(){o.drain=noop,o.tasks=[]},unshift:function(e,t){_insert(o,e,!0,t)},process:function(){for(;!o.paused&&r<o.concurrency&&o.tasks.length;){var t=o.payload?o.tasks.splice(0,o.payload):o.tasks.splice(0,o.tasks.length),n=_map(t,function(e){return e.data});0===o.tasks.length&&o.empty(),r+=1,s.push(t[0]);var i=only_once(_next(o,t));e(n,i)}},length:function(){return o.tasks.length},running:function(){return r},workersList:function(){return s},idle:function(){return o.tasks.length+r===0},pause:function(){o.paused=!0},resume:function(){if(o.paused!==!1){o.paused=!1;for(var e=Math.min(o.concurrency,o.tasks.length),t=1;t<=e;t++)i.setImmediate(o.process)}}};return o}function _console_fn(e){return _restParam(function(t,n){t.apply(null,n.concat([_restParam(function(t,n){"object"==typeof console&&(t?console.error&&console.error(t):console[e]&&_arrayEach(n,function(t){console[e](t)}))})]))})}function _times(e){return function(t,n,r){e(_range(t),n,r)}}function _applyEach(e){return _restParam(function(t,n){var r=_restParam(function(n){var r=this,s=n.pop();return e(t,function(e,t,s){e.apply(r,n.concat([s]))},s)});return n.length?r.apply(this,n):r})}function ensureAsync(e){return _restParam(function(t){var n=t.pop();t.push(function(){var e=arguments;r?i.setImmediate(function(){n.apply(null,e)}):n.apply(null,e)});var r=!0;e.apply(this,t),r=!1})}var s,i={},o="object"==typeof self&&self.self===self&&self||"object"==typeof r&&r.global===r&&r||this;null!=o&&(s=o.async),i.noConflict=function(){return o.async=s,i};var a=Object.prototype.toString,c=Array.isArray||function(e){return"[object Array]"===a.call(e)},u=function(e){var t=typeof e;return"function"===t||"object"===t&&!!e},d=Object.keys||function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t},l="function"==typeof setImmediate&&setImmediate,p=l?function(e){l(e)}:function(e){setTimeout(e,0)};"object"==typeof t&&"function"==typeof t.nextTick?i.nextTick=t.nextTick:i.nextTick=p,i.setImmediate=l?p:i.nextTick,i.forEach=i.each=function(e,t,n){return i.eachOf(e,_withoutIndex(t),n)},i.forEachSeries=i.eachSeries=function(e,t,n){return i.eachOfSeries(e,_withoutIndex(t),n)},i.forEachLimit=i.eachLimit=function(e,t,n,r){return _eachOfLimit(t)(e,_withoutIndex(n),r)},i.forEachOf=i.eachOf=function(e,t,n){function done(e){i--,e?n(e):null===r&&i<=0&&n(null)}n=_once(n||noop),e=e||[];for(var r,s=_keyIterator(e),i=0;null!=(r=s());)i+=1,t(e[r],r,only_once(done));0===i&&n(null)},i.forEachOfSeries=i.eachOfSeries=function(e,t,n){function iterate(){var o=!0;return null===s?n(null):(t(e[s],s,only_once(function(e){if(e)n(e);else{if(s=r(),null===s)return n(null);o?i.setImmediate(iterate):iterate()}})),void(o=!1))}n=_once(n||noop),e=e||[];var r=_keyIterator(e),s=r();iterate()},i.forEachOfLimit=i.eachOfLimit=function(e,t,n,r){_eachOfLimit(t)(e,n,r)},i.map=doParallel(_asyncMap),i.mapSeries=doSeries(_asyncMap),i.mapLimit=doParallelLimit(_asyncMap),i.inject=i.foldl=i.reduce=function(e,t,n,r){i.eachOfSeries(e,function(e,r,s){n(t,e,function(e,n){t=n,s(e)})},function(e){r(e,t)})},i.foldr=i.reduceRight=function(e,t,n,r){var s=_map(e,identity).reverse();i.reduce(s,t,n,r)},i.transform=function(e,t,n,r){3===arguments.length&&(r=n,n=t,t=c(e)?[]:{}),i.eachOf(e,function(e,r,s){n(t,e,r,s)},function(e){r(e,t)})},i.select=i.filter=doParallel(_filter),i.selectLimit=i.filterLimit=doParallelLimit(_filter),i.selectSeries=i.filterSeries=doSeries(_filter),i.reject=doParallel(_reject),i.rejectLimit=doParallelLimit(_reject),i.rejectSeries=doSeries(_reject),i.any=i.some=_createTester(i.eachOf,toBool,identity),i.someLimit=_createTester(i.eachOfLimit,toBool,identity),i.all=i.every=_createTester(i.eachOf,notId,notId),i.everyLimit=_createTester(i.eachOfLimit,notId,notId),i.detect=_createTester(i.eachOf,identity,_findGetResult),i.detectSeries=_createTester(i.eachOfSeries,identity,_findGetResult),i.detectLimit=_createTester(i.eachOfLimit,identity,_findGetResult),i.sortBy=function(e,t,n){function comparator(e,t){var n=e.criteria,r=t.criteria;return n<r?-1:n>r?1:0}i.map(e,function(e,n){t(e,function(t,r){t?n(t):n(null,{value:e,criteria:r})})},function(e,t){return e?n(e):void n(null,_map(t.sort(comparator),function(e){return e.value}))})},i.auto=function(e,t,n){function addListener(e){l.unshift(e)}function removeListener(e){var t=_indexOf(l,e);t>=0&&l.splice(t,1)}function taskComplete(){s--,_arrayEach(l.slice(0),function(e){e()})}"function"==typeof arguments[1]&&(n=t,t=null),n=_once(n||noop);var r=d(e),s=r.length;if(!s)return n(null);t||(t=s);var o={},a=0,u=!1,l=[];addListener(function(){s||n(null,o)}),_arrayEach(r,function(r){function ready(){return a<t&&_reduce(p,function(e,t){return e&&o.hasOwnProperty(t)},!0)&&!o.hasOwnProperty(r)}function listener(){ready()&&(a++,removeListener(listener),d[d.length-1](l,o))}if(!u){for(var s,d=c(e[r])?e[r]:[e[r]],l=_restParam(function(e,t){if(a--,t.length<=1&&(t=t[0]),e){var s={};_forEachOf(o,function(e,t){s[t]=e}),s[r]=t,u=!0,n(e,s)}else o[r]=t,i.setImmediate(taskComplete)}),p=d.slice(0,d.length-1),f=p.length;f--;){if(!(s=e[p[f]]))throw new Error("Has nonexistent dependency in "+p.join(", "));if(c(s)&&_indexOf(s,r)>=0)throw new Error("Has cyclic dependencies")}ready()?(a++,d[d.length-1](l,o)):addListener(listener)}})},i.retry=function(e,t,n){function parseTimes(e,t){if("number"==typeof t)e.times=parseInt(t,10)||r;else{if("object"!=typeof t)throw new Error("Unsupported argument type for 'times': "+typeof t);e.times=parseInt(t.times,10)||r,e.interval=parseInt(t.interval,10)||s}}function wrappedTask(e,t){function retryAttempt(e,n){return function(r){e(function(e,t){r(!e||n,{err:e,result:t})},t)}}function retryInterval(e){return function(t){setTimeout(function(){t(null)},e)}}for(;a.times;){var n=!(a.times-=1);o.push(retryAttempt(a.task,n)),!n&&a.interval>0&&o.push(retryInterval(a.interval))}i.series(o,function(t,n){n=n[n.length-1],(e||a.callback)(n.err,n.result)})}var r=5,s=0,o=[],a={times:r,interval:s},c=arguments.length;if(c<1||c>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return c<=2&&"function"==typeof e&&(n=t,t=e),"function"!=typeof e&&parseTimes(a,e),a.callback=n,a.task=t,a.callback?wrappedTask():wrappedTask},i.waterfall=function(e,t){function wrapIterator(e){return _restParam(function(n,r){if(n)t.apply(null,[n].concat(r));else{var s=e.next();s?r.push(wrapIterator(s)):r.push(t),ensureAsync(e).apply(null,r)}})}if(t=_once(t||noop),!c(e)){var n=new Error("First argument to waterfall must be an array of functions");return t(n)}return e.length?void wrapIterator(i.iterator(e))():t()},i.parallel=function(e,t){_parallel(i.eachOf,e,t)},i.parallelLimit=function(e,t,n){_parallel(_eachOfLimit(t),e,n)},i.series=function(e,t){_parallel(i.eachOfSeries,e,t)},i.iterator=function(e){function makeCallback(t){function fn(){return e.length&&e[t].apply(null,arguments),fn.next()}return fn.next=function(){return t<e.length-1?makeCallback(t+1):null},fn}return makeCallback(0)},i.apply=_restParam(function(e,t){return _restParam(function(n){return e.apply(null,t.concat(n))})}),i.concat=doParallel(_concat),i.concatSeries=doSeries(_concat),i.whilst=function(e,t,n){if(n=n||noop,e()){var r=_restParam(function(s,i){s?n(s):e.apply(this,i)?t(r):n.apply(null,[null].concat(i))});t(r)}else n(null)},i.doWhilst=function(e,t,n){var r=0;return i.whilst(function(){return++r<=1||t.apply(this,arguments)},e,n)},i.until=function(e,t,n){return i.whilst(function(){return!e.apply(this,arguments)},t,n)},i.doUntil=function(e,t,n){return i.doWhilst(e,function(){return!t.apply(this,arguments)},n)},i.during=function(e,t,n){n=n||noop;var r=_restParam(function(t,r){t?n(t):(r.push(s),e.apply(this,r))}),s=function(e,s){e?n(e):s?t(r):n(null)};e(s)},i.doDuring=function(e,t,n){var r=0;i.during(function(e){r++<1?e(null,!0):t.apply(this,arguments)},e,n)},i.queue=function(e,t){var n=_queue(function(t,n){e(t[0],n)},t,1);return n},i.priorityQueue=function(e,t){function _compareTasks(e,t){return e.priority-t.priority}function _binarySearch(e,t,n){for(var r=-1,s=e.length-1;r<s;){var i=r+(s-r+1>>>1);n(t,e[i])>=0?r=i:s=i-1}return r}function _insert(e,t,n,r){if(null!=r&&"function"!=typeof r)throw new Error("task callback must be a function");return e.started=!0,c(t)||(t=[t]),0===t.length?i.setImmediate(function(){e.drain()}):void _arrayEach(t,function(t){var s={data:t,priority:n,callback:"function"==typeof r?r:noop};e.tasks.splice(_binarySearch(e.tasks,s,_compareTasks)+1,0,s),e.tasks.length===e.concurrency&&e.saturated(),i.setImmediate(e.process)})}var n=i.queue(e,t);return n.push=function(e,t,r){_insert(n,e,t,r)},delete n.unshift,n},i.cargo=function(e,t){return _queue(e,1,t)},i.log=_console_fn("log"),i.dir=_console_fn("dir"),i.memoize=function(e,t){var n={},r={},s=Object.prototype.hasOwnProperty;t=t||identity;var o=_restParam(function memoized(o){var a=o.pop(),c=t.apply(null,o);s.call(n,c)?i.setImmediate(function(){a.apply(null,n[c])}):s.call(r,c)?r[c].push(a):(r[c]=[a],e.apply(null,o.concat([_restParam(function(e){n[c]=e;var t=r[c];delete r[c];for(var s=0,i=t.length;s<i;s++)t[s].apply(null,e)})])))});return o.memo=n,o.unmemoized=e,o},i.unmemoize=function(e){return function(){return(e.unmemoized||e).apply(null,arguments)}},i.times=_times(i.map),i.timesSeries=_times(i.mapSeries),i.timesLimit=function(e,t,n,r){return i.mapLimit(_range(e),t,n,r)},i.seq=function(){var e=arguments;return _restParam(function(t){var n=this,r=t[t.length-1];"function"==typeof r?t.pop():r=noop,i.reduce(e,t,function(e,t,r){t.apply(n,e.concat([_restParam(function(e,t){r(e,t)})]))},function(e,t){r.apply(n,[e].concat(t))})})},i.compose=function(){return i.seq.apply(null,Array.prototype.reverse.call(arguments))},i.applyEach=_applyEach(i.eachOf),i.applyEachSeries=_applyEach(i.eachOfSeries),i.forever=function(e,t){function next(e){return e?n(e):void r(next)}var n=only_once(t||noop),r=ensureAsync(e);next()},i.ensureAsync=ensureAsync,i.constant=_restParam(function(e){var t=[null].concat(e);return function(e){return e.apply(this,t)}}),i.wrapSync=i.asyncify=function asyncify(e){return _restParam(function(t){var n,r=t.pop();try{n=e.apply(this,t)}catch(e){return r(e)}u(n)&&"function"==typeof n.then?n.then(function(e){r(null,e)}).catch(function(e){r(e.message?e:new Error(e))}):r(null,n)})},"object"==typeof n&&n.exports?n.exports=i:"function"==typeof e&&e.amd?e([],function(){return i}):o.async=i}()}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/browserify/node_modules/process/browser.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/babel-runtime/core-js/object/assign.js":[function(e,t,n){t.exports={default:e("core-js/library/fn/object/assign"),__esModule:!0}},{"core-js/library/fn/object/assign":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/fn/object/assign.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/babel-runtime/helpers/interop-require-default.js":[function(e,t,n){"use strict";n.default=function(e){return e&&e.__esModule?e:{default:e}},n.__esModule=!0},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/base64-js/lib/b64.js":[function(e,t,n){"use strict";function init(){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,n=e.length;t<n;++t)r[t]=e[t],s[e.charCodeAt(t)]=t;s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63}function toByteArray(e){var t,n,r,o,a,c,u=e.length;if(u%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a="="===e[u-2]?2:"="===e[u-1]?1:0,c=new i(3*u/4-a),r=a>0?u-4:u;var d=0;for(t=0,n=0;t<r;t+=4,n+=3)o=s[e.charCodeAt(t)]<<18|s[e.charCodeAt(t+1)]<<12|s[e.charCodeAt(t+2)]<<6|s[e.charCodeAt(t+3)],c[d++]=o>>16&255,c[d++]=o>>8&255,c[d++]=255&o;return 2===a?(o=s[e.charCodeAt(t)]<<2|s[e.charCodeAt(t+1)]>>4,c[d++]=255&o):1===a&&(o=s[e.charCodeAt(t)]<<10|s[e.charCodeAt(t+1)]<<4|s[e.charCodeAt(t+2)]>>2,c[d++]=o>>8&255,c[d++]=255&o),c}function tripletToBase64(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function encodeChunk(e,t,n){for(var r,s=[],i=t;i<n;i+=3)r=(e[i]<<16)+(e[i+1]<<8)+e[i+2],s.push(tripletToBase64(r));return s.join("")}function fromByteArray(e){for(var t,n=e.length,s=n%3,i="",o=[],a=16383,c=0,u=n-s;c<u;c+=a)o.push(encodeChunk(e,c,c+a>u?u:c+a));return 1===s?(t=e[n-1],i+=r[t>>2],i+=r[t<<4&63],i+="=="):2===s&&(t=(e[n-2]<<8)+e[n-1],i+=r[t>>10],i+=r[t>>4&63],i+=r[t<<2&63],i+="="),o.push(i),o.join("")}n.toByteArray=toByteArray,n.fromByteArray=fromByteArray;var r=[],s=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array;init()},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/bitwise-xor/index.js":[function(e,t,n){(function(e){function xor(t,n){e.isBuffer(t)||(t=new e(t)),e.isBuffer(n)||(n=new e(n));var r=[];if(t.length>n.length)for(var s=0;s<n.length;s++)r.push(t[s]^n[s]);else for(var s=0;s<t.length;s++)r.push(t[s]^n[s]);return new e(r)}t.exports=xor}).call(this,e("buffer").Buffer)},{buffer:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/browser-resolve/empty.js":[function(e,t,n){},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/browserify/node_modules/process/browser.js":[function(e,t,n){function cleanUpNextTick(){c&&o&&(c=!1,o.length?a=o.concat(a):u=-1,a.length&&drainQueue())}function drainQueue(){if(!c){var e=r(cleanUpNextTick);c=!0;for(var t=a.length;t;){for(o=a,a=[];++u<t;)o&&o[u].run();u=-1,t=a.length}o=null,c=!1,s(e)}}function Item(e,t){this.fun=e,this.array=t}function noop(){}var r,s,i=t.exports={};!function(){try{r=setTimeout}catch(e){r=function(){throw new Error("setTimeout is not defined")}}try{s=clearTimeout}catch(e){s=function(){throw new Error("clearTimeout is not defined")}}}();var o,a=[],c=!1,u=-1;i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];a.push(new Item(e,t)),1!==a.length||c||r(drainQueue,0)},Item.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=noop,i.addListener=noop,i.once=noop,i.off=noop,i.removeListener=noop,i.removeAllListeners=noop,i.emit=noop,i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer-shims/index.js":[function(e,t,n){(function(t){"use strict";var r=e("buffer"),s=r.Buffer,i=r.SlowBuffer,o=r.kMaxLength||2147483647;n.alloc=function alloc(e,t,n){if("function"==typeof s.alloc)return s.alloc(e,t,n);if("number"==typeof n)throw new TypeError("encoding must not be number");if("number"!=typeof e)throw new TypeError("size must be a number");if(e>o)throw new RangeError("size is too large");var r=n,i=t;void 0===i&&(r=void 0,i=0);var a=new s(e);if("string"==typeof i)for(var c=new s(i,r),u=c.length,d=-1;++d<e;)a[d]=c[d%u];else a.fill(i);return a},n.allocUnsafe=function allocUnsafe(e){if("function"==typeof s.allocUnsafe)return s.allocUnsafe(e);if("number"!=typeof e)throw new TypeError("size must be a number");if(e>o)throw new RangeError("size is too large");return new s(e)},n.from=function from(e,n,r){if("function"==typeof s.from&&(!t.Uint8Array||Uint8Array.from!==s.from))return s.from(e,n,r);if("number"==typeof e)throw new TypeError('"value" argument must not be a number');if("string"==typeof e)return new s(e,n);if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer){var i=n;if(1===arguments.length)return new s(e);"undefined"==typeof i&&(i=0);var o=r;if("undefined"==typeof o&&(o=e.byteLength-i),i>=e.byteLength)throw new RangeError("'offset' is out of bounds");if(o>e.byteLength-i)throw new RangeError("'length' is out of bounds");return new s(e.slice(i,i+o))}if(s.isBuffer(e)){var a=new s(e.length);return e.copy(a,0,0,e.length),a}if(e){if(Array.isArray(e)||"undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return new s(e);if("Buffer"===e.type&&Array.isArray(e.data))return new s(e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")},n.allocUnsafeSlow=function allocUnsafeSlow(e){if("function"==typeof s.allocUnsafeSlow)return s.allocUnsafeSlow(e);if("number"!=typeof e)throw new TypeError("size must be a number");if(e>=o)throw new RangeError("size is too large");return new i(e)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{buffer:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/index.js":[function(e,t,n){(function(t){"use strict";function typedArraySupport(){try{var e=new Uint8Array(1);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(e,t){if(kMaxLength()<t)throw new RangeError("Invalid typed array length");return Buffer.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=Buffer.prototype):(null===e&&(e=new Buffer(t)),e.length=t),e}function Buffer(e,t,n){if(!(Buffer.TYPED_ARRAY_SUPPORT||this instanceof Buffer))return new Buffer(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return allocUnsafe(this,e)}return from(this,e,t,n)}function from(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?fromArrayBuffer(e,t,n,r):"string"==typeof t?fromString(e,t,n):fromObject(e,t)}function assertSize(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number')}function alloc(e,t,n,r){return assertSize(t),t<=0?createBuffer(e,t):void 0!==n?"string"==typeof r?createBuffer(e,t).fill(n,r):createBuffer(e,t).fill(n):createBuffer(e,t)}function allocUnsafe(e,t){if(assertSize(t),e=createBuffer(e,t<0?0:0|checked(t)),!Buffer.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;n++)e[n]=0;return e}function fromString(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!Buffer.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|byteLength(t,n);return e=createBuffer(e,r),e.write(t,n),e}function fromArrayLike(e,t){var n=0|checked(t.length);e=createBuffer(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function fromArrayBuffer(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return t=void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r),Buffer.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=Buffer.prototype):e=fromArrayLike(e,t),e}function fromObject(e,t){if(Buffer.isBuffer(t)){var n=0|checked(t.length);return e=createBuffer(e,n),0===e.length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||isnan(t.length)?createBuffer(e,0):fromArrayLike(e,t);if("Buffer"===t.type&&i(t.data))return fromArrayLike(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked(e){if(e>=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|e}function SlowBuffer(e){return+e!=e&&(e=0),Buffer.alloc(+e)}function byteLength(e,t){if(Buffer.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"binary":case"raw":case"raws":return n;case"utf8":case"utf-8":case void 0:return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return base64ToBytes(e).length;default:if(r)return utf8ToBytes(e).length;t=(""+t).toLowerCase(),r=!0}}function slowToString(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return hexSlice(this,t,n);case"utf8":case"utf-8":return utf8Slice(this,t,n);case"ascii":return asciiSlice(this,t,n);case"binary":return binarySlice(this,t,n);case"base64":return base64Slice(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function swap(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function arrayIndexOf(e,t,n,r){function read(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}var s=1,i=e.length,o=t.length;if(void 0!==r&&(r=String(r).toLowerCase(),"ucs2"===r||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,i/=2,o/=2,n/=2}for(var a=-1,c=0;n+c<i;c++)if(read(e,n+c)===read(t,a===-1?0:c-a)){if(a===-1&&(a=c),c-a+1===o)return(n+a)*s}else a!==-1&&(c-=c-a),a=-1;return-1}function hexWrite(e,t,n,r){n=Number(n)||0;var s=e.length-n;r?(r=Number(r),r>s&&(r=s)):r=s;var i=t.length;if(i%2!==0)throw new Error("Invalid hex string");r>i/2&&(r=i/2);for(var o=0;o<r;o++){var a=parseInt(t.substr(2*o,2),16);if(isNaN(a))return o;e[n+o]=a}return o}function utf8Write(e,t,n,r){return blitBuffer(utf8ToBytes(t,e.length-n),e,n,r)}function asciiWrite(e,t,n,r){return blitBuffer(asciiToBytes(t),e,n,r)}function binaryWrite(e,t,n,r){return asciiWrite(e,t,n,r)}function base64Write(e,t,n,r){return blitBuffer(base64ToBytes(t),e,n,r)}function ucs2Write(e,t,n,r){return blitBuffer(utf16leToBytes(t,e.length-n),e,n,r)}function base64Slice(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function utf8Slice(e,t,n){n=Math.min(e.length,n);for(var r=[],s=t;s<n;){var i=e[s],o=null,a=i>239?4:i>223?3:i>191?2:1;if(s+a<=n){var c,u,d,l;switch(a){case 1:i<128&&(o=i);break;case 2:c=e[s+1],128===(192&c)&&(l=(31&i)<<6|63&c,l>127&&(o=l));break;case 3:c=e[s+1],u=e[s+2],128===(192&c)&&128===(192&u)&&(l=(15&i)<<12|(63&c)<<6|63&u,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:c=e[s+1],u=e[s+2],d=e[s+3],128===(192&c)&&128===(192&u)&&128===(192&d)&&(l=(15&i)<<18|(63&c)<<12|(63&u)<<6|63&d,l>65535&&l<1114112&&(o=l))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),s+=a}return decodeCodePointsArray(r)}function decodeCodePointsArray(e){var t=e.length;if(t<=o)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=o));return n}function asciiSlice(e,t,n){var r="";n=Math.min(e.length,n);for(var s=t;s<n;s++)r+=String.fromCharCode(127&e[s]);return r}function binarySlice(e,t,n){var r="";n=Math.min(e.length,n);for(var s=t;s<n;s++)r+=String.fromCharCode(e[s]);return r}function hexSlice(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var s="",i=t;i<n;i++)s+=toHex(e[i]);return s}function utf16leSlice(e,t,n){for(var r=e.slice(t,n),s="",i=0;i<r.length;i+=2)s+=String.fromCharCode(r[i]+256*r[i+1]);return s}function checkOffset(e,t,n){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function checkInt(e,t,n,r,s,i){if(!Buffer.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>s||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function objectWriteUInt16(e,t,n,r){t<0&&(t=65535+t+1);for(var s=0,i=Math.min(e.length-n,2);s<i;s++)e[n+s]=(t&255<<8*(r?s:1-s))>>>8*(r?s:1-s)}function objectWriteUInt32(e,t,n,r){t<0&&(t=4294967295+t+1);for(var s=0,i=Math.min(e.length-n,4);s<i;s++)e[n+s]=t>>>8*(r?s:3-s)&255}function checkIEEE754(e,t,n,r,s,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function writeFloat(e,t,n,r,i){return i||checkIEEE754(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),s.write(e,t,n,r,23,4),n+4}function writeDouble(e,t,n,r,i){return i||checkIEEE754(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),s.write(e,t,n,r,52,8),n+8}function base64clean(e){if(e=stringtrim(e).replace(a,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function stringtrim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function toHex(e){return e<16?"0"+e.toString(16):e.toString(16)}function utf8ToBytes(e,t){t=t||1/0;for(var n,r=e.length,s=null,i=[],o=0;o<r;o++){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!s){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&i.push(239,191,189);continue}s=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),s=n;continue}n=(s-55296<<10|n-56320)+65536}else s&&(t-=3)>-1&&i.push(239,191,189);if(s=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function asciiToBytes(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t}function utf16leToBytes(e,t){for(var n,r,s,i=[],o=0;o<e.length&&!((t-=2)<0);o++)n=e.charCodeAt(o),r=n>>8,s=n%256,i.push(s),i.push(r);return i}function base64ToBytes(e){return r.toByteArray(base64clean(e))}function blitBuffer(e,t,n,r){for(var s=0;s<r&&!(s+n>=t.length||s>=e.length);s++)t[s+n]=e[s];return s}function isnan(e){return e!==e}var r=e("base64-js"),s=e("ieee754"),i=e("isarray");n.Buffer=Buffer,n.SlowBuffer=SlowBuffer,n.INSPECT_MAX_BYTES=50,Buffer.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:typedArraySupport(),n.kMaxLength=kMaxLength(),Buffer.poolSize=8192,Buffer._augment=function(e){return e.__proto__=Buffer.prototype,e},Buffer.from=function(e,t,n){return from(null,e,t,n)},Buffer.TYPED_ARRAY_SUPPORT&&(Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0})),Buffer.alloc=function(e,t,n){return alloc(null,e,t,n)},Buffer.allocUnsafe=function(e){return allocUnsafe(null,e)},Buffer.allocUnsafeSlow=function(e){return allocUnsafe(null,e)},Buffer.isBuffer=function isBuffer(e){return!(null==e||!e._isBuffer)},Buffer.compare=function compare(e,t){if(!Buffer.isBuffer(e)||!Buffer.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,s=0,i=Math.min(n,r);s<i;++s)if(e[s]!==t[s]){n=e[s],r=t[s];break}return n<r?-1:r<n?1:0},Buffer.isEncoding=function isEncoding(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer.concat=function concat(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Buffer.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;n++)t+=e[n].length;var r=Buffer.allocUnsafe(t),s=0;for(n=0;n<e.length;n++){var o=e[n];if(!Buffer.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,s),s+=o.length}return r},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function swap16(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)swap(this,t,t+1);return this},Buffer.prototype.swap32=function swap32(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)swap(this,t,t+3),swap(this,t+1,t+2);return this},Buffer.prototype.toString=function toString(){var e=0|this.length;return 0===e?"":0===arguments.length?utf8Slice(this,0,e):slowToString.apply(this,arguments)},Buffer.prototype.equals=function equals(e){if(!Buffer.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Buffer.compare(this,e)},Buffer.prototype.inspect=function inspect(){var e="",t=n.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},Buffer.prototype.compare=function compare(e,t,n,r,s){if(!Buffer.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===s&&(s=this.length),t<0||n>e.length||r<0||s>this.length)throw new RangeError("out of range index");if(r>=s&&t>=n)return 0;if(r>=s)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,s>>>=0,this===e)return 0;for(var i=s-r,o=n-t,a=Math.min(i,o),c=this.slice(r,s),u=e.slice(t,n),d=0;d<a;++d)if(c[d]!==u[d]){i=c[d],o=u[d];break}return i<o?-1:o<i?1:0},Buffer.prototype.indexOf=function indexOf(e,t,n){
  if("string"==typeof t?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t>>=0,0===this.length)return-1;if(t>=this.length)return-1;if(t<0&&(t=Math.max(this.length+t,0)),"string"==typeof e&&(e=Buffer.from(e,n)),Buffer.isBuffer(e))return 0===e.length?-1:arrayIndexOf(this,e,t,n);if("number"==typeof e)return Buffer.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,e,t):arrayIndexOf(this,[e],t,n);throw new TypeError("val must be string, number or Buffer")},Buffer.prototype.includes=function includes(e,t,n){return this.indexOf(e,t,n)!==-1},Buffer.prototype.write=function write(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t=0|t,isFinite(n)?(n=0|n,void 0===r&&(r="utf8")):(r=n,n=void 0)}var s=this.length-t;if((void 0===n||n>s)&&(n=s),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return hexWrite(this,e,t,n);case"utf8":case"utf-8":return utf8Write(this,e,t,n);case"ascii":return asciiWrite(this,e,t,n);case"binary":return binaryWrite(this,e,t,n);case"base64":return base64Write(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var o=4096;Buffer.prototype.slice=function slice(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);var r;if(Buffer.TYPED_ARRAY_SUPPORT)r=this.subarray(e,t),r.__proto__=Buffer.prototype;else{var s=t-e;r=new Buffer(s,(void 0));for(var i=0;i<s;i++)r[i]=this[i+e]}return r},Buffer.prototype.readUIntLE=function readUIntLE(e,t,n){e=0|e,t=0|t,n||checkOffset(e,t,this.length);for(var r=this[e],s=1,i=0;++i<t&&(s*=256);)r+=this[e+i]*s;return r},Buffer.prototype.readUIntBE=function readUIntBE(e,t,n){e=0|e,t=0|t,n||checkOffset(e,t,this.length);for(var r=this[e+--t],s=1;t>0&&(s*=256);)r+=this[e+--t]*s;return r},Buffer.prototype.readUInt8=function readUInt8(e,t){return t||checkOffset(e,1,this.length),this[e]},Buffer.prototype.readUInt16LE=function readUInt16LE(e,t){return t||checkOffset(e,2,this.length),this[e]|this[e+1]<<8},Buffer.prototype.readUInt16BE=function readUInt16BE(e,t){return t||checkOffset(e,2,this.length),this[e]<<8|this[e+1]},Buffer.prototype.readUInt32LE=function readUInt32LE(e,t){return t||checkOffset(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Buffer.prototype.readUInt32BE=function readUInt32BE(e,t){return t||checkOffset(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Buffer.prototype.readIntLE=function readIntLE(e,t,n){e=0|e,t=0|t,n||checkOffset(e,t,this.length);for(var r=this[e],s=1,i=0;++i<t&&(s*=256);)r+=this[e+i]*s;return s*=128,r>=s&&(r-=Math.pow(2,8*t)),r},Buffer.prototype.readIntBE=function readIntBE(e,t,n){e=0|e,t=0|t,n||checkOffset(e,t,this.length);for(var r=t,s=1,i=this[e+--r];r>0&&(s*=256);)i+=this[e+--r]*s;return s*=128,i>=s&&(i-=Math.pow(2,8*t)),i},Buffer.prototype.readInt8=function readInt8(e,t){return t||checkOffset(e,1,this.length),128&this[e]?(255-this[e]+1)*-1:this[e]},Buffer.prototype.readInt16LE=function readInt16LE(e,t){t||checkOffset(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},Buffer.prototype.readInt16BE=function readInt16BE(e,t){t||checkOffset(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},Buffer.prototype.readInt32LE=function readInt32LE(e,t){return t||checkOffset(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Buffer.prototype.readInt32BE=function readInt32BE(e,t){return t||checkOffset(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Buffer.prototype.readFloatLE=function readFloatLE(e,t){return t||checkOffset(e,4,this.length),s.read(this,e,!0,23,4)},Buffer.prototype.readFloatBE=function readFloatBE(e,t){return t||checkOffset(e,4,this.length),s.read(this,e,!1,23,4)},Buffer.prototype.readDoubleLE=function readDoubleLE(e,t){return t||checkOffset(e,8,this.length),s.read(this,e,!0,52,8)},Buffer.prototype.readDoubleBE=function readDoubleBE(e,t){return t||checkOffset(e,8,this.length),s.read(this,e,!1,52,8)},Buffer.prototype.writeUIntLE=function writeUIntLE(e,t,n,r){if(e=+e,t=0|t,n=0|n,!r){var s=Math.pow(2,8*n)-1;checkInt(this,e,t,n,s,0)}var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},Buffer.prototype.writeUIntBE=function writeUIntBE(e,t,n,r){if(e=+e,t=0|t,n=0|n,!r){var s=Math.pow(2,8*n)-1;checkInt(this,e,t,n,s,0)}var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},Buffer.prototype.writeUInt8=function writeUInt8(e,t,n){return e=+e,t=0|t,n||checkInt(this,e,t,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Buffer.prototype.writeUInt16LE=function writeUInt16LE(e,t,n){return e=+e,t=0|t,n||checkInt(this,e,t,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):objectWriteUInt16(this,e,t,!0),t+2},Buffer.prototype.writeUInt16BE=function writeUInt16BE(e,t,n){return e=+e,t=0|t,n||checkInt(this,e,t,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):objectWriteUInt16(this,e,t,!1),t+2},Buffer.prototype.writeUInt32LE=function writeUInt32LE(e,t,n){return e=+e,t=0|t,n||checkInt(this,e,t,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):objectWriteUInt32(this,e,t,!0),t+4},Buffer.prototype.writeUInt32BE=function writeUInt32BE(e,t,n){return e=+e,t=0|t,n||checkInt(this,e,t,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):objectWriteUInt32(this,e,t,!1),t+4},Buffer.prototype.writeIntLE=function writeIntLE(e,t,n,r){if(e=+e,t=0|t,!r){var s=Math.pow(2,8*n-1);checkInt(this,e,t,n,s-1,-s)}var i=0,o=1,a=0;for(this[t]=255&e;++i<n&&(o*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/o>>0)-a&255;return t+n},Buffer.prototype.writeIntBE=function writeIntBE(e,t,n,r){if(e=+e,t=0|t,!r){var s=Math.pow(2,8*n-1);checkInt(this,e,t,n,s-1,-s)}var i=n-1,o=1,a=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/o>>0)-a&255;return t+n},Buffer.prototype.writeInt8=function writeInt8(e,t,n){return e=+e,t=0|t,n||checkInt(this,e,t,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Buffer.prototype.writeInt16LE=function writeInt16LE(e,t,n){return e=+e,t=0|t,n||checkInt(this,e,t,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):objectWriteUInt16(this,e,t,!0),t+2},Buffer.prototype.writeInt16BE=function writeInt16BE(e,t,n){return e=+e,t=0|t,n||checkInt(this,e,t,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):objectWriteUInt16(this,e,t,!1),t+2},Buffer.prototype.writeInt32LE=function writeInt32LE(e,t,n){return e=+e,t=0|t,n||checkInt(this,e,t,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):objectWriteUInt32(this,e,t,!0),t+4},Buffer.prototype.writeInt32BE=function writeInt32BE(e,t,n){return e=+e,t=0|t,n||checkInt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):objectWriteUInt32(this,e,t,!1),t+4},Buffer.prototype.writeFloatLE=function writeFloatLE(e,t,n){return writeFloat(this,e,t,!0,n)},Buffer.prototype.writeFloatBE=function writeFloatBE(e,t,n){return writeFloat(this,e,t,!1,n)},Buffer.prototype.writeDoubleLE=function writeDoubleLE(e,t,n){return writeDouble(this,e,t,!0,n)},Buffer.prototype.writeDoubleBE=function writeDoubleBE(e,t,n){return writeDouble(this,e,t,!1,n)},Buffer.prototype.copy=function copy(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var s,i=r-n;if(this===e&&n<t&&t<r)for(s=i-1;s>=0;s--)e[s+t]=this[s+n];else if(i<1e3||!Buffer.TYPED_ARRAY_SUPPORT)for(s=0;s<i;s++)e[s+t]=this[s+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),t);return i},Buffer.prototype.fill=function fill(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var s=e.charCodeAt(0);s<256&&(e=s)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!Buffer.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e=255&e);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var i;if("number"==typeof e)for(i=t;i<n;i++)this[i]=e;else{var o=Buffer.isBuffer(e)?e:utf8ToBytes(new Buffer(e,r).toString()),a=o.length;for(i=0;i<n-t;i++)this[i+t]=o[i%a]}return this};var a=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/base64-js/lib/b64.js",ieee754:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ieee754/index.js",isarray:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/node_modules/isarray/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/node_modules/isarray/index.js":[function(e,t,n){var r={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/cipher-base/index.js":[function(e,t,n){(function(n){function CipherBase(e){r.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._decoder=null,this._encoding=null}var r=e("stream").Transform,s=e("inherits"),i=e("string_decoder").StringDecoder;t.exports=CipherBase,s(CipherBase,r),CipherBase.prototype.update=function(e,t,r){"string"==typeof e&&(e=new n(e,t));var s=this._update(e);return this.hashMode?this:(r&&(s=this._toString(s,r)),s)},CipherBase.prototype.setAutoPadding=function(){},CipherBase.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},CipherBase.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},CipherBase.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},CipherBase.prototype._transform=function(e,t,n){var r;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){r=e}finally{n(r)}},CipherBase.prototype._flush=function(e){var t;try{this.push(this._final())}catch(e){t=e}finally{e(t)}},CipherBase.prototype._finalOrDigest=function(e){var t=this._final()||new n("");return e&&(t=this._toString(t,e,!0)),t},CipherBase.prototype._toString=function(e,t,n){if(this._decoder||(this._decoder=new i(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var r=this._decoder.write(e);return n&&(r+=this._decoder.end()),r}}).call(this,e("buffer").Buffer)},{buffer:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/index.js",inherits:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/inherits/inherits_browser.js",stream:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/index.js",string_decoder:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/string_decoder/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/fn/object/assign.js":[function(e,t,n){e("../../modules/es6.object.assign"),t.exports=e("../../modules/$.core").Object.assign},{"../../modules/$.core":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/modules/$.core.js","../../modules/es6.object.assign":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/modules/es6.object.assign.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/modules/$.a-function.js":[function(e,t,n){t.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/modules/$.cof.js":[function(e,t,n){var r={}.toString;t.exports=function(e){return r.call(e).slice(8,-1)}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/modules/$.core.js":[function(e,t,n){var r=t.exports={version:"1.2.6"};"number"==typeof __e&&(__e=r)},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/modules/$.ctx.js":[function(e,t,n){var r=e("./$.a-function");t.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,s){return e.call(t,n,r,s)}}return function(){return e.apply(t,arguments)}}},{"./$.a-function":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/modules/$.a-function.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/modules/$.defined.js":[function(e,t,n){t.exports=function(e){if(void 0==e)throw TypeError("Can't call method on  "+e);return e}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/modules/$.export.js":[function(e,t,n){var r=e("./$.global"),s=e("./$.core"),i=e("./$.ctx"),o="prototype",a=function(e,t,n){var c,u,d,l=e&a.F,p=e&a.G,f=e&a.S,m=e&a.P,h=e&a.B,g=e&a.W,b=p?s:s[t]||(s[t]={}),v=p?r:f?r[t]:(r[t]||{})[o];p&&(n=t);for(c in n)u=!l&&v&&c in v,u&&c in b||(d=u?v[c]:n[c],b[c]=p&&"function"!=typeof v[c]?n[c]:h&&u?i(d,r):g&&v[c]==d?function(e){var t=function(t){return this instanceof e?new e(t):e(t)};return t[o]=e[o],t}(d):m&&"function"==typeof d?i(Function.call,d):d,m&&((b[o]||(b[o]={}))[c]=d))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,t.exports=a},{"./$.core":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/modules/$.core.js","./$.ctx":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/modules/$.ctx.js","./$.global":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/modules/$.global.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/modules/$.fails.js":[function(e,t,n){t.exports=function(e){try{return!!e()}catch(e){return!0}}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/modules/$.global.js":[function(e,t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/modules/$.iobject.js":[function(e,t,n){var r=e("./$.cof");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},{"./$.cof":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/modules/$.cof.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/modules/$.js":[function(e,t,n){var r=Object;t.exports={create:r.create,getProto:r.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:r.getOwnPropertyDescriptor,setDesc:r.defineProperty,setDescs:r.defineProperties,getKeys:r.keys,getNames:r.getOwnPropertyNames,getSymbols:r.getOwnPropertySymbols,each:[].forEach}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/modules/$.object-assign.js":[function(e,t,n){var r=e("./$"),s=e("./$.to-object"),i=e("./$.iobject");t.exports=e("./$.fails")(function(){var e=Object.assign,t={},n={},r=Symbol(),s="abcdefghijklmnopqrst";return t[r]=7,s.split("").forEach(function(e){n[e]=e}),7!=e({},t)[r]||Object.keys(e({},n)).join("")!=s})?function assign(e,t){for(var n=s(e),o=arguments,a=o.length,c=1,u=r.getKeys,d=r.getSymbols,l=r.isEnum;a>c;)for(var p,f=i(o[c++]),m=d?u(f).concat(d(f)):u(f),h=m.length,g=0;h>g;)l.call(f,p=m[g++])&&(n[p]=f[p]);return n}:Object.assign},{"./$":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/modules/$.js","./$.fails":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/modules/$.fails.js","./$.iobject":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/modules/$.iobject.js","./$.to-object":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/modules/$.to-object.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/modules/$.to-object.js":[function(e,t,n){var r=e("./$.defined");t.exports=function(e){return Object(r(e))}},{"./$.defined":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/modules/$.defined.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/modules/es6.object.assign.js":[function(e,t,n){var r=e("./$.export");r(r.S+r.F,"Object",{assign:e("./$.object-assign")})},{"./$.export":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/modules/$.export.js","./$.object-assign":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-js/library/modules/$.object-assign.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-util-is/lib/util.js":[function(e,t,n){(function(e){function isArray(e){return Array.isArray?Array.isArray(e):"[object Array]"===objectToString(e)}function isBoolean(e){return"boolean"==typeof e}function isNull(e){return null===e}function isNullOrUndefined(e){return null==e}function isNumber(e){return"number"==typeof e}function isString(e){return"string"==typeof e}function isSymbol(e){return"symbol"==typeof e}function isUndefined(e){return void 0===e}function isRegExp(e){return"[object RegExp]"===objectToString(e)}function isObject(e){return"object"==typeof e&&null!==e}function isDate(e){return"[object Date]"===objectToString(e)}function isError(e){return"[object Error]"===objectToString(e)||e instanceof Error}function isFunction(e){return"function"==typeof e}function isPrimitive(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function objectToString(e){return Object.prototype.toString.call(e)}n.isArray=isArray,n.isBoolean=isBoolean,n.isNull=isNull,n.isNullOrUndefined=isNullOrUndefined,n.isNumber=isNumber,n.isString=isString,n.isSymbol=isSymbol,n.isUndefined=isUndefined,n.isRegExp=isRegExp,n.isObject=isObject,n.isDate=isDate,n.isError=isError,n.isFunction=isFunction,n.isPrimitive=isPrimitive,n.isBuffer=e.isBuffer}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/is-buffer/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/create-hash/browser.js":[function(e,t,n){(function(n){"use strict";function HashNoConstructor(e){a.call(this,"digest"),this._hash=e,this.buffers=[]}function Hash(e){a.call(this,"digest"),this._hash=e}var r=e("inherits"),s=e("./md5"),i=e("ripemd160"),o=e("sha.js"),a=e("cipher-base");r(HashNoConstructor,a),HashNoConstructor.prototype._update=function(e){this.buffers.push(e)},HashNoConstructor.prototype._final=function(){var e=n.concat(this.buffers),t=this._hash(e);return this.buffers=null,t},r(Hash,a),Hash.prototype._update=function(e){this._hash.update(e)},Hash.prototype._final=function(){return this._hash.digest()},t.exports=function createHash(e){return e=e.toLowerCase(),"md5"===e?new HashNoConstructor(s):"rmd160"===e||"ripemd160"===e?new HashNoConstructor(i):new Hash(o(e))}}).call(this,e("buffer").Buffer)},{"./md5":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/create-hash/md5.js",buffer:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/index.js","cipher-base":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/cipher-base/index.js",inherits:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/inherits/inherits_browser.js",ripemd160:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ripemd160/lib/ripemd160.js","sha.js":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sha.js/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/create-hash/helpers.js":[function(e,t,n){(function(e){"use strict";function toArray(n,s){if(n.length%t!==0){var i=n.length+(t-n.length%t);n=e.concat([n,r],i)}for(var o=[],a=s?n.readInt32BE:n.readInt32LE,c=0;c<n.length;c+=t)o.push(a.call(n,c));return o}function toBuffer(t,n,r){for(var s=new e(n),i=r?s.writeInt32BE:s.writeInt32LE,o=0;o<t.length;o++)i.call(s,t[o],4*o,!0);return s}function hash(t,n,r,i){e.isBuffer(t)||(t=new e(t));var o=n(toArray(t,i),t.length*s);return toBuffer(o,r,i)}var t=4,r=new e(t);r.fill(0);var s=8;n.hash=hash}).call(this,e("buffer").Buffer)},{buffer:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/create-hash/md5.js":[function(e,t,n){"use strict";function core_md5(e,t){e[t>>5]|=128<<t%32,e[(t+64>>>9<<4)+14]=t;for(var n=1732584193,r=-271733879,s=-1732584194,i=271733878,o=0;o<e.length;o+=16){var a=n,c=r,u=s,d=i;n=md5_ff(n,r,s,i,e[o+0],7,-680876936),i=md5_ff(i,n,r,s,e[o+1],12,-389564586),s=md5_ff(s,i,n,r,e[o+2],17,606105819),r=md5_ff(r,s,i,n,e[o+3],22,-1044525330),n=md5_ff(n,r,s,i,e[o+4],7,-176418897),i=md5_ff(i,n,r,s,e[o+5],12,1200080426),s=md5_ff(s,i,n,r,e[o+6],17,-1473231341),r=md5_ff(r,s,i,n,e[o+7],22,-45705983),n=md5_ff(n,r,s,i,e[o+8],7,1770035416),i=md5_ff(i,n,r,s,e[o+9],12,-1958414417),s=md5_ff(s,i,n,r,e[o+10],17,-42063),r=md5_ff(r,s,i,n,e[o+11],22,-1990404162),n=md5_ff(n,r,s,i,e[o+12],7,1804603682),i=md5_ff(i,n,r,s,e[o+13],12,-40341101),s=md5_ff(s,i,n,r,e[o+14],17,-1502002290),r=md5_ff(r,s,i,n,e[o+15],22,1236535329),n=md5_gg(n,r,s,i,e[o+1],5,-165796510),i=md5_gg(i,n,r,s,e[o+6],9,-1069501632),s=md5_gg(s,i,n,r,e[o+11],14,643717713),r=md5_gg(r,s,i,n,e[o+0],20,-373897302),n=md5_gg(n,r,s,i,e[o+5],5,-701558691),i=md5_gg(i,n,r,s,e[o+10],9,38016083),s=md5_gg(s,i,n,r,e[o+15],14,-660478335),r=md5_gg(r,s,i,n,e[o+4],20,-405537848),n=md5_gg(n,r,s,i,e[o+9],5,568446438),i=md5_gg(i,n,r,s,e[o+14],9,-1019803690),s=md5_gg(s,i,n,r,e[o+3],14,-187363961),r=md5_gg(r,s,i,n,e[o+8],20,1163531501),n=md5_gg(n,r,s,i,e[o+13],5,-1444681467),i=md5_gg(i,n,r,s,e[o+2],9,-51403784),s=md5_gg(s,i,n,r,e[o+7],14,1735328473),r=md5_gg(r,s,i,n,e[o+12],20,-1926607734),n=md5_hh(n,r,s,i,e[o+5],4,-378558),i=md5_hh(i,n,r,s,e[o+8],11,-2022574463),s=md5_hh(s,i,n,r,e[o+11],16,1839030562),r=md5_hh(r,s,i,n,e[o+14],23,-35309556),n=md5_hh(n,r,s,i,e[o+1],4,-1530992060),i=md5_hh(i,n,r,s,e[o+4],11,1272893353),s=md5_hh(s,i,n,r,e[o+7],16,-155497632),r=md5_hh(r,s,i,n,e[o+10],23,-1094730640),n=md5_hh(n,r,s,i,e[o+13],4,681279174),i=md5_hh(i,n,r,s,e[o+0],11,-358537222),s=md5_hh(s,i,n,r,e[o+3],16,-722521979),r=md5_hh(r,s,i,n,e[o+6],23,76029189),n=md5_hh(n,r,s,i,e[o+9],4,-640364487),i=md5_hh(i,n,r,s,e[o+12],11,-421815835),s=md5_hh(s,i,n,r,e[o+15],16,530742520),r=md5_hh(r,s,i,n,e[o+2],23,-995338651),n=md5_ii(n,r,s,i,e[o+0],6,-198630844),i=md5_ii(i,n,r,s,e[o+7],10,1126891415),s=md5_ii(s,i,n,r,e[o+14],15,-1416354905),r=md5_ii(r,s,i,n,e[o+5],21,-57434055),n=md5_ii(n,r,s,i,e[o+12],6,1700485571),i=md5_ii(i,n,r,s,e[o+3],10,-1894986606),s=md5_ii(s,i,n,r,e[o+10],15,-1051523),r=md5_ii(r,s,i,n,e[o+1],21,-2054922799),n=md5_ii(n,r,s,i,e[o+8],6,1873313359),i=md5_ii(i,n,r,s,e[o+15],10,-30611744),s=md5_ii(s,i,n,r,e[o+6],15,-1560198380),r=md5_ii(r,s,i,n,e[o+13],21,1309151649),n=md5_ii(n,r,s,i,e[o+4],6,-145523070),i=md5_ii(i,n,r,s,e[o+11],10,-1120210379),s=md5_ii(s,i,n,r,e[o+2],15,718787259),r=md5_ii(r,s,i,n,e[o+9],21,-343485551),n=safe_add(n,a),r=safe_add(r,c),s=safe_add(s,u),i=safe_add(i,d)}return Array(n,r,s,i)}function md5_cmn(e,t,n,r,s,i){return safe_add(bit_rol(safe_add(safe_add(t,e),safe_add(r,i)),s),n)}function md5_ff(e,t,n,r,s,i,o){return md5_cmn(t&n|~t&r,e,t,s,i,o)}function md5_gg(e,t,n,r,s,i,o){return md5_cmn(t&r|n&~r,e,t,s,i,o)}function md5_hh(e,t,n,r,s,i,o){return md5_cmn(t^n^r,e,t,s,i,o)}function md5_ii(e,t,n,r,s,i,o){return md5_cmn(n^(t|~r),e,t,s,i,o)}function safe_add(e,t){var n=(65535&e)+(65535&t),r=(e>>16)+(t>>16)+(n>>16);return r<<16|65535&n}function bit_rol(e,t){return e<<t|e>>>32-t}var r=e("./helpers");t.exports=function md5(e){return r.hash(e,core_md5,16)}},{"./helpers":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/create-hash/helpers.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/create-hmac/browser.js":[function(e,t,n){(function(n){"use strict";function Hmac(e,t){i.call(this),e=e.toLowerCase(),"string"==typeof t&&(t=new n(t));var s="sha512"===e||"sha384"===e?128:64;this._alg=e,this._key=t,t.length>s?t=r(e).update(t).digest():t.length<s&&(t=n.concat([t,o],s));for(var a=this._ipad=new n(s),c=this._opad=new n(s),u=0;u<s;u++)a[u]=54^t[u],c[u]=92^t[u];this._hash=r(e).update(a)}var r=e("create-hash/browser"),s=e("inherits"),i=e("stream").Transform,o=new n(128);o.fill(0),s(Hmac,i),Hmac.prototype.update=function(e,t){return this._hash.update(e,t),this},Hmac.prototype._transform=function(e,t,n){this._hash.update(e),n()},Hmac.prototype._flush=function(e){this.push(this.digest()),e()},Hmac.prototype.digest=function(e){var t=this._hash.digest();return r(this._alg).update(this._opad).update(t).digest(e)},t.exports=function createHmac(e,t){return new Hmac(e,t)}}).call(this,e("buffer").Buffer)},{buffer:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/index.js","create-hash/browser":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/create-hash/browser.js",inherits:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/inherits/inherits_browser.js",stream:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/events/events.js":[function(e,t,n){function EventEmitter(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function isFunction(e){return"function"==typeof e}function isNumber(e){return"number"==typeof e}function isObject(e){return"object"==typeof e&&null!==e}function isUndefined(e){return void 0===e}t.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.prototype.setMaxListeners=function(e){if(!isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},EventEmitter.prototype.emit=function(e){var t,n,r,s,i,o;if(this._events||(this._events={}),"error"===e&&(!this._events.error||isObject(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;var a=new Error('Uncaught, unspecified "error" event. ('+t+")");throw a.context=t,a}if(n=this._events[e],isUndefined(n))return!1;if(isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),n.apply(this,s)}else if(isObject(n))for(s=Array.prototype.slice.call(arguments,1),o=n.slice(),r=o.length,i=0;i<r;i++)o[i].apply(this,s);return!0},EventEmitter.prototype.addListener=function(e,t){var n;if(!isFunction(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,isFunction(t.listener)?t.listener:t),this._events[e]?isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,isObject(this._events[e])&&!this._events[e].warned&&(n=isUndefined(this._maxListeners)?EventEmitter.defaultMaxListeners:this._maxListeners,n&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.once=function(e,t){function g(){this.removeListener(e,g),n||(n=!0,t.apply(this,arguments))}if(!isFunction(t))throw TypeError("listener must be a function");var n=!1;return g.listener=t,this.on(e,g),this},EventEmitter.prototype.removeListener=function(e,t){var n,r,s,i;if(!isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],s=n.length,r=-1,n===t||isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(isObject(n)){for(i=s;i-- >0;)if(n[i]===t||n[i].listener&&n[i].listener===t){r=i;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},EventEmitter.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],isFunction(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},EventEmitter.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},EventEmitter.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(isFunction(t))return 1;if(t)return t.length}return 0},EventEmitter.listenerCount=function(e,t){return e.listenerCount(t)}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/extend-object/extend-object.js":[function(e,t,n){var r=[],s=r.forEach,i=r.slice;t.exports=function(e){return s.call(i.call(arguments,1),function(t){if(t)for(var n in t)e[n]=t[n]}),e}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/filetransfer/filetransfer.js":[function(e,t,n){function Sender(e){r.call(this);var t=e||{};this.config={chunksize:16384,pacing:0};var n;for(n in t)this.config[n]=t[n];this.file=null,this.channel=null}function Receiver(){r.call(this),this.receiveBuffer=[],this.received=0,this.metadata={},this.channel=null}var r=e("wildemitter"),s=e("util");s.inherits(Sender,r),Sender.prototype.send=function(e,t){var n=this;this.file=e,this.channel=t;var r=function(t){var s=new window.FileReader;s.onload=function(){return function(s){n.channel.send(s.target.result),n.emit("progress",t,e.size,s.target.result),e.size>t+s.target.result.byteLength?window.setTimeout(r,n.config.pacing,t+n.config.chunksize):(n.emit("progress",e.size,e.size,null),n.emit("sentFile"))}}(e);var i=e.slice(t,t+n.config.chunksize);s.readAsArrayBuffer(i)};window.setTimeout(r,0,0)},s.inherits(Receiver,r),Receiver.prototype.receive=function(e,t){var n=this;e&&(this.metadata=e),this.channel=t,t.binaryType="arraybuffer",this.channel.onmessage=function(e){var t=e.data.byteLength;n.received+=t,n.receiveBuffer.push(e.data),n.emit("progress",n.received,n.metadata.size,e.data),n.received===n.metadata.size?(n.emit("receivedFile",new window.Blob(n.receiveBuffer),n.metadata),n.receiveBuffer=[]):n.received>n.metadata.size&&(console.error("received more than expected, discarding..."),n.receiveBuffer=[])}},t.exports={},t.exports.support="undefined"!=typeof window&&window&&window.File&&window.FileReader&&window.Blob,t.exports.Sender=Sender,t.exports.Receiver=Receiver},{util:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/util/util.js",
  wildemitter:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/wildemitter/wildemitter.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/filetransfer/hashed.js":[function(e,t,n){function Sender(e){r.call(this);var t=this;this.base=new o.Sender(e);var n=e||{};n.hash||(n.hash="sha-1"),this.hash=i.createHash(n.hash),this.base.on("progress",function(e,n,r){t.emit("progress",e,n,r),r&&t.hash.update(new Uint8Array(r))}),this.base.on("sentFile",function(){t.emit("sentFile",{hash:t.hash.digest("hex"),algo:n.hash})})}function Receiver(e){r.call(this);var t=this;this.base=new o.Receiver(e);var n=e||{};n.hash||(n.hash="sha-1"),this.hash=i.createHash(n.hash),this.base.on("progress",function(e,n,r){t.emit("progress",e,n,r),r&&t.hash.update(new Uint8Array(r))}),this.base.on("receivedFile",function(e,n){n.actualhash=t.hash.digest("hex"),t.emit("receivedFile",e,n)})}var r=e("wildemitter"),s=e("util"),i=e("iana-hashes"),o=e("./filetransfer");s.inherits(Sender,r),Sender.prototype.send=function(){this.base.send.apply(this.base,arguments)},s.inherits(Receiver,r),Receiver.prototype.receive=function(){this.base.receive.apply(this.base,arguments)},Object.defineProperty(Receiver.prototype,"metadata",{get:function(){return this.base.metadata},set:function(e){this.base.metadata=e}}),t.exports={},t.exports.support=o.support,t.exports.Sender=Sender,t.exports.Receiver=Receiver},{"./filetransfer":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/filetransfer/filetransfer.js","iana-hashes":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/iana-hashes/index.js",util:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/util/util.js",wildemitter:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/wildemitter/wildemitter.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/for-each/index.js":[function(e,t,n){function forEach(e,t,n){if(!r(t))throw new TypeError("iterator must be a function");arguments.length<3&&(n=this),"[object Array]"===s.call(e)?forEachArray(e,t,n):"string"==typeof e?forEachString(e,t,n):forEachObject(e,t,n)}function forEachArray(e,t,n){for(var r=0,s=e.length;r<s;r++)i.call(e,r)&&t.call(n,e[r],r,e)}function forEachString(e,t,n){for(var r=0,s=e.length;r<s;r++)t.call(n,e.charAt(r),r,e)}function forEachObject(e,t,n){for(var r in e)i.call(e,r)&&t.call(n,e[r],r,e)}var r=e("is-function");t.exports=forEach;var s=Object.prototype.toString,i=Object.prototype.hasOwnProperty},{"is-function":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/is-function/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/global/window.js":[function(e,t,n){(function(e){"undefined"!=typeof window?t.exports=window:"undefined"!=typeof e?t.exports=e:"undefined"!=typeof self?t.exports=self:t.exports={}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/hostmeta/index.js":[function(e,t,n){"use strict";var r=e("async"),s=e("request"),i=e("jxt").createRegistry();i.use(e("./lib/xrd")),t.exports=function(e,t){"string"==typeof e&&(e={host:e});var n={ssl:!0,json:!0,xrd:!0};for(var o in e)n[o]=e[o];var a=n.ssl?"https://":"http://";r.parallel([function(e){s(a+n.host+"/.well-known/host-meta.json",function(t,n,r){if(t)return e(null);var s;try{s=JSON.parse(r)}catch(e){s=null}return e(s)})},function(e){s(a+n.host+"/.well-known/host-meta",function(t,n,r){if(t)return e(null);var s=i.parse(r);return e(s.toJSON())})}],function(e){e?t(null,e):t("no-host-meta")})}},{"./lib/xrd":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/hostmeta/lib/xrd.js",async:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/async/lib/async.js",jxt:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt/index.js",request:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xhr/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/hostmeta/lib/xrd.js":[function(e,t,n){"use strict";var r=e("jxt"),s="http://docs.oasis-open.org/ns/xri/xrd-1.0";t.exports=function(e){var t={get:function(){for(var e={},t=r.find(this.xml,s,"Property"),n=0,i=t.length;n<i;n++){var o=t[n],a=r.getAttribute(o,"type");e[a]=o.textContent}return e}},n=e.define({name:"xrd",namespace:s,element:"XRD",fields:{subject:r.subText(s,"Subject"),expires:r.dateSub(s,"Expires"),aliases:r.multiSubText(s,"Alias"),properties:t}}),i=e.define({name:"_xrdlink",namespace:s,element:"Link",fields:{rel:r.attribute("rel"),href:r.attribute("href"),type:r.attribute("type"),template:r.attribute("template"),titles:r.subLangText(s,"Title","default"),properties:t}});return e.extend(n,i,"links"),n}},{jxt:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/iana-hashes/index.js":[function(e,t,n){var r=e("create-hash"),s=e("create-hmac"),i=e("./lib/get-hashes"),o={md2:"md2",md5:"md5","sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512"},a=Object.keys(o);n.getHashes=function(){for(var e=[],t=i(),n=0,r=a.length;n<r;n++)t.indexOf(o[a[n]])>=0&&e.push(a[n]);return e},n.createHash=function(e){return e=e.toLowerCase(),o[e]&&(e=o[e]),r(e)},n.createHmac=function(e,t){return e=e.toLowerCase(),o[e]&&(e=o[e]),s(e,t)}},{"./lib/get-hashes":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/iana-hashes/lib/get-hashes-browser.js","create-hash":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/create-hash/browser.js","create-hmac":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/create-hmac/browser.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/iana-hashes/lib/get-hashes-browser.js":[function(e,t,n){t.exports=function(){return["sha1","sha224","sha256","sha384","sha512","md5","rmd160"]}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ieee754/index.js":[function(e,t,n){n.read=function(e,t,n,r,s){var i,o,a=8*s-r-1,c=(1<<a)-1,u=c>>1,d=-7,l=n?s-1:0,p=n?-1:1,f=e[t+l];for(l+=p,i=f&(1<<-d)-1,f>>=-d,d+=a;d>0;i=256*i+e[t+l],l+=p,d-=8);for(o=i&(1<<-d)-1,i>>=-d,d+=r;d>0;o=256*o+e[t+l],l+=p,d-=8);if(0===i)i=1-u;else{if(i===c)return o?NaN:(f?-1:1)*(1/0);o+=Math.pow(2,r),i-=u}return(f?-1:1)*o*Math.pow(2,i-r)},n.write=function(e,t,n,r,s,i){var o,a,c,u=8*i-s-1,d=(1<<u)-1,l=d>>1,p=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:i-1,m=r?1:-1,h=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=d):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),t+=o+l>=1?p/c:p*Math.pow(2,1-l),t*c>=2&&(o++,c/=2),o+l>=d?(a=0,o=d):o+l>=1?(a=(t*c-1)*Math.pow(2,s),o+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,s),o=0));s>=8;e[n+f]=255&a,f+=m,a/=256,s-=8);for(o=o<<s|a,u+=s;u>0;e[n+f]=255&o,f+=m,o/=256,u-=8);e[n+f-m]|=128*h}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/inherits/inherits_browser.js":[function(e,t,n){"function"==typeof Object.create?t.exports=function inherits(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function inherits(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/intersect/index.js":[function(e,t,n){function intersect(e,t){for(var n=[],r=0;r<e.length;r++)indexOf(t,e[r])>-1&&n.push(e[r]);return n}function indexOf(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1}t.exports=intersect,intersect.big=function(e,t){for(var n=[],r={},s=0;s<t.length;s++)r[t[s]]=!0;for(var s=0;s<e.length;s++)r[e[s]]&&n.push(e[s]);return n}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/is-buffer/index.js":[function(e,t,n){t.exports=function(e){return!(null==e||!(e._isBuffer||e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)))}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/is-function/index.js":[function(e,t,n){function isFunction(e){var t=r.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}t.exports=isFunction;var r=Object.prototype.toString},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jingle-filetransfer-session/index.js":[function(e,t,n){function FileTransferSession(e){i.call(this,e),this.pc=new o({iceServers:e.iceServers||[],useJingle:!0},e.constraints||{}),this.pc.on("ice",this.onIceCandidate.bind(this)),this.pc.on("iceConnectionStateChange",this.onIceStateChange.bind(this)),this.pc.on("addChannel",this.onChannelAdded.bind(this)),this.sender=null,this.receiver=null}var r=e("util"),s=e("extend-object"),i=e("jingle-session"),o=e("rtcpeerconnection"),a=e("filetransfer/hashed");r.inherits(FileTransferSession,i),FileTransferSession.prototype=s(FileTransferSession.prototype,{start:function(e){var t=this;this.state="pending",this.pc.isInitiator=!0,this.sender=new a.Sender,this.sender.on("progress",function(e,n){t._log("info","Send progress "+e+"/"+n)}),this.sender.on("sentFile",function(e){t._log("info","Sent file",e.name);var n=t.pc.localDescription.contents[0];delete n.transport,n.application={applicationType:"filetransfer",offer:{hash:{algo:e.algo,value:e.hash}}},t.send("description-info",{contents:[n]}),t.emit("sentFile",t,e)});var n=this.pc.createDataChannel("filetransfer");n.onopen=function(){t.sender.send(e,n)};var r={mandatory:{OfferToReceiveAudio:!1,OfferToReceiveVideo:!1}};this.pc.offer(r,function(n,r){return n?(t._log("error","Could not create WebRTC offer",n),t.end("failed-application",!0)):(r.jingle.contents[0].application={applicationType:"filetransfer",offer:{date:e.lastModifiedDate,name:e.name,size:e.size,hash:{algo:"sha-1",value:""}}},void t.send("session-initiate",r.jingle))})},accept:function(){var e=this;this._log("info","Accepted incoming session"),this.state="active",this.pc.answer(function(t,n){return t?(e._log("error","Could not create WebRTC answer",t),e.end("failed-application")):void e.send("session-accept",n.jingle)})},end:function(e,t){this.pc.close(),i.prototype.end.call(this,e,t)},maybeReceivedFile:function(){this.receiver.metadata.hash.value&&(this.receiver.metadata.hash.value===this.receiver.metadata.actualhash?(this._log("info","File hash matches"),this.emit("receivedFile",this,this.receivedFile,this.receiver.metadata),this.end("success")):(this._log("error","File hash does not match"),this.end("media-error")))},onIceCandidate:function(e){this._log("info","Discovered new ICE candidate",e.jingle),this.send("transport-info",e.jingle)},onIceStateChange:function(){switch(this.pc.iceConnectionState){case"checking":this.connectionState="connecting";break;case"completed":case"connected":this.connectionState="connected";break;case"disconnected":"stable"===this.pc.signalingState?this.connectionState="interrupted":this.connectionState="disconnected";break;case"failed":this.connectionState="failed",this.end("failed-transport");break;case"closed":this.connectionState="disconnected"}},onChannelAdded:function(e){this.receiver.receive(null,e)},onSessionInitiate:function(e,t){var n=this;this._log("info","Initiating incoming session"),this.state="pending",this.pc.isInitiator=!1;var r=e.contents[0].application;this.receiver=new a.Receiver({hash:r.offer.hash.algo}),this.receiver.on("progress",function(e,t){n._log("info","Receive progress "+e+"/"+t)}),this.receiver.on("receivedFile",function(e){n.receivedFile=e,n.maybeReceivedFile()}),this.receiver.metadata=r.offer,e.contents[0].application={applicationType:"datachannel"},this.pc.handleOffer({type:"offer",jingle:e},function(e){return e?(n._log("error","Could not create WebRTC answer"),t({condition:"general-error"})):void t()})},onSessionAccept:function(e,t){var n=this;this.state="active",e.contents[0].application={applicationType:"datachannel"},this.pc.handleAnswer({type:"answer",jingle:e},function(e){return e?(n._log("error","Could not process WebRTC answer"),t({condition:"general-error"})):(n.emit("accepted",n),void t())})},onSessionTerminate:function(e,t){this._log("info","Terminating session"),this.pc.close(),i.prototype.end.call(this,e.reason,!0),t()},onDescriptionInfo:function(e,t){var n=e.contents[0].application.offer.hash;this.receiver.metadata.hash=n,this.receiver.metadata.actualhash&&this.maybeReceivedFile(),t()},onTransportInfo:function(e,t){this.pc.processIce(e,function(){t()})}}),t.exports=FileTransferSession},{"extend-object":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/extend-object/extend-object.js","filetransfer/hashed":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/filetransfer/hashed.js","jingle-session":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jingle-session/index.js",rtcpeerconnection:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/rtcpeerconnection/rtcpeerconnection.js",util:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/util/util.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jingle-media-session/index.js":[function(e,t,n){function filterContentSources(e,t){"rtp"===e.application.applicationType&&(delete e.transport,delete e.application.payloads,delete e.application.headerExtensions,e.application.mux=!1,e.application.sources&&(e.application.sources=e.application.sources.filter(function(e){return t.id===e.parameters[1].value.split(" ")[0]})),e.application.sourceGroups&&(e.application.sourceGroups=e.application.sourceGroups.filter(function(t){for(var n=!1,r=0;r<e.application.sources.length;r++)if(e.application.sources[r].ssrc===t.sources[0]){n=!0;break}return n})))}function filterUnusedLabels(e){var t=e.application.sources||[];t.forEach(function(e){e.parameters=e.parameters.filter(function(e){return!("mslabel"===e.key||"label"===e.key)})})}function MediaSession(e){i.call(this,e),this.pc=new o({iceServers:e.iceServers||[],useJingle:!0},e.constraints||{}),this.pc.on("ice",this.onIceCandidate.bind(this,e)),this.pc.on("endOfCandidates",this.onIceEndOfCandidates.bind(this,e)),this.pc.on("iceConnectionStateChange",this.onIceStateChange.bind(this)),this.pc.on("addStream",this.onAddStream.bind(this)),this.pc.on("removeStream",this.onRemoveStream.bind(this)),this.pc.on("addChannel",this.onAddChannel.bind(this)),e.stream&&this.addStream(e.stream),this._ringing=!1}var r=e("util"),s=e("extend-object"),i=e("jingle-session"),o=e("rtcpeerconnection");r.inherits(MediaSession,i),Object.defineProperties(MediaSession.prototype,{ringing:{get:function(){return this._ringing},set:function(e){e!==this._ringing&&(this._ringing=e,this.emit("change:ringing",e))}},streams:{get:function(){return"closed"!==this.pc.signalingState?this.pc.getRemoteStreams():[]}}}),MediaSession.prototype=s(MediaSession.prototype,{start:function(e,t){var n=this;this.state="pending",t=t||function(){},this.pc.isInitiator=!0,this.pc.offer(e,function(r,s){return r?(n._log("error","Could not create WebRTC offer",r),n.end("failed-application",!0)):(e&&e.mandatory&&s.jingle.contents.forEach(function(t){var n=t.application.media;t.description&&"rtp"===t.application.applicationType&&(e.mandatory.OfferToReceiveAudio||"audio"!==n||(t.senders="initiator"),e.mandatory.OfferToReceiveVideo||"video"!==n||(t.senders="initiator"))}),s.jingle.contents.forEach(filterUnusedLabels),n.send("session-initiate",s.jingle),void t())})},accept:function(e,t){var n=this;1===arguments.length&&"function"==typeof e&&(t=e,e={}),t=t||function(){},e=e||{};var r=e.constraints||{mandatory:{OfferToReceiveAudio:!0,OfferToReceiveVideo:!0}};this._log("info","Accepted incoming session"),this.state="active",this.pc.answer(r,function(e,r){return e?(n._log("error","Could not create WebRTC answer",e),n.end("failed-application")):(r.jingle.contents.forEach(filterUnusedLabels),n.send("session-accept",r.jingle),void t())})},end:function(e,t){var n=this;this.streams.forEach(function(e){n.onRemoveStream({stream:e})}),this.pc.close(),i.prototype.end.call(this,e,t)},ring:function(){this._log("info","Ringing on incoming session"),this.ringing=!0,this.send("session-info",{ringing:!0})},mute:function(e,t){this._log("info","Muting",t),this.send("session-info",{mute:{creator:e,name:t}})},unmute:function(e,t){this._log("info","Unmuting",t),this.send("session-info",{unmute:{creator:e,name:t}})},hold:function(){this._log("info","Placing on hold"),this.send("session-info",{hold:!0})},resume:function(){this._log("info","Resuming from hold"),this.send("session-info",{active:!0})},addStream:function(e,t,n){var r=this;n=n||function(){},this.pc.addStream(e),t&&this.pc.handleOffer({type:"offer",jingle:this.pc.remoteDescription},function(t){return t?(r._log("error","Could not create offer for adding new stream"),n(t)):void r.pc.answer(function(t,s){return t?(r._log("error","Could not create answer for adding new stream"),n(t)):(s.jingle.contents.forEach(function(t){filterContentSources(t,e)}),s.jingle.contents=s.jingle.contents.filter(function(e){return"rtp"===e.application.applicationType&&e.application.sources&&e.application.sources.length}),delete s.jingle.groups,r.send("source-add",s.jingle),void n())})})},addStream2:function(e,t){this.addStream(e,!0,t)},removeStream:function(e,t,n){var r=this;if(n=n||function(){},!t)return void this.pc.removeStream(e);var s=this.pc.localDescription;s.contents.forEach(function(t){filterContentSources(t,e)}),s.contents=s.contents.filter(function(e){return"rtp"===e.application.applicationType&&e.application.sources&&e.application.sources.length}),delete s.groups,this.send("source-remove",s),this.pc.removeStream(e),this.pc.handleOffer({type:"offer",jingle:this.pc.remoteDescription},function(e){return e?(r._log("error","Could not process offer for removing stream"),n(e)):void r.pc.answer(function(e){return e?(r._log("error","Could not process answer for removing stream"),n(e)):void n()})})},removeStream2:function(e,t){this.removeStream(e,!0,t)},switchStream:function(e,t,n){var r=this;n=n||function(){};var s=this.pc.localDescription;s.contents.forEach(function(e){delete e.transport,delete e.application.payloads}),this.pc.removeStream(e),this.send("source-remove",s),this.pc.addStream(t),this.pc.handleOffer({type:"offer",jingle:this.pc.remoteDescription},function(e){return e?(r._log("error","Could not process offer for switching streams"),n(e)):void r.pc.answer(function(e,t){return e?(r._log("error","Could not process answer for switching streams"),n(e)):(t.jingle.contents.forEach(function(e){delete e.transport,delete e.application.payloads}),r.send("source-add",t.jingle),void n())})})},onIceCandidate:function(e,t){this._log("info","Discovered new ICE candidate",t.jingle),this.send("transport-info",t.jingle),e.signalEndOfCandidates&&(this.lastCandidate=t)},onIceEndOfCandidates:function(e){if(this._log("info","ICE end of candidates"),e.signalEndOfCandidates){var t=this.lastCandidate.jingle;t.contents[0].transport={transportType:t.contents[0].transport.transportType,gatheringComplete:!0},this.lastCandidate=null,this.send("transport-info",t)}},onIceStateChange:function(){switch(this.pc.iceConnectionState){case"checking":this.connectionState="connecting";break;case"completed":case"connected":this.connectionState="connected";break;case"disconnected":"stable"===this.pc.signalingState?this.connectionState="interrupted":this.connectionState="disconnected";break;case"failed":this.connectionState="failed",this.end("failed-transport");break;case"closed":this.connectionState="disconnected"}},onAddStream:function(e){this._log("info","Stream added"),this.emit("peerStreamAdded",this,e.stream)},onRemoveStream:function(e){this._log("info","Stream removed"),this.emit("peerStreamRemoved",this,e.stream)},onSessionInitiate:function(e,t){var n=this;this._log("info","Initiating incoming session"),this.state="pending",this.pc.isInitiator=!1,this.pc.handleOffer({type:"offer",jingle:e},function(e){return e?(n._log("error","Could not create WebRTC answer"),t({condition:"general-error"})):void t()})},onSessionAccept:function(e,t){var n=this;this.state="active",this.pc.handleAnswer({type:"answer",jingle:e},function(e){return e?(n._log("error","Could not process WebRTC answer"),t({condition:"general-error"})):(n.emit("accepted",n),void t())})},onSessionTerminate:function(e,t){var n=this;this._log("info","Terminating session"),this.streams.forEach(function(e){n.onRemoveStream({stream:e})}),this.pc.close(),i.prototype.end.call(this,e.reason,!0),t()},onSessionInfo:function(e,t){return e.ringing?(this._log("info","Outgoing session is ringing"),this.ringing=!0,this.emit("ringing",this),t()):e.hold?(this._log("info","On hold"),this.emit("hold",this),t()):e.active?(this._log("info","Resuming from hold"),this.emit("resumed",this),t()):e.mute?(this._log("info","Muting",e.mute),this.emit("mute",this,e.mute),t()):e.unmute?(this._log("info","Unmuting",e.unmute),this.emit("unmute",this,e.unmute),t()):void t()},onTransportInfo:function(e,t){this.pc.processIce(e,function(){t()})},onSourceAdd:function(e,t){var n=this;this._log("info","Adding new stream source");var r=this.pc.remoteDescription;this.pc.remoteDescription.contents.forEach(function(t,n){var s=t.application,i=s.sources||[],o=s.sourceGroups||[];e.contents.forEach(function(e){if(t.name===e.name){var s=e.application,a=s.sources||[];i=i.concat(a),r.contents[n].application.sources=JSON.parse(JSON.stringify(i));var c=s.sourceGroups||[];o=o.concat(c),r.contents[n].application.sourceGroups=JSON.parse(JSON.stringify(o))}})}),this.pc.handleOffer({type:"offer",jingle:r},function(e){return e?(n._log("error","Error adding new stream source"),t({condition:"general-error"})):void n.pc.answer(function(e){return e?(n._log("error","Error adding new stream source"),t({condition:"general-error"})):void t()})})},onSourceRemove:function(e,t){var n=this;this._log("info","Removing stream source");var r=this.pc.remoteDescription;this.pc.remoteDescription.contents.forEach(function(t,n){var s=t.application,i=s.sources||[],o=s.sourceGroups||[];e.contents.forEach(function(e){if(t.name===e.name){var s,a,c,u,d=e.application,l=d.sources||[],p=d.sourceGroups||[];for(a=0;a<l.length;a++){for(s=-1,c=0;c<i.length;c++)if(l[a].ssrc===i[c].ssrc){s=c;break}s>-1&&(i.splice(s,1),r.contents[n].application.sources=JSON.parse(JSON.stringify(i)))}for(a=0;a<p.length;a++){for(s=-1,c=0;c<o.length;c++)if(p[a].semantics===o[c].semantics&&p[a].sources.length===o[c].sources.length){var f=!0;for(u=0;u<p[a].sources.length;u++)if(p[a].sources[u]!==o[c].sources[u]){f=!1;break}if(f){s=c;break}}s>-1&&(o.splice(s,1),r.contents[n].application.sourceGroups=JSON.parse(JSON.stringify(o)))}}})}),this.pc.handleOffer({type:"offer",jingle:r},function(e){return e?(n._log("error","Error removing stream source"),t({condition:"general-error"})):void n.pc.answer(function(e){return e?(n._log("error","Error removing stream source"),t({condition:"general-error"})):void t()})})},onAddChannel:function(e){this.emit("addChannel",e)}}),t.exports=MediaSession},{"extend-object":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/extend-object/extend-object.js","jingle-session":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jingle-session/index.js",rtcpeerconnection:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/rtcpeerconnection/rtcpeerconnection.js",util:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/util/util.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jingle-session/index.js":[function(e,t,n){function JingleSession(e){a.call(this);var t=this;this.sid=e.sid||s.v4(),this.peer=e.peer,this.peerID=e.peerID||this.peer.full||this.peer,this.isInitiator=e.initiator||!1,this.parent=e.parent,this.state="starting",this.connectionState="starting",this.pendingApplicationTypes=e.applicationTypes||[],this.pendingAction=!1,this.processingQueue=i.queue(function(e,n){if(t.ended)return n();var r=e.action,s=e.changes,i=e.cb;return t._log("debug",r),c[r]?void t[c[r]](s,function(e,t){return i(e,t),n()}):(t._log("error","Invalid action: "+r),i({condition:"bad-request"}),n())})}var r=e("util"),s=e("uuid"),i=e("async"),o=e("extend-object"),a=e("wildemitter"),c={"content-accept":"onContentAccept","content-add":"onContentAdd","content-modify":"onConentModify","content-reject":"onContentReject","content-remove":"onContentRemove","description-info":"onDescriptionInfo","security-info":"onSecurityInfo","session-accept":"onSessionAccept","session-info":"onSessionInfo","session-initiate":"onSessionInitiate","session-terminate":"onSessionTerminate","transport-accept":"onTransportAccept","transport-info":"onTransportInfo","transport-reject":"onTransportReject","transport-replace":"onTransportReplace","source-add":"onSourceAdd","source-remove":"onSourceRemove"};r.inherits(JingleSession,a),Object.keys(c).forEach(function(e){var t=c[e];JingleSession.prototype[t]=function(t,n){this._log("error","Unsupported action: "+e),n()}}),Object.defineProperties(JingleSession.prototype,{state:{get:function(){return this._sessionState},set:function(e){if(e!==this._sessionState){var t=this._sessionState;this._log("info","Changing session state to: "+e),this._sessionState=e,this.emit("change:sessionState",this,e),this.emit("change:"+e,this,!0),t&&this.emit("change:"+t,this,!1)}}},connectionState:{get:function(){return this._connectionState},set:function(e){if(e!==this._connectionState){var t=this._connectionState;this._log("info","Changing connection state to: "+e),this._connectionState=e,this.emit("change:connectionState",this,e),this.emit("change:"+e,this,!0),t&&this.emit("change:"+t,this,!1)}}},starting:{get:function(){return"starting"===this._sessionState}},pending:{get:function(){return"pending"===this._sessionState}},active:{get:function(){return"active"===this._sessionState}},ended:{get:function(){return"ended"===this._sessionState}},connected:{get:function(){return"connected"===this._connectionState}},connecting:{get:function(){return"connecting"===this._connectionState}},disconnected:{get:function(){return"disconnected"===this._connectionState}},interrupted:{get:function(){return"interrupted"===this._connectionState}}}),JingleSession.prototype=o(JingleSession.prototype,{_log:function(e,t){t=this.sid+": "+t,this.emit("log:"+e,t)},send:function(e,t){t=t||{},t.sid=this.sid,t.action=e;var n={"session-inititate":!0,"session-accept":!0,"content-add":!0,"content-remove":!0,"content-reject":!0,"content-accept":!0,"content-modify":!0,"transport-replace":!0,"transport-reject":!0,"transport-accept":!0,"source-add":!0,"source-remove":!0};n[e]?this.pendingAction=e:this.pendingAction=!1,this.emit("send",{to:this.peer,type:"set",jingle:t})},process:function(e,t,n){this.processingQueue.push({action:e,changes:t,cb:n})},start:function(){this._log("error","Can not start base sessions"),this.end("unsupported-applications",!0)},accept:function(){this._log("error","Can not accept base sessions"),this.end("unsupported-applications")},cancel:function(){this.end("cancel")},decline:function(){this.end("decline")},end:function(e,t){this.state="ended",this.processingQueue.kill(),e||(e="success"),"string"==typeof e&&(e={condition:e}),t||this.send("session-terminate",{reason:e}),this.emit("terminated",this,e)},onSessionTerminate:function(e,t){this.end(e.reason,!0),t()},onSessionInfo:function(e,t){var n={sid:!0,action:!0,initiator:!0,responder:!0},r=!1;Object.keys(e).forEach(function(e){n[e]||(r=!0)}),r?t({type:"modify",condition:"feature-not-implemented",jingleCondition:"unsupported-info"}):t()},onDescriptionInfo:function(e,t){t({type:"modify",condition:"feature-not-implemented",jingleCondition:"unsupported-info"})},onTransportInfo:function(e,t){t({type:"modify",condition:"feature-not-implemented",jingleCondition:"unsupported-info"})},onContentAdd:function(e,t){t(),this.send("content-reject",{reason:{condition:"failed-application",text:"content-add is not supported"}})},onTransportReplace:function(e,t){t(),this.send("transport-reject",{reason:{condition:"failed-application",text:"transport-replace is not supported"}})}}),t.exports=JingleSession},{async:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/async/lib/async.js","extend-object":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/extend-object/extend-object.js",util:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/util/util.js",uuid:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/uuid/uuid.js",wildemitter:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/wildemitter/wildemitter.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jingle/index.js":[function(e,t,n){function SessionManager(e){i.call(this),e=e||{},this.jid=e.jid,this.selfID=e.selfID||this.jid&&this.jid.full||this.jid||"",this.sessions={},this.peers={},this.prepareSession=e.prepareSession||function(e){return e.applicationTypes.indexOf("rtp")>=0?new c(e):e.applicationTypes.indexOf("filetransfer")>=0?new u(e):void 0},this.performTieBreak=e.performTieBreak||function(e,t){var n=t.jingle.contents.map(function(e){if(e.application)return e.application.applicationType}),r=s(e.pendingApplicationTypes,n);return r.length>0},this.screenSharingSupport=o.screenSharing,this.capabilities=["urn:xmpp:jingle:1"],o.support&&(this.capabilities=["urn:xmpp:jingle:1","urn:xmpp:jingle:apps:rtp:1","urn:xmpp:jingle:apps:rtp:audio","urn:xmpp:jingle:apps:rtp:video","urn:xmpp:jingle:apps:rtp:rtcb-fb:0","urn:xmpp:jingle:apps:rtp:rtp-hdrext:0","urn:xmpp:jingle:apps:rtp:ssma:0","urn:xmpp:jingle:apps:dtls:0","urn:xmpp:jingle:apps:grouping:0","urn:xmpp:jingle:apps:file-transfer:3","urn:xmpp:jingle:transports:ice-udp:1","urn:xmpp:jingle:transports.dtls-sctp:1","urn:ietf:rfc:3264","urn:ietf:rfc:5576","urn:ietf:rfc:5888"]),this.config={debug:!1,peerConnectionConfig:{iceServers:e.iceServers||[{url:"stun:stun.l.google.com:19302"}]},peerConnectionConstraints:{optional:[{DtlsSrtpKeyAgreement:!0},{RtpDataChannels:!1}]},media:{audio:!0,video:!0}};for(var t in e)this.config[t]=e[t];this.iceServers=this.config.peerConnectionConfig.iceServers}var r=e("util"),s=e("intersect"),i=e("wildemitter"),o=e("webrtcsupport"),a=e("jingle-session"),c=e("jingle-media-session"),u=e("jingle-filetransfer-session");r.inherits(SessionManager,i),SessionManager.prototype.addICEServer=function(e){"string"==typeof e&&(e={url:e}),this.iceServers.push(e)},SessionManager.prototype.addSession=function(e){var t=this,n=e.sid,r=e.peerID;return this.sessions[n]=e,this.peers[r]||(this.peers[r]=[]),this.peers[r].push(e),e.on("terminated",function(){var s=t.peers[r]||[];s.length&&s.splice(s.indexOf(e),1),delete t.sessions[n]}),e.on("*",function(n,r,s,i){if("send"===n){var o=r.jingle&&r.jingle.action;e.isInitiator&&"session-initiate"===o&&t.emit("outgoing",e)}!t.config.debug||"log:debug"!==n&&"log:error"!==n||console.log("Jingle:",r,s,i),0!==n.indexOf("change")&&t.emit(n,r,s,i)}),this.emit("createdSession",e),e},SessionManager.prototype.createMediaSession=function(e,t,n){var r=new c({sid:t,peer:e,initiator:!0,stream:n,parent:this,iceServers:this.iceServers,constraints:this.config.peerConnectionConstraints});return this.addSession(r),r},SessionManager.prototype.createFileTransferSession=function(e,t){var n=new u({sid:t,peer:e,initiator:!0,parent:this});return this.addSession(n),n},SessionManager.prototype.endPeerSessions=function(e,t,n){e=e.full||e;var r=this.peers[e]||[];delete this.peers[e],r.forEach(function(e){e.end(t||"gone",n)})},SessionManager.prototype.endAllSessions=function(e,t){var n=this;Object.keys(this.peers).forEach(function(r){n.endPeerSessions(r,e,t)})},SessionManager.prototype._createIncomingSession=function(e,t){var n;return this.prepareSession&&(n=this.prepareSession(e,t)),n||(n=new a(e)),this.addSession(n),n},SessionManager.prototype._sendError=function(e,t,n){n.type||(n.type="cancel"),this.emit("send",{to:e,id:t,type:"error",error:n})},SessionManager.prototype._log=function(e,t){this.emit("log:"+e,t)},SessionManager.prototype.process=function(e){var t=this,n=e.jingle?e.jingle.sid:null,r=this.sessions[n]||null,s=e.id,i=e.from.full||e.from;if("error"===e.type){var o=e.error&&"tie-break"===e.error.jingleCondition;return r&&r.pending&&o?r.end("alternative-session",!0):(r&&(r.pendingAction=!1),
  this.emit("error",e))}if("result"===e.type)return void(r&&(r.pendingAction=!1));var a=e.jingle.action,c=e.jingle.contents||[],u=c.map(function(e){if(e.application)return e.application.applicationType}),d=c.map(function(e){if(e.transport)return e.transport.transportType});if("session-initiate"!==a){if(!r)return this._log("error","Unknown session",n),this._sendError(i,s,{condition:"item-not-found",jingleCondition:"unknown-session"});if(r.peerID!==i||r.ended)return this._log("error","Session has ended, or action has wrong sender"),this._sendError(i,s,{condition:"item-not-found",jingleCondition:"unknown-session"});if("session-accept"===a&&!r.pending)return this._log("error","Tried to accept session twice",n),this._sendError(i,s,{condition:"unexpected-request",jingleCondition:"out-of-order"});if("session-terminate"!==a&&a===r.pendingAction&&(this._log("error","Tie break during pending request"),r.isInitiator))return this._sendError(i,s,{condition:"conflict",jingleCondition:"tie-break"})}else if(r){if(r.peerID!==i)return this._log("error","Duplicate sid from new sender"),this._sendError(i,s,{condition:"service-unavailable"});if(!r.pending)return this._log("error","Someone is doing this wrong"),this._sendError(i,s,{condition:"unexpected-request",jingleCondition:"out-of-order"});if(this.selfID>r.peerID&&this.performTieBreak(r,e))return this._log("error","Tie break new session because of duplicate sids"),this._sendError(i,s,{condition:"conflict",jingleCondition:"tie-break"})}else if(this.peers[i]&&this.peers[i].length)for(var l=0,p=this.peers[i].length;l<p;l++){var f=this.peers[i][l];if(f&&f.pending&&f.sid>n&&this.performTieBreak(f,e))return this._log("info","Tie break session-initiate"),this._sendError(i,s,{condition:"conflict",jingleCondition:"tie-break"})}if("session-initiate"===a){if(!c.length)return t._sendError(i,s,{condition:"bad-request"});r=this._createIncomingSession({sid:n,peer:e.from,peerID:i,initiator:!1,parent:this,applicationTypes:u,transportTypes:d,iceServers:this.iceServers,constraints:this.config.peerConnectionConstraints},e)}r.process(a,e.jingle,function(n){n?(t._log("error","Could not process request",e,n),t._sendError(i,s,n)):(t.emit("send",{to:i,id:s,type:"result"}),"session-initiate"===a&&t.emit("incoming",r))})},t.exports=SessionManager},{intersect:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/intersect/index.js","jingle-filetransfer-session":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jingle-filetransfer-session/index.js","jingle-media-session":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jingle-media-session/index.js","jingle-session":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jingle-session/index.js",util:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/util/util.js",webrtcsupport:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/webrtcsupport/index-browser.js",wildemitter:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/wildemitter/wildemitter.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp-types/lib/index.js":[function(e,t,n){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var r=e("./shortcuts"),s=_interopRequireDefault(r),i=e("./types"),o=_interopRequireDefault(i);n.default=function(e){e.use(o.default),e.use(s.default)},t.exports=n.default},{"./shortcuts":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp-types/lib/shortcuts.js","./types":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp-types/lib/types.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp-types/lib/shortcuts.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants"),s={client:r.Namespace.CLIENT,server:r.Namespace.SERVER,component:r.Namespace.COMPONENT};n.default=function(e){e.extendMessage=function(e,t){var n=this;this.withMessage(function(r){n.extend(r,e,t)})},e.extendPresence=function(e,t){var n=this;this.withPresence(function(r){n.extend(r,e,t)})},e.extendIQ=function(e,t){var n=this;this.withIQ(function(r){n.extend(r,e,t)})},e.extendStreamFeatures=function(e){var t=this;this.withStreamFeatures(function(n){t.extend(n,e)})},e.extendPubsubItem=function(e){var t=this;this.withPubsubItem(function(n){t.extend(n,e)})},e.withIQ=function(e){this.withDefinition("iq",r.Namespace.CLIENT,e),this.withDefinition("iq",r.Namespace.COMPONENT,e)},e.withMessage=function(e){this.withDefinition("message",r.Namespace.CLIENT,e),this.withDefinition("message",r.Namespace.COMPONENT,e)},e.withPresence=function(e){this.withDefinition("presence",r.Namespace.CLIENT,e),this.withDefinition("presence",r.Namespace.COMPONENT,e)},e.withStreamFeatures=function(e){this.withDefinition("features",r.Namespace.STREAM,e)},e.withStanzaError=function(e){this.withDefinition("error",r.Namespace.CLIENT,e),this.withDefinition("error",r.Namespace.COMPONENT,e)},e.withDataForm=function(e){this.withDefinition("x",r.Namespace.DATAFORM,e)},e.withPubsubItem=function(e){this.withDefinition("item",r.Namespace.PUBSUB,e),this.withDefinition("item",r.Namespace.PUBSUB_EVENT,e)},e.getMessage=function(){var e=void 0===arguments[0]?"client":arguments[0];return this.getDefinition("message",s[e])},e.getPresence=function(){var e=void 0===arguments[0]?"client":arguments[0];return this.getDefinition("presence",s[e])},e.getIQ=function(){var e=void 0===arguments[0]?"client":arguments[0];return this.getDefinition("iq",s[e])},e.getStreamError=function(){return this.getDefinition("error",r.Namespace.STREAM)},e.getIq=e.getIQ,e.withIq=e.withIQ},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp-types/lib/types.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-jid");n.default=function(e){var t=e.utils;t.jidAttribute=function(e,n){return{get:function get(){var s=new r.JID(t.getAttribute(this.xml,e));return n&&(s.prepped=!0),s},set:function set(n){t.setAttribute(this.xml,e,(n||"").toString())}}},t.jidSub=function(e,n,s){return{get:function get(){var i=new r.JID(t.getSubText(this.xml,e,n));return s&&(i.prepped=!0),i},set:function set(r){t.setSubText(this.xml,e,n,(r||"").toString())}}},t.tzoSub=t.field(function(e,n,r,s){var i=void 0,o=void 0,a=void 0,c=-1,u=t.getSubText(e,n,r);return u?("-"===u.charAt(0)&&(c=1,u=u.slice(1)),a=u.split(":"),i=parseInt(a[0],10),o=parseInt(a[1],10),(60*i+o)*c):s},function(e,n,r,s){var i=void 0,o=void 0,a="-";"number"==typeof s?(s<0&&(s=-s,a="+"),i=s/60,o=s%60,a+=(i<10?"0":"")+i+":"+(o<10?"0":"")+o):a=s,t.setSubText(e,n,r,a)})},t.exports=n.default},{"xmpp-jid":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-jid/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/avatar.js":[function(e,t,n){"use strict";var r=e("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(n,"__esModule",{value:!0});var s=e("xmpp-constants"),i=e("lodash.foreach"),o=r(i);n.default=function(e){var t=e.utils,n=e.define({name:"avatar",namespace:s.Namespace.AVATAR_METADATA,element:"info",fields:{id:t.attribute("id"),bytes:t.attribute("bytes"),height:t.attribute("height"),width:t.attribute("width"),type:t.attribute("type","image/png"),url:t.attribute("url")}}),r={get:function get(){var e=t.find(this.xml,s.Namespace.AVATAR_METADATA,"metadata"),r=[];if(e.length){var i=t.find(e[0],s.Namespace.AVATAR_METADATA,"info");(0,o.default)(i,function(e){r.push(new n({},e))})}return r},set:function set(e){var r=t.findOrCreate(this.xml,s.Namespace.AVATAR_METADATA,"metadata");t.setAttribute(r,"xmlns",s.Namespace.AVATAR_METADATA),(0,o.default)(e,function(e){var t=new n(e);r.appendChild(t.xml)})}};e.withPubsubItem(function(n){e.add(n,"avatars",r),e.add(n,"avatarData",t.textSub(s.Namespace.AVATAR_DATA,"data"))})},t.exports=n.default},{"babel-runtime/helpers/interop-require-default":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/babel-runtime/helpers/interop-require-default.js","lodash.foreach":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.foreach/index.js","xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/bind.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.utils,n=e.define({name:"bind",namespace:r.Namespace.BIND,element:"bind",fields:{resource:t.textSub(r.Namespace.BIND,"resource"),jid:t.jidSub(r.Namespace.BIND,"jid")}});e.extendIQ(n),e.extendStreamFeatures(n)},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/blocking.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants"),s=e("xmpp-jid");n.default=function(e){var t=e.utils,n={get:function get(){var e=[],n=t.find(this.xml,r.Namespace.BLOCKING,"item");return n.length?(n.forEach(function(n){e.push(new s.JID(t.getAttribute(n,"jid","")))}),e):e},set:function set(e){var n=this;e.forEach(function(e){var s=t.createElement(r.Namespace.BLOCKING,"item",r.Namespace.BLOCKING);t.setAttribute(s,"jid",e.toString()),n.xml.appendChild(s)})}},i=e.define({name:"block",namespace:r.Namespace.BLOCKING,element:"block",fields:{jids:n}}),o=e.define({name:"unblock",namespace:r.Namespace.BLOCKING,element:"unblock",fields:{jids:n}}),a=e.define({name:"blockList",namespace:r.Namespace.BLOCKING,element:"blocklist",fields:{jids:n}});e.extendIQ(i),e.extendIQ(o),e.extendIQ(a)},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js","xmpp-jid":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-jid/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/bob.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.utils,n=e.define({name:"bob",namespace:r.Namespace.BOB,element:"data",fields:{cid:t.attribute("cid"),maxAge:t.numberAttribute("max-age"),type:t.attribute("type"),data:t.text()}});e.extendIQ(n),e.extendMessage(n),e.extendPresence(n)},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/bookmarks.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.utils,n=e.define({name:"_conference",namespace:r.Namespace.BOOKMARKS,element:"conference",fields:{name:t.attribute("name"),autoJoin:t.boolAttribute("autojoin"),jid:t.jidAttribute("jid"),nick:t.textSub(r.Namespace.BOOKMARKS,"nick")}}),s=e.define({name:"bookmarks",namespace:r.Namespace.BOOKMARKS,element:"storage"});e.extend(s,n,"conferences"),e.withDefinition("query",r.Namespace.PRIVATE,function(t){e.extend(t,s)})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/bosh.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.utils;e.define({name:"bosh",namespace:r.Namespace.BOSH,element:"body",prefixes:{xmpp:r.Namespace.BOSH_XMPP},fields:{accept:t.attribute("accept"),ack:t.numberAttribute("ack"),authid:t.attribute("authid"),charsets:t.attribute("charsets"),condition:t.attribute("condition"),content:t.attribute("content"),from:t.jidAttribute("from",!0),hold:t.numberAttribute("hold"),inactivity:t.numberAttribute("inactivity"),key:t.attribute("key"),maxpause:t.numberAttribute("maxpause"),newKey:t.attribute("newkey"),pause:t.numberAttribute("pause"),polling:t.numberAttribute("polling"),resport:t.numberAttribute("report"),requests:t.numberAttribute("requests"),rid:t.numberAttribute("rid"),sid:t.attribute("sid"),stream:t.attribute("stream"),time:t.attribute("time"),to:t.jidAttribute("to",!0),type:t.attribute("type"),ver:t.attribute("ver"),wait:t.numberAttribute("wait"),uri:t.textSub(r.Namespace.BOSH,"uri"),lang:t.langAttribute(),version:t.attribute("xmpp:version","1.0"),restart:t.attribute("xmpp:restart"),restartLogic:t.boolAttribute("xmpp:restartLogic"),payload:{get:function get(){for(var t=[],n=0,r=this.xml.childNodes.length;n<r;n++){var s=e.build(this.xml.childNodes[n]);void 0!==s&&t.push(s)}return t},set:function set(e){var t=this;e.forEach(function(e){t.xml.appendChild(e.xml)})}}}})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/carbons.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.define({name:"carbonSent",eventName:"carbon:sent",namespace:r.Namespace.CARBONS_2,element:"sent"}),n=e.define({name:"carbonReceived",eventName:"carbon:received",namespace:r.Namespace.CARBONS_2,element:"received"}),s=e.define({name:"carbonPrivate",eventName:"carbon:private",namespace:r.Namespace.CARBONS_2,element:"private"}),i=e.define({name:"enableCarbons",namespace:r.Namespace.CARBONS_2,element:"enable"}),o=e.define({name:"disableCarbons",namespace:r.Namespace.CARBONS_2,element:"disable"});e.withDefinition("forwarded",r.Namespace.FORWARD_0,function(r){e.extend(t,r),e.extend(n,r)}),e.extendMessage(t),e.extendMessage(n),e.extendMessage(s),e.extendIQ(i),e.extendIQ(o)},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/command.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants"),s=["next","prev","complete","cancel"],i=["bad-action","bad-locale","bad-payload","bad-sessionid","malformed-action","session-expired"];n.default=function(e){var t=e.utils,n=e.define({name:"command",namespace:r.Namespace.ADHOC_COMMANDS,element:"command",fields:{action:t.attribute("action"),node:t.attribute("node"),sessionid:t.attribute("sessionid"),status:t.attribute("status"),execute:t.subAttribute(r.Namespace.ADHOC_COMMANDS,"actions","execute"),actions:{get:function get(){var e=[],n=t.find(this.xml,r.Namespace.ADHOC_COMMANDS,"actions");return n.length?(s.forEach(function(s){var i=t.find(n[0],r.Namespace.ADHOC_COMMANDS,s);i.length&&e.push(s)}),e):[]},set:function set(e){for(var n=t.findOrCreate(this.xml,r.Namespace.ADHOC_COMMANDS,"actions"),s=0,i=n.childNodes.length;s<i;s++)n.removeChild(n.childNodes[s]);e.forEach(function(e){n.appendChild(t.createElement(r.Namespace.ADHOC_COMMANDS,e.toLowerCase(),r.Namespace.ADHOC_COMMANDS))})}}}}),o=e.define({name:"_commandNote",namespace:r.Namespace.ADHOC_COMMANDS,element:"note",fields:{type:t.attribute("type"),value:t.text()}});e.extend(n,o,"notes"),e.extendIQ(n),e.withStanzaError(function(n){e.add(n,"adhocCommandCondition",t.enumSub(r.Namespace.ADHOC_COMMANDS,i))}),e.withDataForm(function(t){e.extend(n,t)})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/csi.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.define({name:"clientStateIndication",namespace:r.Namespace.CSI,element:"csi"});e.define({name:"csiActive",eventName:"csi:active",namespace:r.Namespace.CSI,element:"active",topLevel:!0}),e.define({name:"csiInactive",eventName:"csi:inactive",namespace:r.Namespace.CSI,element:"inactive",topLevel:!0}),e.extendStreamFeatures(t)},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/dataforms.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants"),s=e("xmpp-jid"),i=["text-single","text-private","list-single","jid-single"];n.default=function(e){var t=e.utils,n=e.define({name:"_field",namespace:r.Namespace.DATAFORM,element:"field",init:function init(e){this._type=(e||{}).type||this.type},fields:{type:{get:function get(){return t.getAttribute(this.xml,"type","text-single")},set:function set(e){this._type=e,t.setAttribute(this.xml,"type",e)}},name:t.attribute("var"),desc:t.textSub(r.Namespace.DATAFORM,"desc"),required:t.boolSub(r.Namespace.DATAFORM,"required"),label:t.attribute("label"),value:{get:function get(){var e=t.getMultiSubText(this.xml,r.Namespace.DATAFORM,"value");return"boolean"===this._type?"1"===e[0]||"true"===e[0]:e.length>1?"text-multi"===this._type?e.join("\n"):"jid-multi"===this._type?e.map(function(e){return new s.JID(e)}):e:i.indexOf(this._type)>=0?"jid-single"===this._type?new s.JID(e[0]):e[0]:e},set:function set(e){if("boolean"===this._type||e===!0||e===!1){var n=e===!0||"true"===e||"1"===e,s=t.createElement(r.Namespace.DATAFORM,"value",r.Namespace.DATAFORM);s.textContent=n?"1":"0",this.xml.appendChild(s)}else"text-multi"===this._type&&"string"==typeof e&&(e=e.split("\n")),t.setMultiSubText(this.xml,r.Namespace.DATAFORM,"value",e,function(e){var n=t.createElement(r.Namespace.DATAFORM,"value",r.Namespace.DATAFORM);n.textContent=e,this.xml.appendChild(n)}.bind(this))}}}}),o=e.define({name:"_formoption",namespace:r.Namespace.DATAFORM,element:"option",fields:{label:t.attribute("label"),value:t.textSub(r.Namespace.DATAFORM,"value")}}),a=e.define({name:"_formitem",namespace:r.Namespace.DATAFORM,element:"item"}),c=e.define({name:"media",element:"media",namespace:r.Namespace.DATAFORM_MEDIA,fields:{height:t.numberAttribute("height"),width:t.numberAttribute("width")}}),u=e.define({name:"_mediaURI",element:"uri",namespace:r.Namespace.DATAFORM_MEDIA,fields:{uri:t.text(),type:t.attribute("type")}}),d=e.define({name:"validation",element:"validate",namespace:r.Namespace.DATAFORM_VALIDATION,fields:{dataType:t.attribute("datatype"),basic:t.boolSub(r.Namespace.DATAFORM_VALIDATION,"basic"),open:t.boolSub(r.Namespace.DATAFORM_VALIDATION,"open"),regex:t.textSub(r.Namespace.DATAFORM_VALIDATION,"regex")}}),l=e.define({name:"range",element:"range",namespace:r.Namespace.DATAFORM_VALIDATION,fields:{min:t.attribute("min"),max:t.attribute("max")}}),p=e.define({name:"select",element:"list-range",namespace:r.Namespace.DATAFORM_VALIDATION,fields:{min:t.numberAttribute("min"),max:t.numberAttribute("max")}}),f={get:function get(){for(var e=[],t=0,n=this.xml.childNodes.length;t<n;t++){var s=this.xml.childNodes[t];if(s.namespaceURI===r.Namespace.DATAFORM_LAYOUT)switch(s.localName){case"text":e.push({text:s.textContent});break;case"fieldref":e.push({field:s.getAttribute("var")});break;case"reportedref":e.push({reported:!0});break;case"section":e.push({section:new m(null,s,this).toJSON()})}}return e},set:function set(e){for(var n=0,s=e.length;n<s;n++){var i=e[n];if(i.text){var o=t.createElement(r.Namespace.DATAFORM_LAYOUT,"text",r.Namespace.DATAFORM_LAYOUT);o.textContent=i.text,this.xml.appendChild(o)}if(i.field){var a=t.createElement(r.Namespace.DATAFORM_LAYOUT,"fieldref",r.Namespace.DATAFORM_LAYOUT);a.setAttribute("var",i.field),this.xml.appendChild(a)}if(i.reported&&this.xml.appendChild(t.createElement(r.Namespace.DATAFORM_LAYOUT,"reportedref",r.Namespace.DATAFORM_LAYOUT)),i.section){var c=t.createElement(r.Namespace.DATAFORM_LAYOUT,"section",r.Namespace.DATAFORM_LAYOUT);this.xml.appendChild(c);var u=new m(null,c);u.label=i.section.label,u.contents=i.section.contents}}}},m=e.define({name:"_section",element:"section",namespace:r.Namespace.DATAFORM_LAYOUT,fields:{label:t.attribute("label"),contents:f}}),h=e.define({name:"_page",element:"page",namespace:r.Namespace.DATAFORM_LAYOUT,fields:{label:t.attribute("label"),contents:f}}),g=e.define({name:"form",namespace:r.Namespace.DATAFORM,element:"x",init:function init(){if(this.reportedFields.length){var e={};this.reportedFields.forEach(function(t){e[t.name]=t.type}),this.items.forEach(function(t){t.fields.forEach(function(t){t.type=t._type=e[t.name]})})}},fields:{title:t.textSub(r.Namespace.DATAFORM,"title"),instructions:t.multiTextSub(r.Namespace.DATAFORM,"instructions"),type:t.attribute("type","form"),reportedFields:t.subMultiExtension(r.Namespace.DATAFORM,"reported",n)}});e.extend(g,n,"fields"),e.extend(g,a,"items"),e.extend(g,h,"layout"),e.extend(n,c),e.extend(n,d),e.extend(n,o,"options"),e.extend(a,n,"fields"),e.extend(c,u,"uris"),e.extend(d,l),e.extend(d,p),e.extendMessage(g)},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js","xmpp-jid":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-jid/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/delayed.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.utils,n=e.define({name:"delay",namespace:r.Namespace.DELAY,element:"delay",fields:{from:t.jidAttribute("from"),stamp:t.dateAttribute("stamp"),reason:t.text()}});e.extendMessage(n),e.extendPresence(n)},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/disco.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.utils,n=e.define({name:"caps",namespace:r.Namespace.CAPS,element:"c",fields:{ver:t.attribute("ver"),node:t.attribute("node"),hash:t.attribute("hash"),ext:t.attribute("ext")}}),s=e.define({name:"discoInfo",namespace:r.Namespace.DISCO_INFO,element:"query",fields:{node:t.attribute("node"),features:t.multiSubAttribute(r.Namespace.DISCO_INFO,"feature","var")}}),i=e.define({name:"_discoIdentity",namespace:r.Namespace.DISCO_INFO,element:"identity",fields:{category:t.attribute("category"),type:t.attribute("type"),name:t.attribute("name"),lang:t.langAttribute()}}),o=e.define({name:"discoItems",namespace:r.Namespace.DISCO_ITEMS,element:"query",fields:{node:t.attribute("node")}}),a=e.define({name:"_discoItem",namespace:r.Namespace.DISCO_ITEMS,element:"item",fields:{jid:t.jidAttribute("jid"),node:t.attribute("node"),name:t.attribute("name")}});e.extend(o,a,"items"),e.extend(s,i,"identities"),e.extendIQ(s),e.extendIQ(o),e.extendPresence(n),e.extendStreamFeatures(n),e.withDataForm(function(t){e.extend(s,t,"extensions")}),e.withDefinition("set",r.Namespace.RSM,function(t){e.extend(o,t)})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/error.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants"),s=["bad-request","conflict","feature-not-implemented","forbidden","gone","internal-server-error","item-not-found","jid-malformed","not-acceptable","not-allowed","not-authorized","payment-required","recipient-unavailable","redirect","registration-required","remote-server-not-found","remote-server-timeout","resource-constraint","service-unavailable","subscription-required","undefined-condition","unexpected-request"];n.default=function(e){var t=e.utils,n=e.define({name:"error",namespace:r.Namespace.CLIENT,element:"error",fields:{lang:{get:function get(){return(this.parent||{}).lang||""}},condition:t.enumSub(r.Namespace.STANZA_ERROR,s),gone:{get:function get(){return t.getSubText(this.xml,r.Namespace.STANZA_ERROR,"gone")},set:function set(e){this.condition="gone",t.setSubText(this.xml,r.Namespace.STANZA_ERROR,"gone",e)}},redirect:{get:function get(){return t.getSubText(this.xml,r.Namespace.STANZA_ERROR,"redirect")},set:function set(e){this.condition="redirect",t.setSubText(this.xml,r.Namespace.STANZA_ERROR,"redirect",e)}},code:t.attribute("code"),type:t.attribute("type"),by:t.jidAttribute("by"),$text:{get:function get(){return t.getSubLangText(this.xml,r.Namespace.STANZA_ERROR,"text",this.lang)}},text:{get:function get(){var e=this.$text;return e[this.lang]||""},set:function set(e){t.setSubLangText(this.xml,r.Namespace.STANZA_ERROR,"text",e,this.lang)}}}});e.extendMessage(n),e.extendPresence(n),e.extendIQ(n)},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/extdisco.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.utils,s=n.Services=e.define({name:"services",namespace:r.Namespace.DISCO_EXTERNAL_1,element:"services",fields:{type:t.attribute("type")}}),i=n.Credentials=e.define({name:"credentials",namespace:r.Namespace.DISCO_EXTERNAL_1,element:"credentials"}),o=e.define({name:"service",namespace:r.Namespace.DISCO_EXTERNAL_1,element:"service",fields:{host:t.attribute("host"),port:t.attribute("port"),transport:t.attribute("transport"),type:t.attribute("type"),username:t.attribute("username"),password:t.attribute("password")}});e.extend(s,o,"services"),e.extend(i,o),e.extendIQ(s),e.extendIQ(i),e.withDataForm(function(t){e.extend(o,t)})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/file.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants"),s=r.Namespace.FILE_TRANSFER_4;n.default=function(e){var t=e.utils,n=e.define({name:"file",namespace:s,element:"file",fields:{name:t.textSub(s,"name"),description:t.textSub(s,"desc"),mediaType:t.textSub(s,"media-type"),size:t.numberSub(s,"size"),date:t.dateSub(s,"date")}}),i=e.define({name:"range",namespace:s,element:"range",fields:{offset:t.numberAttribute("offset"),length:t.numberAttribute("length")}}),o=e.define({name:"_"+s,namespace:s,element:"description",tags:["jingle-application"],fields:{applicationType:{value:s}}}),a=e.define({name:"_{"+s+"}received",namespace:s,element:"received",tags:["jingle-info"],fields:{infoType:{value:"{"+s+"}received"},creator:t.attribute("creator"),name:t.attribute("name")}}),c=e.define({name:"_{"+s+"}checksum",namespace:s,element:"checksum",tags:["jingle-info"],fields:{infoType:{value:"{"+s+"}checksum"},creator:t.attribute("creator"),name:t.attribute("name")}});e.extend(n,i),e.extend(c,n),e.extend(o,n),e.withDefinition("hash",r.Namespace.HASHES_1,function(t){e.extend(n,t,"hashes"),e.extend(i,t,"hashes")}),e.withDefinition("content",r.Namespace.JINGLE_1,function(t){e.extend(t,o)}),e.withDefinition("jingle",r.Namespace.JINGLE_1,function(t){e.extend(t,a),e.extend(t,c)})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/file3.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants"),s=r.Namespace.FILE_TRANSFER_3;n.default=function(e){var t=e.utils,n=e.define({name:"_file",namespace:s,element:"file",fields:{name:t.textSub(s,"name"),desc:t.textSub(s,"desc"),size:t.numberSub(s,"size"),date:t.dateSub(s,"date")}}),i=e.define({name:"range",namespace:s,element:"range",fields:{offset:t.numberAttribute("offset")}}),o=e.define({name:"thumbnail",namespace:r.Namespace.THUMBS_0,element:"thumbnail",fields:{cid:t.attribute("cid"),mimeType:t.attribute("mime-type"),width:t.numberAttribute("width"),height:t.numberAttribute("height")}}),a=e.define({name:"_filetransfer",namespace:s,element:"description",tags:["jingle-application"],fields:{applicationType:{value:"filetransfer"},offer:t.subExtension("offer",s,"offer",n),request:t.subExtension("request",s,"request",n)}});e.extend(n,i),e.extend(n,o),e.withDefinition("hash",r.Namespace.HASHES_1,function(t){e.extend(n,t,"hashes")}),e.withDefinition("content",r.Namespace.JINGLE_1,function(t){e.extend(t,a)})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/forwarded.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.define({name:"forwarded",namespace:r.Namespace.FORWARD_0,element:"forwarded"});e.extendIQ(t),e.extendPresence(t),e.withMessage(function(n){e.extend(n,t),e.extend(t,n)}),e.withDefinition("delay",r.Namespace.DELAY,function(n){e.extend(t,n)})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/framing.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.utils;e.define({name:"openStream",namespace:r.Namespace.FRAMING,element:"open",topLevel:!0,fields:{lang:t.langAttribute(),id:t.attribute("id"),version:t.attribute("version","1.0"),to:t.jidAttribute("to",!0),from:t.jidAttribute("from",!0)}}),e.define({name:"closeStream",namespace:r.Namespace.FRAMING,element:"close",topLevel:!0,fields:{seeOtherURI:t.attribute("see-other-uri")}})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/geoloc.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.utils,n=e.define({name:"geoloc",namespace:r.Namespace.GEOLOC,element:"geoloc",fields:{accuracy:t.numberSub(r.Namespace.GEOLOC,"accuracy",!0),altitude:t.numberSub(r.Namespace.GEOLOC,"alt",!0),area:t.textSub(r.Namespace.GEOLOC,"area"),heading:t.numberSub(r.Namespace.GEOLOC,"bearing",!0),bearing:t.numberSub(r.Namespace.GEOLOC,"bearing",!0),building:t.textSub(r.Namespace.GEOLOC,"building"),country:t.textSub(r.Namespace.GEOLOC,"country"),countrycode:t.textSub(r.Namespace.GEOLOC,"countrycode"),datum:t.textSub(r.Namespace.GEOLOC,"datum"),description:t.textSub(r.Namespace.GEOLOC,"description"),error:t.numberSub(r.Namespace.GEOLOC,"error",!0),floor:t.textSub(r.Namespace.GEOLOC,"floor"),latitude:t.numberSub(r.Namespace.GEOLOC,"lat",!0),locality:t.textSub(r.Namespace.GEOLOC,"locality"),longitude:t.numberSub(r.Namespace.GEOLOC,"lon",!0),postalcode:t.textSub(r.Namespace.GEOLOC,"postalcode"),region:t.textSub(r.Namespace.GEOLOC,"region"),room:t.textSub(r.Namespace.GEOLOC,"room"),speed:t.numberSub(r.Namespace.GEOLOC,"speed",!0),street:t.textSub(r.Namespace.GEOLOC,"street"),text:t.textSub(r.Namespace.GEOLOC,"text"),timestamp:t.dateSub(r.Namespace.GEOLOC,"timestamp"),tzo:t.tzoSub(r.Namespace.GEOLOC,"tzo"),uri:t.textSub(r.Namespace.GEOLOC,"uri")}});e.extendPubsubItem(n)},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/hash.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){e.define({name:"hash",namespace:r.Namespace.HASHES_1,element:"hash",fields:{algo:e.utils.attribute("algo"),value:e.utils.text()}})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/hats.js":[function(e,t,n){
  "use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.define({name:"_hat",namespace:r.Namespace.HATS_0,element:"hat",fields:{lang:e.utils.langAttribute(),name:e.utils.attribute("name"),displayName:e.utils.attribute("displayName")}});e.withPresence(function(n){e.add(n,"hats",e.utils.subMultiExtension(r.Namespace.HATS_0,"hats",t))})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/ibb.js":[function(e,t,n){(function(r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var s=e("xmpp-constants"),i="http://jabber.org/protocol/ibb",o="urn:xmpp:jingle:transports:ibb:1";n.default=function(e){var t=e.utils,n={get:function get(){var e=t.find(this.xml,i,"data");if(e.length)return e=e[0],{action:"data",sid:t.getAttribute(e,"sid"),seq:parseInt(t.getAttribute(e,"seq")||"0",10),data:new r(t.getText(e),"base64")};var n=t.find(this.xml,i,"open");if(n.length){n=n[0];var s=t.getAttribute(n,"stanza");return s="message"!==s,{action:"open",sid:t.getAttribute(n,"sid"),blockSize:t.getAttribute(n,"block-size"),ack:s}}var o=t.find(this.xml,i,"close");return o.length?{action:"close",sid:t.getAttribute(o[0],"sid")}:void 0},set:function set(e){if("data"===e.action){var n=t.createElement(i,"data");t.setAttribute(n,"sid",e.sid),t.setAttribute(n,"seq",e.seq.toString()),t.setText(n,e.data.toString("base64")),this.xml.appendChild(n)}if("open"===e.action){var r=t.createElement(i,"open");t.setAttribute(r,"sid",e.sid),t.setAttribute(r,"block-size",(e.blockSize||"4096").toString()),e.ack===!1?t.setAttribute(r,"stanza","message"):t.setAttribute(r,"stanza","iq"),this.xml.appendChild(r)}if("close"===e.action){var s=t.createElement(i,"close");t.setAttribute(s,"sid",e.sid),this.xml.appendChild(s)}}},a=e.define({name:"_"+o,namespace:o,element:"transport",tags:["jingle-transport"],fields:{transportType:{value:o},sid:t.attribute("sid"),blockSize:t.numberAttribute("block-size"),ack:{get:function get(){var e=t.getAttribute(this.xml,"stanza");return"message"!==e},set:function set(e){e.ack===!1?t.setAttribute(this.xml,"stanza","message"):t.setAttribute(this.xml,"stanza","iq")}}}});e.withDefinition("content",s.Namespace.JINGLE_1,function(t){e.extend(t,a)}),e.withIQ(function(t){e.add(t,"ibb",n)}),e.withMessage(function(t){e.add(t,"ibb",n)})},t.exports=n.default}).call(this,e("buffer").Buffer)},{buffer:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/index.js","xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/iceUdp.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.utils,n=e.define({name:"_iceUdp",namespace:r.Namespace.JINGLE_ICE_UDP_1,element:"transport",tags:["jingle-transport"],fields:{transportType:{value:"iceUdp"},pwd:t.attribute("pwd"),ufrag:t.attribute("ufrag")}}),s=e.define({name:"remoteCandidate",namespace:r.Namespace.JINGLE_ICE_UDP_1,element:"remote-candidate",fields:{component:t.attribute("component"),ip:t.attribute("ip"),port:t.attribute("port")}}),i=e.define({name:"_iceUdpCandidate",namespace:r.Namespace.JINGLE_ICE_UDP_1,element:"candidate",fields:{component:t.attribute("component"),foundation:t.attribute("foundation"),generation:t.attribute("generation"),id:t.attribute("id"),ip:t.attribute("ip"),network:t.attribute("network"),port:t.attribute("port"),priority:t.attribute("priority"),protocol:t.attribute("protocol"),relAddr:t.attribute("rel-addr"),relPort:t.attribute("rel-port"),tcpType:t.attribute("tcptype"),type:t.attribute("type")}}),o=e.define({name:"_iceFingerprint",namespace:r.Namespace.JINGLE_DTLS_0,element:"fingerprint",fields:{hash:t.attribute("hash"),setup:t.attribute("setup"),value:t.text(),required:t.boolAttribute("required")}}),a=e.define({name:"_sctpMap",namespace:r.Namespace.DTLS_SCTP_1,element:"sctpmap",fields:{number:t.attribute("number"),protocol:t.attribute("protocol"),streams:t.attribute("streams")}});e.extend(n,i,"candidates"),e.extend(n,s),e.extend(n,o,"fingerprints"),e.extend(n,a,"sctp"),e.withDefinition("content",r.Namespace.JINGLE_1,function(t){e.extend(t,n)})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/index.js":[function(e,t,n){"use strict";var r=e("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(n,"__esModule",{value:!0});var s=e("./avatar"),i=r(s),o=e("./bind"),a=r(o),c=e("./blocking"),u=r(c),d=e("./bob"),l=r(d),p=e("./bookmarks"),f=r(p),m=e("./bosh"),h=r(m),g=e("./carbons"),b=r(g),v=e("./command"),j=r(v),_=e("./csi"),x=r(_),y=e("./dataforms"),S=r(y),w=e("./delayed"),z=r(w),P=e("./disco"),E=r(P),U=e("./error"),C=r(U),T=e("./extdisco"),R=r(T),N=e("./file"),A=r(N),O=e("./file3"),I=r(O),M=e("./forwarded"),k=r(M),D=e("./framing"),B=r(D),L=e("./geoloc"),F=r(L),q=e("./hash"),G=r(q),J=e("./hats"),H=r(J),V=e("./iceUdp"),W=r(V),X=e("./ibb"),$=r(X),Y=e("./iq"),K=r(Y),Q=e("./jidprep"),Z=r(Q),ee=e("./jingle"),te=r(ee),ne=e("./json"),re=r(ne),se=e("./logging"),ie=r(se),oe=e("./mam"),ae=r(oe),ce=e("./message"),ue=r(ce),de=e("./mood"),le=r(de),pe=e("./muc"),fe=r(pe),me=e("./nick"),he=r(me),ge=e("./oob"),be=r(ge),ve=e("./ping"),je=r(ve),_e=e("./presence"),xe=r(_e),ye=e("./private"),Se=r(ye),we=e("./psa"),ze=r(we),Pe=e("./pubsub"),Ee=r(Pe),Ue=e("./pubsubError"),Ce=r(Ue),Te=e("./pubsubEvents"),Re=r(Te),Ne=e("./pubsubOwner"),Ae=r(Ne),Oe=e("./push"),Ie=r(Oe),Me=e("./reach"),ke=r(Me),De=e("./register"),Be=r(De),Le=e("./roster"),Fe=r(Le),qe=e("./rsm"),Ge=r(qe),Je=e("./rtp"),He=r(Je),Ve=e("./rtt"),We=r(Ve),Xe=e("./sasl"),$e=r(Xe),Ye=e("./session"),Ke=r(Ye),Qe=e("./shim"),Ze=r(Qe),et=e("./sm"),tt=r(et),nt=e("./stream"),rt=r(nt),st=e("./streamError"),it=r(st),ot=e("./streamFeatures"),at=r(ot),ct=e("./time"),ut=r(ct),dt=e("./tune"),lt=r(dt),pt=e("./vcard"),ft=r(pt),mt=e("./version"),ht=r(mt),gt=e("./visibility"),bt=r(gt);n.default=function(e){e.use(i.default),e.use(a.default),e.use(u.default),e.use(l.default),e.use(f.default),e.use(h.default),e.use(b.default),e.use(j.default),e.use(x.default),e.use(S.default),e.use(z.default),e.use(E.default),e.use(C.default),e.use(R.default),e.use(A.default),e.use(I.default),e.use(k.default),e.use(B.default),e.use(F.default),e.use(G.default),e.use(H.default),e.use(W.default),e.use($.default),e.use(K.default),e.use(Z.default),e.use(te.default),e.use(re.default),e.use(ie.default),e.use(ae.default),e.use(ue.default),e.use(le.default),e.use(fe.default),e.use(he.default),e.use(be.default),e.use(je.default),e.use(xe.default),e.use(Se.default),e.use(ze.default),e.use(Ee.default),e.use(Ce.default),e.use(Re.default),e.use(Ae.default),e.use(Ie.default),e.use(ke.default),e.use(Be.default),e.use(Fe.default),e.use(Ge.default),e.use(He.default),e.use(We.default),e.use($e.default),e.use(Ke.default),e.use(Ze.default),e.use(tt.default),e.use(rt.default),e.use(it.default),e.use(at.default),e.use(ut.default),e.use(lt.default),e.use(ft.default),e.use(ht.default),e.use(bt.default)},t.exports=n.default},{"./avatar":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/avatar.js","./bind":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/bind.js","./blocking":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/blocking.js","./bob":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/bob.js","./bookmarks":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/bookmarks.js","./bosh":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/bosh.js","./carbons":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/carbons.js","./command":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/command.js","./csi":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/csi.js","./dataforms":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/dataforms.js","./delayed":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/delayed.js","./disco":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/disco.js","./error":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/error.js","./extdisco":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/extdisco.js","./file":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/file.js","./file3":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/file3.js","./forwarded":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/forwarded.js","./framing":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/framing.js","./geoloc":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/geoloc.js","./hash":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/hash.js","./hats":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/hats.js","./ibb":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/ibb.js","./iceUdp":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/iceUdp.js","./iq":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/iq.js","./jidprep":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/jidprep.js","./jingle":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/jingle.js","./json":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/json.js","./logging":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/logging.js","./mam":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/mam.js","./message":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/message.js","./mood":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/mood.js","./muc":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/muc.js","./nick":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/nick.js","./oob":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/oob.js","./ping":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/ping.js","./presence":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/presence.js","./private":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/private.js","./psa":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/psa.js","./pubsub":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/pubsub.js","./pubsubError":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/pubsubError.js","./pubsubEvents":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/pubsubEvents.js","./pubsubOwner":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/pubsubOwner.js","./push":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/push.js","./reach":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/reach.js","./register":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/register.js","./roster":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/roster.js","./rsm":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/rsm.js","./rtp":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/rtp.js","./rtt":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/rtt.js","./sasl":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/sasl.js","./session":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/session.js","./shim":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/shim.js","./sm":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/sm.js","./stream":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/stream.js","./streamError":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/streamError.js","./streamFeatures":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/streamFeatures.js","./time":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/time.js","./tune":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/tune.js","./vcard":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/vcard.js","./version":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/version.js","./visibility":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/visibility.js","babel-runtime/helpers/interop-require-default":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/babel-runtime/helpers/interop-require-default.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/iq.js":[function(e,t,n){"use strict";var r=e("babel-runtime/core-js/object/assign").default;Object.defineProperty(n,"__esModule",{value:!0});var s=e("xmpp-constants"),i={};i.defineIQ=function(e,t,n){var s=e.utils,i=e.define({name:t,namespace:n,element:"iq",topLevel:!0,fields:{lang:s.langAttribute(),id:s.attribute("id"),to:s.jidAttribute("to",!0),from:s.jidAttribute("from",!0),type:s.attribute("type")}}),o=i.prototype.toJSON;r(i.prototype,{toJSON:function toJSON(){var e=o.call(this);return e.resultReply=this.resultReply,e.errorReply=this.errorReply,e},resultReply:function resultReply(e){return e=e||{},e.to=this.from,e.id=this.id,e.type="result",new i(e)},errorReply:function errorReply(e){return e=e||{},e.to=this.from,e.id=this.id,e.type="error",new i(e)}})},n.default=function(e){i.defineIQ(e,"iq",s.Namespace.CLIENT),i.defineIQ(e,"serverIQ",s.Namespace.SERVER),i.defineIQ(e,"componentIQ",s.Namespace.COMPONENT)},t.exports=n.default},{"babel-runtime/core-js/object/assign":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/babel-runtime/core-js/object/assign.js","xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/jidprep.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants"),s=e("xmpp-jid");n.default=function(e){e.withIQ(function(t){e.add(t,"jidPrep",{get:function get(){var t=e.utils.getSubText(this.xml,r.Namespace.JID_PREP_0,"jid");if(t){var n=new s.JID(t);return n.prepped=!0,n}},set:function set(t){e.utils.setSubText(this.xml,r.Namespace.JID_PREP_0,"jid",(t||"").toString())}})})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js","xmpp-jid":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-jid/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/jingle.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants"),s=["out-of-order","tie-break","unknown-session","unsupported-info"],i=["alternative-session","busy","cancel","connectivity-error","decline","expired","failed-application","failed-transport","general-error","gone","incompatible-parameters","media-error","security-error","success","timeout","unsupported-applications","unsupported-transports"];n.default=function(e){var t=e.utils,n=e.define({name:"jingle",namespace:r.Namespace.JINGLE_1,element:"jingle",fields:{action:t.attribute("action"),initiator:t.attribute("initiator"),responder:t.attribute("responder"),sid:t.attribute("sid"),info:{get:function get(){for(var n=e.tagged("jingle-info").map(function(e){return e.prototype._name}),r=0,s=n.length;r<s;r++)if(this._extensions[n[r]])return this._extensions[n[r]];if("session-info"===t.getAttribute(this.xml,"action"))return 0===this.xml.children.length?{infoType:"ping"}:{infoType:"unknown"}},set:function set(e){if("ping"!==e.infoType){var t="_"+e.infoType;this[t]=e}}}}}),o=e.define({name:"_jingleContent",namespace:r.Namespace.JINGLE_1,element:"content",fields:{creator:t.attribute("creator"),disposition:t.attribute("disposition","session"),name:t.attribute("name"),senders:t.attribute("senders","both"),application:{get:function get(){for(var t=e.tagged("jingle-application").map(function(e){return e.prototype._name}),n=0,r=t.length;n<r;n++)if(this._extensions[t[n]])return this._extensions[t[n]]},set:function set(e){var t="_"+e.applicationType;this[t]=e}},transport:{get:function get(){for(var t=e.tagged("jingle-transport").map(function(e){return e.prototype._name}),n=0,r=t.length;n<r;n++)if(this._extensions[t[n]])return this._extensions[t[n]]},set:function set(e){var t="_"+e.transportType;this[t]=e}},security:{get:function get(){for(var t=e.tagged("jingle-security").map(function(e){return Security.prototype._name}),n=0,r=t.length;n<r;n++)if(this._extensions[t[n]])return this._extensions[t[n]]},set:function set(e){var t="_"+e.securityType;this[t]=e}}}}),a=e.define({name:"reason",namespace:r.Namespace.JINGLE_1,element:"reason",fields:{condition:t.enumSub(r.Namespace.JINGLE_1,i),alternativeSession:{get:function get(){return t.getSubText(this.xml,r.Namespace.JINGLE_1,"alternative-session")},set:function set(e){this.condition="alternative-session",t.setSubText(this.xml,r.Namespace.JINGLE_1,"alternative-session",e)}},text:t.textSub(r.Namespace.JINGLE_1,"text")}});e.extend(n,o,"contents"),e.extend(n,a),e.extendIQ(n),e.withStanzaError(function(n){e.add(n,"jingleCondition",t.enumSub(r.Namespace.JINGLE_ERRORS_1,s))})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/json.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t={get:function get(){var t=e.utils.getSubText(this.xml,r.Namespace.JSON_0,"json");if(t)return JSON.parse(t)},set:function set(t){t=JSON.stringify(t),t&&e.utils.setSubText(this.xml,r.Namespace.JSON_0,"json",t)}};e.withMessage(function(n){e.add(n,"json",t)}),e.withPubsubItem(function(n){e.add(n,"json",t)})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/logging.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.utils,n=e.define({name:"log",namespace:r.Namespace.EVENTLOG,element:"log",fields:{id:t.attribute("id"),timestamp:t.dateAttribute("timestamp"),type:t.attribute("type"),level:t.attribute("level"),object:t.attribute("object"),subject:t.attribute("subject"),facility:t.attribute("facility"),module:t.attribute("module"),message:t.textSub(r.Namespace.EVENTLOG,"message"),stackTrace:t.textSub(r.Namespace.EVENTLOG,"stackTrace")}}),s=e.define({name:"_logtag",namespace:r.Namespace.EVENTLOG,element:"tag",fields:{name:t.attribute("name"),value:t.attribute("value"),type:t.attribute("type")}});e.extend(n,s,"tags"),e.extendMessage(n),e.extendPubsubItem(n)},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/mam.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants"),s=e("xmpp-jid");n.default=function(e){var t=e.utils,n=e.define({name:"mam",namespace:r.Namespace.MAM_0,element:"query",fields:{queryid:t.attribute("queryid")}}),i=e.define({name:"mamItem",namespace:r.Namespace.MAM_0,element:"result",fields:{queryid:t.attribute("queryid"),id:t.attribute("id")}}),o=e.define({name:"mamResult",namespace:r.Namespace.MAM_0,element:"fin",fields:{queryid:t.attribute("queryid"),complete:t.boolAttribute("complete"),stable:t.boolAttribute("stable")}}),a=e.define({name:"mamPrefs",namespace:r.Namespace.MAM_0,element:"prefs",fields:{defaultCondition:t.attribute("default"),always:{get:function get(){var e=[],n=t.find(this.xml,r.Namespace.MAM_0,"always");if(0===n.length)return e;n=n[0];var i=t.getMultiSubText(n,r.Namespace.MAM_0,"jid");return i.forEach(function(t){e.push(new s.JID(t.textContent))}),e},set:function set(e){if(e.length>0){var n=t.findOrCreate(this.xml,r.Namespace.MAM_0,"always");t.setMultiSubText(n,r.Namespace.MAM_0,"jid",e)}}},never:{get:function get(){var e=[],n=t.find(this.xml,r.Namespace.MAM_0,"always");if(0===n.length)return e;n=n[0];var i=t.getMultiSubText(n,r.Namespace.MAM_0,"jid");return i.forEach(function(t){e.push(new s.JID(t.textContent))}),e},set:function set(e){if(e.length>0){var n=t.findOrCreate(this.xml,r.Namespace.MAM_0,"never");t.setMultiSubText(n,r.Namespace.MAM_0,"jid",e)}}}}});e.extendMessage(i),e.extendMessage(o),e.extendIQ(n),e.extendIQ(a),e.withDataForm(function(t){e.extend(n,t)}),e.withDefinition("forwarded",r.Namespace.FORWARD_0,function(t){e.extend(i,t)}),e.withDefinition("set",r.Namespace.RSM,function(t){e.extend(n,t),e.extend(o,t)})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js","xmpp-jid":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-jid/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/message.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants"),s={};s.defineMessage=function(e,t,n){var s=e.utils;e.define({name:t,namespace:n,element:"message",topLevel:!0,fields:{lang:s.langAttribute(),id:s.attribute("id"),to:s.jidAttribute("to",!0),from:s.jidAttribute("from",!0),type:s.attribute("type","normal"),thread:s.textSub(n,"thread"),parentThread:s.subAttribute(n,"thread","parent"),subject:s.textSub(n,"subject"),$body:{get:function getBody$(){return s.getSubLangText(this.xml,n,"body",this.lang)}},body:{get:function getBody(){var e=this.$body;return e[this.lang]||""},set:function setBody(e){s.setSubLangText(this.xml,n,"body",e,this.lang)}},attention:s.boolSub(r.Namespace.ATTENTION_0,"attention"),chatState:s.enumSub(r.Namespace.CHAT_STATES,["active","composing","paused","inactive","gone"]),replace:s.subAttribute(r.Namespace.CORRECTION_0,"replace","id"),requestReceipt:s.boolSub(r.Namespace.RECEIPTS,"request"),receipt:s.subAttribute(r.Namespace.RECEIPTS,"received","id")}})},n.default=function(e){s.defineMessage(e,"message",r.Namespace.CLIENT),s.defineMessage(e,"serverMessage",r.Namespace.SERVER),s.defineMessage(e,"componentMessage",r.Namespace.COMPONENT)},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/mood.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants"),s=["afraid","amazed","amorous","angry","annoyed","anxious","aroused","ashamed","bored","brave","calm","cautious","cold","confident","confused","contemplative","contented","cranky","crazy","creative","curious","dejected","depressed","disappointed","disgusted","dismayed","distracted","embarrassed","envious","excited","flirtatious","frustrated","grateful","grieving","grumpy","guilty","happy","hopeful","hot","humbled","humiliated","hungry","hurt","impressed","in_awe","in_love","indignant","interested","intoxicated","invincible","jealous","lonely","lucky","mean","moody","nervous","neutral","offended","outraged","playful","proud","relaxed","relieved","remorseful","restless","sad","sarcastic","serious","shocked","shy","sick","sleepy","spontaneous","stressed","strong","surprised","thankful","thirsty","tired","undefined","weak","worried"];n.default=function(e){var t=e.define({name:"mood",namespace:r.Namespace.MOOD,element:"mood",fields:{text:e.utils.textSub(r.Namespace.MOOD,"text"),value:e.utils.enumSub(r.Namespace.MOOD,s)}});e.extendMessage(t),e.extendPubsubItem(t)},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/muc.js":[function(e,t,n){"use strict";function proxy(e,t){return{get:function get(){if(this._extensions[e])return this[e][t]},set:function set(n){this[e][t]=n}}}Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.utils,n=e.define({name:"_mucUserItem",namespace:r.Namespace.MUC_USER,element:"item",fields:{affiliation:t.attribute("affiliation"),nick:t.attribute("nick"),jid:t.jidAttribute("jid"),role:t.attribute("role"),reason:t.textSub(r.Namespace.MUC_USER,"reason")}}),s=e.define({name:"_mucUserActor",namespace:r.Namespace.MUC_USER,element:"actor",fields:{nick:t.attribute("nick"),jid:t.jidAttribute("jid")}}),i=e.define({name:"destroyed",namespace:r.Namespace.MUC_USER,element:"destroy",fields:{jid:t.jidAttribute("jid"),reason:t.textSub(r.Namespace.MUC_USER,"reason")}}),o=e.define({name:"invite",namespace:r.Namespace.MUC_USER,element:"invite",fields:{to:t.jidAttribute("to"),from:t.jidAttribute("from"),reason:t.textSub(r.Namespace.MUC_USER,"reason"),thread:t.subAttribute(r.Namespace.MUC_USER,"continue","thread"),continue:t.boolSub(r.Namespace.MUC_USER,"continue")}}),a=e.define({name:"decline",namespace:r.Namespace.MUC_USER,element:"decline",fields:{to:t.jidAttribute("to"),from:t.jidAttribute("from"),reason:t.textSub(r.Namespace.MUC_USER,"reason")}}),c=e.define({name:"_mucAdminItem",namespace:r.Namespace.MUC_ADMIN,element:"item",fields:{affiliation:t.attribute("affiliation"),nick:t.attribute("nick"),jid:t.jidAttribute("jid"),role:t.attribute("role"),reason:t.textSub(r.Namespace.MUC_ADMIN,"reason")}}),u=e.define({name:"actor",namespace:r.Namespace.MUC_USER,element:"actor",fields:{nick:t.attribute("nick"),jid:t.jidAttribute("jid")}}),d=e.define({name:"destroy",namespace:r.Namespace.MUC_OWNER,element:"destroy",fields:{jid:t.jidAttribute("jid"),password:t.textSub(r.Namespace.MUC_OWNER,"password"),reason:t.textSub(r.Namespace.MUC_OWNER,"reason")}}),l=e.define({name:"muc",namespace:r.Namespace.MUC_USER,element:"x",fields:{affiliation:proxy("_mucUserItem","affiliation"),nick:proxy("_mucUserItem","nick"),jid:proxy("_mucUserItem","jid"),role:proxy("_mucUserItem","role"),actor:proxy("_mucUserItem","_mucUserActor"),reason:proxy("_mucUserItem","reason"),password:t.textSub(r.Namespace.MUC_USER,"password"),codes:{get:function get(){return t.getMultiSubText(this.xml,r.Namespace.MUC_USER,"status",function(e){return t.getAttribute(e,"code")})},set:function set(e){var n=this;t.setMultiSubText(this.xml,r.Namespace.MUC_USER,"status",e,function(e){var s=t.createElement(r.Namespace.MUC_USER,"status",r.Namespace.MUC_USER);t.setAttribute(s,"code",e),n.xml.appendChild(s)})}}}}),p=e.define({name:"mucAdmin",namespace:r.Namespace.MUC_ADMIN,element:"query",fields:{affiliation:proxy("_mucAdminItem","affiliation"),nick:proxy("_mucAdminItem","nick"),jid:proxy("_mucAdminItem","jid"),role:proxy("_mucAdminItem","role"),actor:proxy("_mucAdminItem","_mucAdminActor"),reason:proxy("_mucAdminItem","reason")}}),f=e.define({name:"mucOwner",namespace:r.Namespace.MUC_OWNER,element:"query"}),m=e.define({name:"joinMuc",namespace:r.Namespace.MUC,element:"x",fields:{password:t.textSub(r.Namespace.MUC,"password"),history:{get:function get(){var e={},n=t.find(this.xml,r.Namespace.MUC,"history");if(!n.length)return{};n=n[0];var s=n.getAttribute("maxchars")||"",i=n.getAttribute("maxstanzas")||"",o=n.getAttribute("seconds")||"",a=n.getAttribute("since")||"";s&&(e.maxchars=parseInt(s,10)),i&&(e.maxstanzas=parseInt(i,10)),o&&(e.seconds=parseInt(o,10)),a&&(e.since=new Date(a))},set:function set(e){var n=t.find(this.xml,r.Namespace.MUC,"history");if(n.length)for(var s=0;s<n.length;s++)this.xml.removeChild(n[s]);var i=t.createElement(r.Namespace.MUC,"history",r.Namespace.MUC);this.xml.appendChild(i),e.maxchars&&i.setAttribute("maxchars",""+e.maxchars),e.maxstanzas&&i.setAttribute("maxstanzas",""+e.maxstanzas),e.seconds&&i.setAttribute("seconds",""+e.seconds),e.since&&i.setAttribute("since",e.since.toISOString())}}}}),h=e.define({name:"mucInvite",namespace:r.Namespace.MUC_DIRECT_INVITE,element:"x",fields:{jid:t.jidAttribute("jid"),password:t.attribute("password"),reason:t.attribute("reason"),thread:t.attribute("thread"),continue:t.boolAttribute("continue")}});e.extend(n,s),e.extend(l,n),e.extend(l,o,"invites"),e.extend(l,a),e.extend(l,i),e.extend(c,u),e.extend(p,c,"items"),e.extend(f,d),e.extendPresence(l),e.extendPresence(m),e.extendMessage(l),e.extendMessage(h),e.withIQ(function(n){e.add(n,"mucUnique",t.textSub(r.Namespace.MUC_UNIQUE,"unique")),e.extend(n,p),e.extend(n,f)}),e.withDataForm(function(t){e.extend(f,t)})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/nick.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.utils.textSub(r.Namespace.NICK,"nick");e.withPubsubItem(function(n){e.add(n,"nick",t)}),e.withPresence(function(n){e.add(n,"nick",t)}),e.withMessage(function(n){e.add(n,"nick",t)})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/oob.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.define({name:"oob",element:"x",namespace:r.Namespace.OOB,fields:{url:e.utils.textSub(r.Namespace.OOB,"url"),desc:e.utils.textSub(r.Namespace.OOB,"desc")}});e.extendMessage(t,"oobURIs")},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/ping.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.define({name:"ping",namespace:r.Namespace.PING,element:"ping"});e.extendIQ(t)},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/presence.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants"),s={};s.definePresence=function(e,t,n){var s=e.utils;e.define({name:t,namespace:n,element:"presence",topLevel:!0,fields:{lang:s.langAttribute(),id:s.attribute("id"),to:s.jidAttribute("to",!0),from:s.jidAttribute("from",!0),priority:s.numberSub(n,"priority",!1,0),show:s.textSub(n,"show"),type:{get:function get(){return s.getAttribute(this.xml,"type","available")},set:function set(e){"available"===e&&(e=!1),s.setAttribute(this.xml,"type",e)}},$status:{get:function get(){return s.getSubLangText(this.xml,n,"status",this.lang)}},status:{get:function get(){var e=this.$status;return e[this.lang]||""},set:function set(e){s.setSubLangText(this.xml,n,"status",e,this.lang)}},idleSince:s.dateSubAttribute(r.Namespace.IDLE_1,"idle","since"),decloak:s.subAttribute(r.Namespace.DECLOAK_0,"decloak","reason"),avatarId:{get:function get(){var e=s.find(this.xml,r.Namespace.VCARD_TEMP_UPDATE,"x");return e.length?s.getSubText(e[0],r.Namespace.VCARD_TEMP_UPDATE,"photo"):""},set:function set(e){var t=s.findOrCreate(this.xml,r.Namespace.VCARD_TEMP_UPDATE,"x");if(""===e)s.setBoolSub(t,r.Namespace.VCARD_TEMP_UPDATE,"photo",!0);else{if(e===!0)return;e?s.setSubText(t,r.Namespace.VCARD_TEMP_UPDATE,"photo",e):this.xml.removeChild(t)}}}}})},n.default=function(e){s.definePresence(e,"presence",r.Namespace.CLIENT),s.definePresence(e,"serverPresence",r.Namespace.SERVER),s.definePresence(e,"componentPresence",r.Namespace.COMPONENT)},t.exports=n.default;
  },{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/private.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.define({name:"privateStorage",namespace:r.Namespace.PRIVATE,element:"query"});e.extendIQ(t)},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/psa.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants"),s=["server-unavailable","connection-paused"];n.default=function(e){var t=e.define({name:"state",namespace:r.Namespace.PSA,element:"state-annotation",fields:{from:e.utils.jidAttribute("from"),condition:e.utils.enumSub(r.Namespace.PSA,s),description:e.utils.textSub(r.Namespace.PSA,"description")}});e.extendPresence(t)},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/pubsub.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.utils,n=e.define({name:"pubsub",namespace:r.Namespace.PUBSUB,element:"pubsub",fields:{create:{get:function get(){var e=t.getSubAttribute(this.xml,r.Namespace.PUBSUB,"create","node");return e?e:t.getBoolSub(this.xml,r.Namespace.PUBSUB,"create")},set:function set(e){e!==!0&&e?t.setSubAttribute(this.xml,r.Namespace.PUBSUB,"create","node",e):t.setBoolSub(this.xml,r.Namespace.PUBSUB,"create",e)}},publishOptions:{get:function get(){var n=e.getDefinition("x",r.Namespace.DATAFORM),s=t.find(this.xml,r.Namespace.PUBSUB,"publish-options");if(s.length&&s[0].childNodes.length)return new n({},s[0].childNodes[0])},set:function set(n){var s=e.getDefinition("x",r.Namespace.DATAFORM),i=t.findOrCreate(this.xml,r.Namespace.PUBSUB,"publish-options");if(n){var o=new s(n);i.appendChild(o.xml)}}}}}),s=e.define({name:"config",namespace:r.Namespace.PUBSUB,element:"configure"}),i=e.define({name:"subscribe",namespace:r.Namespace.PUBSUB,element:"subscribe",fields:{node:t.attribute("node"),jid:t.jidAttribute("jid")}}),o=e.define({name:"subscription",namespace:r.Namespace.PUBSUB,element:"subscription",fields:{node:t.attribute("node"),jid:t.jidAttribute("jid"),subid:t.attribute("subid"),type:t.attribute("subscription"),configurable:t.boolSub("subscribe-options"),configurationRequired:{get:function get(){var e=t.find(this.xml,r.Namespace.PUBSUB,"subscribe-options");return!!e.length&&t.getBoolSub(e[0],r.Namespace.PUBSUB,"required")}}}}),a=e.define({name:"subscriptions",namespace:r.Namespace.PUBSUB,element:"subscriptions",fields:{node:t.attribute("node"),jid:t.jidAttribute("jid")}}),c=e.define({name:"affiliation",namespace:r.Namespace.PUBSUB,element:"affiliation",fields:{node:t.attribute("node"),type:t.attribute("affiliation")}}),u=e.define({name:"affiliations",namespace:r.Namespace.PUBSUB,element:"affiliations",fields:{node:t.attribute("node")}}),d=e.define({name:"subscriptionOptions",namespace:r.Namespace.PUBSUB,element:"options",fields:{node:t.attribute("node"),jid:t.jidAttribute("jid"),subid:t.attribute("subid")}}),l=e.define({name:"unsubscribe",namespace:r.Namespace.PUBSUB,element:"unsubscribe",fields:{node:t.attribute("node"),subid:t.attribute("subid"),jid:t.jidAttribute("jid")}}),p=e.define({name:"publish",namespace:r.Namespace.PUBSUB,element:"publish",fields:{node:t.attribute("node")}}),f=e.define({name:"retract",namespace:r.Namespace.PUBSUB,element:"retract",fields:{node:t.attribute("node"),notify:t.boolAttribute("notify"),id:t.subAttribute(r.Namespace.PUBSUB,"item","id")}}),m=e.define({name:"retrieve",namespace:r.Namespace.PUBSUB,element:"items",fields:{node:t.attribute("node"),max:t.attribute("max_items")}}),h=e.define({name:"item",namespace:r.Namespace.PUBSUB,element:"item",fields:{id:t.attribute("id")}});e.extend(n,s),e.extend(n,i),e.extend(n,l),e.extend(n,p),e.extend(n,f),e.extend(n,m),e.extend(n,o),e.extend(n,d),e.extend(n,a),e.extend(n,u),e.extend(p,h,"items"),e.extend(m,h,"items"),e.extend(a,o,"list"),e.extend(u,c,"list"),e.extendIQ(n),e.withDataForm(function(t){e.extend(d,t),e.extend(h,t),e.extend(s,t)}),e.withDefinition("set",r.Namespace.RSM,function(t){e.extend(n,t)})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/pubsubError.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants"),s=["closed-node","configuration-required","invalid-jid","invalid-options","invalid-payload","invalid-subid","item-forbidden","item-required","jid-required","max-items-exceeded","max-nodes-exceeded","nodeid-required","not-in-roster-group","not-subscribed","payload-too-big","payload-required","pending-subscription","presence-subscription-required","subid-required","too-many-subscriptions","unsupported","unsupported-access-model"];n.default=function(e){e.withStanzaError(function(t){e.add(t,"pubsubCondition",e.utils.enumSub(r.Namespace.PUBSUB_ERRORS,s)),e.add(t,"pubsubUnsupportedFeature",{get:function get(){return e.utils.getSubAttribute(this.xml,r.Namespace.PUBSUB_ERRORS,"unsupported","feature")},set:function set(t){t&&(this.pubsubCondition="unsupported"),e.utils.setSubAttribute(this.xml,r.Namespace.PUBSUB_ERRORS,"unsupported","feature",t)}})})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/pubsubEvents.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.utils,n=e.define({name:"event",namespace:r.Namespace.PUBSUB_EVENT,element:"event"}),s=e.define({name:"purged",namespace:r.Namespace.PUBSUB_EVENT,element:"purge",fields:{node:t.attribute("node")}}),i=e.define({name:"deleted",namespace:r.Namespace.PUBSUB_EVENT,element:"delete",fields:{node:t.attribute("node"),redirect:t.subAttribute(r.Namespace.PUBSUB_EVENT,"redirect","uri")}}),o=e.define({name:"subscriptionChanged",namespace:r.Namespace.PUBSUB_EVENT,element:"subscription",fields:{node:t.attribute("node"),jid:t.jidAttribute("jid"),type:t.attribute("subscription"),subid:t.attribute("subid"),expiry:{get:function get(){var e=t.getAttribute(this.xml,"expiry");return"presence"===e?e:e?new Date(e):void 0},set:function set(e){e&&("string"!=typeof e&&(e=e.toISOString()),t.setAttribute(this.xml,"expiry",e))}}}}),a=e.define({name:"configurationChanged",namespace:r.Namespace.PUBSUB_EVENT,element:"configuration",fields:{node:t.attribute("node")}}),c=e.define({name:"updated",namespace:r.Namespace.PUBSUB_EVENT,element:"items",fields:{node:t.attribute("node"),retracted:{get:function get(){var e=[],n=t.find(this.xml,r.Namespace.PUBSUB_EVENT,"retract");return n.forEach(function(t){e.push(t.getAttribute("id"))}),e},set:function set(e){e.forEach(function(e){var n=t.createElement(r.Namespace.PUBSUB_EVENT,"retract",r.Namespace.PUBSUB_EVENT);n.setAttribute("id",e),this.xml.appendChild(n)})}}}}),u=e.define({name:"_eventItem",namespace:r.Namespace.PUBSUB_EVENT,element:"item",fields:{id:t.attribute("id"),node:t.attribute("node"),publisher:t.jidAttribute("publisher")}});e.extend(c,u,"published"),e.extend(n,c),e.extend(n,o),e.extend(n,a),e.extend(n,i),e.extend(n,s),e.extendMessage(n),e.withDataForm(function(t){e.extend(a,t)})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/pubsubOwner.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.utils,n=e.define({name:"pubsubOwner",namespace:r.Namespace.PUBSUB_OWNER,element:"pubsub",fields:{purge:t.subAttribute(r.Namespace.PUBSUB_OWNER,"purge","node"),del:t.subAttribute(r.Namespace.PUBSUB_OWNER,"delete","node"),redirect:{get:function get(){var e=t.find(this.xml,r.Namespace.PUBSUB_OWNER,"delete");return e.length?t.getSubAttribute(e[0],r.Namespace.PUBSUB_OWNER,"redirect","uri"):""},set:function set(e){var n=t.findOrCreate(this.xml,r.Namespace.PUBSUB_OWNER,"delete");t.setSubAttribute(n,r.Namespace.PUBSUB_OWNER,"redirect","uri",e)}}}}),s=e.define({name:"subscription",namespace:r.Namespace.PUBSUB_OWNER,element:"subscription",fields:{node:t.attribute("node"),jid:t.jidAttribute("jid"),subid:t.attribute("subid"),type:t.attribute("subscription"),configurable:t.boolSub("subscribe-options"),configurationRequired:{get:function get(){var e=t.find(this.xml,r.Namespace.PUBSUB_OWNER,"subscribe-options");return!!e.length&&t.getBoolSub(e[0],r.Namespace.PUBSUB_OWNER,"required")}}}}),i=e.define({name:"subscriptions",namespace:r.Namespace.PUBSUB_OWNER,element:"subscriptions",fields:{node:t.attribute("node")}}),o=e.define({name:"affiliation",namespace:r.Namespace.PUBSUB_OWNER,element:"affiliation",fields:{jid:t.jidAttribute("jid"),type:t.attribute("affiliation")}}),a=e.define({name:"affiliations",namespace:r.Namespace.PUBSUB_OWNER,element:"affiliations",fields:{node:t.attribute("node")}}),c=e.define({name:"config",namespace:r.Namespace.PUBSUB_OWNER,element:"configure",fields:{node:t.attribute("node")}});e.extend(n,c),e.extend(n,i),e.extend(n,a),e.extend(i,s,"list"),e.extend(a,o,"list"),e.extendIQ(n),e.withDataForm(function(t){e.extend(c,t)})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/push.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.utils,n=e.define({name:"enablePush",element:"enable",namespace:r.Namespace.PUSH_0,fields:{jid:t.jidAttribute("jid"),node:t.attribute("node")}}),s=e.define({name:"disablePush",element:"disable",namespace:r.Namespace.PUSH_0,fields:{jid:t.jidAttribute("jid"),node:t.attribute("node")}}),i=e.define({name:"pushNotification",element:"notification",namespace:r.Namespace.PUSH_0});e.withDataForm(function(t){e.extend(i,t),e.extend(n,t)}),e.extendIQ(n),e.extendIQ(s)},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/reach.js":[function(e,t,n){"use strict";var r=e("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(n,"__esModule",{value:!0});var s=e("xmpp-constants"),i=e("lodash.foreach"),o=r(i);n.default=function(e){var t=e.utils,n=e.define({name:"_reachAddr",namespace:s.Namespace.REACH_0,element:"addr",fields:{uri:t.attribute("uri"),$desc:{get:function get(){return t.getSubLangText(this.xml,s.Namespace.REACH_0,"desc",this.lang)}},desc:{get:function get(){var e=this.$desc;return e[this.lang]||""},set:function set(e){t.setSubLangText(this.xml,s.Namespace.REACH_0,"desc",e,this.lang)}}}}),r={get:function get(){var e=t.find(this.xml,s.Namespace.REACH_0,"reach"),r=[];if(e.length){var i=t.find(e[0],s.Namespace.REACH_0,"addr");(0,o.default)(i,function(e){r.push(new n({},e))})}return r},set:function set(e){var r=t.findOrCreate(this.xml,s.Namespace.REACH_0,"reach");t.setAttribute(r,"xmlns",s.Namespace.REACH_0),(0,o.default)(e,function(e){var t=new n(e);r.appendChild(t.xml)})}};e.withPubsubItem(function(t){e.add(t,"reach",r)}),e.withPresence(function(t){e.add(t,"reach",r)})},t.exports=n.default},{"babel-runtime/helpers/interop-require-default":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/babel-runtime/helpers/interop-require-default.js","lodash.foreach":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.foreach/index.js","xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/register.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.utils,n=e.define({name:"register",namespace:r.Namespace.REGISTER,element:"query",fields:{instructions:t.textSub(r.Namespace.REGISTER,"instructions"),registered:t.boolSub(r.Namespace.REGISTER,"registered"),remove:t.boolSub(r.Namespace.REGISTER,"remove"),username:t.textSub(r.Namespace.REGISTER,"username"),nick:t.textSub(r.Namespace.REGISTER,"nick"),password:t.textSub(r.Namespace.REGISTER,"password"),name:t.textSub(r.Namespace.REGISTER,"name"),first:t.textSub(r.Namespace.REGISTER,"first"),last:t.textSub(r.Namespace.REGISTER,"last"),email:t.textSub(r.Namespace.REGISTER,"email"),address:t.textSub(r.Namespace.REGISTER,"address"),city:t.textSub(r.Namespace.REGISTER,"city"),state:t.textSub(r.Namespace.REGISTER,"state"),zip:t.textSub(r.Namespace.REGISTER,"zip"),phone:t.textSub(r.Namespace.REGISTER,"phone"),url:t.textSub(r.Namespace.REGISTER,"url"),date:t.textSub(r.Namespace.REGISTER,"date"),misc:t.textSub(r.Namespace.REGISTER,"misc"),text:t.textSub(r.Namespace.REGISTER,"text"),key:t.textSub(r.Namespace.REGISTER,"key")}});e.extendIQ(n),e.withDefinition("x",r.Namespace.OOB,function(t){e.extend(n,t)}),e.withDataForm(function(t){e.extend(n,t)})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/roster.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.utils,n=e.define({name:"roster",namespace:r.Namespace.ROSTER,element:"query",fields:{ver:{get:function get(){return t.getAttribute(this.xml,"ver")},set:function set(e){var n=""===e;t.setAttribute(this.xml,"ver",e,n)}}}}),s=e.define({name:"_rosterItem",namespace:r.Namespace.ROSTER,element:"item",fields:{jid:t.jidAttribute("jid",!0),name:t.attribute("name"),subscription:t.attribute("subscription","none"),subscriptionRequested:{get:function get(){var e=t.getAttribute(this.xml,"ask");return"subscribe"===e}},preApproved:t.boolAttribute(r.Namespace.ROSTER,"approved"),groups:t.multiTextSub(r.Namespace.ROSTER,"group")}});e.extend(n,s,"items"),e.extendIQ(n)},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/rsm.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.utils;e.define({name:"rsm",namespace:r.Namespace.RSM,element:"set",fields:{after:t.textSub(r.Namespace.RSM,"after"),before:{get:function get(){return t.getSubText(this.xml,r.Namespace.RSM,"before")},set:function set(e){e===!0?t.findOrCreate(this.xml,r.Namespace.RSM,"before"):t.setSubText(this.xml,r.Namespace.RSM,"before",e)}},count:t.numberSub(r.Namespace.RSM,"count",!1,0),first:t.textSub(r.Namespace.RSM,"first"),firstIndex:t.subAttribute(r.Namespace.RSM,"first","index"),index:t.textSub(r.Namespace.RSM,"index"),last:t.textSub(r.Namespace.RSM,"last"),max:t.textSub(r.Namespace.RSM,"max")}})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/rtp.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.utils,n={get:function get(){var e=t.find(this.xml,r.Namespace.JINGLE_RTP_RTCP_FB_0,"rtcp-fb"),n=[];return e.forEach(function(e){n.push({type:t.getAttribute(e,"type"),subtype:t.getAttribute(e,"subtype")})}),e=t.find(this.xml,r.Namespace.JINGLE_RTP_RTCP_FB_0,"rtcp-fb-trr-int"),e.forEach(function(e){n.push({type:t.getAttribute(e,"type"),value:t.getAttribute(e,"value")})}),n},set:function set(e){var n=this,s=t.find(this.xml,r.Namespace.JINGLE_RTP_RTCP_FB_0,"rtcp-fb");s.forEach(function(e){n.xml.removeChild(e)}),s=t.find(this.xml,r.Namespace.JINGLE_RTP_RTCP_FB_0,"rtcp-fb-trr-int"),s.forEach(function(e){n.xml.removeChild(e)}),e.forEach(function(e){var s=void 0;"trr-int"===e.type?(s=t.createElement(r.Namespace.JINGLE_RTP_RTCP_FB_0,"rtcp-fb-trr-int",r.Namespace.JINGLE_RTP_1),t.setAttribute(s,"type",e.type),t.setAttribute(s,"value",e.value)):(s=t.createElement(r.Namespace.JINGLE_RTP_RTCP_FB_0,"rtcp-fb",r.Namespace.JINGLE_RTP_1),t.setAttribute(s,"type",e.type),t.setAttribute(s,"subtype",e.subtype)),n.xml.appendChild(s)})}},s=e.define({name:"bandwidth",namespace:r.Namespace.JINGLE_RTP_1,element:"bandwidth",fields:{type:t.attribute("type"),bandwidth:t.text()}}),i=e.define({name:"_rtp",namespace:r.Namespace.JINGLE_RTP_1,element:"description",tags:["jingle-application"],fields:{applicationType:{value:"rtp"},media:t.attribute("media"),ssrc:t.attribute("ssrc"),mux:t.boolSub(r.Namespace.JINGLE_RTP_1,"rtcp-mux"),encryption:{get:function get(){var e=t.find(this.xml,r.Namespace.JINGLE_RTP_1,"encryption");if(!e.length)return[];e=e[0];var n=this,s=t.find(e,r.Namespace.JINGLE_RTP_1,"crypto"),i=[];return s.forEach(function(e){i.push(new a({},e,n).toJSON())}),i},set:function set(e){var n=t.find(this.xml,r.Namespace.JINGLE_RTP_1,"encryption");if(n.length&&this.xml.removeChild(n),e.length){t.setBoolSubAttribute(this.xml,r.Namespace.JINGLE_RTP_1,"encryption","required",!0),n=t.find(this.xml,r.Namespace.JINGLE_RTP_1,"encryption")[0];var s=this;e.forEach(function(e){var t=new a(e,null,s);n.appendChild(t.xml)})}}},feedback:n,headerExtensions:{get:function get(){var e=t.find(this.xml,r.Namespace.JINGLE_RTP_HDREXT_0,"rtp-hdrext"),n=[];return e.forEach(function(e){n.push({id:t.getAttribute(e,"id"),uri:t.getAttribute(e,"uri"),senders:t.getAttribute(e,"senders")})}),n},set:function set(e){var n=this,s=t.find(this.xml,r.Namespace.JINGLE_RTP_HDREXT_0,"rtp-hdrext");s.forEach(function(e){n.xml.removeChild(e)}),e.forEach(function(e){var s=t.createElement(r.Namespace.JINGLE_RTP_HDREXT_0,"rtp-hdrext",r.Namespace.JINGLE_RTP_1);t.setAttribute(s,"id",e.id),t.setAttribute(s,"uri",e.uri),t.setAttribute(s,"senders",e.senders),n.xml.appendChild(s)})}}}}),o=e.define({name:"_payloadType",namespace:r.Namespace.JINGLE_RTP_1,element:"payload-type",fields:{channels:t.attribute("channels"),clockrate:t.attribute("clockrate"),id:t.attribute("id"),maxptime:t.attribute("maxptime"),name:t.attribute("name"),ptime:t.attribute("ptime"),feedback:n,parameters:{get:function get(){var e=[],n=t.find(this.xml,r.Namespace.JINGLE_RTP_1,"parameter");return n.forEach(function(n){e.push({key:t.getAttribute(n,"name"),value:t.getAttribute(n,"value")})}),e},set:function set(e){var n=this;e.forEach(function(e){var s=t.createElement(r.Namespace.JINGLE_RTP_1,"parameter");t.setAttribute(s,"name",e.key),t.setAttribute(s,"value",e.value),n.xml.appendChild(s)})}}}}),a=e.define({name:"crypto",namespace:r.Namespace.JINGLE_RTP_1,element:"crypto",fields:{cipherSuite:t.attribute("crypto-suite"),keyParams:t.attribute("key-params"),sessionParams:t.attribute("session-params"),tag:t.attribute("tag")}}),c=e.define({name:"_group",namespace:r.Namespace.JINGLE_GROUPING_0,element:"group",fields:{semantics:t.attribute("semantics"),contents:t.multiSubAttribute(r.Namespace.JINGLE_GROUPING_0,"content","name")}}),u=e.define({name:"_sourceGroup",namespace:r.Namespace.JINGLE_RTP_SSMA_0,element:"ssrc-group",fields:{semantics:t.attribute("semantics"),sources:t.multiSubAttribute(r.Namespace.JINGLE_RTP_SSMA_0,"source","ssrc")}}),d=e.define({name:"_source",namespace:r.Namespace.JINGLE_RTP_SSMA_0,element:"source",fields:{ssrc:t.attribute("ssrc"),parameters:{get:function get(){var e=[],n=t.find(this.xml,r.Namespace.JINGLE_RTP_SSMA_0,"parameter");return n.forEach(function(n){e.push({key:t.getAttribute(n,"name"),value:t.getAttribute(n,"value")})}),e},set:function set(e){var n=this;e.forEach(function(e){var s=t.createElement(r.Namespace.JINGLE_RTP_SSMA_0,"parameter");t.setAttribute(s,"name",e.key),t.setAttribute(s,"value",e.value),n.xml.appendChild(s)})}}}}),l=e.define({name:"mute",namespace:r.Namespace.JINGLE_RTP_INFO_1,element:"mute",fields:{creator:t.attribute("creator"),name:t.attribute("name")}}),p=e.define({name:"unmute",namespace:r.Namespace.JINGLE_RTP_INFO_1,element:"unmute",fields:{creator:t.attribute("creator"),name:t.attribute("name")}});e.extend(i,s),e.extend(i,o,"payloads"),e.extend(i,d,"sources"),e.extend(i,u,"sourceGroups"),e.withDefinition("content",r.Namespace.JINGLE_1,function(t){e.extend(t,i)}),e.withDefinition("jingle",r.Namespace.JINGLE_1,function(n){e.extend(n,l),e.extend(n,p),e.extend(n,c,"groups"),e.add(n,"ringing",t.boolSub(r.Namespace.JINGLE_RTP_INFO_1,"ringing")),e.add(n,"hold",t.boolSub(r.Namespace.JINGLE_RTP_INFO_1,"hold")),e.add(n,"active",t.boolSub(r.Namespace.JINGLE_RTP_INFO_1,"active"))})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/rtt.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants"),s={insert:"t",erase:"e",wait:"w"},i={t:"insert",e:"erase",w:"wait"};n.default=function(e){var t=e.utils,n=e.define({name:"rtt",namespace:r.Namespace.RTT_0,element:"rtt",fields:{id:t.attribute("id"),event:t.attribute("event","edit"),seq:t.numberAttribute("seq"),actions:{get:function get(){for(var e=[],n=0,s=this.xml.childNodes.length;n<s;n++){var o=this.xml.childNodes[n],a=o.localName,c={};if(o.namespaceURI===r.Namespace.RTT_0&&i[a]){c.type=i[a];var u=t.getAttribute(o,"p");u&&(c.pos=parseInt(u,10));var d=t.getAttribute(o,"n");d&&(c.num=parseInt(d,10));var l=t.getText(o);l&&"t"===a&&(c.text=l),e.push(c)}}return e},set:function set(e){for(var n=this,i=0,o=this.xml.childNodes.length;i<o;i++)this.xml.removeChild(this.xml.childNodes[i]);e.forEach(function(e){if(s[e.type]){var i=t.createElement(r.Namespace.RTT_0,s[e.type],r.Namespace.RTT_0);void 0!==e.pos&&t.setAttribute(i,"p",e.pos.toString()),e.num&&t.setAttribute(i,"n",e.num.toString()),e.text&&t.setText(i,e.text),n.xml.appendChild(i)}})}}}});e.extendMessage(n)},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/sasl.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants"),s=["aborted","account-disabled","credentials-expired","encryption-required","incorrect-encoding","invalid-authzid","invalid-mechanism","malformed-request","mechanism-too-weak","not-authorized","temporary-auth-failure"];n.default=function(e){var t=e.utils,n=e.define({name:"sasl",namespace:r.Namespace.SASL,element:"mechanisms",fields:{mechanisms:t.multiTextSub(r.Namespace.SASL,"mechanism")}});e.define({name:"saslAuth",eventName:"sasl:auth",namespace:r.Namespace.SASL,element:"auth",topLevel:!0,fields:{value:t.text(),mechanism:t.attribute("mechanism")}}),e.define({name:"saslChallenge",eventName:"sasl:challenge",namespace:r.Namespace.SASL,element:"challenge",topLevel:!0,fields:{value:t.text()}}),e.define({name:"saslResponse",eventName:"sasl:response",namespace:r.Namespace.SASL,element:"response",topLevel:!0,fields:{value:t.text()}}),e.define({name:"saslAbort",eventName:"sasl:abort",namespace:r.Namespace.SASL,element:"abort",topLevel:!0}),e.define({name:"saslSuccess",eventName:"sasl:success",namespace:r.Namespace.SASL,element:"success",topLevel:!0,fields:{value:t.text()}}),e.define({name:"saslFailure",eventName:"sasl:failure",namespace:r.Namespace.SASL,element:"failure",topLevel:!0,fields:{lang:{get:function get(){return this._lang||""},set:function set(e){this._lang=e}},condition:t.enumSub(r.Namespace.SASL,s),$text:{get:function get(){return t.getSubLangText(this.xml,r.Namespace.SASL,"text",this.lang)}},text:{get:function get(){var e=this.$text;return e[this.lang]||""},set:function set(e){t.setSubLangText(this.xml,r.Namespace.SASL,"text",e,this.lang)}}}}),e.extendStreamFeatures(n)},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/session.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.define({name:"session",namespace:r.Namespace.SESSION,element:"session",fields:{required:e.utils.boolSub(r.Namespace.SESSION,"required"),optional:e.utils.boolSub(r.Namespace.SESSION,"optional")}});e.extendIQ(t),e.extendStreamFeatures(t)},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/shim.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.utils,n={get:function get(){var e=t.find(this.xml,r.Namespace.SHIM,"headers");return e.length?t.getMultiSubText(e[0],r.Namespace.SHIM,"header",function(e){var n=t.getAttribute(e,"name");if(n)return{name:n,value:t.getText(e)}}):[]},set:function set(n){var s=t.findOrCreate(this.xml,r.Namespace.SHIM,"headers");e.setMultiSubText(s,r.Namespace.SHIM,"header",n,function(e){var n=t.createElement(r.Namespace.SHIM,"header",r.Namespace.SHIM);t.setAttribute(n,"name",e.name),t.setText(n,e.value),s.appendChild(n)})}};e.withMessage(function(t){e.add(t,"headers",n)}),e.withPresence(function(t){e.add(t,"headers",n)})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/sm.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.utils,n=e.define({name:"streamManagement",namespace:r.Namespace.SMACKS_3,element:"sm"});e.define({name:"smEnable",eventName:"stream:management:enable",namespace:r.Namespace.SMACKS_3,element:"enable",topLevel:!0,fields:{resume:t.boolAttribute("resume")}}),e.define({name:"smEnabled",eventName:"stream:management:enabled",namespace:r.Namespace.SMACKS_3,element:"enabled",topLevel:!0,fields:{id:t.attribute("id"),resume:t.boolAttribute("resume")}}),e.define({name:"smResume",eventName:"stream:management:resume",namespace:r.Namespace.SMACKS_3,element:"resume",topLevel:!0,fields:{h:t.numberAttribute("h",!1,0),previd:t.attribute("previd")}}),e.define({name:"smResumed",eventName:"stream:management:resumed",namespace:r.Namespace.SMACKS_3,element:"resumed",topLevel:!0,fields:{h:t.numberAttribute("h",!1,0),previd:t.attribute("previd")}}),e.define({name:"smFailed",eventName:"stream:management:failed",namespace:r.Namespace.SMACKS_3,element:"failed",topLevel:!0}),e.define({name:"smAck",eventName:"stream:management:ack",namespace:r.Namespace.SMACKS_3,element:"a",topLevel:!0,fields:{h:t.numberAttribute("h",!1,0)}}),e.define({name:"smRequest",eventName:"stream:management:request",namespace:r.Namespace.SMACKS_3,element:"r",topLevel:!0}),e.extendStreamFeatures(n)},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/stream.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.utils;e.define({name:"stream",namespace:r.Namespace.STREAM,element:"stream",fields:{lang:t.langAttribute(),id:t.attribute("id"),version:t.attribute("version","1.0"),to:t.jidAttribute("to",!0),from:t.jidAttribute("from",!0)}})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/streamError.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants"),s=["bad-format","bad-namespace-prefix","conflict","connection-timeout","host-gone","host-unknown","improper-addressing","internal-server-error","invalid-from","invalid-namespace","invalid-xml","not-authorized","not-well-formed","policy-violation","remote-connection-failed","reset","resource-constraint","restricted-xml","see-other-host","system-shutdown","undefined-condition","unsupported-encoding","unsupported-feature","unsupported-stanza-type","unsupported-version"];n.default=function(e){var t=e.utils;e.define({name:"streamError",namespace:r.Namespace.STREAM,element:"error",topLevel:!0,fields:{lang:{get:function get(){return this._lang||""},set:function set(e){this._lang=e}},condition:t.enumSub(r.Namespace.STREAM_ERROR,s),seeOtherHost:{get:function get(){return t.getSubText(this.xml,r.Namespace.STREAM_ERROR,"see-other-host")},set:function set(e){this.condition="see-other-host",t.setSubText(this.xml,r.Namespace.STREAM_ERROR,"see-other-host",e)}},$text:{get:function get(){return t.getSubLangText(this.xml,r.Namespace.STREAM_ERROR,"text",this.lang)}},text:{get:function get(){var e=this.$text;return e[this.lang]||""},set:function set(e){t.setSubLangText(this.xml,r.Namespace.STREAM_ERROR,"text",e,this.lang)}}}})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/streamFeatures.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=(e.define({name:"streamFeatures",namespace:r.Namespace.STREAM,element:"features",topLevel:!0}),e.define({name:"rosterVersioning",namespace:r.Namespace.ROSTER_VERSIONING,element:"ver"})),n=e.define({name:"subscriptionPreApproval",namespace:r.Namespace.SUBSCRIPTION_PREAPPROVAL,element:"sub"});e.extendStreamFeatures(t),e.extendStreamFeatures(n)},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/time.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.define({name:"time",namespace:r.Namespace.TIME,element:"time",fields:{utc:e.utils.dateSub(r.Namespace.TIME,"utc"),tzo:e.utils.tzoSub(r.Namespace.TIME,"tzo",0)}});e.extendIQ(t)},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/tune.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.utils,n=e.define({name:"tune",namespace:r.Namespace.TUNE,element:"tune",fields:{artist:t.textSub(r.Namespace.TUNE,"artist"),length:t.numberSub(r.Namespace.TUNE,"length"),rating:t.numberSub(r.Namespace.TUNE,"rating"),source:t.textSub(r.Namespace.TUNE,"source"),title:t.textSub(r.Namespace.TUNE,"title"),track:t.textSub(r.Namespace.TUNE,"track"),uri:t.textSub(r.Namespace.TUNE,"uri")}});e.extendPubsubItem(n),e.extendMessage(n)},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/vcard.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.utils,n=e.define({name:"vCardTemp",namespace:r.Namespace.VCARD_TEMP,element:"vCard",fields:{role:t.textSub(r.Namespace.VCARD_TEMP,"ROLE"),website:t.textSub(r.Namespace.VCARD_TEMP,"URL"),
  title:t.textSub(r.Namespace.VCARD_TEMP,"TITLE"),description:t.textSub(r.Namespace.VCARD_TEMP,"DESC"),fullName:t.textSub(r.Namespace.VCARD_TEMP,"FN"),birthday:t.dateSub(r.Namespace.VCARD_TEMP,"BDAY"),nicknames:t.multiTextSub(r.Namespace.VCARD_TEMP,"NICKNAME"),jids:t.multiTextSub(r.Namespace.VCARD_TEMP,"JABBERID")}}),s=e.define({name:"_email",namespace:r.Namespace.VCARD_TEMP,element:"EMAIL",fields:{email:t.textSub(r.Namespace.VCARD_TEMP,"USERID"),home:t.boolSub(r.Namespace.VCARD_TEMP,"HOME"),work:t.boolSub(r.Namespace.VCARD_TEMP,"WORK"),preferred:t.boolSub(r.Namespace.VCARD_TEMP,"PREF")}}),i=e.define({name:"_tel",namespace:r.Namespace.VCARD_TEMP,element:"TEL",fields:{number:t.textSub(r.Namespace.VCARD_TEMP,"NUMBER"),home:t.boolSub(r.Namespace.VCARD_TEMP,"HOME"),work:t.boolSub(r.Namespace.VCARD_TEMP,"WORK"),mobile:t.boolSub(r.Namespace.VCARD_TEMP,"CELL"),preferred:t.boolSub(r.Namespace.VCARD_TEMP,"PREF")}}),o=e.define({name:"_address",namespace:r.Namespace.VCARD_TEMP,element:"ADR",fields:{street:t.textSub(r.Namespace.VCARD_TEMP,"STREET"),street2:t.textSub(r.Namespace.VCARD_TEMP,"EXTADD"),country:t.textSub(r.Namespace.VCARD_TEMP,"CTRY"),city:t.textSub(r.Namespace.VCARD_TEMP,"LOCALITY"),region:t.textSub(r.Namespace.VCARD_TEMP,"REGION"),postalCode:t.textSub(r.Namespace.VCARD_TEMP,"PCODE"),pobox:t.textSub(r.Namespace.VCARD_TEMP,"POBOX"),home:t.boolSub(r.Namespace.VCARD_TEMP,"HOME"),work:t.boolSub(r.Namespace.VCARD_TEMP,"WORK"),preferred:t.boolSub(r.Namespace.VCARD_TEMP,"PREF")}}),a=e.define({name:"organization",namespace:r.Namespace.VCARD_TEMP,element:"ORG",fields:{name:t.textSub(r.Namespace.VCARD_TEMP,"ORGNAME"),unit:t.textSub(r.Namespace.VCARD_TEMP,"ORGUNIT")}}),c=e.define({name:"name",namespace:r.Namespace.VCARD_TEMP,element:"N",fields:{family:t.textSub(r.Namespace.VCARD_TEMP,"FAMILY"),given:t.textSub(r.Namespace.VCARD_TEMP,"GIVEN"),middle:t.textSub(r.Namespace.VCARD_TEMP,"MIDDLE"),prefix:t.textSub(r.Namespace.VCARD_TEMP,"PREFIX"),suffix:t.textSub(r.Namespace.VCARD_TEMP,"SUFFIX")}}),u=e.define({name:"photo",namespace:r.Namespace.VCARD_TEMP,element:"PHOTO",fields:{type:t.textSub(r.Namespace.VCARD_TEMP,"TYPE"),data:t.textSub(r.Namespace.VCARD_TEMP,"BINVAL"),url:t.textSub(r.Namespace.VCARD_TEMP,"EXTVAL")}});e.extend(n,s,"emails"),e.extend(n,o,"addresses"),e.extend(n,i,"phoneNumbers"),e.extend(n,a),e.extend(n,c),e.extend(n,u),e.extendIQ(n)},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/version.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){var t=e.define({name:"version",namespace:r.Namespace.VERSION,element:"query",fields:{name:e.utils.textSub(r.Namespace.VERSION,"name"),version:e.utils.textSub(r.Namespace.VERSION,"version"),os:e.utils.textSub(r.Namespace.VERSION,"os")}});e.extendIQ(t)},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt-xmpp/lib/visibility.js":[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("xmpp-constants");n.default=function(e){e.withIQ(function(t){e.add(t,"visible",e.utils.boolSub(r.Namespace.INVISIBLE_0,"visible")),e.add(t,"invisible",e.utils.boolSub(r.Namespace.INVISIBLE_0,"invisible"))})},t.exports=n.default},{"xmpp-constants":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt/index.js":[function(e,t,n){"use strict";function JXT(){this._LOOKUP={},this._LOOKUP_EXT={},this._TAGS={},this._CB_DEFINITION={},this._CB_TAG={},this._ID=s.v4(),this.utils=r({},i,o)}var r=e("lodash.assign"),s=e("uuid"),i=e("./lib/types"),o=e("./lib/helpers"),a=e("./lib/stanza");JXT.prototype.use=function(e){return e["__JXT_LOADED_"+this._ID]||e(this),e["__JXT_LOADED_"+this._ID]=!0,this},JXT.prototype.getDefinition=function(e,t,n){var r=this._LOOKUP[t+"|"+e];if(n&&!r)throw new Error("Could not find definition for <"+e+' xmlns="'+t+'" />');return r},JXT.prototype.getExtensions=function(e,t){return this._LOOKUP_EXT[t+"|"+e]||{}},JXT.prototype.withDefinition=function(e,t,n){var r=t+"|"+e;this._CB_DEFINITION[r]||(this._CB_DEFINITION[r]=[]),this._CB_DEFINITION[r].push(n),this._LOOKUP[r]&&n(this._LOOKUP[r])},JXT.prototype.withTag=function(e,t){this._CB_TAG[e]||(this._CB_TAG[e]=[]),this._CB_TAG[e].push(t),this.tagged(e).forEach(function(e){t(e)})},JXT.prototype.tagged=function(e){return this._TAGS[e]||[]},JXT.prototype.build=function(e){var t=this.getDefinition(e.localName,e.namespaceURI);if(t)return new t(null,e)},JXT.prototype.parse=function(e){var t=o.parse(e);if(t)return this.build(t)},JXT.prototype.extend=function(e,t,n,r){var s=e.prototype._NS+"|"+e.prototype._EL,o=t.prototype._name,a=t.prototype._NS+"|"+t.prototype._EL;this._LOOKUP[a]=t,this._LOOKUP_EXT[a]||(this._LOOKUP_EXT[a]={}),this._LOOKUP_EXT[s]||(this._LOOKUP_EXT[s]={}),this._LOOKUP_EXT[s][o]=t,(!n||n&&!r)&&this.add(e,o,i.extension(t)),n&&this.add(e,n,i.multiExtension(t))},JXT.prototype.add=function(e,t,n){n.enumerable=!0,Object.defineProperty(e.prototype,t,n)},JXT.prototype.define=function(e){var t=this,n=a(this,e),r=n.prototype._NS,s=n.prototype._EL,i=n.prototype._TAGS,o=r+"|"+s;this._LOOKUP[o]=n,i.forEach(function(e){t._TAGS[e]||(t._TAGS[e]=[]),t._TAGS[e].push(n)});var c=Object.keys(e.fields||{});return c.forEach(function(r){t.add(n,r,e.fields[r])}),this._CB_DEFINITION[o]&&this._CB_DEFINITION[o].forEach(function(e){e(n)}),i.forEach(function(e){t._CB_TAG[e]&&t._CB_TAG[e].forEach(function(e){e(n)})}),n},JXT.createRegistry=function(){return new JXT},r(JXT,o),r(JXT,i);var c=new JXT;JXT.define=c.define.bind(c),JXT.extend=c.extend.bind(c),JXT.add=c.add.bind(c),JXT.parse=c.parse.bind(c),JXT.build=c.build.bind(c),JXT.getExtensions=c.getExtensions.bind(c),JXT.getDefinition=c.getDefinition.bind(c),JXT.withDefinition=c.withDefinition.bind(c),JXT.withTag=c.withTag.bind(c),JXT.tagged=c.tagged.bind(c),JXT.getGlobalJXT=function(){return c},t.exports=JXT},{"./lib/helpers":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt/lib/helpers.js","./lib/stanza":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt/lib/stanza.js","./lib/types":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt/lib/types.js","lodash.assign":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.assign/index.js",uuid:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/uuid/uuid.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt/lib/helpers.js":[function(e,t,n){"use strict";var r=e("ltx"),s=e("ltx/lib/DOMElement"),i=n.XML_NS="http://www.w3.org/XML/1998/namespace";n.parse=function(e){var t=r.parse(e,{Element:s});if(1===t.nodeType)return t},n.createElement=function(e,t,r){var i=new s(t);return r&&r===e||n.setAttribute(i,"xmlns",e),i};var o=n.find=function(e,t,n){for(var r=[],s=e.getElementsByTagName(n),i=0,o=s.length;i<o;i++){var a=s[i];a.namespaceURI===t&&a.parentNode===e&&r.push(a)}return r};n.findOrCreate=function(e,t,r){var s=n.find(e,t,r);if(s.length)return s[0];var i=n.createElement(t,r,e.namespaceURI);return e.appendChild(i),i},n.getAttribute=function(e,t,n){return e.getAttribute(t)||n||""},n.getAttributeNS=function(e,t,n,r){return e.getAttributeNS(t,n)||r||""},n.setAttribute=function(e,t,n,r){n||r?e.setAttribute(t,n):e.removeAttribute(t)},n.setAttributeNS=function(e,t,n,r,s){r||s?e.setAttributeNS(t,n,r):e.removeAttributeNS(t,n)},n.getBoolAttribute=function(e,t,n){var r=e.getAttribute(t)||n||"";return"true"===r||"1"===r},n.setBoolAttribute=function(e,t,n){n?e.setAttribute(t,"1"):e.removeAttribute(t)},n.getSubAttribute=function(e,t,n,r,s){var i=o(e,t,n);if(!i)return"";for(var a=0;a<i.length;a++)return i[a].getAttribute(r)||s||"";return""},n.setSubAttribute=function(e,t,r,s,i){var a=o(e,t,r);if(a.length)for(var c=0;c<a.length;c++){if(i)return void a[c].setAttribute(s,i);a[c].removeAttribute(s)}else i&&(r=n.createElement(t,r,e.namespaceURI),r.setAttribute(s,i),e.appendChild(r))},n.getBoolSubAttribute=function(e,t,n,r,s){var i=e.getSubAttribute(t,n,r)||s||"";return"true"===i||"1"===i},n.setBoolSubAttribute=function(e,t,r,s,i){i=i?"1":"",n.setSubAttribute(e,t,r,s,i)},n.getText=function(e){return e.textContent},n.setText=function(e,t){e.textContent=t},n.getSubText=n.getTextSub=function(e,t,n,r){var s=o(e,t,n);return r=r||"",s.length?s[0].textContent||r:r},n.setSubText=n.setTextSub=function(e,t,r,s){var i=o(e,t,r);if(i.length)for(var a=0;a<i.length;a++)e.removeChild(i[a]);if(s){var c=n.createElement(t,r,e.namespaceURI);s!==!0&&(c.textContent=s),e.appendChild(c)}},n.getMultiSubText=function(e,t,n,r){var s=o(e,t,n),i=[];r=r||function(e){return e.textContent||""};for(var a=0;a<s.length;a++)i.push(r(s[a]));return i},n.setMultiSubText=function(e,t,r,s,i){var a=o(e,t,r),c=[];i=i||function(s){if(s){var i=n.createElement(t,r,e.namespaceURI);i.textContent=s,e.appendChild(i)}},c="string"==typeof s?(s||"").split("\n"):s;var u,d;for(u=0,d=a.length;u<d;u++)e.removeChild(a[u]);for(u=0,d=c.length;u<d;u++)i(c[u])},n.getMultiSubAttribute=function(e,t,r,s){return n.getMultiSubText(e,t,r,function(e){return n.getAttribute(e,s)})},n.setMultiSubAttribute=function(e,t,r,s,i){n.setMultiSubText(e,t,r,i,function(i){var o=n.createElement(t,r,e.namespaceURI);n.setAttribute(o,s,i),e.appendChild(o)})},n.getSubLangText=function(e,t,n,r){var s=o(e,t,n);if(!s.length)return{};for(var a,c,u={},d=[],l=0;l<s.length;l++)c=s[l],a=c.getAttributeNS(i,"lang")||r,d.push(a),u[a]=c.textContent||"";return u},n.setSubLangText=function(e,t,r,s,a){var c,u,d=o(e,t,r);if(d.length)for(var l=0;l<d.length;l++)e.removeChild(d[l]);if("string"==typeof s)c=n.createElement(t,r,e.namespaceURI),c.textContent=s,e.appendChild(c);else if("object"==typeof s)for(u in s)s.hasOwnProperty(u)&&(c=n.createElement(t,r,e.namespaceURI),u!==a&&c.setAttributeNS(i,"lang",u),c.textContent=s[u],e.appendChild(c))},n.getBoolSub=function(e,t,n){var r=o(e,t,n);return!!r.length},n.setBoolSub=function(e,t,r,s){var i=o(e,t,r);if(i.length)for(var a=0;a<i.length;a++){if(s)return;e.removeChild(i[a])}else if(s){var c=n.createElement(t,r,e.namespaceURI);e.appendChild(c)}}},{ltx:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/index.js","ltx/lib/DOMElement":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/DOMElement.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt/lib/stanza.js":[function(e,t,n){"use strict";var r=e("./helpers"),s=e("lodash.assign"),i={constructor:!0,parent:!0,prototype:!0,toJSON:!0,toString:!0,xml:!0};t.exports=function(e,t){function Stanza(n,i,o){var a=this,c=(i||{}).parentNode||(o||{}).xml,u=(c||{}).namespaceURI;a.xml=i||r.createElement(a._NS,a._EL,u),Object.keys(a._PREFIXES).forEach(function(e){var t=a._PREFIXES[e];a.xml.setAttribute("xmlns:"+e,t)}),a._extensions={};for(var d=0,l=a.xml.childNodes.length;d<l;d++){var p=a.xml.childNodes[d],f=e.getDefinition(p.localName,p.namespaceURI);if(void 0!==f){var m=f.prototype._name;a._extensions[m]=new f(null,p),a._extensions[m].parent=a}}return s(a,n),t.init&&t.init.apply(a,[n]),a}return Stanza.prototype._isJXT=!0,Stanza.prototype._name=t.name,Stanza.prototype._eventname=t.eventName,Stanza.prototype._NS=t.namespace,Stanza.prototype._EL=t.element||t.name,Stanza.prototype._PREFIXES=t.prefixes||{},Stanza.prototype._TAGS=t.tags||[],Stanza.prototype.toString=function(){return this.xml.toString()},Stanza.prototype.toJSON=function(){var t,n={};for(t in this._extensions)this._extensions[t].toJSON&&"_"!==t[0]&&(n[t]=this._extensions[t].toJSON());for(t in this){var r=!i[t]&&"_"!==t[0],s=e.getExtensions(this._EL,this._NS)[t];if(r&&!s){var o=this[t];if("function"==typeof o)continue;var a=Object.prototype.toString.call(o);if(a.indexOf("Object")>=0)Object.keys(o).length>0&&(o._isJXT?n[t]=o.toJSON():n[t]=o);else if(a.indexOf("Array")>=0){if(o.length>0){for(var c=[],u=o.length,d=0;d<u;d++){var l=o[d];"undefined"!=typeof l&&(l._isJXT?c.push(l.toJSON()):c.push(l))}n[t]=c}}else void 0!==o&&o!==!1&&""!==o&&(n[t]=o)}}return n},Stanza}},{"./helpers":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt/lib/helpers.js","lodash.assign":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.assign/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt/lib/types.js":[function(e,t,n){(function(t){"use strict";var r=e("./helpers"),s=e("lodash.assign"),i=r.find,o=r.createElement,a=n.field=function(e,t){return function(){var n=Array.prototype.slice.call(arguments);return{get:function(){return e.apply(null,[this.xml].concat(n))},set:function(e){t.apply(null,[this.xml].concat(n).concat([e]))}}}};n.boolAttribute=a(r.getBoolAttribute,r.setBoolAttribute),n.subAttribute=a(r.getSubAttribute,r.setSubAttribute),n.boolSubAttribute=a(r.getSubBoolAttribute,r.setSubBoolAttribute),n.text=a(r.getText,r.setText),n.textSub=n.subText=a(r.getSubText,r.setSubText),n.multiTextSub=n.multiSubText=a(r.getMultiSubText,r.setMultiSubText),n.multiSubAttribute=a(r.getMultiSubAttribute,r.setMultiSubAttribute),n.langTextSub=n.subLangText=a(r.getSubLangText,r.setSubLangText),n.boolSub=a(r.getBoolSub,r.setBoolSub),n.langAttribute=a(function(e){return e.getAttributeNS(r.XML_NS,"lang")||""},function(e,t){e.setAttributeNS(r.XML_NS,"lang",t)}),n.b64Text=a(function(e){return e.textContent&&"="!==e.textContent?new t(e.textContent,"base64"):""},function(e,n){if("string"==typeof n){var r=new t(n).toString("base64");e.textContent=r||"="}else e.textContent=""}),n.dateAttribute=function(e,t){return{get:function(){var n=r.getAttribute(this.xml,e);return n?new Date(n):t?new Date(Date.now()):void 0},set:function(t){t&&("string"!=typeof t&&(t=t.toISOString()),r.setAttribute(this.xml,e,t))}}},n.dateSub=function(e,t,n){return{get:function(){var s=r.getSubText(this.xml,e,t);return s?new Date(s):n?new Date(Date.now()):void 0},set:function(n){n&&("string"!=typeof n&&(n=n.toISOString()),r.setSubText(this.xml,e,t,n))}}},n.dateSubAttribute=function(e,t,n,s){return{get:function(){var i=r.getSubAttribute(this.xml,e,t,n);return i?new Date(i):s?new Date(Date.now()):void 0},set:function(s){s&&("string"!=typeof s&&(s=s.toISOString()),r.setSubAttribute(this.xml,e,t,n,s))}}},n.numberAttribute=function(e,t,n){return{get:function(){var s=t?parseFloat:parseInt,i=r.getAttribute(this.xml,e,"");if(!i)return n;var o=s(i,10);return isNaN(o)?n:o},set:function(t){r.setAttribute(this.xml,e,t.toString())}}},n.numberSub=function(e,t,n,s){return{get:function(){var i=n?parseFloat:parseInt,o=r.getSubText(this.xml,e,t,"");if(!o)return s;var a=i(o,10);return isNaN(a)?s:a},set:function(n){r.setSubText(this.xml,e,t,n.toString())}}},n.attribute=function(e,t){return{get:function(){return r.getAttribute(this.xml,e,t)},set:function(t){r.setAttribute(this.xml,e,t)}}},n.attributeNS=function(e,t,n){return{get:function(){return r.getAttributeNS(this.xml,e,t,n)},set:function(n){r.setAttributeNS(this.xml,e,t,n)}}},n.extension=function(e){return{get:function(){var t=this,n=e.prototype._name;if(!this._extensions[n]){var r=i(this.xml,e.prototype._NS,e.prototype._EL);r.length?this._extensions[n]=new e(null,r[0],t):(this._extensions[n]=new e({},null,t),this.xml.appendChild(this._extensions[n].xml)),this._extensions[n].parent=this}return this._extensions[n]},set:function(t){if(t){var n=this[e.prototype._name];t===!0&&(t={}),s(n,t)}}}},n.multiExtension=function(e){return{get:function(){for(var t=this,n=i(this.xml,e.prototype._NS,e.prototype._EL),r=[],s=0,o=n.length;s<o;s++)r.push(new e({},n[s],t));return r},set:function(t){t=t||[];var n,r,s=this,o=i(this.xml,e.prototype._NS,e.prototype._EL);for(n=0,r=o.length;n<r;n++)s.xml.removeChild(o[n]);for(n=0,r=t.length;n<r;n++){var a=new e(t[n],null,s);s.xml.appendChild(a.xml)}}}},n.enumSub=function(e,t){return{get:function(){var n=this,r=[];return t.forEach(function(t){var s=i(n.xml,e,t);s.length&&r.push(s[0].nodeName)}),r[0]||""},set:function(n){var r=this,s=!1;if(t.forEach(function(t){var o=i(r.xml,e,t);o.length&&(t===n?s=!0:r.xml.removeChild(o[0]))}),n&&!s){var a=o(e,n);this.xml.appendChild(a)}}}},n.subExtension=function(e,t,n,r){return{get:function(){if(!this._extensions[e]){var s=i(this.xml,t,n);s.length?s=s[0]:(s=o(t,n,this._NS),this.xml.appendChild(s));var a=i(s,r.prototype._NS,r.prototype._EL);a.length?this._extensions[e]=new r(null,a[0],{xml:s}):(this._extensions[e]=new r({},null,{xml:s}),s.appendChild(this._extensions[e].xml)),this._extensions[e].parent=this}return this._extensions[e]},set:function(r){var o=i(this.xml,t,n);if(o.length&&!r&&this.xml.removeChild(o[0]),r){var a=this[e];r===!0&&(r={}),s(a,r)}}}},n.subMultiExtension=function(e,t,n){return{get:function(){var r=this,s=[],o=i(this.xml,e,t);if(!o.length)return s;o=o[0];var a=i(o,n.prototype._NS,n.prototype._EL);return a.forEach(function(e){s.push(new n({},e,r))}),s},set:function(r){var s=this,a=i(this.xml,e,t);a.length&&s.xml.removeChild(a[0]),r.length&&(a=o(e,t,this._NS),r.forEach(function(e){var t=new n(e,null,s);a.appendChild(t.xml)}),s.xml.appendChild(a))}}}}).call(this,e("buffer").Buffer)},{"./helpers":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/jxt/lib/helpers.js",buffer:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/index.js","lodash.assign":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.assign/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._arrayeach/index.js":[function(e,t,n){function arrayEach(e,t){for(var n=-1,r=e.length;++n<r&&t(e[n],n,e)!==!1;);return e}t.exports=arrayEach},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._arrayfilter/index.js":[function(e,t,n){function arrayFilter(e,t){for(var n=-1,r=e.length,s=-1,i=[];++n<r;){var o=e[n];t(o,n,e)&&(i[++s]=o)}return i}t.exports=arrayFilter},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._baseassign/index.js":[function(e,t,n){function baseAssign(e,t){return null==t?e:r(t,s(t),e)}var r=e("lodash._basecopy"),s=e("lodash.keys");t.exports=baseAssign},{"lodash._basecopy":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._basecopy/index.js","lodash.keys":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.keys/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._basecallback/index.js":[function(e,t,n){function baseToString(e){return null==e?"":e+""}function baseCallback(e,t,n){var r=typeof e;return"function"==r?void 0===t?e:s(e,t,n):null==e?identity:"object"==r?baseMatches(e):void 0===t?property(e):baseMatchesProperty(e,t)}function baseGet(e,t,n){if(null!=e){void 0!==n&&n in toObject(e)&&(t=[n]);for(var r=0,s=t.length;null!=e&&r<s;)e=e[t[r++]];return r&&r==s?e:void 0}}function baseIsMatch(e,t,n){var s=t.length,i=s,o=!n;if(null==e)return!i;for(e=toObject(e);s--;){var a=t[s];if(o&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++s<i;){a=t[s];var c=a[0],u=e[c],d=a[1];if(o&&a[2]){if(void 0===u&&!(c in e))return!1}else{var l=n?n(u,d,c):void 0;if(!(void 0===l?r(d,u,n,!0):l))return!1}}return!0}function baseMatches(e){var t=getMatchData(e);if(1==t.length&&t[0][2]){var n=t[0][0],r=t[0][1];return function(e){return null!=e&&(e[n]===r&&(void 0!==r||n in toObject(e)))}}return function(e){return baseIsMatch(e,t)}}function baseMatchesProperty(e,t){var n=i(e),s=isKey(e)&&isStrictComparable(t),o=e+"";return e=toPath(e),function(i){if(null==i)return!1;var a=o;if(i=toObject(i),(n||!s)&&!(a in i)){if(i=1==e.length?i:baseGet(i,baseSlice(e,0,-1)),null==i)return!1;a=last(e),i=toObject(i)}return i[a]===t?void 0!==t||a in i:r(t,i[a],void 0,!0)}}function baseProperty(e){return function(t){return null==t?void 0:t[e]}}function basePropertyDeep(e){var t=e+"";return e=toPath(e),function(n){return baseGet(n,e,t)}}function baseSlice(e,t,n){var r=-1,s=e.length;t=null==t?0:+t||0,t<0&&(t=-t>s?0:s+t),n=void 0===n||n>s?s:+n||0,n<0&&(n+=s),s=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(s);++r<s;)i[r]=e[r+t];return i}function getMatchData(e){for(var t=o(e),n=t.length;n--;)t[n][2]=isStrictComparable(t[n][1]);return t}function isKey(e,t){var n=typeof e;if("string"==n&&c.test(e)||"number"==n)return!0;if(i(e))return!1;var r=!a.test(e);return r||null!=t&&e in toObject(t)}function isStrictComparable(e){return e===e&&!isObject(e)}function toObject(e){return isObject(e)?e:Object(e)}function toPath(e){if(i(e))return e;var t=[];return baseToString(e).replace(u,function(e,n,r,s){t.push(r?s.replace(d,"$1"):n||e)}),t}function last(e){var t=e?e.length:0;return t?e[t-1]:void 0}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function identity(e){return e}function property(e){return isKey(e)?baseProperty(e):basePropertyDeep(e)}var r=e("lodash._baseisequal"),s=e("lodash._bindcallback"),i=e("lodash.isarray"),o=e("lodash.pairs"),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,c=/^\w*$/,u=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,d=/\\(\\)?/g;t.exports=baseCallback},{"lodash._baseisequal":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._baseisequal/index.js","lodash._bindcallback":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._bindcallback/index.js","lodash.isarray":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.isarray/index.js","lodash.pairs":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.pairs/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._basecopy/index.js":[function(e,t,n){function baseCopy(e,t,n){n||(n={});for(var r=-1,s=t.length;++r<s;){var i=t[r];n[i]=e[i]}return n}t.exports=baseCopy},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._baseeach/index.js":[function(e,t,n){function baseForOwn(e,t){return o(e,t,r)}function baseProperty(e){return function(t){return null==t?void 0:t[e]}}function createBaseEach(e,t){return function(n,r){var s=n?a(n):0;if(!isLength(s))return e(n,r);for(var i=t?s:-1,o=toObject(n);(t?i--:++i<s)&&r(o[i],i,o)!==!1;);return n}}function createBaseFor(e){return function(t,n,r){for(var s=toObject(t),i=r(t),o=i.length,a=e?o:-1;e?a--:++a<o;){var c=i[a];if(n(s[c],c,s)===!1)break}return t}}function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}function toObject(e){return isObject(e)?e:Object(e)}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var r=e("lodash.keys"),s=9007199254740991,i=createBaseEach(baseForOwn),o=createBaseFor(),a=baseProperty("length");t.exports=i},{"lodash.keys":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.keys/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._basefilter/index.js":[function(e,t,n){function baseFilter(e,t){var n=[];return r(e,function(e,r,s){t(e,r,s)&&n.push(e)}),n}var r=e("lodash._baseeach");t.exports=baseFilter},{"lodash._baseeach":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._baseeach/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._baseindexof/index.js":[function(e,t,n){function baseIndexOf(e,t,n){if(t!==t)return indexOfNaN(e,n);for(var r=n-1,s=e.length;++r<s;)if(e[r]===t)return r;return-1}function indexOfNaN(e,t,n){for(var r=e.length,s=t+(n?0:-1);n?s--:++s<r;){var i=e[s];if(i!==i)return s}return-1}t.exports=baseIndexOf},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._baseisequal/index.js":[function(e,t,n){function isObjectLike(e){return!!e&&"object"==typeof e}function arraySome(e,t){for(var n=-1,r=e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function baseIsEqual(e,t,n,r,s,i){return e===t||(null==e||null==t||!isObject(e)&&!isObjectLike(t)?e!==e&&t!==t:baseIsEqualDeep(e,t,baseIsEqual,n,r,s,i))}function baseIsEqualDeep(e,t,n,i,c,u,d){var l=r(e),f=r(t),m=a,h=a;l||(m=b.call(e),m==o?m=p:m!=p&&(l=s(e))),f||(h=b.call(t),h==o?h=p:h!=p&&(f=s(t)));var v=m==p,j=h==p,_=m==h;if(_&&!l&&!v)return equalByTag(e,t,m);if(!c){var x=v&&g.call(e,"__wrapped__"),y=j&&g.call(t,"__wrapped__");if(x||y)return n(x?e.value():e,y?t.value():t,i,c,u,d)}if(!_)return!1;u||(u=[]),d||(d=[]);for(var S=u.length;S--;)if(u[S]==e)return d[S]==t;u.push(e),d.push(t);var w=(l?equalArrays:equalObjects)(e,t,n,i,c,u,d);return u.pop(),d.pop(),w}function equalArrays(e,t,n,r,s,i,o){var a=-1,c=e.length,u=t.length;if(c!=u&&!(s&&u>c))return!1;for(;++a<c;){var d=e[a],l=t[a],p=r?r(s?l:d,s?d:l,a):void 0;if(void 0!==p){if(p)continue;return!1}if(s){if(!arraySome(t,function(e){return d===e||n(d,e,r,s,i,o)}))return!1}else if(d!==l&&!n(d,l,r,s,i,o))return!1}return!0}function equalByTag(e,t,n){switch(n){case c:case u:return+e==+t;case d:return e.name==t.name&&e.message==t.message;case l:return e!=+e?t!=+t:e==+t;case f:case m:return e==t+""}return!1}function equalObjects(e,t,n,r,s,o,a){var c=i(e),u=c.length,d=i(t),l=d.length;if(u!=l&&!s)return!1;for(var p=u;p--;){var f=c[p];if(!(s?f in t:g.call(t,f)))return!1}for(var m=s;++p<u;){f=c[p];var h=e[f],b=t[f],v=r?r(s?b:h,s?h:b,f):void 0;if(!(void 0===v?n(h,b,r,s,o,a):v))return!1;m||(m="constructor"==f)}if(!m){var j=e.constructor,_=t.constructor;if(j!=_&&"constructor"in e&&"constructor"in t&&!("function"==typeof j&&j instanceof j&&"function"==typeof _&&_ instanceof _))return!1}return!0}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var r=e("lodash.isarray"),s=e("lodash.istypedarray"),i=e("lodash.keys"),o="[object Arguments]",a="[object Array]",c="[object Boolean]",u="[object Date]",d="[object Error]",l="[object Number]",p="[object Object]",f="[object RegExp]",m="[object String]",h=Object.prototype,g=h.hasOwnProperty,b=h.toString;t.exports=baseIsEqual},{"lodash.isarray":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.isarray/index.js","lodash.istypedarray":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.istypedarray/index.js","lodash.keys":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.keys/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._baseuniq/index.js":[function(e,t,n){function baseUniq(e,t){var n=-1,a=r,c=e.length,u=!0,d=u&&c>=o,l=d?i():null,p=[];l?(a=s,u=!1):(d=!1,l=t?[]:p);e:for(;++n<c;){var f=e[n],m=t?t(f,n,e):f;if(u&&f===f){for(var h=l.length;h--;)if(l[h]===m)continue e;t&&l.push(m),p.push(f)}else a(l,m,0)<0&&((t||d)&&l.push(m),p.push(f))}return p}var r=e("lodash._baseindexof"),s=e("lodash._cacheindexof"),i=e("lodash._createcache"),o=200;t.exports=baseUniq},{"lodash._baseindexof":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._baseindexof/index.js","lodash._cacheindexof":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._cacheindexof/index.js","lodash._createcache":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._createcache/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._bindcallback/index.js":[function(e,t,n){function bindCallback(e,t,n){if("function"!=typeof e)return identity;if(void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,s){return e.call(t,n,r,s)};case 4:return function(n,r,s,i){return e.call(t,n,r,s,i)};case 5:return function(n,r,s,i,o){return e.call(t,n,r,s,i,o)}}return function(){return e.apply(t,arguments)}}function identity(e){return e}t.exports=bindCallback},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._cacheindexof/index.js":[function(e,t,n){function cacheIndexOf(e,t){var n=e.data,r="string"==typeof t||isObject(t)?n.set.has(t):n.hash[t];return r?0:-1}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}t.exports=cacheIndexOf},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._createassigner/index.js":[function(e,t,n){function createAssigner(e){return i(function(t,n){var i=-1,o=null==t?0:n.length,a=o>2?n[o-2]:void 0,c=o>2?n[2]:void 0,u=o>1?n[o-1]:void 0;for("function"==typeof a?(a=r(a,u,5),o-=2):(a="function"==typeof u?u:void 0,o-=a?1:0),c&&s(n[0],n[1],c)&&(a=o<3?void 0:a,o=1);++i<o;){var d=n[i];d&&e(t,d,a)}return t})}var r=e("lodash._bindcallback"),s=e("lodash._isiterateecall"),i=e("lodash.restparam");t.exports=createAssigner},{"lodash._bindcallback":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._bindcallback/index.js","lodash._isiterateecall":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._isiterateecall/index.js","lodash.restparam":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.restparam/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._createcache/index.js":[function(e,t,n){(function(n){function SetCache(e){var t=e?e.length:0;for(this.data={hash:i(null),set:new s};t--;)this.push(e[t])}function cachePush(e){var t=this.data;"string"==typeof e||isObject(e)?t.set.add(e):t.hash[e]=!0}function createCache(e){return i&&s?new SetCache(e):null}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var r=e("lodash._getnative"),s=r(n,"Set"),i=r(Object,"create");SetCache.prototype.push=cachePush,t.exports=createCache}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"lodash._getnative":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._getnative/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._getnative/index.js":[function(e,t,n){function isObjectLike(e){return!!e&&"object"==typeof e}function getNative(e,t){var n=null==e?void 0:e[t];return isNative(n)?n:void 0}function isFunction(e){return isObject(e)&&c.call(e)==r}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function isNative(e){return null!=e&&(isFunction(e)?u.test(o.call(e)):isObjectLike(e)&&s.test(e))}var r="[object Function]",s=/^\[object .+?Constructor\]$/,i=Object.prototype,o=Function.prototype.toString,a=i.hasOwnProperty,c=i.toString,u=RegExp("^"+o.call(a).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=getNative},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._isiterateecall/index.js":[function(e,t,n){function baseProperty(e){return function(t){return null==t?void 0:t[e]}}function isArrayLike(e){return null!=e&&isLength(i(e))}function isIndex(e,t){return e="number"==typeof e||r.test(e)?+e:-1,t=null==t?s:t,e>-1&&e%1==0&&e<t}function isIterateeCall(e,t,n){if(!isObject(n))return!1;var r=typeof t;if("number"==r?isArrayLike(n)&&isIndex(t,n.length):"string"==r&&t in n){var s=n[t];return e===e?e===s:s!==s}return!1}function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var r=/^\d+$/,s=9007199254740991,i=baseProperty("length");t.exports=isIterateeCall},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.assign/index.js":[function(e,t,n){function assignWith(e,t,n){for(var r=-1,s=i(t),o=s.length;++r<o;){var a=s[r],c=e[a],u=n(c,t[a],a,e,t);(u===u?u===c:c!==c)&&(void 0!==c||a in e)||(e[a]=u)}return e}var r=e("lodash._baseassign"),s=e("lodash._createassigner"),i=e("lodash.keys"),o=s(function(e,t,n){return n?assignWith(e,t,n):r(e,t)});t.exports=o},{"lodash._baseassign":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._baseassign/index.js","lodash._createassigner":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._createassigner/index.js","lodash.keys":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.keys/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.filter/index.js":[function(e,t,n){function filter(e,t,n){var a=o(e)?r:i;return t=s(t,n,3),a(e,t)}var r=e("lodash._arrayfilter"),s=e("lodash._basecallback"),i=e("lodash._basefilter"),o=e("lodash.isarray");t.exports=filter},{"lodash._arrayfilter":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._arrayfilter/index.js","lodash._basecallback":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._basecallback/index.js","lodash._basefilter":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._basefilter/index.js",
  "lodash.isarray":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.isarray/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.foreach/index.js":[function(e,t,n){function createForEach(e,t){return function(n,r,s){return"function"==typeof r&&void 0===s&&o(n)?e(n,r):t(n,i(r,s,3))}}var r=e("lodash._arrayeach"),s=e("lodash._baseeach"),i=e("lodash._bindcallback"),o=e("lodash.isarray"),a=createForEach(r,s);t.exports=a},{"lodash._arrayeach":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._arrayeach/index.js","lodash._baseeach":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._baseeach/index.js","lodash._bindcallback":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._bindcallback/index.js","lodash.isarray":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.isarray/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.isarguments/index.js":[function(e,t,n){function baseProperty(e){return function(t){return null==t?void 0:t[e]}}function isArguments(e){return isArrayLikeObject(e)&&c.call(e,"callee")&&(!d.call(e,"callee")||u.call(e)==s)}function isArrayLike(e){return null!=e&&isLength(l(e))&&!isFunction(e)}function isArrayLikeObject(e){return isObjectLike(e)&&isArrayLike(e)}function isFunction(e){var t=isObject(e)?u.call(e):"";return t==i||t==o}function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function isObjectLike(e){return!!e&&"object"==typeof e}var r=9007199254740991,s="[object Arguments]",i="[object Function]",o="[object GeneratorFunction]",a=Object.prototype,c=a.hasOwnProperty,u=a.toString,d=a.propertyIsEnumerable,l=baseProperty("length");t.exports=isArguments},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.isarray/index.js":[function(e,t,n){function isObjectLike(e){return!!e&&"object"==typeof e}function getNative(e,t){var n=null==e?void 0:e[t];return isNative(n)?n:void 0}function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=p}function isFunction(e){return isObject(e)&&u.call(e)==s}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function isNative(e){return null!=e&&(isFunction(e)?d.test(a.call(e)):isObjectLike(e)&&i.test(e))}var r="[object Array]",s="[object Function]",i=/^\[object .+?Constructor\]$/,o=Object.prototype,a=Function.prototype.toString,c=o.hasOwnProperty,u=o.toString,d=RegExp("^"+a.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),l=getNative(Array,"isArray"),p=9007199254740991,f=l||function(e){return isObjectLike(e)&&isLength(e.length)&&u.call(e)==r};t.exports=f},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.istypedarray/index.js":[function(e,t,n){function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}function isObjectLike(e){return!!e&&"object"==typeof e}function isTypedArray(e){return isObjectLike(e)&&isLength(e.length)&&!!U[T.call(e)]}var r=9007199254740991,s="[object Arguments]",i="[object Array]",o="[object Boolean]",a="[object Date]",c="[object Error]",u="[object Function]",d="[object Map]",l="[object Number]",p="[object Object]",f="[object RegExp]",m="[object Set]",h="[object String]",g="[object WeakMap]",b="[object ArrayBuffer]",v="[object DataView]",j="[object Float32Array]",_="[object Float64Array]",x="[object Int8Array]",y="[object Int16Array]",S="[object Int32Array]",w="[object Uint8Array]",z="[object Uint8ClampedArray]",P="[object Uint16Array]",E="[object Uint32Array]",U={};U[j]=U[_]=U[x]=U[y]=U[S]=U[w]=U[z]=U[P]=U[E]=!0,U[s]=U[i]=U[b]=U[o]=U[v]=U[a]=U[c]=U[u]=U[d]=U[l]=U[p]=U[f]=U[m]=U[h]=U[g]=!1;var C=Object.prototype,T=C.toString;t.exports=isTypedArray},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.keys/index.js":[function(e,t,n){function baseProperty(e){return function(t){return null==t?void 0:t[e]}}function isArrayLike(e){return null!=e&&isLength(l(e))}function isIndex(e,t){return e="number"==typeof e||o.test(e)?+e:-1,t=null==t?d:t,e>-1&&e%1==0&&e<t}function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=d}function shimKeys(e){for(var t=keysIn(e),n=t.length,r=n&&e.length,o=!!r&&isLength(r)&&(i(e)||s(e)),a=-1,u=[];++a<n;){var d=t[a];(o&&isIndex(d,r)||c.call(e,d))&&u.push(d)}return u}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function keysIn(e){if(null==e)return[];isObject(e)||(e=Object(e));var t=e.length;t=t&&isLength(t)&&(i(e)||s(e))&&t||0;for(var n=e.constructor,r=-1,o="function"==typeof n&&n.prototype===e,a=Array(t),u=t>0;++r<t;)a[r]=r+"";for(var d in e)u&&isIndex(d,t)||"constructor"==d&&(o||!c.call(e,d))||a.push(d);return a}var r=e("lodash._getnative"),s=e("lodash.isarguments"),i=e("lodash.isarray"),o=/^\d+$/,a=Object.prototype,c=a.hasOwnProperty,u=r(Object,"keys"),d=9007199254740991,l=baseProperty("length"),p=u?function(e){var t=null==e?void 0:e.constructor;return"function"==typeof t&&t.prototype===e||"function"!=typeof e&&isArrayLike(e)?shimKeys(e):isObject(e)?u(e):[]}:shimKeys;t.exports=p},{"lodash._getnative":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._getnative/index.js","lodash.isarguments":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.isarguments/index.js","lodash.isarray":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.isarray/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.pairs/index.js":[function(e,t,n){function toObject(e){return isObject(e)?e:Object(e)}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function pairs(e){e=toObject(e);for(var t=-1,n=r(e),s=n.length,i=Array(s);++t<s;){var o=n[t];i[t]=[o,e[o]]}return i}var r=e("lodash.keys");t.exports=pairs},{"lodash.keys":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.keys/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.restparam/index.js":[function(e,t,n){function restParam(e,t){if("function"!=typeof e)throw new TypeError(r);return t=s(void 0===t?e.length-1:+t||0,0),function(){for(var n=arguments,r=-1,i=s(n.length-t,0),o=Array(i);++r<i;)o[r]=n[t+r];switch(t){case 0:return e.call(this,o);case 1:return e.call(this,n[0],o);case 2:return e.call(this,n[0],n[1],o)}var a=Array(t+1);for(r=-1;++r<t;)a[r]=n[r];return a[t]=o,e.apply(this,a)}}var r="Expected a function",s=Math.max;t.exports=restParam},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash.uniq/index.js":[function(e,t,n){function sortedUniq(e,t){for(var n,r=-1,s=e.length,i=-1,o=[];++r<s;){var a=e[r],c=t?t(a,r,e):a;r&&n===c||(n=c,o[++i]=a)}return o}function uniq(e,t,n,o){var a=e?e.length:0;return a?(null!=t&&"boolean"!=typeof t&&(o=n,n=i(e,t,o)?void 0:t,t=!1),n=null==n?n:r(n,o,3),t?sortedUniq(e,n):s(e,n)):[]}var r=e("lodash._basecallback"),s=e("lodash._baseuniq"),i=e("lodash._isiterateecall");t.exports=uniq},{"lodash._basecallback":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._basecallback/index.js","lodash._baseuniq":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._baseuniq/index.js","lodash._isiterateecall":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/lodash._isiterateecall/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/index.js":[function(e,t,n){"use strict";var r=e("./lib/parse"),s=e("./lib/Parser"),i=e("./lib/escape"),o=e("./lib/Element"),a=e("./lib/equal"),c=e("./lib/createElement"),u=e("./lib/tag"),d=e("./lib/is");n=t.exports=u,n.Element=o,n.equal=a.equal,n.nameEqual=a.name,n.attrsEqual=a.attrs,n.childrenEqual=a.children,n.isNode=d.isNode,n.isElement=d.isElement,n.isText=d.isText,n.createElement=c,n.escapeXML=i.escapeXML,n.unescapeXML=i.unescapeXML,n.escapeXMLText=i.escapeXMLText,n.unescapeXMLText=i.unescapeXMLText,n.Parser=s,n.parse=r,n.tag=u},{"./lib/Element":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/Element.js","./lib/Parser":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/Parser.js","./lib/createElement":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/createElement.js","./lib/equal":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/equal.js","./lib/escape":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/escape.js","./lib/is":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/is.js","./lib/parse":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/parse.js","./lib/tag":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/tag.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/DOMElement.js":[function(e,t,n){"use strict";function DOMElement(e,t){s.call(this,e,t),this.nodeType=1,this.nodeName=this.localName}var r=e("inherits"),s=e("./Element");r(DOMElement,s),DOMElement.prototype._getElement=function(e,t){var n=new DOMElement(e,t);return n},Object.defineProperty(DOMElement.prototype,"localName",{get:function(){return this.getName()}}),Object.defineProperty(DOMElement.prototype,"namespaceURI",{get:function(){return this.getNS()}}),Object.defineProperty(DOMElement.prototype,"parentNode",{get:function(){return this.parent}}),Object.defineProperty(DOMElement.prototype,"childNodes",{get:function(){return this.children}}),Object.defineProperty(DOMElement.prototype,"textContent",{get:function(){return this.getText()},set:function(e){this.children.push(e)}}),DOMElement.prototype.getElementsByTagName=function(e){return this.getChildren(e)},DOMElement.prototype.getAttribute=function(e){return this.getAttr(e)},DOMElement.prototype.setAttribute=function(e,t){this.attr(e,t)},DOMElement.prototype.getAttributeNS=function(e,t){return"http://www.w3.org/XML/1998/namespace"===e?this.getAttr(["xml",t].join(":")):this.getAttr(t,e)},DOMElement.prototype.setAttributeNS=function(e,t,n){var r;if("http://www.w3.org/XML/1998/namespace"===e)r="xml";else{var s=this.getXmlns();r=s[e]||""}r&&this.attr([r,t].join(":"),n)},DOMElement.prototype.removeAttribute=function(e){this.attr(e,null)},DOMElement.prototype.removeAttributeNS=function(e,t){var n;if("http://www.w3.org/XML/1998/namespace"===e)n="xml";else{var r=this.getXmlns();n=r[e]||""}n&&this.attr([n,t].join(":"),null)},DOMElement.prototype.appendChild=function(e){this.cnode(e)},DOMElement.prototype.removeChild=function(e){this.remove(e)},DOMElement.createElement=function(e,t){var n=new DOMElement(e,t),r=Array.prototype.slice.call(arguments,2);return r.forEach(function(e){n.appendChild(e)}),n},t.exports=DOMElement},{"./Element":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/Element.js",inherits:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/inherits/inherits_browser.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/Element.js":[function(e,t,n){"use strict";function Element(e,t){this.name=e,this.parent=null,this.children=[],this.attrs={},this.setAttrs(t)}var r=e("./escape"),s=r.escapeXML,i=r.escapeXMLText,o=e("./equal"),a=o.equal,c=o.name,u=o.attrs,d=o.children,l=e("./clone");Element.prototype.is=function(e,t){return this.getName()===e&&(!t||this.getNS()===t)},Element.prototype.getName=function(){return this.name.indexOf(":")>=0?this.name.substr(this.name.indexOf(":")+1):this.name},Element.prototype.getNS=function(){if(this.name.indexOf(":")>=0){var e=this.name.substr(0,this.name.indexOf(":"));return this.findNS(e)}return this.findNS()},Element.prototype.findNS=function(e){if(e){var t="xmlns:"+e;if(this.attrs[t])return this.attrs[t];if(this.parent)return this.parent.findNS(e)}else{if(this.attrs.xmlns)return this.attrs.xmlns;if(this.parent)return this.parent.findNS()}},Element.prototype.getXmlns=function(){var e={};this.parent&&(e=this.parent.getXmlns());for(var t in this.attrs){var n=t.match("xmlns:?(.*)");this.attrs.hasOwnProperty(t)&&n&&(e[this.attrs[t]]=n[1])}return e},Element.prototype.setAttrs=function(e){"string"==typeof e?this.attrs.xmlns=e:e&&Object.keys(e).forEach(function(t){this.attrs[t]=e[t]},this)},Element.prototype.getAttr=function(e,t){if(!t)return this.attrs[e];var n=this.getXmlns();return n[t]?this.attrs[[n[t],e].join(":")]:null},Element.prototype.getChild=function(e,t){return this.getChildren(e,t)[0]},Element.prototype.getChildren=function(e,t){for(var n=[],r=0;r<this.children.length;r++){var s=this.children[r];!s.getName||s.getName()!==e||t&&s.getNS()!==t||n.push(s)}return n},Element.prototype.getChildByAttr=function(e,t,n,r){return this.getChildrenByAttr(e,t,n,r)[0]},Element.prototype.getChildrenByAttr=function(e,t,n,r){for(var s=[],i=0;i<this.children.length;i++){var o=this.children[i];!o.attrs||o.attrs[e]!==t||n&&o.getNS()!==n||s.push(o),r&&o.getChildrenByAttr&&s.push(o.getChildrenByAttr(e,t,n,!0))}return r&&(s=[].concat.apply([],s)),s},Element.prototype.getChildrenByFilter=function(e,t){for(var n=[],r=0;r<this.children.length;r++){var s=this.children[r];e(s)&&n.push(s),t&&s.getChildrenByFilter&&n.push(s.getChildrenByFilter(e,!0))}return t&&(n=[].concat.apply([],n)),n},Element.prototype.getText=function(){for(var e="",t=0;t<this.children.length;t++){var n=this.children[t];"string"!=typeof n&&"number"!=typeof n||(e+=n)}return e},Element.prototype.getChildText=function(e,t){var n=this.getChild(e,t);return n?n.getText():null},Element.prototype.getChildElements=function(){return this.getChildrenByFilter(function(e){return e instanceof Element})},Element.prototype.root=function(){return this.parent?this.parent.root():this},Element.prototype.tree=Element.prototype.root,Element.prototype.up=function(){return this.parent?this.parent:this},Element.prototype.c=function(e,t){return this.cnode(new Element(e,t))},Element.prototype.cnode=function(e){return this.children.push(e),"object"==typeof e&&(e.parent=this),e},Element.prototype.t=function(e){return this.children.push(e),this},Element.prototype.remove=function(e,t){var n;return n="string"==typeof e?function(n){return!(n.is&&n.is(e,t))}:function(t){return t!==e},this.children=this.children.filter(n),this},Element.prototype.clone=function(){return l(this)},Element.prototype.text=function(e){return e&&1===this.children.length?(this.children[0]=e,this):this.getText()},Element.prototype.attr=function(e,t){return"undefined"!=typeof t||null===t?(this.attrs||(this.attrs={}),this.attrs[e]=t,this):this.attrs[e]},Element.prototype.toString=function(){var e="";return this.write(function(t){e+=t}),e},Element.prototype.toJSON=function(){return{name:this.name,attrs:this.attrs,children:this.children.map(function(e){return e&&e.toJSON?e.toJSON():e})}},Element.prototype._addChildren=function(e){e(">");for(var t=0;t<this.children.length;t++){var n=this.children[t];(n||0===n)&&(n.write?n.write(e):"string"==typeof n?e(i(n)):n.toString&&e(i(n.toString(10))))}e("</"),e(this.name),e(">")},Element.prototype.write=function(e){e("<"),e(this.name);for(var t in this.attrs){var n=this.attrs[t];null!=n&&(e(" "),e(t),e('="'),"string"!=typeof n&&(n=n.toString()),e(s(n)),e('"'))}0===this.children.length?e("/>"):this._addChildren(e)},Element.prototype.nameEquals=function(e){return c(this,e)},Element.prototype.attrsEquals=function(e){return u(this,e)},Element.prototype.childrenEquals=function(e){return d(this,e)},Element.prototype.equals=function(e){return a(this,e)},t.exports=Element},{"./clone":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/clone.js","./equal":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/equal.js","./escape":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/escape.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/Parser.js":[function(e,t,n){"use strict";var r=e("events").EventEmitter,s=e("inherits"),i=e("./Element"),o=e("./parsers/ltx"),a=function(e){r.call(this);var t=this.Parser=e&&e.Parser||this.DefaultParser,n=this.Element=e&&e.Element||this.DefaultElement;this.parser=new t;var s,i=this;this.parser.on("startElement",function(e,t){var r=new n(e,t);s=s?s.cnode(r):r}),this.parser.on("endElement",function(e){s&&e===s.name&&(s.parent?s=s.parent:i.tree||(i.tree=s,s=void 0))}),this.parser.on("text",function(e){s&&s.t(e)}),this.parser.on("error",function(e){i.error=e,i.emit("error",e)})};s(a,r),a.prototype.DefaultParser=o,a.prototype.DefaultElement=i,a.prototype.write=function(e){this.parser.write(e)},a.prototype.end=function(e){this.parser.end(e),this.error||(this.tree?this.emit("tree",this.tree):this.emit("error",new Error("Incomplete document")))},t.exports=a},{"./Element":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/Element.js","./parsers/ltx":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/parsers/ltx.js",events:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/events/events.js",inherits:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/inherits/inherits_browser.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/clone.js":[function(e,t,n){"use strict";t.exports=function clone(e){for(var clone=new e.constructor(e.name,e.attrs),t=0;t<e.children.length;t++){var n=e.children[t];clone.cnode(n.clone?n.clone():n)}return clone}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/createElement.js":[function(e,t,n){"use strict";var r=e("./Element");t.exports=function createElement(e,t){for(var n=new r(e,t),s=2;s<arguments.length;s++){var i=arguments[s];i&&n.cnode(i)}return n}},{"./Element":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/Element.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/equal.js":[function(e,t,n){"use strict";function nameEqual(e,t){return e.name===t.name}function attrsEqual(e,t){var n=e.attrs,r=Object.keys(n),s=r.length;if(s!==Object.keys(t.attrs).length)return!1;for(var i=0,o=s;i<o;i++){var a=r[i],c=n[a];if(null==c||null==t.attrs[a]){if(c!==t.attrs[a])return!1}else if(c.toString()!==t.attrs[a].toString())return!1}return!0}function childrenEqual(e,t){var n=e.children,r=n.length;if(r!==t.children.length)return!1;for(var s=0,i=r;s<i;s++){var o=n[s];if("string"==typeof o){if(o!==t.children[s])return!1}else if(!o.equals(t.children[s]))return!1}return!0}function equal(e,t){return!!nameEqual(e,t)&&(!!attrsEqual(e,t)&&!!childrenEqual(e,t))}t.exports.name=nameEqual,t.exports.attrs=attrsEqual,t.exports.children=childrenEqual,t.exports.equal=equal},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/escape.js":[function(e,t,n){"use strict";function escapeXMLReplace(e){return r[e]}function unescapeXMLReplace(e){return s[e]}var r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&apos;"},s={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&quot;":'"',"&#34;":'"',"&apos;":"'","&#39;":"'"};n.escapeXML=function escapeXML(e){return e.replace(/&|<|>|"|'/g,escapeXMLReplace)},n.unescapeXML=function unescapeXML(e){return e.replace(/&(amp|#38|lt|#60|gt|#62|quot|#34|apos|#39);/g,unescapeXMLReplace)},n.escapeXMLText=function escapeXMLText(e){return e.replace(/&|<|>/g,escapeXMLReplace)},n.unescapeXMLText=function unescapeXMLText(e){return e.replace(/&(amp|#38|lt|#60|gt|#62);/g,unescapeXMLReplace)}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/is.js":[function(e,t,n){"use strict";var r=e("./Element");t.exports.isNode=function is(e){return e instanceof r||"string"==typeof e},t.exports.isElement=function isElement(e){return e instanceof r},t.exports.isText=function isText(e){return"string"==typeof e}},{"./Element":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/Element.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/parse.js":[function(e,t,n){"use strict";var r=e("./Parser");t.exports=function parse(e,t){var n;n="function"==typeof t?new t:new r(t);var s=null,i=null;if(n.on("tree",function(e){s=e}),n.on("error",function(e){i=e}),n.write(e),n.end(),i)throw i;return s}},{"./Parser":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/Parser.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/parsers/ltx.js":[function(e,t,n){"use strict";var r=e("inherits"),s=e("events").EventEmitter,i=e("../escape").unescapeXML,o=0,a=1,c=2,u=3,d=4,l=5,p=6,f=7,m=t.exports=function SaxLtx(){s.call(this);var e,t,n,r,m,h,g,b=o,v=0;this._handleTagOpening=function(e,t,n){e?this.emit("endElement",t):(this.emit("startElement",t,n),m&&this.emit("endElement",t))},this.write=function(s){function endRecording(){if("number"==typeof v){var e=s.slice(v,j);return v=void 0,e}}"string"!=typeof s&&(s=s.toString());var j=0;for(e&&(s=e+s,j+=e.length,e=null);j<s.length;j++){var _=s.charCodeAt(j);switch(b){case o:if(60===_){var x=endRecording();x&&this.emit("text",i(x)),b=c,v=j+1,n={}}break;case c:47===_&&v===j?(v=j+1,r=!0):33===_||63===_?(v=void 0,b=a):(_<=32||47===_||62===_)&&(t=endRecording(),j--,b=u);break;case a:62===_&&(b=o);break;case u:62===_?(this._handleTagOpening(r,t,n),t=void 0,n=void 0,r=void 0,m=void 0,b=o,v=j+1):47===_?m=!0:_>32&&(v=j,b=d);break;case d:(_<=32||61===_)&&(g=endRecording(),j--,b=l);break;case l:61===_&&(b=p);break;case p:34!==_&&39!==_||(h=_,b=f,v=j+1);break;case f:if(_===h){var y=i(endRecording());n[g]=y,g=void 0,b=u}}}"number"==typeof v&&v<=s.length&&(e=s.slice(v),v=0)}};r(m,s),m.prototype.end=function(e){e&&this.write(e),this.write=function(){}}},{"../escape":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/escape.js",events:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/events/events.js",inherits:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/inherits/inherits_browser.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/tag.js":[function(e,t,n){"use strict";var r=e("./escape").escapeXML,s=e("./parse");t.exports=function tag(){for(var e=arguments[0],t="",n=1;n<arguments.length;n++)t+=e[n-1],t+=r(arguments[n]);return t+=e[e.length-1],s(t)}},{"./escape":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/escape.js","./parse":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ltx/lib/parse.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/once/once.js":[function(e,t,n){function once(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}t.exports=once,once.proto=once(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once(this)},configurable:!0})})},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/parse-headers/parse-headers.js":[function(e,t,n){var r=e("trim"),s=e("for-each"),i=function(e){return"[object Array]"===Object.prototype.toString.call(e)};t.exports=function(e){if(!e)return{};var t={};return s(r(e).split("\n"),function(e){var n=e.indexOf(":"),s=r(e.slice(0,n)).toLowerCase(),o=r(e.slice(n+1));"undefined"==typeof t[s]?t[s]=o:i(t[s])?t[s].push(o):t[s]=[t[s],o]}),t}},{"for-each":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/for-each/index.js",trim:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/trim/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/process-nextick-args/index.js":[function(e,t,n){(function(e){"use strict";function nextTick(t,n,r,s){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var i,o,a=arguments.length;switch(a){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function afterTickOne(){t.call(null,n)});case 3:return e.nextTick(function afterTickTwo(){t.call(null,n,r)});case 4:return e.nextTick(function afterTickThree(){t.call(null,n,r,s)});default:for(i=new Array(a-1),o=0;o<i.length;)i[o++]=arguments[o];return e.nextTick(function afterTick(){t.apply(null,i)})}}!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports=nextTick:t.exports=e.nextTick}).call(this,e("_process"))},{_process:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/browserify/node_modules/process/browser.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/punycode/punycode.js":[function(t,n,r){(function(t){!function(s){function error(e){throw new RangeError(y[e])}function map(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function mapDomain(e,t){var n=e.split("@"),r="";n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(x,".");var s=e.split("."),i=map(s,t).join(".");return r+i}function ucs2decode(e){for(var t,n,r=[],s=0,i=e.length;s<i;)t=e.charCodeAt(s++),t>=55296&&t<=56319&&s<i?(n=e.charCodeAt(s++),56320==(64512&n)?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),s--)):r.push(t);return r}function ucs2encode(e){return map(e,function(e){var t="";return e>65535&&(e-=65536,t+=z(e>>>10&1023|55296),e=56320|1023&e),t+=z(e)}).join("")}function basicToDigit(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:l}function digitToBasic(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function adapt(e,t,n){var r=0;for(e=n?w(e/h):e>>1,e+=w(e/t);e>S*f>>1;r+=l)e=w(e/S);return w(r+(S+1)*e/(e+m))}function decode(e){var t,n,r,s,i,o,a,c,u,m,h=[],j=e.length,_=0,x=b,y=g;for(n=e.lastIndexOf(v),n<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&error("not-basic"),h.push(e.charCodeAt(r));for(s=n>0?n+1:0;s<j;){for(i=_,o=1,a=l;s>=j&&error("invalid-input"),c=basicToDigit(e.charCodeAt(s++)),(c>=l||c>w((d-_)/o))&&error("overflow"),_+=c*o,u=a<=y?p:a>=y+f?f:a-y,!(c<u);a+=l)m=l-u,o>w(d/m)&&error("overflow"),o*=m;t=h.length+1,y=adapt(_-i,t,0==i),w(_/t)>d-x&&error("overflow"),x+=w(_/t),_%=t,h.splice(_++,0,x)}return ucs2encode(h)}function encode(e){var t,n,r,s,i,o,a,c,u,m,h,j,_,x,y,S=[];for(e=ucs2decode(e),j=e.length,t=b,n=0,i=g,o=0;o<j;++o)h=e[o],h<128&&S.push(z(h));for(r=s=S.length,s&&S.push(v);r<j;){for(a=d,o=0;o<j;++o)h=e[o],h>=t&&h<a&&(a=h);for(_=r+1,a-t>w((d-n)/_)&&error("overflow"),n+=(a-t)*_,t=a,o=0;o<j;++o)if(h=e[o],h<t&&++n>d&&error("overflow"),h==t){for(c=n,u=l;m=u<=i?p:u>=i+f?f:u-i,!(c<m);u+=l)y=c-m,x=l-m,S.push(z(digitToBasic(m+y%x,0))),c=w(y/x);S.push(z(digitToBasic(c,0))),i=adapt(n,_,r==s),n=0,++r}++n,++t}return S.join("")}function toUnicode(e){return mapDomain(e,function(e){return j.test(e)?decode(e.slice(4).toLowerCase()):e})}function toASCII(e){return mapDomain(e,function(e){return _.test(e)?"xn--"+encode(e):e})}var i="object"==typeof r&&r&&!r.nodeType&&r,o="object"==typeof n&&n&&!n.nodeType&&n,a="object"==typeof t&&t;a.global!==a&&a.window!==a&&a.self!==a||(s=a);var c,u,d=2147483647,l=36,p=1,f=26,m=38,h=700,g=72,b=128,v="-",j=/^xn--/,_=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},S=l-p,w=Math.floor,z=String.fromCharCode;if(c={version:"1.4.1",ucs2:{decode:ucs2decode,encode:ucs2encode},decode:decode,encode:encode,toASCII:toASCII,toUnicode:toUnicode},"function"==typeof e&&"object"==typeof e.amd&&e.amd)e("punycode",function(){return c});else if(i&&o)if(n.exports==i)o.exports=c;else for(u in c)c.hasOwnProperty(u)&&(i[u]=c[u]);else s.punycode=c}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/randombytes/browser.js":[function(e,t,n){(function(e,n,r){"use strict";function oldBrowser(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}function randomBytes(t,i){if(t>65536)throw new Error("requested too many random bytes");var o=new n.Uint8Array(t);t>0&&s.getRandomValues(o);var a=new r(o.buffer);return"function"==typeof i?e.nextTick(function(){i(null,a)}):a}var s=n.crypto||n.msCrypto;s&&s.getRandomValues?t.exports=randomBytes:t.exports=oldBrowser}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{_process:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/browserify/node_modules/process/browser.js",buffer:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/ripemd160/lib/ripemd160.js":[function(e,t,n){(function(e){function bytesToWords(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t}function wordsToBytes(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t}function processBlock(e,t,c){for(var u=0;u<16;u++){var d=c+u,l=t[d];t[d]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}var p,f,m,h,g,b,v,j,_,x;b=p=e[0],v=f=e[1],j=m=e[2],_=h=e[3],x=g=e[4];var y;for(u=0;u<80;u+=1)y=p+t[c+n[u]]|0,y+=u<16?f1(f,m,h)+o[0]:u<32?f2(f,m,h)+o[1]:u<48?f3(f,m,h)+o[2]:u<64?f4(f,m,h)+o[3]:f5(f,m,h)+o[4],y=0|y,y=rotl(y,s[u]),y=y+g|0,p=g,g=h,h=rotl(m,10),m=f,f=y,y=b+t[c+r[u]]|0,y+=u<16?f5(v,j,_)+a[0]:u<32?f4(v,j,_)+a[1]:u<48?f3(v,j,_)+a[2]:u<64?f2(v,j,_)+a[3]:f1(v,j,_)+a[4],y=0|y,y=rotl(y,i[u]),y=y+x|0,b=x,x=_,_=rotl(j,10),j=v,v=y;y=e[1]+m+_|0,e[1]=e[2]+h+x|0,e[2]=e[3]+g+b|0,e[3]=e[4]+p+v|0,e[4]=e[0]+f+j|0,e[0]=y}function f1(e,t,n){return e^t^n}function f2(e,t,n){return e&t|~e&n}function f3(e,t,n){return(e|~t)^n}function f4(e,t,n){return e&n|t&~n}function f5(e,t,n){return e^(t|~n)}function rotl(e,t){return e<<t|e>>>32-t}function ripemd160(t){var n=[1732584193,4023233417,2562383102,271733878,3285377520];"string"==typeof t&&(t=new e(t,"utf8"));var r=bytesToWords(t),s=8*t.length,i=8*t.length;r[s>>>5]|=128<<24-s%32,r[(s+64>>>9<<4)+14]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);for(var o=0;o<r.length;o+=16)processBlock(n,r,o);for(o=0;o<5;o++){var a=n[o];n[o]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}var c=wordsToBytes(n);return new e(c)}var n=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],r=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],s=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],i=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],o=[0,1518500249,1859775393,2400959708,2840853838],a=[1352829926,1548603684,1836072691,2053994217,0];t.exports=ripemd160}).call(this,e("buffer").Buffer)},{buffer:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/rtcpeerconnection/rtcpeerconnection.js":[function(e,t,n){function PeerConnection(e,t){var n,r=this;i.call(this),e=e||{},e.iceServers=e.iceServers||[];var s=a.browserDetails.browser;this.enableChromeNativeSimulcast=!1,t&&t.optional&&"chrome"===s&&null===navigator.appVersion.match(/Chromium\//)&&t.optional.forEach(function(e){e.enableChromeNativeSimulcast&&(r.enableChromeNativeSimulcast=!0)}),this.enableMultiStreamHacks=!1,t&&t.optional&&"chrome"===s&&t.optional.forEach(function(e){e.enableMultiStreamHacks&&(r.enableMultiStreamHacks=!0)}),this.restrictBandwidth=0,t&&t.optional&&t.optional.forEach(function(e){e.andyetRestrictBandwidth&&(r.restrictBandwidth=e.andyetRestrictBandwidth)}),this.batchIceCandidates=0,t&&t.optional&&t.optional.forEach(function(e){e.andyetBatchIce&&(r.batchIceCandidates=e.andyetBatchIce)}),this.batchedIceCandidates=[],t&&t.optional&&"chrome"===s&&t.optional.forEach(function(e){e.andyetFasterICE&&(r.eliminateDuplicateCandidates=e.andyetFasterICE)}),t&&t.optional&&t.optional.forEach(function(e){e.andyetDontSignalCandidates&&(r.dontSignalCandidates=e.andyetDontSignalCandidates)}),this.assumeSetLocalSuccess=!1,t&&t.optional&&t.optional.forEach(function(e){e.andyetAssumeSetLocalSuccess&&(r.assumeSetLocalSuccess=e.andyetAssumeSetLocalSuccess)}),"firefox"===s&&t&&t.optional&&(this.wtFirefox=0,t.optional.forEach(function(e){e.andyetFirefoxMakesMeSad&&(r.wtFirefox=e.andyetFirefoxMakesMeSad,r.wtFirefox>0&&(r.firefoxcandidatebuffer=[]));
  })),this.pc=new o(e,t),this.getLocalStreams=this.pc.getLocalStreams.bind(this.pc),this.getRemoteStreams=this.pc.getRemoteStreams.bind(this.pc),this.addStream=this.pc.addStream.bind(this.pc),this.removeStream=this.pc.removeStream.bind(this.pc),this.pc.on("*",function(){r.emit.apply(r,arguments)}),this.pc.onremovestream=this.emit.bind(this,"removeStream"),this.pc.onaddstream=this.emit.bind(this,"addStream"),this.pc.onnegotiationneeded=this.emit.bind(this,"negotiationNeeded"),this.pc.oniceconnectionstatechange=this.emit.bind(this,"iceConnectionStateChange"),this.pc.onsignalingstatechange=this.emit.bind(this,"signalingStateChange"),this.pc.onicecandidate=this._onIce.bind(this),this.pc.ondatachannel=this._onDataChannel.bind(this),this.localDescription={contents:[]},this.remoteDescription={contents:[]},this.config={debug:!1,sid:"",isInitiator:!0,sdpSessionID:Date.now(),useJingle:!1},this.iceCredentials={local:{},remote:{}};for(n in e)this.config[n]=e[n];this.config.debug&&this.on("*",function(){var t=e.logger||console;t.log("PeerConnection event:",arguments)}),this.hadLocalStunCandidate=!1,this.hadRemoteStunCandidate=!1,this.hadLocalRelayCandidate=!1,this.hadRemoteRelayCandidate=!1,this.hadLocalIPv6Candidate=!1,this.hadRemoteIPv6Candidate=!1,this._remoteDataChannels=[],this._localDataChannels=[],this._candidateBuffer=[]}var r=e("util"),s=e("sdp-jingle-json"),i=e("wildemitter"),o=e("traceablepeerconnection"),a=e("webrtc-adapter");r.inherits(PeerConnection,i),Object.defineProperty(PeerConnection.prototype,"signalingState",{get:function(){return this.pc.signalingState}}),Object.defineProperty(PeerConnection.prototype,"iceConnectionState",{get:function(){return this.pc.iceConnectionState}}),PeerConnection.prototype._role=function(){return this.isInitiator?"initiator":"responder"},PeerConnection.prototype.addStream=function(e){this.localStream=e,this.pc.addStream(e)},PeerConnection.prototype._checkLocalCandidate=function(e){var t=s.toCandidateJSON(e);"srflx"==t.type?this.hadLocalStunCandidate=!0:"relay"==t.type&&(this.hadLocalRelayCandidate=!0),t.ip.indexOf(":")!=-1&&(this.hadLocalIPv6Candidate=!0)},PeerConnection.prototype._checkRemoteCandidate=function(e){var t=s.toCandidateJSON(e);"srflx"==t.type?this.hadRemoteStunCandidate=!0:"relay"==t.type&&(this.hadRemoteRelayCandidate=!0),t.ip.indexOf(":")!=-1&&(this.hadRemoteIPv6Candidate=!0)},PeerConnection.prototype.processIce=function(e,t){t=t||function(){};var n=this;if("closed"===this.pc.signalingState)return t();if(e.contents||e.jingle&&e.jingle.contents){var r=this.remoteDescription.contents.map(function(e){return e.name}),i=e.contents||e.jingle.contents;i.forEach(function(e){var i=e.transport||{},o=i.candidates||[],a=r.indexOf(e.name),c=e.name,u=n.remoteDescription.contents.find(function(t){return t.name===e.name}),d=function(){o.forEach(function(e){var t=s.toCandidateSDP(e)+"\r\n";n.pc.addIceCandidate(new RTCIceCandidate({candidate:t,sdpMLineIndex:a,sdpMid:c}),function(){},function(e){n.emit("error",e)}),n._checkRemoteCandidate(t)}),t()};if(n.iceCredentials.remote[e.name]&&i.ufrag&&n.iceCredentials.remote[e.name].ufrag!==i.ufrag)if(u){u.transport.ufrag=i.ufrag,u.transport.pwd=i.pwd;var l={type:"offer",jingle:n.remoteDescription};l.sdp=s.toSessionSDP(l.jingle,{sid:n.config.sdpSessionID,role:n._role(),direction:"incoming"}),n.pc.setRemoteDescription(new RTCSessionDescription(l),function(){d()},function(e){n.emit("error",e)})}else n.emit("error","ice restart failed to find matching content");else d()})}else{if(e.candidate&&0!==e.candidate.candidate.indexOf("a=")&&(e.candidate.candidate="a="+e.candidate.candidate),this.wtFirefox&&null!==this.firefoxcandidatebuffer&&this.pc.localDescription&&"offer"===this.pc.localDescription.type)return this.firefoxcandidatebuffer.push(e.candidate),t();n.pc.addIceCandidate(new RTCIceCandidate(e.candidate),function(){},function(e){n.emit("error",e)}),n._checkRemoteCandidate(e.candidate.candidate),t()}},PeerConnection.prototype.offer=function(e,t){var n=this,r=2===arguments.length,i=r&&e?e:{offerToReceiveAudio:1,offerToReceiveVideo:1};return t=r?t:e,t=t||function(){},"closed"===this.pc.signalingState?t("Already closed"):void this.pc.createOffer(function(e){var r={type:"offer",sdp:e.sdp};n.assumeSetLocalSuccess&&(n.emit("offer",r),t(null,r)),n._candidateBuffer=[],n.pc.setLocalDescription(e,function(){var i;n.config.useJingle&&(i=s.toSessionJSON(e.sdp,{role:n._role(),direction:"outgoing"}),i.sid=n.config.sid,n.localDescription=i,i.contents.forEach(function(e){var t=e.transport||{};t.ufrag&&(n.iceCredentials.local[e.name]={ufrag:t.ufrag,pwd:t.pwd})}),r.jingle=i),r.sdp.split("\r\n").forEach(function(e){0===e.indexOf("a=candidate:")&&n._checkLocalCandidate(e)}),n.assumeSetLocalSuccess||(n.emit("offer",r),t(null,r))},function(e){n.emit("error",e),t(e)})},function(e){n.emit("error",e),t(e)},i)},PeerConnection.prototype.handleOffer=function(e,t){t=t||function(){};var n=this;if(e.type="offer",e.jingle){if(this.enableChromeNativeSimulcast&&e.jingle.contents.forEach(function(e){"video"===e.name&&(e.application.googConferenceFlag=!0)}),this.enableMultiStreamHacks&&e.jingle.contents.forEach(function(e){if("video"===e.name){var t=e.application.sources||[];0!==t.length&&"3735928559"===t[0].ssrc||(t.unshift({ssrc:"3735928559",parameters:[{key:"cname",value:"deadbeef"},{key:"msid",value:"mixyourfecintothis please"}]}),e.application.sources=t)}}),n.restrictBandwidth>0&&e.jingle.contents.length>=2&&"video"===e.jingle.contents[1].name){var r=e.jingle.contents[1],i=r.application&&r.application.bandwidth&&r.application.bandwidth.bandwidth;i||(e.jingle.contents[1].application.bandwidth={type:"AS",bandwidth:n.restrictBandwidth.toString()},e.sdp=s.toSessionSDP(e.jingle,{sid:n.config.sdpSessionID,role:n._role(),direction:"outgoing"}))}e.jingle.contents.forEach(function(e){var t=e.transport||{};t.ufrag&&(n.iceCredentials.remote[e.name]={ufrag:t.ufrag,pwd:t.pwd})}),e.sdp=s.toSessionSDP(e.jingle,{sid:n.config.sdpSessionID,role:n._role(),direction:"incoming"}),n.remoteDescription=e.jingle}e.sdp.split("\r\n").forEach(function(e){0===e.indexOf("a=candidate:")&&n._checkRemoteCandidate(e)}),n.pc.setRemoteDescription(new RTCSessionDescription(e),function(){t()},t)},PeerConnection.prototype.answerAudioOnly=function(e){var t={mandatory:{OfferToReceiveAudio:!0,OfferToReceiveVideo:!1}};this._answer(t,e)},PeerConnection.prototype.answerBroadcastOnly=function(e){var t={mandatory:{OfferToReceiveAudio:!1,OfferToReceiveVideo:!1}};this._answer(t,e)},PeerConnection.prototype.answer=function(e,t){var n=2===arguments.length,r=n?t:e,s=n&&e?e:{mandatory:{OfferToReceiveAudio:!0,OfferToReceiveVideo:!0}};this._answer(s,r)},PeerConnection.prototype.handleAnswer=function(e,t){t=t||function(){};var n=this;e.jingle&&(e.sdp=s.toSessionSDP(e.jingle,{sid:n.config.sdpSessionID,role:n._role(),direction:"incoming"}),n.remoteDescription=e.jingle,e.jingle.contents.forEach(function(e){var t=e.transport||{};t.ufrag&&(n.iceCredentials.remote[e.name]={ufrag:t.ufrag,pwd:t.pwd})})),e.sdp.split("\r\n").forEach(function(e){0===e.indexOf("a=candidate:")&&n._checkRemoteCandidate(e)}),n.pc.setRemoteDescription(new RTCSessionDescription(e),function(){n.wtFirefox&&window.setTimeout(function(){n.firefoxcandidatebuffer.forEach(function(e){n.pc.addIceCandidate(new RTCIceCandidate(e),function(){},function(e){n.emit("error",e)}),n._checkRemoteCandidate(e.candidate)}),n.firefoxcandidatebuffer=null},n.wtFirefox),t(null)},t)},PeerConnection.prototype.close=function(){this.pc.close(),this._localDataChannels=[],this._remoteDataChannels=[],this.emit("close")},PeerConnection.prototype._answer=function(e,t){t=t||function(){};var n=this;if(!this.pc.remoteDescription)throw new Error("remoteDescription not set");return"closed"===this.pc.signalingState?t("Already closed"):void n.pc.createAnswer(function(e){var r=[];if(n.enableChromeNativeSimulcast&&(e.jingle=s.toSessionJSON(e.sdp,{role:n._role(),direction:"outgoing"}),e.jingle.contents.length>=2&&"video"===e.jingle.contents[1].name)){var i=e.jingle.contents[1].application.sourceGroups||[],o=!1;if(i.forEach(function(e){"SIM"==e.semantics&&(o=!0)}),!o&&e.jingle.contents[1].application.sources.length){var a=JSON.parse(JSON.stringify(e.jingle.contents[1].application.sources[0]));a.ssrc=""+Math.floor(4294967295*Math.random()),e.jingle.contents[1].application.sources.push(a),r.push(e.jingle.contents[1].application.sources[0].ssrc),r.push(a.ssrc),i.push({semantics:"SIM",sources:r});var c=JSON.parse(JSON.stringify(a));c.ssrc=""+Math.floor(4294967295*Math.random()),e.jingle.contents[1].application.sources.push(c),i.push({semantics:"FID",sources:[a.ssrc,c.ssrc]}),e.jingle.contents[1].application.sourceGroups=i,e.sdp=s.toSessionSDP(e.jingle,{sid:n.config.sdpSessionID,role:n._role(),direction:"outgoing"})}}var u={type:"answer",sdp:e.sdp};n.assumeSetLocalSuccess&&(n.emit("answer",u),t(null,u)),n._candidateBuffer=[],n.pc.setLocalDescription(e,function(){if(n.config.useJingle){var r=s.toSessionJSON(e.sdp,{role:n._role(),direction:"outgoing"});r.sid=n.config.sid,n.localDescription=r,u.jingle=r}n.enableChromeNativeSimulcast&&(u.jingle||(u.jingle=s.toSessionJSON(e.sdp,{role:n._role(),direction:"outgoing"})),u.jingle.contents[1].application.sources.forEach(function(e,t){e.parameters=e.parameters.map(function(e){return"msid"===e.key&&(e.value+="-"+Math.floor(t/2)),e})}),u.sdp=s.toSessionSDP(u.jingle,{sid:n.sdpSessionID,role:n._role(),direction:"outgoing"})),u.sdp.split("\r\n").forEach(function(e){0===e.indexOf("a=candidate:")&&n._checkLocalCandidate(e)}),n.assumeSetLocalSuccess||(n.emit("answer",u),t(null,u))},function(e){n.emit("error",e),t(e)})},function(e){n.emit("error",e),t(e)},e)},PeerConnection.prototype._onIce=function(e){var t=this;if(e.candidate){if(this.dontSignalCandidates)return;var n=e.candidate,r={candidate:{candidate:n.candidate,sdpMid:n.sdpMid,sdpMLineIndex:n.sdpMLineIndex}};this._checkLocalCandidate(n.candidate);var i,o,a=s.toCandidateJSON(n.candidate);if(this.eliminateDuplicateCandidates&&"relay"===a.type&&(i=this._candidateBuffer.filter(function(e){return"relay"===e.type}).map(function(e){return e.foundation+":"+e.component}),o=i.indexOf(a.foundation+":"+a.component),o>-1&&a.priority>>24>=i[o].priority>>24))return;if("max-bundle"===this.config.bundlePolicy&&(i=this._candidateBuffer.filter(function(e){return a.type===e.type}).map(function(e){return e.address+":"+e.port}),o=i.indexOf(a.address+":"+a.port),o>-1))return;if("require"===this.config.rtcpMuxPolicy&&"2"===a.component)return;if(this._candidateBuffer.push(a),t.config.useJingle){if(n.sdpMid||(t.pc.remoteDescription&&"offer"===t.pc.remoteDescription.type?n.sdpMid=t.remoteDescription.contents[n.sdpMLineIndex].name:n.sdpMid=t.localDescription.contents[n.sdpMLineIndex].name),!t.iceCredentials.local[n.sdpMid]){var c=s.toSessionJSON(t.pc.localDescription.sdp,{role:t._role(),direction:"outgoing"});c.contents.forEach(function(e){var n=e.transport||{};n.ufrag&&(t.iceCredentials.local[e.name]={ufrag:n.ufrag,pwd:n.pwd})})}if(r.jingle={contents:[{name:n.sdpMid,creator:t._role(),transport:{transportType:"iceUdp",ufrag:t.iceCredentials.local[n.sdpMid].ufrag,pwd:t.iceCredentials.local[n.sdpMid].pwd,candidates:[a]}}]},t.batchIceCandidates>0)return 0===t.batchedIceCandidates.length&&window.setTimeout(function(){var e={};t.batchedIceCandidates.forEach(function(t){t=t.contents[0],e[t.name]||(e[t.name]=t),e[t.name].transport.candidates.push(t.transport.candidates[0])});var n={jingle:{contents:[]}};Object.keys(e).forEach(function(t){n.jingle.contents.push(e[t])}),t.batchedIceCandidates=[],t.emit("ice",n)},t.batchIceCandidates),void t.batchedIceCandidates.push(r.jingle)}this.emit("ice",r)}else this.emit("endOfCandidates")},PeerConnection.prototype._onDataChannel=function(e){var t=e.channel;this._remoteDataChannels.push(t),this.emit("addChannel",t)},PeerConnection.prototype.createDataChannel=function(e,t){var n=this.pc.createDataChannel(e,t);return this._localDataChannels.push(n),n},PeerConnection.prototype.getStats=function(e){this.pc.getStats(null,function(t){e(null,t)},function(t){e(t)})},t.exports=PeerConnection},{"sdp-jingle-json":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sdp-jingle-json/index.js",traceablepeerconnection:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/traceablepeerconnection/index.js",util:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/util/util.js","webrtc-adapter":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/webrtc-adapter/src/js/adapter_core.js",wildemitter:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/wildemitter/wildemitter.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sasl-anonymous/lib/mechanism.js":[function(t,n,r){!function(t,s){"object"==typeof r?s(r,n):"function"==typeof e&&e.amd&&e(["exports","module"],s)}(this,function(e,t){function Mechanism(){}Mechanism.prototype.name="ANONYMOUS",Mechanism.prototype.clientFirst=!0,Mechanism.prototype.response=function(e){return e.trace||""},Mechanism.prototype.challenge=function(e){},e=t.exports=Mechanism})},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sasl-anonymous/main.js":[function(t,n,r){!function(s,i){"object"==typeof r?i(r,n,t("./lib/mechanism")):"function"==typeof e&&e.amd&&e(["exports","module","./lib/mechanism"],i)}(this,function(e,t,n){e=t.exports=n,e.Mechanism=n})},{"./lib/mechanism":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sasl-anonymous/lib/mechanism.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sasl-external/lib/mechanism.js":[function(t,n,r){!function(t,s){"object"==typeof r?s(r,n):"function"==typeof e&&e.amd&&e(["exports","module"],s)}(this,function(e,t){function Mechanism(){}Mechanism.prototype.name="EXTERNAL",Mechanism.prototype.clientFirst=!0,Mechanism.prototype.response=function(e){return e.authzid||""},Mechanism.prototype.challenge=function(e){},e=t.exports=Mechanism})},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sasl-external/main.js":[function(e,t,n){arguments[4]["/Users/pedrogutierrez/Projects/stanza.io/node_modules/sasl-anonymous/main.js"][0].apply(n,arguments)},{"./lib/mechanism":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sasl-external/lib/mechanism.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sasl-plain/lib/mechanism.js":[function(t,n,r){!function(t,s){"object"==typeof r?s(r,n):"function"==typeof e&&e.amd&&e(["exports","module"],s)}(this,function(e,t){function Mechanism(){}Mechanism.prototype.name="PLAIN",Mechanism.prototype.clientFirst=!0,Mechanism.prototype.response=function(e){var t="";return t+=e.authzid||"",t+="\0",t+=e.username,t+="\0",t+=e.password},Mechanism.prototype.challenge=function(e){return this},e=t.exports=Mechanism})},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sasl-plain/main.js":[function(e,t,n){arguments[4]["/Users/pedrogutierrez/Projects/stanza.io/node_modules/sasl-anonymous/main.js"][0].apply(n,arguments)},{"./lib/mechanism":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sasl-plain/lib/mechanism.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sasl-scram-sha-1/index.js":[function(e,t,n){(function(n){function Mechanism(e){e=e||{},this._genNonce=e.genNonce||s.genNonce,this._stage="initial"}var r=e("./lib/bitops"),s=e("./lib/utils"),i={},o="Client Key",a="Server Key";Mechanism.Mechanism=Mechanism,Mechanism.prototype.name="SCRAM-SHA-1",Mechanism.prototype.clientFirst=!0,Mechanism.prototype.response=function(e){return i[this._stage](this,e)},Mechanism.prototype.challenge=function(e){var t=s.parse(e);return this._salt=new n(t.s||"","base64"),this._iterationCount=parseInt(t.i,10),this._nonce=t.r,this._verifier=t.v,this._error=t.e,this._challenge=e,this},i.initial=function(e,t){e._cnonce=e._genNonce();var n="";t.authzid&&(n="a="+s.saslname(t.authzid)),e._gs2Header="n,"+n+",";var r="r="+e._cnonce,i="n="+s.saslname(t.username||"");e._clientFirstMessageBare=i+","+r;var o=e._gs2Header+e._clientFirstMessageBare;return e._stage="challenge",o},i.challenge=function(e,t){var s=new n(e._gs2Header).toString("base64");e._clientFinalMessageWithoutProof="c="+s+",r="+e._nonce;var i,c,u;t.salt&&0===n.compare(t.salt,e._salt)?t.clientKey&&t.serverKey?(c=t.clientKey,u=t.serverKey):t.saltedPassword&&(i=t.saltedPassword,c=r.HMAC(i,o),u=r.HMAC(i,a)):(i=r.Hi(t.password||"",e._salt,e._iterationCount),c=r.HMAC(i,o),u=r.HMAC(i,a));var d=r.H(c),l=e._clientFirstMessageBare+","+e._challenge+","+e._clientFinalMessageWithoutProof,p=r.HMAC(d,l),f=r.XOR(c,p).toString("base64");e._serverSignature=r.HMAC(u,l);var m=e._clientFinalMessageWithoutProof+",p="+f;return e._stage="final",e.cache={salt:e._salt,saltedPassword:i,clientKey:c,serverKey:u},m},i.final=function(){return""},t.exports=Mechanism}).call(this,e("buffer").Buffer)},{"./lib/bitops":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sasl-scram-sha-1/lib/bitops.js","./lib/utils":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sasl-scram-sha-1/lib/utils.js",buffer:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sasl-scram-sha-1/lib/bitops.js":[function(e,t,n){(function(t){var r=e("create-hash"),s=e("create-hmac"),i=e("bitwise-xor");n.XOR=i,n.H=function(e){return r("sha1").update(e).digest()},n.HMAC=function(e,t){return s("sha1",e).update(t).digest()},n.Hi=function(e,r,s){for(var i=n.HMAC(e,t.concat([r,new t([0,0,0,1],"binary")])),o=i,a=0;a<s-1;a++)i=n.HMAC(e,i),o=n.XOR(o,i);return o}}).call(this,e("buffer").Buffer)},{"bitwise-xor":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/bitwise-xor/index.js",buffer:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/index.js","create-hash":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/create-hash/browser.js","create-hmac":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/create-hmac/browser.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sasl-scram-sha-1/lib/utils.js":[function(e,t,n){var r=e("randombytes");n.parse=function(e){for(var t={},n=e.split(/,(?=(?:[^"]|"[^"]*")*$)/),r=0,s=n.length;r<s;r++){var i=/(\w+)=["]?([^"]+)["]?$/.exec(n[r]);i&&(t[i[1]]=i[2])}return t},n.saslname=function(e){for(var t=[],n="",r=0;r<e.length;r++)n=e[r],","===n?t.push("=2C"):"="===n?t.push("=3D"):t.push(n);return t.join("")},n.genNonce=function(e){return r((e||32)/2).toString("hex")}},{randombytes:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/randombytes/browser.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sasl-x-oauth2/lib/mechanism.js":[function(t,n,r){!function(t,s){"object"==typeof r?s(r,n):"function"==typeof e&&e.amd&&e(["exports","module"],s)}(this,function(e,t){function Mechanism(){}Mechanism.prototype.name="X-OAUTH2",Mechanism.prototype.clientFirst=!0,Mechanism.prototype.response=function(e){var t="";return t+="\0",t+=e.username,t+="\0",t+=e.token},Mechanism.prototype.challenge=function(e){},e=t.exports=Mechanism})},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sasl-x-oauth2/main.js":[function(e,t,n){arguments[4]["/Users/pedrogutierrez/Projects/stanza.io/node_modules/sasl-anonymous/main.js"][0].apply(n,arguments)},{"./lib/mechanism":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sasl-x-oauth2/lib/mechanism.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/saslmechanisms/lib/factory.js":[function(t,n,r){!function(t,s){"object"==typeof r?s(r,n):"function"==typeof e&&e.amd&&e(["exports","module"],s)}(this,function(e,t){function Factory(){this._mechs=[]}Factory.prototype.use=function(e,t){return t||(t=e,e=t.prototype.name),this._mechs.push({name:e,mech:t}),this},Factory.prototype.create=function(e){for(var t=0,n=this._mechs.length;t<n;t++)for(var r=0,s=e.length;r<s;r++){var i=this._mechs[t];if(i.name==e[r])return new i.mech}return null},e=t.exports=Factory})},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/saslmechanisms/main.js":[function(t,n,r){!function(s,i){"object"==typeof r?i(r,n,t("./lib/factory")):"function"==typeof e&&e.amd&&e(["exports","module","./lib/factory"],i)}(this,function(e,t,n){e=t.exports=n,e.Factory=n})},{"./lib/factory":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/saslmechanisms/lib/factory.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sdp-jingle-json/index.js":[function(e,t,n){var r=e("./lib/tosdp"),s=e("./lib/tojson");n.toIncomingSDPOffer=function(e){return r.toSessionSDP(e,{role:"responder",direction:"incoming"})},n.toOutgoingSDPOffer=function(e){return r.toSessionSDP(e,{role:"initiator",direction:"outgoing"})},n.toIncomingSDPAnswer=function(e){return r.toSessionSDP(e,{role:"initiator",direction:"incoming"})},n.toOutgoingSDPAnswer=function(e){return r.toSessionSDP(e,{role:"responder",direction:"outgoing"})},n.toIncomingMediaSDPOffer=function(e){return r.toMediaSDP(e,{role:"responder",direction:"incoming"})},n.toOutgoingMediaSDPOffer=function(e){return r.toMediaSDP(e,{role:"initiator",direction:"outgoing"})},n.toIncomingMediaSDPAnswer=function(e){return r.toMediaSDP(e,{role:"initiator",direction:"incoming"})},n.toOutgoingMediaSDPAnswer=function(e){return r.toMediaSDP(e,{role:"responder",direction:"outgoing"})},n.toCandidateSDP=r.toCandidateSDP,n.toMediaSDP=r.toMediaSDP,n.toSessionSDP=r.toSessionSDP,n.toIncomingJSONOffer=function(e,t){return s.toSessionJSON(e,{role:"responder",direction:"incoming",creators:t})},n.toOutgoingJSONOffer=function(e,t){return s.toSessionJSON(e,{role:"initiator",direction:"outgoing",creators:t})},n.toIncomingJSONAnswer=function(e,t){return s.toSessionJSON(e,{role:"initiator",direction:"incoming",creators:t})},n.toOutgoingJSONAnswer=function(e,t){return s.toSessionJSON(e,{role:"responder",direction:"outgoing",creators:t})},n.toIncomingMediaJSONOffer=function(e,t){return s.toMediaJSON(e,{role:"responder",direction:"incoming",creator:t})},n.toOutgoingMediaJSONOffer=function(e,t){return s.toMediaJSON(e,{role:"initiator",direction:"outgoing",creator:t})},n.toIncomingMediaJSONAnswer=function(e,t){return s.toMediaJSON(e,{role:"initiator",direction:"incoming",creator:t})},n.toOutgoingMediaJSONAnswer=function(e,t){return s.toMediaJSON(e,{role:"responder",direction:"outgoing",creator:t})},n.toCandidateJSON=s.toCandidateJSON,n.toMediaJSON=s.toMediaJSON,n.toSessionJSON=s.toSessionJSON},{"./lib/tojson":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sdp-jingle-json/lib/tojson.js","./lib/tosdp":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sdp-jingle-json/lib/tosdp.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sdp-jingle-json/lib/parsers.js":[function(e,t,n){n.lines=function(e){return e.split("\r\n").filter(function(e){return e.length>0})},n.findLine=function(e,t,n){for(var r=e.length,s=0;s<t.length;s++)if(t[s].substr(0,r)===e)return t[s];if(!n)return!1;for(var i=0;i<n.length;i++)if(n[i].substr(0,r)===e)return n[i];return!1},n.findLines=function(e,t,n){for(var r=[],s=e.length,i=0;i<t.length;i++)t[i].substr(0,s)===e&&r.push(t[i]);if(r.length||!n)return r;for(var o=0;o<n.length;o++)n[o].substr(0,s)===e&&r.push(n[o]);return r},n.mline=function(e){for(var t=e.substr(2).split(" "),n={media:t[0],port:t[1],proto:t[2],formats:[]},r=3;r<t.length;r++)t[r]&&n.formats.push(t[r]);return n},n.rtpmap=function(e){var t=e.substr(9).split(" "),n={id:t.shift()};return t=t[0].split("/"),n.name=t[0],n.clockrate=t[1],n.channels=3==t.length?t[2]:"1",n},n.sctpmap=function(e){var t=e.substr(10).split(" "),n={number:t.shift(),protocol:t.shift(),streams:t.shift()};return n},n.fmtp=function(e){for(var t,n,r,s=e.substr(e.indexOf(" ")+1).split(";"),i=[],o=0;o<s.length;o++)t=s[o].split("="),n=t[0].trim(),r=t[1],n&&r?i.push({key:n,value:r}):n&&i.push({key:"",value:n});return i},n.crypto=function(e){var t=e.substr(9).split(" "),n={tag:t[0],cipherSuite:t[1],keyParams:t[2],sessionParams:t.slice(3).join(" ")};return n},n.fingerprint=function(e){var t=e.substr(14).split(" ");return{hash:t[0],value:t[1]}},n.extmap=function(e){var t=e.substr(9).split(" "),n={},r=t.shift(),s=r.indexOf("/");return s>=0?(n.id=r.substr(0,s),n.senders=r.substr(s+1)):(n.id=r,n.senders="sendrecv"),n.uri=t.shift()||"",n},n.rtcpfb=function(e){var t=e.substr(10).split(" "),n={};return n.id=t.shift(),n.type=t.shift(),"trr-int"===n.type?n.value=t.shift():n.subtype=t.shift()||"",n.parameters=t,n},n.candidate=function(e){var t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");for(var n={foundation:t[0],component:t[1],protocol:t[2].toLowerCase(),priority:t[3],ip:t[4],port:t[5],type:t[7],generation:"0"},r=8;r<t.length;r+=2)"raddr"===t[r]?n.relAddr=t[r+1]:"rport"===t[r]?n.relPort=t[r+1]:"generation"===t[r]?n.generation=t[r+1]:"tcptype"===t[r]&&(n.tcpType=t[r+1]);return n.network="1",n},n.sourceGroups=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n].substr(13).split(" ");t.push({semantics:r.shift(),sources:r})}return t},n.sources=function(e){for(var t=[],n={},r=0;r<e.length;r++){var s=e[r].substr(7).split(" "),i=s.shift();if(!n[i]){var o={ssrc:i,parameters:[]};t.push(o),n[i]=o}s=s.join(" ").split(":");var a=s.shift(),c=s.join(":")||null;n[i].parameters.push({key:a,value:c})}return t},n.groups=function(e){for(var t,n=[],r=0;r<e.length;r++)t=e[r].substr(8).split(" "),n.push({semantics:t.shift(),contents:t});return n},n.bandwidth=function(e){var t=e.substr(2).split(":"),n={};return n.type=t.shift(),n.bandwidth=t.shift(),n},n.msid=function(e){var t=e.substr(7),n=t.split(" ");return{msid:t,mslabel:n[0],label:n[1]}}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sdp-jingle-json/lib/senders.js":[function(e,t,n){t.exports={initiator:{incoming:{initiator:"recvonly",responder:"sendonly",both:"sendrecv",none:"inactive",recvonly:"initiator",sendonly:"responder",sendrecv:"both",inactive:"none"},outgoing:{initiator:"sendonly",responder:"recvonly",both:"sendrecv",none:"inactive",recvonly:"responder",sendonly:"initiator",sendrecv:"both",inactive:"none"}},responder:{incoming:{initiator:"sendonly",responder:"recvonly",both:"sendrecv",none:"inactive",recvonly:"responder",sendonly:"initiator",sendrecv:"both",inactive:"none"},outgoing:{initiator:"recvonly",responder:"sendonly",both:"sendrecv",none:"inactive",recvonly:"initiator",sendonly:"responder",sendrecv:"both",inactive:"none"}}}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sdp-jingle-json/lib/tojson.js":[function(e,t,n){var r=e("./senders"),s=e("./parsers"),i=Math.random();n._setIdCounter=function(e){i=e},n.toSessionJSON=function(e,t){var r,i=t.creators||[],o=t.role||"initiator",a=t.direction||"outgoing",c=e.split("\r\nm=");for(r=1;r<c.length;r++)c[r]="m="+c[r],r!==c.length-1&&(c[r]+="\r\n");var u=c.shift()+"\r\n",d=s.lines(u),l={},p=[];for(r=0;r<c.length;r++)p.push(n.toMediaJSON(c[r],u,{role:o,direction:a,creator:i[r]||"initiator"}));l.contents=p;var f=s.findLines("a=group:",d);return f.length&&(l.groups=s.groups(f)),l},n.toMediaJSON=function(e,t,i){var o=i.creator||"initiator",a=i.role||"initiator",c=i.direction||"outgoing",u=s.lines(e),d=s.lines(t),l=s.mline(u[0]),p={creator:o,name:l.media,application:{applicationType:"rtp",media:l.media,payloads:[],encryption:[],feedback:[],headerExtensions:[]},transport:{transportType:"iceUdp",candidates:[],fingerprints:[]}};"application"==l.media&&(p.application={applicationType:"datachannel"},p.transport.sctp=[]);var f=p.application,m=p.transport,h=s.findLine("a=mid:",u);if(h&&(p.name=h.substr(6)),s.findLine("a=sendrecv",u,d)?p.senders="both":s.findLine("a=sendonly",u,d)?p.senders=r[a][c].sendonly:s.findLine("a=recvonly",u,d)?p.senders=r[a][c].recvonly:s.findLine("a=inactive",u,d)&&(p.senders="none"),"rtp"==f.applicationType){var g=s.findLine("b=",u);g&&(f.bandwidth=s.bandwidth(g));var b=s.findLine("a=ssrc:",u);b&&(f.ssrc=b.substr(7).split(" ")[0]);var v=s.findLines("a=rtpmap:",u);v.forEach(function(e){var t=s.rtpmap(e);t.parameters=[],t.feedback=[];var n=s.findLines("a=fmtp:"+t.id,u);n.forEach(function(e){t.parameters=s.fmtp(e)});var r=s.findLines("a=rtcp-fb:"+t.id,u);r.forEach(function(e){t.feedback.push(s.rtcpfb(e))}),f.payloads.push(t)});var j=s.findLines("a=crypto:",u,d);j.forEach(function(e){f.encryption.push(s.crypto(e))}),s.findLine("a=rtcp-mux",u)&&(f.mux=!0);var _=s.findLines("a=rtcp-fb:*",u);_.forEach(function(e){f.feedback.push(s.rtcpfb(e))});var x=s.findLines("a=extmap:",u);x.forEach(function(e){var t=s.extmap(e);t.senders=r[a][c][t.senders],f.headerExtensions.push(t)});var y=s.findLines("a=ssrc-group:",u);f.sourceGroups=s.sourceGroups(y||[]);var S=s.findLines("a=ssrc:",u),w=f.sources=s.sources(S||[]),z=s.findLine("a=msid:",u);if(z){var P=s.msid(z);["msid","mslabel","label"].forEach(function(e){for(var t=0;t<w.length;t++){for(var n=!1,r=0;r<w[t].parameters.length;r++)w[t].parameters[r].key===e&&(n=!0);n||w[t].parameters.push({key:e,value:P[e]})}})}s.findLine("a=x-google-flag:conference",u,d)&&(f.googConferenceFlag=!0)}var E=s.findLines("a=fingerprint:",u,d),U=s.findLine("a=setup:",u,d);E.forEach(function(e){var t=s.fingerprint(e);U&&(t.setup=U.substr(8)),m.fingerprints.push(t)});var C=s.findLine("a=ice-ufrag:",u,d),T=s.findLine("a=ice-pwd:",u,d);if(C&&T){m.ufrag=C.substr(12),m.pwd=T.substr(10),m.candidates=[];var R=s.findLines("a=candidate:",u,d);R.forEach(function(e){m.candidates.push(n.toCandidateJSON(e))})}if("datachannel"==f.applicationType){var N=s.findLines("a=sctpmap:",u);N.forEach(function(e){var t=s.sctpmap(e);m.sctp.push(t)})}return p},n.toCandidateJSON=function(e){var t=s.candidate(e.split("\r\n")[0]);return t.id=(i++).toString(36).substr(0,12),t}},{"./parsers":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sdp-jingle-json/lib/parsers.js","./senders":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sdp-jingle-json/lib/senders.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sdp-jingle-json/lib/tosdp.js":[function(e,t,n){var r=e("./senders");n.toSessionSDP=function(e,t){var r=(t.role||"initiator",t.direction||"outgoing",t.sid||e.sid||Date.now()),s=t.time||Date.now(),i=["v=0","o=- "+r+" "+s+" IN IP4 0.0.0.0","s=-","t=0 0"],o=e.contents||[],a=!1;o.forEach(function(e){e.application.sources&&e.application.sources.length&&(a=!0)}),a&&i.push("a=msid-semantic: WMS *");var c=e.groups||[];return c.forEach(function(e){i.push("a=group:"+e.semantics+" "+e.contents.join(" "))}),o.forEach(function(e){i.push(n.toMediaSDP(e,t))}),i.join("\r\n")+"\r\n"},n.toMediaSDP=function(e,t){var s=[],i=t.role||"initiator",o=t.direction||"outgoing",a=e.application,c=e.transport,u=a.payloads||[],d=c&&c.fingerprints||[],l=[];if("datachannel"==a.applicationType?(l.push("application"),l.push("1"),l.push("DTLS/SCTP"),c.sctp&&c.sctp.forEach(function(e){l.push(e.number)})):(l.push(a.media),l.push("1"),d.length>0?l.push("UDP/TLS/RTP/SAVPF"):a.encryption&&a.encryption.length>0?l.push("RTP/SAVPF"):l.push("RTP/AVPF"),u.forEach(function(e){l.push(e.id)})),s.push("m="+l.join(" ")),s.push("c=IN IP4 0.0.0.0"),a.bandwidth&&a.bandwidth.type&&a.bandwidth.bandwidth&&s.push("b="+a.bandwidth.type+":"+a.bandwidth.bandwidth),"rtp"==a.applicationType&&s.push("a=rtcp:1 IN IP4 0.0.0.0"),c){c.ufrag&&s.push("a=ice-ufrag:"+c.ufrag),c.pwd&&s.push("a=ice-pwd:"+c.pwd);var p=!1;d.forEach(function(e){s.push("a=fingerprint:"+e.hash+" "+e.value),e.setup&&!p&&s.push("a=setup:"+e.setup)}),c.sctp&&c.sctp.forEach(function(e){s.push("a=sctpmap:"+e.number+" "+e.protocol+" "+e.streams)})}"rtp"==a.applicationType&&s.push("a="+(r[i][o][e.senders]||"sendrecv")),s.push("a=mid:"+e.name),a.sources&&a.sources.length&&(a.sources[0].parameters||[]).forEach(function(e){"msid"===e.key&&s.push("a=msid:"+e.value)}),a.mux&&s.push("a=rtcp-mux");var f=a.encryption||[];f.forEach(function(e){s.push("a=crypto:"+e.tag+" "+e.cipherSuite+" "+e.keyParams+(e.sessionParams?" "+e.sessionParams:""))}),a.googConferenceFlag&&s.push("a=x-google-flag:conference"),u.forEach(function(e){var t="a=rtpmap:"+e.id+" "+e.name+"/"+e.clockrate;if(e.channels&&"1"!=e.channels&&(t+="/"+e.channels),s.push(t),e.parameters&&e.parameters.length){var n=["a=fmtp:"+e.id],r=[];e.parameters.forEach(function(e){
  r.push((e.key?e.key+"=":"")+e.value)}),n.push(r.join(";")),s.push(n.join(" "))}e.feedback&&e.feedback.forEach(function(t){"trr-int"===t.type?s.push("a=rtcp-fb:"+e.id+" trr-int "+(t.value?t.value:"0")):s.push("a=rtcp-fb:"+e.id+" "+t.type+(t.subtype?" "+t.subtype:""))})}),a.feedback&&a.feedback.forEach(function(e){"trr-int"===e.type?s.push("a=rtcp-fb:* trr-int "+(e.value?e.value:"0")):s.push("a=rtcp-fb:* "+e.type+(e.subtype?" "+e.subtype:""))});var m=a.headerExtensions||[];m.forEach(function(e){s.push("a=extmap:"+e.id+(e.senders?"/"+r[i][o][e.senders]:"")+" "+e.uri)});var h=a.sourceGroups||[];h.forEach(function(e){s.push("a=ssrc-group:"+e.semantics+" "+e.sources.join(" "))});var g=a.sources||[];g.forEach(function(e){for(var t=0;t<e.parameters.length;t++){var n=e.parameters[t];s.push("a=ssrc:"+(e.ssrc||a.ssrc)+" "+n.key+(n.value?":"+n.value:""))}});var b=c.candidates||[];return b.forEach(function(e){s.push(n.toCandidateSDP(e))}),s.join("\r\n")},n.toCandidateSDP=function(e){var t=[];t.push(e.foundation),t.push(e.component),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.ip),t.push(e.port);var n=e.type;return t.push("typ"),t.push(n),"srflx"!==n&&"prflx"!==n&&"relay"!==n||e.relAddr&&e.relPort&&(t.push("raddr"),t.push(e.relAddr),t.push("rport"),t.push(e.relPort)),e.tcpType&&"TCP"==e.protocol.toUpperCase()&&(t.push("tcptype"),t.push(e.tcpType)),t.push("generation"),t.push(e.generation||"0"),"a=candidate:"+t.join(" ")}},{"./senders":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sdp-jingle-json/lib/senders.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sdp/sdp.js":[function(e,t,n){"use strict";var r={};r.generateIdentifier=function(){return Math.random().toString(36).substr(2,10)},r.localCName=r.generateIdentifier(),r.splitLines=function(e){return e.trim().split("\n").map(function(e){return e.trim()})},r.splitSections=function(e){var t=e.split("\nm=");return t.map(function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"})},r.matchPrefix=function(e,t){return r.splitLines(e).filter(function(e){return 0===e.indexOf(t)})},r.parseCandidate=function(e){var t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");for(var n={foundation:t[0],component:t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],port:parseInt(t[5],10),type:t[7]},r=8;r<t.length;r+=2)switch(t[r]){case"raddr":n.relatedAddress=t[r+1];break;case"rport":n.relatedPort=parseInt(t[r+1],10);break;case"tcptype":n.tcpType=t[r+1]}return n},r.writeCandidate=function(e){var t=[];t.push(e.foundation),t.push(e.component),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.ip),t.push(e.port);var n=e.type;return t.push("typ"),t.push(n),"host"!==n&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),"candidate:"+t.join(" ")},r.parseRtpMap=function(e){var t=e.substr(9).split(" "),n={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),n.name=t[0],n.clockRate=parseInt(t[1],10),n.numChannels=3===t.length?parseInt(t[2],10):1,n},r.writeRtpMap=function(e){var t=e.payloadType;return void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType),"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==e.numChannels?"/"+e.numChannels:"")+"\r\n"},r.parseExtmap=function(e){var t=e.substr(9).split(" ");return{id:parseInt(t[0],10),uri:t[1]}},r.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+" "+e.uri+"\r\n"},r.parseFmtp=function(e){for(var t,n={},r=e.substr(e.indexOf(" ")+1).split(";"),s=0;s<r.length;s++)t=r[s].trim().split("="),n[t[0].trim()]=t[1];return n},r.writeFmtp=function(e){var t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var r=[];Object.keys(e.parameters).forEach(function(t){r.push(t+"="+e.parameters[t])}),t+="a=fmtp:"+n+" "+r.join(";")+"\r\n"}return t},r.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},r.writeRtcpFb=function(e){var t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach(function(e){t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"}),t},r.parseSsrcMedia=function(e){var t=e.indexOf(" "),n={ssrc:parseInt(e.substr(7,t-7),10)},r=e.indexOf(":",t);return r>-1?(n.attribute=e.substr(t+1,r-t-1),n.value=e.substr(r+1)):n.attribute=e.substr(t+1),n},r.getDtlsParameters=function(e,t){var n=r.splitLines(e);n=n.concat(r.splitLines(t));var s=n.filter(function(e){return 0===e.indexOf("a=fingerprint:")})[0].substr(14),i={role:"auto",fingerprints:[{algorithm:s.split(" ")[0],value:s.split(" ")[1]}]};return i},r.writeDtlsParameters=function(e,t){var n="a=setup:"+t+"\r\n";return e.fingerprints.forEach(function(e){n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"}),n},r.getIceParameters=function(e,t){var n=r.splitLines(e);n=n.concat(r.splitLines(t));var s={usernameFragment:n.filter(function(e){return 0===e.indexOf("a=ice-ufrag:")})[0].substr(12),password:n.filter(function(e){return 0===e.indexOf("a=ice-pwd:")})[0].substr(10)};return s},r.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},r.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=r.splitLines(e),s=n[0].split(" "),i=3;i<s.length;i++){var o=s[i],a=r.matchPrefix(e,"a=rtpmap:"+o+" ")[0];if(a){var c=r.parseRtpMap(a),u=r.matchPrefix(e,"a=fmtp:"+o+" ");switch(c.parameters=u.length?r.parseFmtp(u[0]):{},c.rtcpFeedback=r.matchPrefix(e,"a=rtcp-fb:"+o+" ").map(r.parseRtcpFb),t.codecs.push(c),c.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(c.name.toUpperCase())}}}return r.matchPrefix(e,"a=extmap:").forEach(function(e){t.headerExtensions.push(r.parseExtmap(e))}),t},r.writeRtpDescription=function(e,t){var n="";return n+="m="+e+" ",n+=t.codecs.length>0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=t.codecs.map(function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType}).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach(function(e){n+=r.writeRtpMap(e),n+=r.writeFmtp(e),n+=r.writeRtcpFb(e)}),n+="a=rtcp-mux\r\n"},r.parseRtpEncodingParameters=function(e){var t,n=[],s=r.parseRtpParameters(e),i=s.fecMechanisms.indexOf("RED")!==-1,o=s.fecMechanisms.indexOf("ULPFEC")!==-1,a=r.matchPrefix(e,"a=ssrc:").map(function(e){return r.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute}),c=a.length>0&&a[0].ssrc,u=r.matchPrefix(e,"a=ssrc-group:FID").map(function(e){var t=e.split(" ");return t.shift(),t.map(function(e){return parseInt(e,10)})});u.length>0&&u[0].length>1&&u[0][0]===c&&(t=u[0][1]),s.codecs.forEach(function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var r={ssrc:c,codecPayloadType:parseInt(e.parameters.apt,10),rtx:{payloadType:e.payloadType,ssrc:t}};n.push(r),i&&(r=JSON.parse(JSON.stringify(r)),r.fec={ssrc:t,mechanism:o?"red+ulpfec":"red"},n.push(r))}}),0===n.length&&c&&n.push({ssrc:c});var d=r.matchPrefix(e,"b=");return d.length&&(0===d[0].indexOf("b=TIAS:")?d=parseInt(d[0].substr(7),10):0===d[0].indexOf("b=AS:")&&(d=parseInt(d[0].substr(5),10)),n.forEach(function(e){e.maxBitrate=d})),n},r.writeSessionBoilerplate=function(){return"v=0\r\no=thisisadapterortc 8169639915646943137 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},r.writeMediaSection=function(e,t,n,s){var i=r.writeRtpDescription(e.kind,t);if(i+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),i+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":"active"),i+="a=mid:"+e.mid+"\r\n",i+=e.rtpSender&&e.rtpReceiver?"a=sendrecv\r\n":e.rtpSender?"a=sendonly\r\n":e.rtpReceiver?"a=recvonly\r\n":"a=inactive\r\n",e.rtpSender){var o="msid:"+s.id+" "+e.rtpSender.track.id+"\r\n";i+="a="+o,i+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+o}return i+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n"},r.getDirection=function(e,t){for(var n=r.splitLines(e),s=0;s<n.length;s++)switch(n[s]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[s].substr(2)}return t?r.getDirection(t):"sendrecv"},t.exports=r},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sha.js/hash.js":[function(e,t,n){(function(e){function Hash(t,n){this._block=new e(t),this._finalSize=n,this._blockSize=t,this._len=0,this._s=0}Hash.prototype.update=function(t,n){"string"==typeof t&&(n=n||"utf8",t=new e(t,n));for(var r=this._len+=t.length,s=this._s||0,i=0,o=this._block;s<r;){for(var a=Math.min(t.length,i+this._blockSize-s%this._blockSize),c=a-i,u=0;u<c;u++)o[s%this._blockSize+u]=t[u+i];s+=c,i+=c,s%this._blockSize===0&&this._update(o)}return this._s=s,this},Hash.prototype.digest=function(e){var t=8*this._len;this._block[this._len%this._blockSize]=128,this._block.fill(0,this._len%this._blockSize+1),t%(8*this._blockSize)>=8*this._finalSize&&(this._update(this._block),this._block.fill(0)),this._block.writeInt32BE(t,this._blockSize-4);var n=this._update(this._block)||this._hash();return e?n.toString(e):n},Hash.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=Hash}).call(this,e("buffer").Buffer)},{buffer:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sha.js/index.js":[function(e,t,n){var n=t.exports=function SHA(e){e=e.toLowerCase();var t=n[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};n.sha=e("./sha"),n.sha1=e("./sha1"),n.sha224=e("./sha224"),n.sha256=e("./sha256"),n.sha384=e("./sha384"),n.sha512=e("./sha512")},{"./sha":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sha.js/sha.js","./sha1":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sha.js/sha1.js","./sha224":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sha.js/sha224.js","./sha256":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sha.js/sha256.js","./sha384":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sha.js/sha384.js","./sha512":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sha.js/sha512.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sha.js/sha.js":[function(e,t,n){(function(n){function Sha(){this.init(),this._w=o,s.call(this,64,56)}function rotl5(e){return e<<5|e>>>27}function rotl30(e){return e<<30|e>>>2}function ft(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}var r=e("inherits"),s=e("./hash"),i=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);r(Sha,s),Sha.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha.prototype._update=function(e){for(var t=this._w,n=0|this._a,r=0|this._b,s=0|this._c,o=0|this._d,a=0|this._e,c=0;c<16;++c)t[c]=e.readInt32BE(4*c);for(;c<80;++c)t[c]=t[c-3]^t[c-8]^t[c-14]^t[c-16];for(var u=0;u<80;++u){var d=~~(u/20),l=rotl5(n)+ft(d,r,s,o)+a+t[u]+i[d]|0;a=o,o=s,s=rotl30(r),r=n,n=l}this._a=n+this._a|0,this._b=r+this._b|0,this._c=s+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0},Sha.prototype._hash=function(){var e=new n(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=Sha}).call(this,e("buffer").Buffer)},{"./hash":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sha.js/hash.js",buffer:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/index.js",inherits:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/inherits/inherits_browser.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sha.js/sha1.js":[function(e,t,n){(function(n){function Sha1(){this.init(),this._w=o,s.call(this,64,56)}function rotl1(e){return e<<1|e>>>31}function rotl5(e){return e<<5|e>>>27}function rotl30(e){return e<<30|e>>>2}function ft(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}var r=e("inherits"),s=e("./hash"),i=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);r(Sha1,s),Sha1.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha1.prototype._update=function(e){for(var t=this._w,n=0|this._a,r=0|this._b,s=0|this._c,o=0|this._d,a=0|this._e,c=0;c<16;++c)t[c]=e.readInt32BE(4*c);for(;c<80;++c)t[c]=rotl1(t[c-3]^t[c-8]^t[c-14]^t[c-16]);for(var u=0;u<80;++u){var d=~~(u/20),l=rotl5(n)+ft(d,r,s,o)+a+t[u]+i[d]|0;a=o,o=s,s=rotl30(r),r=n,n=l}this._a=n+this._a|0,this._b=r+this._b|0,this._c=s+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0},Sha1.prototype._hash=function(){var e=new n(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=Sha1}).call(this,e("buffer").Buffer)},{"./hash":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sha.js/hash.js",buffer:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/index.js",inherits:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/inherits/inherits_browser.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sha.js/sha224.js":[function(e,t,n){(function(n){function Sha224(){this.init(),this._w=o,i.call(this,64,56)}var r=e("inherits"),s=e("./sha256"),i=e("./hash"),o=new Array(64);r(Sha224,s),Sha224.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},Sha224.prototype._hash=function(){var e=new n(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},t.exports=Sha224}).call(this,e("buffer").Buffer)},{"./hash":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sha.js/hash.js","./sha256":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sha.js/sha256.js",buffer:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/index.js",inherits:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/inherits/inherits_browser.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sha.js/sha256.js":[function(e,t,n){(function(n){function Sha256(){this.init(),this._w=o,s.call(this,64,56)}function ch(e,t,n){return n^e&(t^n)}function maj(e,t,n){return e&t|n&(e|t)}function sigma0(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function sigma1(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function gamma0(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function gamma1(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}var r=e("inherits"),s=e("./hash"),i=[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],o=new Array(64);r(Sha256,s),Sha256.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},Sha256.prototype._update=function(e){for(var t=this._w,n=0|this._a,r=0|this._b,s=0|this._c,o=0|this._d,a=0|this._e,c=0|this._f,u=0|this._g,d=0|this._h,l=0;l<16;++l)t[l]=e.readInt32BE(4*l);for(;l<64;++l)t[l]=gamma1(t[l-2])+t[l-7]+gamma0(t[l-15])+t[l-16]|0;for(var p=0;p<64;++p){var f=d+sigma1(a)+ch(a,c,u)+i[p]+t[p]|0,m=sigma0(n)+maj(n,r,s)|0;d=u,u=c,c=a,a=o+f|0,o=s,s=r,r=n,n=f+m|0}this._a=n+this._a|0,this._b=r+this._b|0,this._c=s+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0,this._f=c+this._f|0,this._g=u+this._g|0,this._h=d+this._h|0},Sha256.prototype._hash=function(){var e=new n(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},t.exports=Sha256}).call(this,e("buffer").Buffer)},{"./hash":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sha.js/hash.js",buffer:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/index.js",inherits:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/inherits/inherits_browser.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sha.js/sha384.js":[function(e,t,n){(function(n){function Sha384(){this.init(),this._w=o,i.call(this,128,112)}var r=e("inherits"),s=e("./sha512"),i=e("./hash"),o=new Array(160);r(Sha384,s),Sha384.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},Sha384.prototype._hash=function(){function writeInt64BE(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}var e=new n(48);return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),e},t.exports=Sha384}).call(this,e("buffer").Buffer)},{"./hash":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sha.js/hash.js","./sha512":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sha.js/sha512.js",buffer:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/index.js",inherits:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/inherits/inherits_browser.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sha.js/sha512.js":[function(e,t,n){(function(n){function Sha512(){this.init(),this._w=o,s.call(this,128,112)}function Ch(e,t,n){return n^e&(t^n)}function maj(e,t,n){return e&t|n&(e|t)}function sigma0(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function sigma1(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Gamma0(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function Gamma0l(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function Gamma1(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Gamma1l(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function getCarry(e,t){return e>>>0<t>>>0?1:0}var r=e("inherits"),s=e("./hash"),i=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],o=new Array(160);r(Sha512,s),Sha512.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},Sha512.prototype._update=function(e){for(var t=this._w,n=0|this._ah,r=0|this._bh,s=0|this._ch,o=0|this._dh,a=0|this._eh,c=0|this._fh,u=0|this._gh,d=0|this._hh,l=0|this._al,p=0|this._bl,f=0|this._cl,m=0|this._dl,h=0|this._el,g=0|this._fl,b=0|this._gl,v=0|this._hl,j=0;j<32;j+=2)t[j]=e.readInt32BE(4*j),t[j+1]=e.readInt32BE(4*j+4);for(;j<160;j+=2){var _=t[j-30],x=t[j-30+1],y=Gamma0(_,x),S=Gamma0l(x,_);_=t[j-4],x=t[j-4+1];var w=Gamma1(_,x),z=Gamma1l(x,_),P=t[j-14],E=t[j-14+1],U=t[j-32],C=t[j-32+1],T=S+E|0,R=y+P+getCarry(T,S)|0;T=T+z|0,R=R+w+getCarry(T,z)|0,T=T+C|0,R=R+U+getCarry(T,C)|0,t[j]=R,t[j+1]=T}for(var N=0;N<160;N+=2){R=t[N],T=t[N+1];var A=maj(n,r,s),O=maj(l,p,f),I=sigma0(n,l),M=sigma0(l,n),k=sigma1(a,h),D=sigma1(h,a),B=i[N],L=i[N+1],F=Ch(a,c,u),q=Ch(h,g,b),G=v+D|0,J=d+k+getCarry(G,v)|0;G=G+q|0,J=J+F+getCarry(G,q)|0,G=G+L|0,J=J+B+getCarry(G,L)|0,G=G+T|0,J=J+R+getCarry(G,T)|0;var H=M+O|0,V=I+A+getCarry(H,M)|0;d=u,v=b,u=c,b=g,c=a,g=h,h=m+G|0,a=o+J+getCarry(h,m)|0,o=s,m=f,s=r,f=p,r=n,p=l,l=G+H|0,n=J+V+getCarry(l,G)|0}this._al=this._al+l|0,this._bl=this._bl+p|0,this._cl=this._cl+f|0,this._dl=this._dl+m|0,this._el=this._el+h|0,this._fl=this._fl+g|0,this._gl=this._gl+b|0,this._hl=this._hl+v|0,this._ah=this._ah+n+getCarry(this._al,l)|0,this._bh=this._bh+r+getCarry(this._bl,p)|0,this._ch=this._ch+s+getCarry(this._cl,f)|0,this._dh=this._dh+o+getCarry(this._dl,m)|0,this._eh=this._eh+a+getCarry(this._el,h)|0,this._fh=this._fh+c+getCarry(this._fl,g)|0,this._gh=this._gh+u+getCarry(this._gl,b)|0,this._hh=this._hh+d+getCarry(this._hl,v)|0},Sha512.prototype._hash=function(){function writeInt64BE(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}var e=new n(64);return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),writeInt64BE(this._gh,this._gl,48),writeInt64BE(this._hh,this._hl,56),e},t.exports=Sha512}).call(this,e("buffer").Buffer)},{"./hash":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sha.js/hash.js",buffer:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/index.js",inherits:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/inherits/inherits_browser.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/index.js":[function(e,t,n){function Stream(){r.call(this)}t.exports=Stream;var r=e("events").EventEmitter,s=e("inherits");s(Stream,r),Stream.Readable=e("readable-stream/readable.js"),Stream.Writable=e("readable-stream/writable.js"),Stream.Duplex=e("readable-stream/duplex.js"),Stream.Transform=e("readable-stream/transform.js"),Stream.PassThrough=e("readable-stream/passthrough.js"),Stream.Stream=Stream,Stream.prototype.pipe=function(e,t){function ondata(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function ondrain(){n.readable&&n.resume&&n.resume()}function onend(){s||(s=!0,e.end())}function onclose(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function onerror(e){if(cleanup(),0===r.listenerCount(this,"error"))throw e}function cleanup(){n.removeListener("data",ondata),e.removeListener("drain",ondrain),n.removeListener("end",onend),n.removeListener("close",onclose),n.removeListener("error",onerror),e.removeListener("error",onerror),n.removeListener("end",cleanup),n.removeListener("close",cleanup),e.removeListener("close",cleanup)}var n=this;n.on("data",ondata),e.on("drain",ondrain),e._isStdio||t&&t.end===!1||(n.on("end",onend),n.on("close",onclose));var s=!1;return n.on("error",onerror),e.on("error",onerror),n.on("end",cleanup),n.on("close",cleanup),e.on("close",cleanup),e.emit("pipe",n),e}},{events:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/events/events.js",inherits:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/inherits/inherits_browser.js","readable-stream/duplex.js":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/duplex.js","readable-stream/passthrough.js":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/passthrough.js","readable-stream/readable.js":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/readable.js","readable-stream/transform.js":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/transform.js","readable-stream/writable.js":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/writable.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/isarray/index.js":[function(e,t,n){arguments[4]["/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/node_modules/isarray/index.js"][0].apply(n,arguments)},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/duplex.js":[function(e,t,n){t.exports=e("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js":[function(e,t,n){"use strict";function Duplex(e){return this instanceof Duplex?(o.call(this,e),a.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),void this.once("end",onend)):new Duplex(e)}function onend(){this.allowHalfOpen||this._writableState.ended||s(onEndNT,this)}function onEndNT(e){e.end()}var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=Duplex;var s=e("process-nextick-args"),i=e("core-util-is");i.inherits=e("inherits");var o=e("./_stream_readable"),a=e("./_stream_writable");i.inherits(Duplex,o);for(var c=r(a.prototype),u=0;u<c.length;u++){var d=c[u];Duplex.prototype[d]||(Duplex.prototype[d]=a.prototype[d])}},{"./_stream_readable":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_readable.js","./_stream_writable":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js","core-util-is":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-util-is/lib/util.js",inherits:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/inherits/inherits_browser.js","process-nextick-args":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/process-nextick-args/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_passthrough.js":[function(e,t,n){"use strict";function PassThrough(e){return this instanceof PassThrough?void r.call(this,e):new PassThrough(e)}t.exports=PassThrough;var r=e("./_stream_transform"),s=e("core-util-is");s.inherits=e("inherits"),s.inherits(PassThrough,r),PassThrough.prototype._transform=function(e,t,n){n(null,e)}},{"./_stream_transform":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_transform.js","core-util-is":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-util-is/lib/util.js",inherits:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/inherits/inherits_browser.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_readable.js":[function(e,t,n){(function(n){"use strict";function prependListener(e,t,n){return h?e.prependListener(t,n):void(e._events&&e._events[t]?s(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n))}function ReadableState(t,n){m=m||e("./_stream_duplex"),t=t||{},this.objectMode=!!t.objectMode,n instanceof m&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var r=t.highWaterMark,s=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:s,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(f||(f=e("string_decoder/").StringDecoder),this.decoder=new f(t.encoding),this.encoding=t.encoding)}function Readable(t){return m=m||e("./_stream_duplex"),this instanceof Readable?(this._readableState=new ReadableState(t,this),this.readable=!0,t&&"function"==typeof t.read&&(this._read=t.read),void i.call(this)):new Readable(t)}function readableAddChunk(e,t,n,r,s){var i=chunkInvalid(t,n);if(i)e.emit("error",i);else if(null===n)t.reading=!1,onEofChunk(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!s){var o=new Error("stream.push() after EOF");e.emit("error",o)}else if(t.endEmitted&&s){var a=new Error("stream.unshift() after end event");e.emit("error",a)}else{var c;!t.decoder||s||r||(n=t.decoder.write(n),c=!t.objectMode&&0===n.length),s||(t.reading=!1),c||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,s?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&emitReadable(e))),maybeReadMore(e,t)}else s||(t.reading=!1);return needMoreData(t)}function needMoreData(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}function computeNewHighWaterMark(e){return e>=g?e=g:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function howMuchToRead(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:null===e||isNaN(e)?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:e<=0?0:(e>t.highWaterMark&&(t.highWaterMark=computeNewHighWaterMark(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function chunkInvalid(e,t){var n=null;return c.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function onEofChunk(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,emitReadable(e)}}function emitReadable(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(p("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?r(emitReadable_,e):emitReadable_(e))}function emitReadable_(e){p("emit readable"),e.emit("readable"),flow(e)}function maybeReadMore(e,t){t.readingMore||(t.readingMore=!0,r(maybeReadMore_,e,t))}function maybeReadMore_(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(p("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function pipeOnDrain(e){return function(){var t=e._readableState;p("pipeOnDrain",t.awaitDrain),
  t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,flow(e))}}function nReadingNextTick(e){p("readable nexttick read 0"),e.read(0)}function resume(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r(resume_,e,t))}function resume_(e,t){t.reading||(p("resume read 0"),e.read(0)),t.resumeScheduled=!1,e.emit("resume"),flow(e),t.flowing&&!t.reading&&e.read(0)}function flow(e){var t=e._readableState;if(p("flow",t.flowing),t.flowing)do var n=e.read();while(null!==n&&t.flowing)}function fromList(e,t){var n,r=t.buffer,s=t.length,i=!!t.decoder,o=!!t.objectMode;if(0===r.length)return null;if(0===s)n=null;else if(o)n=r.shift();else if(!e||e>=s)n=i?r.join(""):1===r.length?r[0]:c.concat(r,s),r.length=0;else if(e<r[0].length){var a=r[0];n=a.slice(0,e),r[0]=a.slice(e)}else if(e===r[0].length)n=r.shift();else{n=i?"":u.allocUnsafe(e);for(var d=0,l=0,p=r.length;l<p&&d<e;l++){var f=r[0],m=Math.min(e-d,f.length);i?n+=f.slice(0,m):f.copy(n,d,0,m),m<f.length?r[0]=f.slice(m):r.shift(),d+=m}}return n}function endReadable(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,r(endReadableNT,t,e))}function endReadableNT(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function forEach(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}function indexOf(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}t.exports=Readable;var r=e("process-nextick-args"),s=e("isarray");Readable.ReadableState=ReadableState;var i,o=e("events").EventEmitter,a=function(e,t){return e.listeners(t).length};!function(){try{i=e("stream")}catch(e){}finally{i||(i=e("events").EventEmitter)}}();var c=e("buffer").Buffer,u=e("buffer-shims"),d=e("core-util-is");d.inherits=e("inherits");var l=e("util"),p=void 0;p=l&&l.debuglog?l.debuglog("stream"):function(){};var f;d.inherits(Readable,i);var m,m,h="function"==typeof o.prototype.prependListener;Readable.prototype.push=function(e,t){var n=this._readableState;return n.objectMode||"string"!=typeof e||(t=t||n.defaultEncoding,t!==n.encoding&&(e=u.from(e,t),t="")),readableAddChunk(this,n,e,t,!1)},Readable.prototype.unshift=function(e){var t=this._readableState;return readableAddChunk(this,t,e,"",!0)},Readable.prototype.isPaused=function(){return this._readableState.flowing===!1},Readable.prototype.setEncoding=function(t){return f||(f=e("string_decoder/").StringDecoder),this._readableState.decoder=new f(t),this._readableState.encoding=t,this};var g=8388608;Readable.prototype.read=function(e){p("read",e);var t=this._readableState,n=e;if(("number"!=typeof e||e>0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return p("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?endReadable(this):emitReadable(this),null;if(e=howMuchToRead(e,t),0===e&&t.ended)return 0===t.length&&endReadable(this),null;var r=t.needReadable;p("need readable",r),(0===t.length||t.length-e<t.highWaterMark)&&(r=!0,p("length less than watermark",r)),(t.ended||t.reading)&&(r=!1,p("reading or ended",r)),r&&(p("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1),r&&!t.reading&&(e=howMuchToRead(n,t));var s;return s=e>0?fromList(e,t):null,null===s&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),n!==e&&t.ended&&0===t.length&&endReadable(this),null!==s&&this.emit("data",s),s},Readable.prototype._read=function(e){this.emit("error",new Error("not implemented"))},Readable.prototype.pipe=function(e,t){function onunpipe(e){p("onunpipe"),e===s&&cleanup()}function onend(){p("onend"),e.end()}function cleanup(){p("cleanup"),e.removeListener("close",onclose),e.removeListener("finish",onfinish),e.removeListener("drain",u),e.removeListener("error",onerror),e.removeListener("unpipe",onunpipe),s.removeListener("end",onend),s.removeListener("end",cleanup),s.removeListener("data",ondata),d=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||u()}function ondata(t){p("ondata");var n=e.write(t);!1===n&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&indexOf(i.pipes,e)!==-1)&&!d&&(p("false write response, pause",s._readableState.awaitDrain),s._readableState.awaitDrain++),s.pause())}function onerror(t){p("onerror",t),unpipe(),e.removeListener("error",onerror),0===a(e,"error")&&e.emit("error",t)}function onclose(){e.removeListener("finish",onfinish),unpipe()}function onfinish(){p("onfinish"),e.removeListener("close",onclose),unpipe()}function unpipe(){p("unpipe"),s.unpipe(e)}var s=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,p("pipe count=%d opts=%j",i.pipesCount,t);var o=(!t||t.end!==!1)&&e!==n.stdout&&e!==n.stderr,c=o?onend:cleanup;i.endEmitted?r(c):s.once("end",c),e.on("unpipe",onunpipe);var u=pipeOnDrain(s);e.on("drain",u);var d=!1;return s.on("data",ondata),prependListener(e,"error",onerror),e.once("close",onclose),e.once("finish",onfinish),e.emit("pipe",s),i.flowing||(p("pipe resume"),s.resume()),e},Readable.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s<r;s++)n[s].emit("unpipe",this);return this}var i=indexOf(t.pipes,e);return i===-1?this:(t.pipes.splice(i,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this),this)},Readable.prototype.on=function(e,t){var n=i.prototype.on.call(this,e,t);if("data"===e&&!1!==this._readableState.flowing&&this.resume(),"readable"===e&&!this._readableState.endEmitted){var s=this._readableState;s.readableListening||(s.readableListening=!0,s.emittedReadable=!1,s.needReadable=!0,s.reading?s.length&&emitReadable(this,s):r(nReadingNextTick,this))}return n},Readable.prototype.addListener=Readable.prototype.on,Readable.prototype.resume=function(){var e=this._readableState;return e.flowing||(p("resume"),e.flowing=!0,resume(this,e)),this},Readable.prototype.pause=function(){return p("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(p("pause"),this._readableState.flowing=!1,this.emit("pause")),this},Readable.prototype.wrap=function(e){var t=this._readableState,n=!1,r=this;e.on("end",function(){if(p("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&r.push(e)}r.push(null)}),e.on("data",function(s){if(p("wrapped data"),t.decoder&&(s=t.decoder.write(s)),(!t.objectMode||null!==s&&void 0!==s)&&(t.objectMode||s&&s.length)){var i=r.push(s);i||(n=!0,e.pause())}});for(var s in e)void 0===this[s]&&"function"==typeof e[s]&&(this[s]=function(t){return function(){return e[t].apply(e,arguments)}}(s));var i=["error","close","destroy","pause","resume"];return forEach(i,function(t){e.on(t,r.emit.bind(r,t))}),r._read=function(t){p("wrapped _read",t),n&&(n=!1,e.resume())},r},Readable._fromList=fromList}).call(this,e("_process"))},{"./_stream_duplex":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js",_process:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/browserify/node_modules/process/browser.js",buffer:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/index.js","buffer-shims":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer-shims/index.js","core-util-is":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-util-is/lib/util.js",events:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/events/events.js",inherits:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/inherits/inherits_browser.js",isarray:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/isarray/index.js","process-nextick-args":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/process-nextick-args/index.js","string_decoder/":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/string_decoder/index.js",util:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/browser-resolve/empty.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_transform.js":[function(e,t,n){"use strict";function TransformState(e){this.afterTransform=function(t,n){return afterTransform(e,t,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function afterTransform(e,t,n){var r=e._transformState;r.transforming=!1;var s=r.writecb;if(!s)return e.emit("error",new Error("no writecb in Transform class"));r.writechunk=null,r.writecb=null,null!==n&&void 0!==n&&e.push(n),s(t);var i=e._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&e._read(i.highWaterMark)}function Transform(e){if(!(this instanceof Transform))return new Transform(e);r.call(this,e),this._transformState=new TransformState(this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.once("prefinish",function(){"function"==typeof this._flush?this._flush(function(e){done(t,e)}):done(t)})}function done(e,t){if(t)return e.emit("error",t);var n=e._writableState,r=e._transformState;if(n.length)throw new Error("Calling transform done when ws.length != 0");if(r.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}t.exports=Transform;var r=e("./_stream_duplex"),s=e("core-util-is");s.inherits=e("inherits"),s.inherits(Transform,r),Transform.prototype.push=function(e,t){return this._transformState.needTransform=!1,r.prototype.push.call(this,e,t)},Transform.prototype._transform=function(e,t,n){throw new Error("Not implemented")},Transform.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var s=this._readableState;(r.needTransform||s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}},Transform.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0}},{"./_stream_duplex":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js","core-util-is":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-util-is/lib/util.js",inherits:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/inherits/inherits_browser.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js":[function(e,t,n){(function(n){"use strict";function nop(){}function WriteReq(e,t,n){this.chunk=e,this.encoding=t,this.callback=n,this.next=null}function WritableState(t,n){d=d||e("./_stream_duplex"),t=t||{},this.objectMode=!!t.objectMode,n instanceof d&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var r=t.highWaterMark,s=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:s,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var i=t.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){onwrite(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new CorkedRequest(this)}function Writable(t){return d=d||e("./_stream_duplex"),this instanceof Writable||this instanceof d?(this._writableState=new WritableState(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev)),void o.call(this)):new Writable(t)}function writeAfterEnd(e,t){var n=new Error("write after end");e.emit("error",n),r(t,n)}function validChunk(e,t,n,s){var i=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):c.isBuffer(n)||"string"==typeof n||void 0===n||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),r(s,o),i=!1),i}function decodeChunk(e,t,n){return e.objectMode||e.decodeStrings===!1||"string"!=typeof t||(t=u.from(t,n)),t}function writeOrBuffer(e,t,n,r,s){n=decodeChunk(t,n,r),c.isBuffer(n)&&(r="buffer");var i=t.objectMode?1:n.length;t.length+=i;var o=t.length<t.highWaterMark;if(o||(t.needDrain=!0),t.writing||t.corked){var a=t.lastBufferedRequest;t.lastBufferedRequest=new WriteReq(n,r,s),a?a.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else doWrite(e,t,!1,i,n,r,s);return o}function doWrite(e,t,n,r,s,i,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,n?e._writev(s,t.onwrite):e._write(s,i,t.onwrite),t.sync=!1}function onwriteError(e,t,n,s,i){--t.pendingcb,n?r(i,s):i(s),e._writableState.errorEmitted=!0,e.emit("error",s)}function onwriteStateUpdate(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function onwrite(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(onwriteStateUpdate(n),t)onwriteError(e,n,r,t,i);else{var o=needFinish(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||clearBuffer(e,n),r?s(afterWrite,e,n,o,i):afterWrite(e,n,o,i)}}function afterWrite(e,t,n,r){n||onwriteDrain(e,t),t.pendingcb--,r(),finishMaybe(e,t)}function onwriteDrain(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function clearBuffer(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,s=new Array(r),i=t.corkedRequestsFree;i.entry=n;for(var o=0;n;)s[o]=n,n=n.next,o+=1;doWrite(e,t,!0,t.length,s,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new CorkedRequest(t)}else{for(;n;){var a=n.chunk,c=n.encoding,u=n.callback,d=t.objectMode?1:a.length;if(doWrite(e,t,!1,d,a,c,u),n=n.next,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=n,t.bufferProcessing=!1}function needFinish(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function prefinish(e,t){t.prefinished||(t.prefinished=!0,e.emit("prefinish"))}function finishMaybe(e,t){var n=needFinish(t);return n&&(0===t.pendingcb?(prefinish(e,t),t.finished=!0,e.emit("finish")):prefinish(e,t)),n}function endWritable(e,t,n){t.ending=!0,finishMaybe(e,t),n&&(t.finished?r(n):e.once("finish",n)),t.ended=!0,e.writable=!1}function CorkedRequest(e){var t=this;this.next=null,this.entry=null,this.finish=function(n){var r=t.entry;for(t.entry=null;r;){var s=r.callback;e.pendingcb--,s(n),r=r.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}}t.exports=Writable;var r=e("process-nextick-args"),s=!n.browser&&["v0.10","v0.9."].indexOf(n.version.slice(0,5))>-1?setImmediate:r;Writable.WritableState=WritableState;var i=e("core-util-is");i.inherits=e("inherits");var o,a={deprecate:e("util-deprecate")};!function(){try{o=e("stream")}catch(e){}finally{o||(o=e("events").EventEmitter)}}();var c=e("buffer").Buffer,u=e("buffer-shims");i.inherits(Writable,o);var d;WritableState.prototype.getBuffer=function writableStateGetBuffer(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:a.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(e){}}();var d;Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Writable.prototype.write=function(e,t,n){var r=this._writableState,s=!1;return"function"==typeof t&&(n=t,t=null),c.isBuffer(e)?t="buffer":t||(t=r.defaultEncoding),"function"!=typeof n&&(n=nop),r.ended?writeAfterEnd(this,n):validChunk(this,r,e,n)&&(r.pendingcb++,s=writeOrBuffer(this,r,e,t,n)),s},Writable.prototype.cork=function(){var e=this._writableState;e.corked++},Writable.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||clearBuffer(this,e))},Writable.prototype.setDefaultEncoding=function setDefaultEncoding(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Writable.prototype._write=function(e,t,n){n(new Error("not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||endWritable(this,r,n)}}).call(this,e("_process"))},{"./_stream_duplex":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js",_process:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/browserify/node_modules/process/browser.js",buffer:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/index.js","buffer-shims":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer-shims/index.js","core-util-is":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/core-util-is/lib/util.js",events:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/events/events.js",inherits:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/inherits/inherits_browser.js","process-nextick-args":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/process-nextick-args/index.js","util-deprecate":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/util-deprecate/browser.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/passthrough.js":[function(e,t,n){t.exports=e("./lib/_stream_passthrough.js")},{"./lib/_stream_passthrough.js":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_passthrough.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/readable.js":[function(e,t,n){(function(r){var s=function(){try{return e("stream")}catch(e){}}();n=t.exports=e("./lib/_stream_readable.js"),n.Stream=s||n,n.Readable=n,n.Writable=e("./lib/_stream_writable.js"),n.Duplex=e("./lib/_stream_duplex.js"),n.Transform=e("./lib/_stream_transform.js"),n.PassThrough=e("./lib/_stream_passthrough.js"),!r.browser&&"disable"===r.env.READABLE_STREAM&&s&&(t.exports=s)}).call(this,e("_process"))},{"./lib/_stream_duplex.js":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js","./lib/_stream_passthrough.js":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_passthrough.js","./lib/_stream_readable.js":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_readable.js","./lib/_stream_transform.js":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_transform.js","./lib/_stream_writable.js":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js",_process:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/browserify/node_modules/process/browser.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/transform.js":[function(e,t,n){t.exports=e("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_transform.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/writable.js":[function(e,t,n){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/string_decoder/index.js":[function(e,t,n){function assertEncoding(e){if(e&&!s(e))throw new Error("Unknown encoding: "+e)}function passThroughWrite(e){return e.toString(this.encoding)}function utf16DetectIncompleteChar(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function base64DetectIncompleteChar(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}var r=e("buffer").Buffer,s=r.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},i=n.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),assertEncoding(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=utf16DetectIncompleteChar;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=base64DetectIncompleteChar;break;default:return void(this.write=passThroughWrite)}this.charBuffer=new r(6),this.charReceived=0,this.charLength=0};i.prototype.write=function(e){for(var t="";this.charLength;){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived<this.charLength)return"";e=e.slice(n,e.length),t=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var r=t.charCodeAt(t.length-1);if(!(r>=55296&&r<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var s=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,s),s-=this.charReceived),t+=e.toString(this.encoding,0,s);var s=t.length-1,r=t.charCodeAt(s);if(r>=55296&&r<=56319){var i=this.surrogateSize;return this.charLength+=i,this.charReceived+=i,this.charBuffer.copy(this.charBuffer,i,0,i),e.copy(this.charBuffer,0,0,i),t.substring(0,s)}return t},i.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},i.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,r=this.charBuffer,s=this.encoding;t+=r.slice(0,n).toString(s)}return t}},{buffer:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/buffer/index.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/traceablepeerconnection/index.js":[function(e,t,n){function dumpSDP(e){return{type:e.type,sdp:e.sdp}}function dumpStream(e){var t={label:e.id};return e.getAudioTracks().length&&(t.audio=e.getAudioTracks().map(function(e){return e.id})),e.getVideoTracks().length&&(t.video=e.getVideoTracks().map(function(e){return e.id})),t}function TraceablePeerConnection(e,t){var n=this;s.call(this),this.peerconnection=new window.RTCPeerConnection(e,t),this.trace=function(e,t){n.emit("PeerConnectionTrace",{time:new Date,type:e,value:t||""})},this.onicecandidate=null,this.peerconnection.onicecandidate=function(e){n.trace("onicecandidate",e.candidate),null!==n.onicecandidate&&n.onicecandidate(e)},this.onaddstream=null,this.peerconnection.onaddstream=function(e){n.trace("onaddstream",dumpStream(e.stream)),null!==n.onaddstream&&n.onaddstream(e)},this.onremovestream=null,this.peerconnection.onremovestream=function(e){n.trace("onremovestream",dumpStream(e.stream)),null!==n.onremovestream&&n.onremovestream(e)},this.onsignalingstatechange=null,this.peerconnection.onsignalingstatechange=function(e){n.trace("onsignalingstatechange",n.signalingState),null!==n.onsignalingstatechange&&n.onsignalingstatechange(e)},this.oniceconnectionstatechange=null,this.peerconnection.oniceconnectionstatechange=function(e){n.trace("oniceconnectionstatechange",n.iceConnectionState),null!==n.oniceconnectionstatechange&&n.oniceconnectionstatechange(e)},this.onnegotiationneeded=null,this.peerconnection.onnegotiationneeded=function(e){n.trace("onnegotiationneeded"),null!==n.onnegotiationneeded&&n.onnegotiationneeded(e)},n.ondatachannel=null,this.peerconnection.ondatachannel=function(e){n.trace("ondatachannel",e),null!==n.ondatachannel&&n.ondatachannel(e)},this.getLocalStreams=this.peerconnection.getLocalStreams.bind(this.peerconnection),this.getRemoteStreams=this.peerconnection.getRemoteStreams.bind(this.peerconnection)}var r=e("util"),s=(e("webrtc-adapter"),e("wildemitter"));r.inherits(TraceablePeerConnection,s),["signalingState","iceConnectionState","localDescription","remoteDescription"].forEach(function(e){Object.defineProperty(TraceablePeerConnection.prototype,e,{get:function(){return this.peerconnection[e]}})}),TraceablePeerConnection.prototype.addStream=function(e){this.trace("addStream",dumpStream(e)),this.peerconnection.addStream(e)},TraceablePeerConnection.prototype.removeStream=function(e){this.trace("removeStream",dumpStream(e)),this.peerconnection.removeStream(e)},TraceablePeerConnection.prototype.createDataChannel=function(e,t){return this.trace("createDataChannel",e,t),this.peerconnection.createDataChannel(e,t)},TraceablePeerConnection.prototype.setLocalDescription=function(e,t,n){var r=this;return this.trace("setLocalDescription",dumpSDP(e)),this.peerconnection.setLocalDescription(e).then(function(){r.trace("setLocalDescriptionOnSuccess"),t&&t()},function(e){r.trace("setLocalDescriptionOnFailure",e),n&&n(e)})},TraceablePeerConnection.prototype.setRemoteDescription=function(e,t,n){var r=this;return this.trace("setRemoteDescription",dumpSDP(e)),this.peerconnection.setRemoteDescription(e).then(function(){r.trace("setRemoteDescriptionOnSuccess"),t&&t()},function(e){r.trace("setRemoteDescriptionOnFailure",e),n&&n(e)})},TraceablePeerConnection.prototype.close=function(){this.trace("stop"),"closed"!=this.peerconnection.signalingState&&this.peerconnection.close()},TraceablePeerConnection.prototype.createOffer=function(e,t,n){var r=this;return this.trace("createOffer",n),this.peerconnection.createOffer(n).then(function(t){r.trace("createOfferOnSuccess",dumpSDP(t)),e&&e(t)},function(e){r.trace("createOfferOnFailure",e),t&&t(e)})},TraceablePeerConnection.prototype.createAnswer=function(e,t,n){var r=this;return this.trace("createAnswer",n),this.peerconnection.createAnswer(n).then(function(t){r.trace("createAnswerOnSuccess",dumpSDP(t)),e&&e(t)},function(e){r.trace("createAnswerOnFailure",e),t&&t(e)})},TraceablePeerConnection.prototype.addIceCandidate=function(e,t,n){var r=this;return this.trace("addIceCandidate",e),this.peerconnection.addIceCandidate(e).then(function(){t&&t()},function(e){r.trace("addIceCandidateOnFailure",e),n&&n(e)})},TraceablePeerConnection.prototype.getStats=function(){this.peerconnection.getStats.apply(this.peerconnection,arguments)},t.exports=TraceablePeerConnection},{util:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/util/util.js","webrtc-adapter":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/webrtc-adapter/src/js/adapter_core.js",wildemitter:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/wildemitter/wildemitter.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/trim/index.js":[function(e,t,n){function trim(e){return e.replace(/^\s*|\s*$/g,"")}n=t.exports=trim,n.left=function(e){return e.replace(/^\s*/,"")},n.right=function(e){return e.replace(/\s*$/,"")}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/util-deprecate/browser.js":[function(e,t,n){(function(e){function deprecate(e,t){function deprecated(){if(!n){if(config("throwDeprecation"))throw new Error(t);config("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}if(config("noDeprecation"))return e;var n=!1;return deprecated}function config(t){try{if(!e.localStorage)return!1}catch(e){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=deprecate}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/util/support/isBufferBrowser.js":[function(e,t,n){t.exports=function isBuffer(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/util/util.js":[function(e,t,n){(function(t,r){function inspect(e,t){var r={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),isBoolean(t)?r.showHidden=t:t&&n._extend(r,t),isUndefined(r.showHidden)&&(r.showHidden=!1),isUndefined(r.depth)&&(r.depth=2),isUndefined(r.colors)&&(r.colors=!1),isUndefined(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=stylizeWithColor),formatValue(r,e,r.depth)}function stylizeWithColor(e,t){var n=inspect.styles[t];return n?"["+inspect.colors[n][0]+"m"+e+"["+inspect.colors[n][1]+"m":e}function stylizeNoColor(e,t){return e}function arrayToHash(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}function formatValue(e,t,r){if(e.customInspect&&t&&isFunction(t.inspect)&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var s=t.inspect(r,e);return isString(s)||(s=formatValue(e,s,r)),s}var i=formatPrimitive(e,t);if(i)return i;var o=Object.keys(t),a=arrayToHash(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),isError(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return formatError(t);if(0===o.length){if(isFunction(t)){var c=t.name?": "+t.name:"";return e.stylize("[Function"+c+"]","special")}if(isRegExp(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(isDate(t))return e.stylize(Date.prototype.toString.call(t),"date");if(isError(t))return formatError(t)}var u="",d=!1,l=["{","}"];if(isArray(t)&&(d=!0,l=["[","]"]),isFunction(t)){var p=t.name?": "+t.name:"";u=" [Function"+p+"]"}if(isRegExp(t)&&(u=" "+RegExp.prototype.toString.call(t)),isDate(t)&&(u=" "+Date.prototype.toUTCString.call(t)),isError(t)&&(u=" "+formatError(t)),0===o.length&&(!d||0==t.length))return l[0]+u+l[1];if(r<0)return isRegExp(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var f;return f=d?formatArray(e,t,r,a,o):o.map(function(n){return formatProperty(e,t,r,a,n,d)}),e.seen.pop(),reduceToSingleString(f,u,l)}function formatPrimitive(e,t){if(isUndefined(t))return e.stylize("undefined","undefined");if(isString(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return isNumber(t)?e.stylize(""+t,"number"):isBoolean(t)?e.stylize(""+t,"boolean"):isNull(t)?e.stylize("null","null"):void 0}function formatError(e){return"["+Error.prototype.toString.call(e)+"]"}function formatArray(e,t,n,r,s){for(var i=[],o=0,a=t.length;o<a;++o)hasOwnProperty(t,String(o))?i.push(formatProperty(e,t,n,r,String(o),!0)):i.push("");return s.forEach(function(s){s.match(/^\d+$/)||i.push(formatProperty(e,t,n,r,s,!0))}),i}function formatProperty(e,t,n,r,s,i){var o,a,c;if(c=Object.getOwnPropertyDescriptor(t,s)||{value:t[s]},c.get?a=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(a=e.stylize("[Setter]","special")),hasOwnProperty(r,s)||(o="["+s+"]"),a||(e.seen.indexOf(c.value)<0?(a=isNull(n)?formatValue(e,c.value,null):formatValue(e,c.value,n-1),
  a.indexOf("\n")>-1&&(a=i?a.split("\n").map(function(e){return"  "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return"   "+e}).join("\n"))):a=e.stylize("[Circular]","special")),isUndefined(o)){if(i&&s.match(/^\d+$/))return a;o=JSON.stringify(""+s),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+a}function reduceToSingleString(e,t,n){var r=0,s=e.reduce(function(e,t){return r++,t.indexOf("\n")>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return s>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n  ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function isArray(e){return Array.isArray(e)}function isBoolean(e){return"boolean"==typeof e}function isNull(e){return null===e}function isNullOrUndefined(e){return null==e}function isNumber(e){return"number"==typeof e}function isString(e){return"string"==typeof e}function isSymbol(e){return"symbol"==typeof e}function isUndefined(e){return void 0===e}function isRegExp(e){return isObject(e)&&"[object RegExp]"===objectToString(e)}function isObject(e){return"object"==typeof e&&null!==e}function isDate(e){return isObject(e)&&"[object Date]"===objectToString(e)}function isError(e){return isObject(e)&&("[object Error]"===objectToString(e)||e instanceof Error)}function isFunction(e){return"function"==typeof e}function isPrimitive(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function objectToString(e){return Object.prototype.toString.call(e)}function pad(e){return e<10?"0"+e.toString(10):e.toString(10)}function timestamp(){var e=new Date,t=[pad(e.getHours()),pad(e.getMinutes()),pad(e.getSeconds())].join(":");return[e.getDate(),a[e.getMonth()],t].join(" ")}function hasOwnProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var s=/%[sdj%]/g;n.format=function(e){if(!isString(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(inspect(arguments[n]));return t.join(" ")}for(var n=1,r=arguments,i=r.length,o=String(e).replace(s,function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}}),a=r[n];n<i;a=r[++n])o+=isNull(a)||!isObject(a)?" "+a:" "+inspect(a);return o},n.deprecate=function(e,s){function deprecated(){if(!i){if(t.throwDeprecation)throw new Error(s);t.traceDeprecation?console.trace(s):console.error(s),i=!0}return e.apply(this,arguments)}if(isUndefined(r.process))return function(){return n.deprecate(e,s).apply(this,arguments)};if(t.noDeprecation===!0)return e;var i=!1;return deprecated};var i,o={};n.debuglog=function(e){if(isUndefined(i)&&(i=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!o[e])if(new RegExp("\\b"+e+"\\b","i").test(i)){var r=t.pid;o[e]=function(){var t=n.format.apply(n,arguments);console.error("%s %d: %s",e,r,t)}}else o[e]=function(){};return o[e]},n.inspect=inspect,inspect.colors={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]},inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=isArray,n.isBoolean=isBoolean,n.isNull=isNull,n.isNullOrUndefined=isNullOrUndefined,n.isNumber=isNumber,n.isString=isString,n.isSymbol=isSymbol,n.isUndefined=isUndefined,n.isRegExp=isRegExp,n.isObject=isObject,n.isDate=isDate,n.isError=isError,n.isFunction=isFunction,n.isPrimitive=isPrimitive,n.isBuffer=e("./support/isBuffer");var a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(){console.log("%s - %s",timestamp(),n.format.apply(n,arguments))},n.inherits=e("inherits"),n._extend=function(e,t){if(!t||!isObject(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/util/support/isBufferBrowser.js",_process:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/browserify/node_modules/process/browser.js",inherits:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/inherits/inherits_browser.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/uuid/rng-browser.js":[function(e,t,n){(function(e){var n;if(e.crypto&&crypto.getRandomValues){var r=new Uint8Array(16);n=function whatwgRNG(){return crypto.getRandomValues(r),r}}if(!n){var s=new Array(16);n=function(){for(var e,t=0;t<16;t++)0===(3&t)&&(e=4294967296*Math.random()),s[t]=e>>>((3&t)<<3)&255;return s}}t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/uuid/uuid.js":[function(e,t,n){function parse(e,t,n){var r=t&&n||0,s=0;for(t=t||[],e.toLowerCase().replace(/[0-9a-f]{2}/g,function(e){s<16&&(t[r+s++]=i[e])});s<16;)t[r+s++]=0;return t}function unparse(e,t){var n=t||0,r=s;return r[e[n++]]+r[e[n++]]+r[e[n++]]+r[e[n++]]+"-"+r[e[n++]]+r[e[n++]]+"-"+r[e[n++]]+r[e[n++]]+"-"+r[e[n++]]+r[e[n++]]+"-"+r[e[n++]]+r[e[n++]]+r[e[n++]]+r[e[n++]]+r[e[n++]]+r[e[n++]]}function v1(e,t,n){var r=t&&n||0,s=t||[];e=e||{};var i=void 0!==e.clockseq?e.clockseq:u,o=void 0!==e.msecs?e.msecs:(new Date).getTime(),a=void 0!==e.nsecs?e.nsecs:l+1,p=o-d+(a-l)/1e4;if(p<0&&void 0===e.clockseq&&(i=i+1&16383),(p<0||o>d)&&void 0===e.nsecs&&(a=0),a>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");d=o,l=a,u=i,o+=122192928e5;var f=(1e4*(268435455&o)+a)%4294967296;s[r++]=f>>>24&255,s[r++]=f>>>16&255,s[r++]=f>>>8&255,s[r++]=255&f;var m=o/4294967296*1e4&268435455;s[r++]=m>>>8&255,s[r++]=255&m,s[r++]=m>>>24&15|16,s[r++]=m>>>16&255,s[r++]=i>>>8|128,s[r++]=255&i;for(var h=e.node||c,g=0;g<6;g++)s[r+g]=h[g];return t?t:unparse(s)}function v4(e,t,n){var s=t&&n||0;"string"==typeof e&&(t="binary"==e?new Array(16):null,e=null),e=e||{};var i=e.random||(e.rng||r)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var o=0;o<16;o++)t[s+o]=i[o];return t||unparse(i)}for(var r=e("./rng"),s=[],i={},o=0;o<256;o++)s[o]=(o+256).toString(16).substr(1),i[s[o]]=o;var a=r(),c=[1|a[0],a[1],a[2],a[3],a[4],a[5]],u=16383&(a[6]<<8|a[7]),d=0,l=0,p=v4;p.v1=v1,p.v4=v4,p.parse=parse,p.unparse=unparse,t.exports=p},{"./rng":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/uuid/rng-browser.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/webrtc-adapter/src/js/adapter_core.js":[function(e,t,n){"use strict";!function(){var n=e("./utils").log,r=e("./utils").browserDetails;t.exports.browserDetails=r,t.exports.extractVersion=e("./utils").extractVersion,t.exports.disableLog=e("./utils").disableLog;var s=e("./chrome/chrome_shim")||null,i=e("./edge/edge_shim")||null,o=e("./firefox/firefox_shim")||null,a=e("./safari/safari_shim")||null;switch(r.browser){case"opera":case"chrome":if(!s||!s.shimPeerConnection)return void n("Chrome shim is not included in this adapter release.");n("adapter.js shimming chrome."),t.exports.browserShim=s,s.shimGetUserMedia(),s.shimMediaStream(),s.shimSourceObject(),s.shimPeerConnection(),s.shimOnTrack();break;case"firefox":if(!o||!o.shimPeerConnection)return void n("Firefox shim is not included in this adapter release.");n("adapter.js shimming firefox."),t.exports.browserShim=o,o.shimGetUserMedia(),o.shimSourceObject(),o.shimPeerConnection(),o.shimOnTrack();break;case"edge":if(!i||!i.shimPeerConnection)return void n("MS edge shim is not included in this adapter release.");n("adapter.js shimming edge."),t.exports.browserShim=i,i.shimGetUserMedia(),i.shimPeerConnection();break;case"safari":if(!a)return void n("Safari shim is not included in this adapter release.");n("adapter.js shimming safari."),t.exports.browserShim=a,a.shimGetUserMedia();break;default:n("Unsupported browser!")}}()},{"./chrome/chrome_shim":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/webrtc-adapter/src/js/chrome/chrome_shim.js","./edge/edge_shim":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/webrtc-adapter/src/js/edge/edge_shim.js","./firefox/firefox_shim":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/webrtc-adapter/src/js/firefox/firefox_shim.js","./safari/safari_shim":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/webrtc-adapter/src/js/safari/safari_shim.js","./utils":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/webrtc-adapter/src/js/utils.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/webrtc-adapter/src/js/chrome/chrome_shim.js":[function(e,t,n){"use strict";var r=e("../utils.js").log,s=e("../utils.js").browserDetails,i={shimMediaStream:function(){window.MediaStream=window.MediaStream||window.webkitMediaStream},shimOnTrack:function(){"object"!=typeof window||!window.RTCPeerConnection||"ontrack"in window.RTCPeerConnection.prototype||Object.defineProperty(window.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){var t=this;this._ontrack&&(this.removeEventListener("track",this._ontrack),this.removeEventListener("addstream",this._ontrackpoly)),this.addEventListener("track",this._ontrack=e),this.addEventListener("addstream",this._ontrackpoly=function(e){e.stream.addEventListener("addtrack",function(n){var r=new Event("track");r.track=n.track,r.receiver={track:n.track},r.streams=[e.stream],t.dispatchEvent(r)}),e.stream.getTracks().forEach(function(t){var n=new Event("track");n.track=t,n.receiver={track:t},n.streams=[e.stream],this.dispatchEvent(n)}.bind(this))}.bind(this))}})},shimSourceObject:function(){"object"==typeof window&&(!window.HTMLMediaElement||"srcObject"in window.HTMLMediaElement.prototype||Object.defineProperty(window.HTMLMediaElement.prototype,"srcObject",{get:function(){return this._srcObject},set:function(e){var t=this;return this._srcObject=e,this.src&&URL.revokeObjectURL(this.src),e?(this.src=URL.createObjectURL(e),e.addEventListener("addtrack",function(){t.src&&URL.revokeObjectURL(t.src),t.src=URL.createObjectURL(e)}),void e.addEventListener("removetrack",function(){t.src&&URL.revokeObjectURL(t.src),t.src=URL.createObjectURL(e)})):void(this.src="")}}))},shimPeerConnection:function(){window.RTCPeerConnection=function(e,t){r("PeerConnection"),e&&e.iceTransportPolicy&&(e.iceTransports=e.iceTransportPolicy);var n=new webkitRTCPeerConnection(e,t),s=n.getStats.bind(n);return n.getStats=function(e,t,n){var r=this,i=arguments;if(arguments.length>0&&"function"==typeof e)return s(e,t);var o=function(e){var t={},n=e.result();return n.forEach(function(e){var n={id:e.id,timestamp:e.timestamp,type:e.type};e.names().forEach(function(t){n[t]=e.stat(t)}),t[n.id]=n}),t},a=function(e,t){var n=new Map(Object.keys(e).map(function(t){return[t,e[t]]}));return t=t||e,Object.keys(t).forEach(function(e){n[e]=t[e]}),n};if(arguments.length>=2){var c=function(e){i[1](a(o(e)))};return s.apply(this,[c,arguments[0]])}return new Promise(function(t,n){1===i.length&&"object"==typeof e?s.apply(r,[function(e){t(a(o(e)))},n]):s.apply(r,[function(e){t(a(o(e),e.result()))},n])}).then(t,n)},n},window.RTCPeerConnection.prototype=webkitRTCPeerConnection.prototype,webkitRTCPeerConnection.generateCertificate&&Object.defineProperty(window.RTCPeerConnection,"generateCertificate",{get:function(){return webkitRTCPeerConnection.generateCertificate}}),["createOffer","createAnswer"].forEach(function(e){var t=webkitRTCPeerConnection.prototype[e];webkitRTCPeerConnection.prototype[e]=function(){var e=this;if(arguments.length<1||1===arguments.length&&"object"==typeof arguments[0]){var n=1===arguments.length?arguments[0]:void 0;return new Promise(function(r,s){t.apply(e,[r,s,n])})}return t.apply(this,arguments)}}),s.version<51&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){var t=webkitRTCPeerConnection.prototype[e];webkitRTCPeerConnection.prototype[e]=function(){var e=arguments,n=this,r=new Promise(function(r,s){t.apply(n,[e[0],r,s])});return e.length<2?r:r.then(function(){e[1].apply(null,[])},function(t){e.length>=3&&e[2].apply(null,[t])})}});var e=RTCPeerConnection.prototype.addIceCandidate;RTCPeerConnection.prototype.addIceCandidate=function(){return null===arguments[0]?Promise.resolve():e.apply(this,arguments)},["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){var t=webkitRTCPeerConnection.prototype[e];webkitRTCPeerConnection.prototype[e]=function(){return arguments[0]=new("addIceCandidate"===e?RTCIceCandidate:RTCSessionDescription)(arguments[0]),t.apply(this,arguments)}})},attachMediaStream:function(e,t){r("DEPRECATED, attachMediaStream will soon be removed."),s.version>=43?e.srcObject=t:"undefined"!=typeof e.src?e.src=URL.createObjectURL(t):r("Error attaching stream to element.")},reattachMediaStream:function(e,t){r("DEPRECATED, reattachMediaStream will soon be removed."),s.version>=43?e.srcObject=t.srcObject:e.src=t.src}};t.exports={shimMediaStream:i.shimMediaStream,shimOnTrack:i.shimOnTrack,shimSourceObject:i.shimSourceObject,shimPeerConnection:i.shimPeerConnection,shimGetUserMedia:e("./getusermedia"),attachMediaStream:i.attachMediaStream,reattachMediaStream:i.reattachMediaStream}},{"../utils.js":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/webrtc-adapter/src/js/utils.js","./getusermedia":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/webrtc-adapter/src/js/chrome/getusermedia.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/webrtc-adapter/src/js/chrome/getusermedia.js":[function(e,t,n){"use strict";var r=e("../utils.js").log;t.exports=function(){var e=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;var t={};return Object.keys(e).forEach(function(n){if("require"!==n&&"advanced"!==n&&"mediaSource"!==n){var r="object"==typeof e[n]?e[n]:{ideal:e[n]};void 0!==r.exact&&"number"==typeof r.exact&&(r.min=r.max=r.exact);var s=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==r.ideal){t.optional=t.optional||[];var i={};"number"==typeof r.ideal?(i[s("min",n)]=r.ideal,t.optional.push(i),i={},i[s("max",n)]=r.ideal,t.optional.push(i)):(i[s("",n)]=r.ideal,t.optional.push(i))}void 0!==r.exact&&"number"!=typeof r.exact?(t.mandatory=t.mandatory||{},t.mandatory[s("",n)]=r.exact):["min","max"].forEach(function(e){void 0!==r[e]&&(t.mandatory=t.mandatory||{},t.mandatory[s(e,n)]=r[e])})}}),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},t=function(t,n){if(t=JSON.parse(JSON.stringify(t)),t&&t.audio&&(t.audio=e(t.audio)),t&&"object"==typeof t.video){var s=t.video.facingMode;if(s=s&&("object"==typeof s?s:{ideal:s}),s&&("user"===s.exact||"environment"===s.exact||"user"===s.ideal||"environment"===s.ideal)&&(!navigator.mediaDevices.getSupportedConstraints||!navigator.mediaDevices.getSupportedConstraints().facingMode)&&(delete t.video.facingMode,"environment"===s.exact||"environment"===s.ideal))return navigator.mediaDevices.enumerateDevices().then(function(i){i=i.filter(function(e){return"videoinput"===e.kind});var o=i.find(function(e){return e.label.toLowerCase().indexOf("back")!==-1})||i.length&&i[i.length-1];return o&&(t.video.deviceId=s.exact?{exact:o.deviceId}:{ideal:o.deviceId}),t.video=e(t.video),r("chrome: "+JSON.stringify(t)),n(t)});t.video=e(t.video)}return r("chrome: "+JSON.stringify(t)),n(t)},n=function(e){return{name:{PermissionDeniedError:"NotAllowedError",ConstraintNotSatisfiedError:"OverconstrainedError"}[e.name]||e.name,message:e.message,constraint:e.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}},s=function(e,r,s){t(e,function(e){navigator.webkitGetUserMedia(e,r,function(e){s(n(e))})})};navigator.getUserMedia=s;var i=function(e){return new Promise(function(t,n){navigator.getUserMedia(e,t,n)})};if(navigator.mediaDevices||(navigator.mediaDevices={getUserMedia:i,enumerateDevices:function(){return new Promise(function(e){var t={audio:"audioinput",video:"videoinput"};return MediaStreamTrack.getSources(function(n){e(n.map(function(e){return{label:e.label,kind:t[e.kind],deviceId:e.id,groupId:""}}))})})}}),navigator.mediaDevices.getUserMedia){var o=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(e){return t(e,function(e){return o(e).catch(function(e){return Promise.reject(n(e))})})}}else navigator.mediaDevices.getUserMedia=function(e){return i(e)};"undefined"==typeof navigator.mediaDevices.addEventListener&&(navigator.mediaDevices.addEventListener=function(){r("Dummy mediaDevices.addEventListener called.")}),"undefined"==typeof navigator.mediaDevices.removeEventListener&&(navigator.mediaDevices.removeEventListener=function(){r("Dummy mediaDevices.removeEventListener called.")})}},{"../utils.js":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/webrtc-adapter/src/js/utils.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/webrtc-adapter/src/js/edge/edge_shim.js":[function(e,t,n){"use strict";var r=e("sdp"),s=e("../utils").log,i={shimPeerConnection:function(){window.RTCIceGatherer&&(window.RTCIceCandidate||(window.RTCIceCandidate=function(e){return e}),window.RTCSessionDescription||(window.RTCSessionDescription=function(e){return e})),window.RTCPeerConnection=function(e){var t=this,n=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach(function(e){t[e]=n[e].bind(n)}),this.onicecandidate=null,this.onaddstream=null,this.ontrack=null,this.onremovestream=null,this.onsignalingstatechange=null,this.oniceconnectionstatechange=null,this.onnegotiationneeded=null,this.ondatachannel=null,this.localStreams=[],this.remoteStreams=[],this.getLocalStreams=function(){return t.localStreams},this.getRemoteStreams=function(){return t.remoteStreams},this.localDescription=new RTCSessionDescription({type:"",sdp:""}),this.remoteDescription=new RTCSessionDescription({type:"",sdp:""}),this.signalingState="stable",this.iceConnectionState="new",this.iceGatheringState="new",this.iceOptions={gatherPolicy:"all",iceServers:[]},e&&e.iceTransportPolicy)switch(e.iceTransportPolicy){case"all":case"relay":this.iceOptions.gatherPolicy=e.iceTransportPolicy;break;case"none":throw new TypeError('iceTransportPolicy "none" not supported')}if(this.usingBundle=e&&"max-bundle"===e.bundlePolicy,e&&e.iceServers){var r=JSON.parse(JSON.stringify(e.iceServers));this.iceOptions.iceServers=r.filter(function(e){if(e&&e.urls){var t=e.urls;return"string"==typeof t&&(t=[t]),t=t.filter(function(e){return 0===e.indexOf("turn:")&&e.indexOf("transport=udp")!==-1})[0],!!t}return!1})}this.transceivers=[],this._localIceCandidatesBuffer=[]},window.RTCPeerConnection.prototype._emitBufferedCandidates=function(){var e=this,t=r.splitSections(e.localDescription.sdp);this._localIceCandidatesBuffer.forEach(function(n){var r=!n.candidate||0===Object.keys(n.candidate).length;if(r)for(var s=1;s<t.length;s++)t[s].indexOf("\r\na=end-of-candidates\r\n")===-1&&(t[s]+="a=end-of-candidates\r\n");else n.candidate.candidate.indexOf("typ endOfCandidates")===-1&&(t[n.candidate.sdpMLineIndex+1]+="a="+n.candidate.candidate+"\r\n");if(e.localDescription.sdp=t.join(""),e.dispatchEvent(n),null!==e.onicecandidate&&e.onicecandidate(n),!n.candidate&&"complete"!==e.iceGatheringState){var i=e.transceivers.every(function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state});i&&(e.iceGatheringState="complete")}}),this._localIceCandidatesBuffer=[]},window.RTCPeerConnection.prototype.addStream=function(e){this.localStreams.push(e.clone()),this._maybeFireNegotiationNeeded()},window.RTCPeerConnection.prototype.removeStream=function(e){var t=this.localStreams.indexOf(e);t>-1&&(this.localStreams.splice(t,1),this._maybeFireNegotiationNeeded())},window.RTCPeerConnection.prototype.getSenders=function(){return this.transceivers.filter(function(e){return!!e.rtpSender}).map(function(e){return e.rtpSender})},window.RTCPeerConnection.prototype.getReceivers=function(){return this.transceivers.filter(function(e){return!!e.rtpReceiver}).map(function(e){return e.rtpReceiver})},window.RTCPeerConnection.prototype._getCommonCapabilities=function(e,t){var n={codecs:[],headerExtensions:[],fecMechanisms:[]};return e.codecs.forEach(function(e){for(var r=0;r<t.codecs.length;r++){var s=t.codecs[r];if(e.name.toLowerCase()===s.name.toLowerCase()&&e.clockRate===s.clockRate&&e.numChannels===s.numChannels){n.codecs.push(s);break}}}),e.headerExtensions.forEach(function(e){for(var r=0;r<t.headerExtensions.length;r++){var s=t.headerExtensions[r];if(e.uri===s.uri){n.headerExtensions.push(s);break}}}),n},window.RTCPeerConnection.prototype._createIceAndDtlsTransports=function(e,t){var n=this,s=new RTCIceGatherer(n.iceOptions),i=new RTCIceTransport(s);s.onlocalcandidate=function(o){var a=new Event("icecandidate");a.candidate={sdpMid:e,sdpMLineIndex:t};var c=o.candidate,u=!c||0===Object.keys(c).length;u?(void 0===s.state&&(s.state="completed"),a.candidate.candidate="candidate:1 1 udp 1 0.0.0.0 9 typ endOfCandidates"):(c.component="RTCP"===i.component?2:1,a.candidate.candidate=r.writeCandidate(c));var d=r.splitSections(n.localDescription.sdp);a.candidate.candidate.indexOf("typ endOfCandidates")===-1?d[a.candidate.sdpMLineIndex+1]+="a="+a.candidate.candidate+"\r\n":d[a.candidate.sdpMLineIndex+1]+="a=end-of-candidates\r\n",n.localDescription.sdp=d.join("");var l=n.transceivers.every(function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state});switch(n.iceGatheringState){case"new":n._localIceCandidatesBuffer.push(a),u&&l&&n._localIceCandidatesBuffer.push(new Event("icecandidate"));break;case"gathering":n._emitBufferedCandidates(),n.dispatchEvent(a),null!==n.onicecandidate&&n.onicecandidate(a),l&&(n.dispatchEvent(new Event("icecandidate")),null!==n.onicecandidate&&n.onicecandidate(new Event("icecandidate")),n.iceGatheringState="complete");break;case"complete":}},i.onicestatechange=function(){n._updateConnectionState()};var o=new RTCDtlsTransport(i);return o.ondtlsstatechange=function(){n._updateConnectionState()},o.onerror=function(){o.state="failed",n._updateConnectionState()},{iceGatherer:s,iceTransport:i,dtlsTransport:o}},window.RTCPeerConnection.prototype._transceive=function(e,t,n){var s=this._getCommonCapabilities(e.localCapabilities,e.remoteCapabilities);t&&e.rtpSender&&(s.encodings=e.sendEncodingParameters,s.rtcp={cname:r.localCName},e.recvEncodingParameters.length&&(s.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(s)),n&&e.rtpReceiver&&(s.encodings=e.recvEncodingParameters,s.rtcp={cname:e.cname},e.sendEncodingParameters.length&&(s.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(s))},window.RTCPeerConnection.prototype.setLocalDescription=function(e){var t,n,s=this;if("offer"===e.type)this._pendingOffer&&(t=r.splitSections(e.sdp),n=t.shift(),t.forEach(function(e,t){var n=r.parseRtpParameters(e);s._pendingOffer[t].localCapabilities=n}),this.transceivers=this._pendingOffer,delete this._pendingOffer);else if("answer"===e.type){t=r.splitSections(s.remoteDescription.sdp),n=t.shift();var i=r.matchPrefix(n,"a=ice-lite").length>0;t.forEach(function(e,t){var o=s.transceivers[t],a=o.iceGatherer,c=o.iceTransport,u=o.dtlsTransport,d=o.localCapabilities,l=o.remoteCapabilities,p="0"===e.split("\n",1)[0].split(" ",2)[1];if(!p){var f=r.getIceParameters(e,n);if(i){var m=r.matchPrefix(e,"a=candidate:").map(function(e){return r.parseCandidate(e)}).filter(function(e){return"1"===e.component});m.length&&c.setRemoteCandidates(m)}var h=r.getDtlsParameters(e,n);i&&(h.role="server"),s.usingBundle&&0!==t||(c.start(a,f,i?"controlling":"controlled"),u.start(h));var g=s._getCommonCapabilities(d,l);s._transceive(o,g.codecs.length>0,!1)}})}switch(this.localDescription={type:e.type,sdp:e.sdp},e.type){case"offer":this._updateSignalingState("have-local-offer");break;case"answer":this._updateSignalingState("stable");break;default:throw new TypeError('unsupported type "'+e.type+'"')}var o=arguments.length>1&&"function"==typeof arguments[1];if(o){var a=arguments[1];window.setTimeout(function(){a(),"new"===s.iceGatheringState&&(s.iceGatheringState="gathering"),s._emitBufferedCandidates()},0)}var c=Promise.resolve();return c.then(function(){o||("new"===s.iceGatheringState&&(s.iceGatheringState="gathering"),window.setTimeout(s._emitBufferedCandidates.bind(s),500))}),c},window.RTCPeerConnection.prototype.setRemoteDescription=function(e){var t=this,n=new MediaStream,s=[],i=r.splitSections(e.sdp),o=i.shift(),a=r.matchPrefix(o,"a=ice-lite").length>0;switch(this.usingBundle=r.matchPrefix(o,"a=group:BUNDLE ").length>0,i.forEach(function(i,c){var u,d,l,p,f,m,h,g,b,v,j,_,x=r.splitLines(i),y=x[0].substr(2).split(" "),S=y[0],w="0"===y[1],z=r.getDirection(i,o),P=r.parseRtpParameters(i);w||(j=r.getIceParameters(i,o),_=r.getDtlsParameters(i,o),_.role="client"),g=r.parseRtpEncodingParameters(i);var E=r.matchPrefix(i,"a=mid:");E=E.length?E[0].substr(6):r.generateIdentifier();var U,C=r.matchPrefix(i,"a=ssrc:").map(function(e){return r.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute})[0];C&&(U=C.value);var T=r.matchPrefix(i,"a=end-of-candidates").length>0,R=r.matchPrefix(i,"a=candidate:").map(function(e){return r.parseCandidate(e)}).filter(function(e){return"1"===e.component});if("offer"!==e.type||w)"answer"!==e.type||w||(u=t.transceivers[c],d=u.iceGatherer,l=u.iceTransport,p=u.dtlsTransport,f=u.rtpSender,m=u.rtpReceiver,h=u.sendEncodingParameters,b=u.localCapabilities,t.transceivers[c].recvEncodingParameters=g,t.transceivers[c].remoteCapabilities=P,t.transceivers[c].cname=U,(a||T)&&R.length&&l.setRemoteCandidates(R),t.usingBundle&&0!==c||(l.start(d,j,"controlling"),p.start(_)),t._transceive(u,"sendrecv"===z||"recvonly"===z,"sendrecv"===z||"sendonly"===z),!m||"sendrecv"!==z&&"sendonly"!==z?delete u.rtpReceiver:(v=m.track,s.push([v,m]),n.addTrack(v)));else{var N=t.usingBundle&&c>0?{iceGatherer:t.transceivers[0].iceGatherer,iceTransport:t.transceivers[0].iceTransport,dtlsTransport:t.transceivers[0].dtlsTransport}:t._createIceAndDtlsTransports(E,c);if(T&&N.iceTransport.setRemoteCandidates(R),b=RTCRtpReceiver.getCapabilities(S),h=[{ssrc:1001*(2*c+2)}],m=new RTCRtpReceiver(N.dtlsTransport,S),v=m.track,s.push([v,m]),n.addTrack(v),t.localStreams.length>0&&t.localStreams[0].getTracks().length>=c){var A=t.localStreams[0].getTracks()[c];f=new RTCRtpSender(A,N.dtlsTransport)}t.transceivers[c]={iceGatherer:N.iceGatherer,iceTransport:N.iceTransport,dtlsTransport:N.dtlsTransport,localCapabilities:b,remoteCapabilities:P,rtpSender:f,rtpReceiver:m,kind:S,mid:E,cname:U,sendEncodingParameters:h,recvEncodingParameters:g},t._transceive(t.transceivers[c],!1,"sendrecv"===z||"sendonly"===z)}}),this.remoteDescription={type:e.type,sdp:e.sdp},e.type){case"offer":this._updateSignalingState("have-remote-offer");break;case"answer":this._updateSignalingState("stable");break;default:throw new TypeError('unsupported type "'+e.type+'"')}return n.getTracks().length&&(t.remoteStreams.push(n),window.setTimeout(function(){var e=new Event("addstream");e.stream=n,t.dispatchEvent(e),null!==t.onaddstream&&window.setTimeout(function(){t.onaddstream(e)},0),s.forEach(function(r){var s=r[0],i=r[1],o=new Event("track");o.track=s,o.receiver=i,o.streams=[n],t.dispatchEvent(e),null!==t.ontrack&&window.setTimeout(function(){t.ontrack(o)},0)})},0)),arguments.length>1&&"function"==typeof arguments[1]&&window.setTimeout(arguments[1],0),Promise.resolve()},window.RTCPeerConnection.prototype.close=function(){this.transceivers.forEach(function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()}),this._updateSignalingState("closed")},window.RTCPeerConnection.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this.dispatchEvent(t),null!==this.onsignalingstatechange&&this.onsignalingstatechange(t)},window.RTCPeerConnection.prototype._maybeFireNegotiationNeeded=function(){var e=new Event("negotiationneeded");this.dispatchEvent(e),null!==this.onnegotiationneeded&&this.onnegotiationneeded(e)},window.RTCPeerConnection.prototype._updateConnectionState=function(){var e,t=this,n={new:0,closed:0,connecting:0,checking:0,connected:0,completed:0,failed:0};if(this.transceivers.forEach(function(e){n[e.iceTransport.state]++,n[e.dtlsTransport.state]++}),n.connected+=n.completed,e="new",n.failed>0?e="failed":n.connecting>0||n.checking>0?e="connecting":n.disconnected>0?e="disconnected":n.new>0?e="new":(n.connected>0||n.completed>0)&&(e="connected"),e!==t.iceConnectionState){t.iceConnectionState=e;var r=new Event("iceconnectionstatechange");this.dispatchEvent(r),null!==this.oniceconnectionstatechange&&this.oniceconnectionstatechange(r)}},window.RTCPeerConnection.prototype.createOffer=function(){var e=this;if(this._pendingOffer)throw new Error("createOffer called while there is a pending offer.");var t;1===arguments.length&&"function"!=typeof arguments[0]?t=arguments[0]:3===arguments.length&&(t=arguments[2]);var n=[],s=0,i=0;if(this.localStreams.length&&(s=this.localStreams[0].getAudioTracks().length,i=this.localStreams[0].getVideoTracks().length),t){if(t.mandatory||t.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==t.offerToReceiveAudio&&(s=t.offerToReceiveAudio),void 0!==t.offerToReceiveVideo&&(i=t.offerToReceiveVideo)}for(this.localStreams.length&&this.localStreams[0].getTracks().forEach(function(e){n.push({kind:e.kind,track:e,wantReceive:"audio"===e.kind?s>0:i>0}),"audio"===e.kind?s--:"video"===e.kind&&i--});s>0||i>0;)s>0&&(n.push({kind:"audio",wantReceive:!0}),s--),i>0&&(n.push({kind:"video",wantReceive:!0}),i--);var o=r.writeSessionBoilerplate(),a=[];n.forEach(function(t,n){var s,i,o=t.track,c=t.kind,u=r.generateIdentifier(),d=e.usingBundle&&n>0?{iceGatherer:a[0].iceGatherer,iceTransport:a[0].iceTransport,dtlsTransport:a[0].dtlsTransport}:e._createIceAndDtlsTransports(u,n),l=RTCRtpSender.getCapabilities(c),p=[{ssrc:1001*(2*n+1)}];o&&(s=new RTCRtpSender(o,d.dtlsTransport)),t.wantReceive&&(i=new RTCRtpReceiver(d.dtlsTransport,c)),a[n]={iceGatherer:d.iceGatherer,iceTransport:d.iceTransport,dtlsTransport:d.dtlsTransport,localCapabilities:l,remoteCapabilities:null,rtpSender:s,rtpReceiver:i,kind:c,mid:u,sendEncodingParameters:p,recvEncodingParameters:null}}),this.usingBundle&&(o+="a=group:BUNDLE "+a.map(function(e){return e.mid}).join(" ")+"\r\n"),n.forEach(function(t,n){var s=a[n];o+=r.writeMediaSection(s,s.localCapabilities,"offer",e.localStreams[0])}),this._pendingOffer=a;var c=new RTCSessionDescription({type:"offer",sdp:o});return arguments.length&&"function"==typeof arguments[0]&&window.setTimeout(arguments[0],0,c),Promise.resolve(c)},window.RTCPeerConnection.prototype.createAnswer=function(){var e=this,t=r.writeSessionBoilerplate();this.usingBundle&&(t+="a=group:BUNDLE "+this.transceivers.map(function(e){return e.mid}).join(" ")+"\r\n"),this.transceivers.forEach(function(n){var s=e._getCommonCapabilities(n.localCapabilities,n.remoteCapabilities);t+=r.writeMediaSection(n,s,"answer",e.localStreams[0])});var n=new RTCSessionDescription({type:"answer",sdp:t});return arguments.length&&"function"==typeof arguments[0]&&window.setTimeout(arguments[0],0,n),Promise.resolve(n)},window.RTCPeerConnection.prototype.addIceCandidate=function(e){if(null===e)this.transceivers.forEach(function(e){e.iceTransport.addRemoteCandidate({})});else{var t=e.sdpMLineIndex;if(e.sdpMid)for(var n=0;n<this.transceivers.length;n++)if(this.transceivers[n].mid===e.sdpMid){t=n;break}var s=this.transceivers[t];if(s){var i=Object.keys(e.candidate).length>0?r.parseCandidate(e.candidate):{};if("tcp"===i.protocol&&0===i.port)return;if("1"!==i.component)return;"endOfCandidates"===i.type&&(i={}),s.iceTransport.addRemoteCandidate(i);
  var o=r.splitSections(this.remoteDescription.sdp);o[t+1]+=(i.type?e.candidate.trim():"a=end-of-candidates")+"\r\n",this.remoteDescription.sdp=o.join("")}}return arguments.length>1&&"function"==typeof arguments[1]&&window.setTimeout(arguments[1],0),Promise.resolve()},window.RTCPeerConnection.prototype.getStats=function(){var e=[];this.transceivers.forEach(function(t){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach(function(n){t[n]&&e.push(t[n].getStats())})});var t=arguments.length>1&&"function"==typeof arguments[1]&&arguments[1];return new Promise(function(n){var r=new Map;Promise.all(e).then(function(e){e.forEach(function(e){Object.keys(e).forEach(function(t){r.set(t,e[t]),r[t]=e[t]})}),t&&window.setTimeout(t,0,r),n(r)})})}},attachMediaStream:function(e,t){s("DEPRECATED, attachMediaStream will soon be removed."),e.srcObject=t},reattachMediaStream:function(e,t){s("DEPRECATED, reattachMediaStream will soon be removed."),e.srcObject=t.srcObject}};t.exports={shimPeerConnection:i.shimPeerConnection,shimGetUserMedia:e("./getusermedia"),attachMediaStream:i.attachMediaStream,reattachMediaStream:i.reattachMediaStream}},{"../utils":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/webrtc-adapter/src/js/utils.js","./getusermedia":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/webrtc-adapter/src/js/edge/getusermedia.js",sdp:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/sdp/sdp.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/webrtc-adapter/src/js/edge/getusermedia.js":[function(e,t,n){"use strict";t.exports=function(){var e=function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name}}},t=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(n){return t(n).catch(function(t){return Promise.reject(e(t))})}}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/webrtc-adapter/src/js/firefox/firefox_shim.js":[function(e,t,n){"use strict";var r=e("../utils").log,s=e("../utils").browserDetails,i={shimOnTrack:function(){"object"!=typeof window||!window.RTCPeerConnection||"ontrack"in window.RTCPeerConnection.prototype||Object.defineProperty(window.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&(this.removeEventListener("track",this._ontrack),this.removeEventListener("addstream",this._ontrackpoly)),this.addEventListener("track",this._ontrack=e),this.addEventListener("addstream",this._ontrackpoly=function(e){e.stream.getTracks().forEach(function(t){var n=new Event("track");n.track=t,n.receiver={track:t},n.streams=[e.stream],this.dispatchEvent(n)}.bind(this))}.bind(this))}})},shimSourceObject:function(){"object"==typeof window&&(!window.HTMLMediaElement||"srcObject"in window.HTMLMediaElement.prototype||Object.defineProperty(window.HTMLMediaElement.prototype,"srcObject",{get:function(){return this.mozSrcObject},set:function(e){this.mozSrcObject=e}}))},shimPeerConnection:function(){if("object"==typeof window&&(window.RTCPeerConnection||window.mozRTCPeerConnection)){window.RTCPeerConnection||(window.RTCPeerConnection=function(e,t){if(s.version<38&&e&&e.iceServers){for(var n=[],r=0;r<e.iceServers.length;r++){var i=e.iceServers[r];if(i.hasOwnProperty("urls"))for(var o=0;o<i.urls.length;o++){var a={url:i.urls[o]};0===i.urls[o].indexOf("turn")&&(a.username=i.username,a.credential=i.credential),n.push(a)}else n.push(e.iceServers[r])}e.iceServers=n}return new mozRTCPeerConnection(e,t)},window.RTCPeerConnection.prototype=mozRTCPeerConnection.prototype,mozRTCPeerConnection.generateCertificate&&Object.defineProperty(window.RTCPeerConnection,"generateCertificate",{get:function(){return mozRTCPeerConnection.generateCertificate}}),window.RTCSessionDescription=mozRTCSessionDescription,window.RTCIceCandidate=mozRTCIceCandidate),["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){var t=RTCPeerConnection.prototype[e];RTCPeerConnection.prototype[e]=function(){return arguments[0]=new("addIceCandidate"===e?RTCIceCandidate:RTCSessionDescription)(arguments[0]),t.apply(this,arguments)}});var e=RTCPeerConnection.prototype.addIceCandidate;RTCPeerConnection.prototype.addIceCandidate=function(){return null===arguments[0]?Promise.resolve():e.apply(this,arguments)};var t=function(e){var t=new Map;return Object.keys(e).forEach(function(n){t.set(n,e[n]),t[n]=e[n]}),t},n=RTCPeerConnection.prototype.getStats;RTCPeerConnection.prototype.getStats=function(e,r,s){return n.apply(this,[e||null]).then(function(e){return t(e)}).then(r,s)}}},attachMediaStream:function(e,t){r("DEPRECATED, attachMediaStream will soon be removed."),e.srcObject=t},reattachMediaStream:function(e,t){r("DEPRECATED, reattachMediaStream will soon be removed."),e.srcObject=t.srcObject}};t.exports={shimOnTrack:i.shimOnTrack,shimSourceObject:i.shimSourceObject,shimPeerConnection:i.shimPeerConnection,shimGetUserMedia:e("./getusermedia"),attachMediaStream:i.attachMediaStream,reattachMediaStream:i.reattachMediaStream}},{"../utils":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/webrtc-adapter/src/js/utils.js","./getusermedia":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/webrtc-adapter/src/js/firefox/getusermedia.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/webrtc-adapter/src/js/firefox/getusermedia.js":[function(e,t,n){"use strict";var r=e("../utils").log,s=e("../utils").browserDetails;t.exports=function(){var e=function(e){return{name:{SecurityError:"NotAllowedError",PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:{"The operation is insecure.":"The request is not allowed by the user agent or the platform in the current context."}[e.message]||e.message,constraint:e.constraint,toString:function(){return this.name+(this.message&&": ")+this.message}}},t=function(t,n,i){var o=function(e){if("object"!=typeof e||e.require)return e;var t=[];return Object.keys(e).forEach(function(n){if("require"!==n&&"advanced"!==n&&"mediaSource"!==n){var r=e[n]="object"==typeof e[n]?e[n]:{ideal:e[n]};if(void 0===r.min&&void 0===r.max&&void 0===r.exact||t.push(n),void 0!==r.exact&&("number"==typeof r.exact?r.min=r.max=r.exact:e[n]=r.exact,delete r.exact),void 0!==r.ideal){e.advanced=e.advanced||[];var s={};"number"==typeof r.ideal?s[n]={min:r.ideal,max:r.ideal}:s[n]=r.ideal,e.advanced.push(s),delete r.ideal,Object.keys(r).length||delete e[n]}}}),t.length&&(e.require=t),e};return t=JSON.parse(JSON.stringify(t)),s.version<38&&(r("spec: "+JSON.stringify(t)),t.audio&&(t.audio=o(t.audio)),t.video&&(t.video=o(t.video)),r("ff37: "+JSON.stringify(t))),navigator.mozGetUserMedia(t,n,function(t){i(e(t))})},n=function(e){return new Promise(function(n,r){t(e,n,r)})};if(navigator.mediaDevices||(navigator.mediaDevices={getUserMedia:n,addEventListener:function(){},removeEventListener:function(){}}),navigator.mediaDevices.enumerateDevices=navigator.mediaDevices.enumerateDevices||function(){return new Promise(function(e){var t=[{kind:"audioinput",deviceId:"default",label:"",groupId:""},{kind:"videoinput",deviceId:"default",label:"",groupId:""}];e(t)})},s.version<41){var i=navigator.mediaDevices.enumerateDevices.bind(navigator.mediaDevices);navigator.mediaDevices.enumerateDevices=function(){return i().then(void 0,function(e){if("NotFoundError"===e.name)return[];throw e})}}if(s.version<49){var o=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(t){return o(t).catch(function(t){return Promise.reject(e(t))})}}navigator.getUserMedia=function(e,n,r){return s.version<44?t(e,n,r):(console.warn("navigator.getUserMedia has been replaced by navigator.mediaDevices.getUserMedia"),void navigator.mediaDevices.getUserMedia(e).then(n,r))}}},{"../utils":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/webrtc-adapter/src/js/utils.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/webrtc-adapter/src/js/safari/safari_shim.js":[function(e,t,n){"use strict";var r={shimGetUserMedia:function(){navigator.getUserMedia=navigator.webkitGetUserMedia}};t.exports={shimGetUserMedia:r.shimGetUserMedia}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/webrtc-adapter/src/js/utils.js":[function(e,t,n){"use strict";var r=!0,s={disableLog:function(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(r=e,e?"adapter.js logging disabled":"adapter.js logging enabled")},log:function(){if("object"==typeof window){if(r)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}},extractVersion:function(e,t,n){var r=e.match(t);return r&&r.length>=n&&parseInt(r[n],10)},detectBrowser:function(){var e={};if(e.browser=null,e.version=null,e.minVersion=null,"undefined"==typeof window||!window.navigator)return e.browser="Not a browser.",e;if(navigator.mozGetUserMedia)e.browser="firefox",e.version=this.extractVersion(navigator.userAgent,/Firefox\/([0-9]+)\./,1),e.minVersion=31;else if(navigator.webkitGetUserMedia)if(window.webkitRTCPeerConnection)e.browser="chrome",e.version=this.extractVersion(navigator.userAgent,/Chrom(e|ium)\/([0-9]+)\./,2),e.minVersion=38;else{if(!navigator.userAgent.match(/Version\/(\d+).(\d+)/))return e.browser="Unsupported webkit-based browser with GUM support but no WebRTC support.",e;e.browser="safari",e.version=this.extractVersion(navigator.userAgent,/AppleWebKit\/([0-9]+)\./,1),e.minVersion=602}else{if(!navigator.mediaDevices||!navigator.userAgent.match(/Edge\/(\d+).(\d+)$/))return e.browser="Not a supported browser.",e;e.browser="edge",e.version=this.extractVersion(navigator.userAgent,/Edge\/(\d+).(\d+)$/,2),e.minVersion=10547}return e.version<e.minVersion&&s.log("Browser: "+e.browser+" Version: "+e.version+" < minimum supported version: "+e.minVersion+"\n some things might not work!"),e}};t.exports={log:s.log,disableLog:s.disableLog,browserDetails:s.detectBrowser(),extractVersion:s.extractVersion}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/webrtcsupport/index-browser.js":[function(e,t,n){var r,s;window.mozRTCPeerConnection||navigator.mozGetUserMedia?(r="moz",s=parseInt(navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1],10)):(window.webkitRTCPeerConnection||navigator.webkitGetUserMedia)&&(r="webkit",s=navigator.userAgent.match(/Chrom(e|ium)/)&&parseInt(navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)[2],10));var i=window.mozRTCPeerConnection||window.webkitRTCPeerConnection,o=window.mozRTCIceCandidate||window.RTCIceCandidate,a=window.mozRTCSessionDescription||window.RTCSessionDescription,c=window.webkitMediaStream||window.MediaStream,u="https:"===window.location.protocol&&("webkit"===r&&s>=26||"moz"===r&&s>=33),d=window.AudioContext||window.webkitAudioContext,l=document.createElement("video"),p=l&&l.canPlayType&&"probably"===l.canPlayType('video/webm; codecs="vp8", vorbis'),f=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.msGetUserMedia||navigator.mozGetUserMedia;t.exports={prefix:r,browserVersion:s,support:!!i&&p&&!!f,supportRTCPeerConnection:!!i,supportVp8:p,supportGetUserMedia:!!f,supportDataChannel:!!(i&&i.prototype&&i.prototype.createDataChannel),supportWebAudio:!(!d||!d.prototype.createMediaStreamSource),supportMediaStream:!(!c||!c.prototype.removeTrack),supportScreenSharing:!!u,dataChannel:!!(i&&i.prototype&&i.prototype.createDataChannel),webAudio:!(!d||!d.prototype.createMediaStreamSource),mediaStream:!(!c||!c.prototype.removeTrack),screenSharing:!!u,AudioContext:d,PeerConnection:i,SessionDescription:a,IceCandidate:o,MediaStream:c,getUserMedia:f}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/wildemitter/wildemitter.js":[function(e,t,n){function WildEmitter(){}t.exports=WildEmitter,WildEmitter.mixin=function(e){var t=e.prototype||e;t.isWildEmitter=!0,t.on=function(e,t,n){this.callbacks=this.callbacks||{};var r=3===arguments.length,s=r?arguments[1]:void 0,i=r?arguments[2]:arguments[1];return i._groupName=s,(this.callbacks[e]=this.callbacks[e]||[]).push(i),this},t.once=function(e,t,n){function on(){r.off(e,on),o.apply(this,arguments)}var r=this,s=3===arguments.length,i=s?arguments[1]:void 0,o=s?arguments[2]:arguments[1];return this.on(e,i,on),this},t.releaseGroup=function(e){this.callbacks=this.callbacks||{};var t,n,r,s;for(t in this.callbacks)for(s=this.callbacks[t],n=0,r=s.length;n<r;n++)s[n]._groupName===e&&(s.splice(n,1),n--,r--);return this},t.off=function(e,t){this.callbacks=this.callbacks||{};var n,r=this.callbacks[e];return r?1===arguments.length?(delete this.callbacks[e],this):(n=r.indexOf(t),r.splice(n,1),0===r.length&&delete this.callbacks[e],this):this},t.emit=function(e){this.callbacks=this.callbacks||{};var t,n,r,s=[].slice.call(arguments,1),i=this.callbacks[e],o=this.getWildcardCallbacks(e);if(i)for(r=i.slice(),t=0,n=r.length;t<n&&r[t];++t)r[t].apply(this,s);if(o)for(n=o.length,r=o.slice(),t=0,n=r.length;t<n&&r[t];++t)r[t].apply(this,[e].concat(s));return this},t.getWildcardCallbacks=function(e){this.callbacks=this.callbacks||{};var t,n,r=[];for(t in this.callbacks)n=t.split("*"),("*"===t||2===n.length&&e.slice(0,n[0].length)===n[0])&&(r=r.concat(this.callbacks[t]));return r}},WildEmitter.mixin(WildEmitter)},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xhr/index.js":[function(e,t,n){"use strict";function forEachArray(e,t){for(var n=0;n<e.length;n++)t(e[n])}function isEmpty(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function initParams(e,t,n){var r=e;return i(t)?(n=t,"string"==typeof e&&(r={uri:e})):r=a(t,{uri:e}),r.callback=n,r}function createXHR(e,t,n){return t=initParams(e,t,n),_createXHR(t)}function _createXHR(e){function readystatechange(){4===r.readyState&&loadFunc()}function getBody(){var e=void 0;if(r.response?e=r.response:"text"!==r.responseType&&r.responseType||(e=r.responseText||r.responseXML),m)try{e=JSON.parse(e)}catch(e){}return e}function errorFunc(e){clearTimeout(c),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,t(e,n)}function loadFunc(){if(!a){var s;clearTimeout(c),s=e.useXDR&&void 0===r.status?200:1223===r.status?204:r.status;var i=n,l=null;0!==s?(i={body:getBody(),statusCode:s,method:d,headers:{},url:u,rawRequest:r},r.getAllResponseHeaders&&(i.headers=o(r.getAllResponseHeaders()))):l=new Error("Internal XMLHttpRequest Error"),t(l,i,i.body)}}var t=e.callback;if("undefined"==typeof t)throw new Error("callback argument missing");t=s(t);var n={body:void 0,headers:{},statusCode:0,method:d,url:u,rawRequest:r},r=e.xhr||null;r||(r=e.cors||e.useXDR?new createXHR.XDomainRequest:new createXHR.XMLHttpRequest);var i,a,c,u=r.url=e.uri||e.url,d=r.method=e.method||"GET",l=e.body||e.data||null,p=r.headers=e.headers||{},f=!!e.sync,m=!1;if("json"in e&&(m=!0,p.accept||p.Accept||(p.Accept="application/json"),"GET"!==d&&"HEAD"!==d&&(p["content-type"]||p["Content-Type"]||(p["Content-Type"]="application/json"),l=JSON.stringify(e.json))),r.onreadystatechange=readystatechange,r.onload=loadFunc,r.onerror=errorFunc,r.onprogress=function(){},r.ontimeout=errorFunc,r.open(d,u,!f,e.username,e.password),f||(r.withCredentials=!!e.withCredentials),!f&&e.timeout>0&&(c=setTimeout(function(){a=!0,r.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",errorFunc(e)},e.timeout)),r.setRequestHeader)for(i in p)p.hasOwnProperty(i)&&r.setRequestHeader(i,p[i]);else if(e.headers&&!isEmpty(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(r.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(r),r.send(l),r}function noop(){}var r=e("global/window"),s=e("once"),i=e("is-function"),o=e("parse-headers"),a=e("xtend");t.exports=createXHR,createXHR.XMLHttpRequest=r.XMLHttpRequest||noop,createXHR.XDomainRequest="withCredentials"in new createXHR.XMLHttpRequest?createXHR.XMLHttpRequest:r.XDomainRequest,forEachArray(["get","put","post","patch","head","delete"],function(e){createXHR["delete"===e?"del":e]=function(t,n,r){return n=initParams(t,n,r),n.method=e.toUpperCase(),_createXHR(n)}})},{"global/window":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/global/window.js","is-function":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/is-function/index.js",once:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/once/once.js","parse-headers":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/parse-headers/parse-headers.js",xtend:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xtend/immutable.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/index.js":[function(e,t,n){t.exports={Namespace:e("./lib/namespaces"),MUC:e("./lib/muc"),PubSub:e("./lib/pubsub"),Jingle:e("./lib/jingle"),Presence:e("./lib/presence")}},{"./lib/jingle":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/lib/jingle.js","./lib/muc":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/lib/muc.js","./lib/namespaces":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/lib/namespaces.js","./lib/presence":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/lib/presence.js","./lib/pubsub":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/lib/pubsub.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/lib/jingle.js":[function(e,t,n){t.exports={Action:{CONTENT_ACCEPT:"content-accept",CONTENT_ADD:"content-add",CONTENT_MODIFY:"content-modify",CONTENT_REJECT:"content-reject",CONTENT_REMOVE:"content-remove",DESCRIPTION_INFO:"description-info",SECURITY_INFO:"security-info",SESSION_ACCEPT:"session-accept",SESSION_INFO:"session-info",SESSION_INITIATE:"session-initiate",SESSION_TERMINATE:"session-terminate",TRANSPORT_ACCEPT:"transport-accept",TRANSPORT_INFO:"transport-info",TRANSPORT_REJECT:"transport-reject",TRANSPORT_REPLACE:"transport-replace"},Reason:{ALTERNATIVE_SESSION:"alernative-session",BUSY:"busy",CANCEL:"cancel",CONNECTIVITY_ERROR:"connectivity-error",DECLINE:"decline",EXPIRED:"expired",FAILED_APPLICATION:"failed-application",FAILED_TRANSPORT:"failed-transport",GENERAL_ERROR:"general-error",GONE:"gone",INCOMPATIBLE_PARAMETERS:"incompatible-parameters",MEDIA_ERROR:"media-error",SECURITY_ERROR:"security-error",SUCCESS:"success",TIMEOUT:"timeout",UNSUPPORTED_APPLICATIONS:"unsupported-applications",UNSUPPORTED_TRANSPORTS:"unsupported-transports"},Condition:{OUT_OF_ORDER:"out-of-order",TIE_BREAK:"tie-break",UNKNOWN_SESSION:"unknown-session",UNSUPPORTED_INFO:"unsupported-info"}}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/lib/muc.js":[function(e,t,n){t.exports={Status:{REALJID_PUBLIC:"100",AFFILIATION_CHANGED:"101",UNAVAILABLE_SHOWN:"102",UNAVAILABLE_NOT_SHOWN:"103",CONFIGURATION_CHANGED:"104",SELF_PRESENCE:"110",LOGGING_ENABLED:"170",LOGGING_DISABLED:"171",NON_ANONYMOUS:"172",SEMI_ANONYMOUS:"173",FULLY_ANONYMOUS:"174",ROOM_CREATED:"201",NICK_ASSIGNED:"210",BANNED:"301",NEW_NICK:"303",KICKED:"307",REMOVED_AFFILIATION:"321",REMOVED_MEMBERSHIP:"322",REMOVED_SHUTDOWN:"332"},Affiliation:{ADMIN:"admin",MEMBER:"member",NONE:"none",OUTCAST:"outcast",OWNER:"owner"},Role:{MODERATOR:"moderator",NONE:"none",PARTICIPANT:"participant",VISITOR:"visitor"}}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/lib/namespaces.js":[function(e,t,n){t.exports={BIND:"urn:ietf:params:xml:ns:xmpp-bind",CLIENT:"jabber:client",SASL:"urn:ietf:params:xml:ns:xmpp-sasl",SERVER:"jabber:server",SESSION:"urn:ietf:params:xml:ns:xmpp-session",STANZA_ERROR:"urn:ietf:params:xml:ns:xmpp-stanzas",STREAM:"http://etherx.jabber.org/streams",STREAM_ERROR:"urn:ietf:params:xml:ns:xmpp-streams",ROSTER:"jabber:iq:roster",ROSTER_VERSIONING:"urn:xmpp:features:rosterver",SUBSCRIPTION_PREAPPROVAL:"urn:xmpp:features:pre-approval",FRAMING:"urn:ietf:params:xml:ns:xmpp-framing",DATAFORM:"jabber:x:data",RPC:"jabber:iq:rpc",LAST_ACTIVITY:"jabber:iq:last",PRIVACY:"jabber:iq:privacy",DISCO_INFO:"http://jabber.org/protocol/disco#info",DISCO_ITEMS:"http://jabber.org/protocol/disco#items",ADDRESS:"http://jabber.org/protocol/address",MUC:"http://jabber.org/protocol/muc",MUC_ADMIN:"http://jabber.org/protocol/muc#admin",MUC_OWNER:"http://jabber.org/protocol/muc#owner",MUC_USER:"http://jabber.org/protocol/muc#user",IBB:"http://jabber.org/protocol/ibb",BOOKMARKS:"storage:bookmarks",PRIVATE:"jabber:iq:private",ADHOC_COMMANDS:"http://jabber.org/protocol/commands",VCARD_TEMP:"vcard-temp",SEARCH:"jabber:iq:search",RSM:"http://jabber.org/protocol/rsm",PUBSUB:"http://jabber.org/protocol/pubsub",PUBSUB_ERRORS:"http://jabber.org/protocol/pubsub#errors",PUBSUB_EVENT:"http://jabber.org/protocol/pubsub#event",PUBSUB_OWNER:"http://jabber.org/protocol/pubsub#owner",SOCKS5:"http://jabber.org/protocol/bytestreams",OOB:"jabber:x:oob",HTTP_AUTH:"http://jabber.org/protocol/http-auth",XHTML_IM:"http://jabber.org/protocol/xhtml-im",REGISTER:"jabber:iq:register",AMP:"http://jabber.org/protocol/amp",GEOLOC:"http://jabber.org/protocol/geoloc",ROSTER_DELIMITER:"roster:delimiter",AVATAR_DATA:"urn:xmpp:avatar:data",AVATAR_METADATA:"urn:xmpp:avatar:metadata",CHAT_STATES:"http://jabber.org/protocol/chatstates",VERSION:"jabber:iq:version",MOOD:"http://jabber.org/protocol/mood",ACTIVITY:"http://jabber.org/protocol/activity",COMPONENT:"jabber:component:accept",CAPS:"http://jabber.org/protocol/caps",TUNE:"http://jabber.org/protocol/tune",DATAFORM_VALIDATION:"http://jabber.org/protocol/xdata-validate",BOSH:"http://jabber.org/protocol/httpbind",SHIM:"http://jabber.org/protocol/shim",COMPRESSION:"http://jabber.org/features/compress",DATAFORM_LAYOUT:"http://jabber.org/protocol/xdata-layout",ROSTER_EXCHANGE:"http://jabber.org/protocol/rosterx",ROSTER_NOTES:"storage:rosternotes",REACH_0:"urn:xmpp:reach:0",VCARD_TEMP_UPDATE:"vcard-temp:x:update",CAPTCHA:"urn:xmpp:captcha",JINGLE_1:"urn:xmpp:jingle:1",JINGLE_ERRORS_1:"urn:xmpp:jingle:errors:1",JINGLE_RTP_1:"urn:xmpp:jingle:apps:rtp:1",JINGLE_RTP_ERRORS_1:"urn:xmpp:jingle:apps:rtp:errors:1",JINGLE_RTP_INFO_1:"urn:xmpp:jingle:apps:rtp:info:1",LANG_TRANS:"urn:xmpp:langtrans",LANG_TRANS_ITEMS:"urn:xmpp:langtrans:items",NICK:"http://jabber.org/protocol/nick",JINGLE_ICE_UDP_1:"urn:xmpp:jingle:transports:ice-udp:1",JINGLE_RAW_UDP_1:"urn:xmpp:jingle:transports:raw-udp:1",RECEIPTS:"urn:xmpp:receipts",INVISIBLE_0:"urn:xmpp:invisible:0",BLOCKING:"urn:xmpp:blocking",SMACKS_3:"urn:xmpp:sm:3",PING:"urn:xmpp:ping",TIME:"urn:xmpp:time",DELAY:"urn:xmpp:delay",BOSH_XMPP:"urn:xmpp:xbosh",DISCO_EXTERNAL_1:"urn:xmpp:extdisco:1",DATAFORM_MEDIA:"urn:xmpp:media-element",ATTENTION_0:"urn:xmpp:attention:0",BOB:"urn:xmpp:bob",FILE_TRANSFER_3:"urn:xmpp:jingle:apps:file-transfer:3",FILE_TRANSFER_4:"urn:xmpp:jingle:apps:file-transfer:4",MUC_DIRECT_INVITE:"jabber:x:conference",SEC_LABEL_0:"urn:xmpp:sec-label:0",SEC_LABEL_CATALOG_2:"urn:xmpp:sec-label:catalog:2",SEC_LABEL_ESS_0:"urn:xmpp:sec-label:ess:0",JINGLE_SOCKS5_1:"urn:xmpp:jingle:transports:s5b:1",JINGLE_IBB_1:"urn:xmpp:jingle:transports:ibb:1",JINGLE_RTP_ZRTP_1:"urn:xmpp:jingle:apps:rtp:zrtp:1",THUMBS_0:"urn:xmpp:thumbs:0",THUMBS_1:"urn:xmpp:thumbs:1",DECLOAKING_0:"urn:xmpp:decloaking:0",CARBONS_2:"urn:xmpp:carbons:2",JINGLE_RTP_RTCP_FB_0:"urn:xmpp:jingle:apps:rtp:rtcp-fb:0",JINGLE_RTP_HDREXT_0:"urn:xmpp:jingle:apps:rtp:rtp-hdrext:0",FORWARD_0:"urn:xmpp:forward:0",HASHES_1:"urn:xmpp:hashes:1",RTT_0:"urn:xmpp:rtt:0",MUC_UNIQUE:"http://jabber.org/protocol/muc#unique",CORRECTION_0:"urn:xmpp:message-correct:0",PSA:"urn:xmpp:psa",MAM_TMP:"urn:xmpp:mam:tmp",MAM_0:"urn:xmpp:mam:0",HATS_0:"urn:xmpp:hats:0",IDLE_1:"urn:xmpp:idle:1",JINGLE_DTLS_0:"urn:xmpp:jingle:apps:dtls:0",JID_PREP_0:"urn:xmpp:jidprep:0",HINTS:"urn:xmpp:hints",JSON_0:"urn:xmpp:json:0",EVENTLOG:"urn:xmpp:eventlog",JINGLE_GROUPING_0:"urn:xmpp:jingle:apps:grouping:0",JINGLE_RTP_SSMA_0:"urn:xmpp:jingle:apps:rtp:ssma:0",COLIBRI:"http://jitsi.org/protocol/colibri",DTLS_SCTP_1:"urn:xmpp:jingle:transports:dtls-sctp:1",CSI:"urn:xmpp:csi",JINGLE_MSG_INITIATE_0:"urn:xmpp:jingle:jingle-message:0",PUSH_0:"urn:xmpp:push:0",JINGLE_PUB_1:"urn:xmpp:jinglepub:1"}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/lib/presence.js":[function(e,t,n){t.exports={Type:{SUBSCRIBE:"subscribe",SUBSCRIBED:"subscribed",UNSUBSCRIBE:"unsubscribe",UNSUBSCRIBED:"unsubscribed",PROBE:"probe",UNAVAILABLE:"unavailable"},Show:{CHAT:"chat",AWAY:"away",DO_NOT_DISTURB:"dnd",EXTENDED_AWAY:"xa"}}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-constants/lib/pubsub.js":[function(e,t,n){t.exports={Affiliation:{MEMBER:"member",NONE:"none",OUTCAST:"outcast",OWNER:"owner",PUBLISHER:"publisher",PUBLISH_ONLY:"publish-only"},Subscription:{NONE:"none",PENDING:"pending",UNCONFIGURED:"unconfigured",SUBSCRIBED:"subscribed"},AccessModel:{OPEN:"open",PRESENCE:"presence",ROSTER:"roster",AUTHORIZE:"authorize",WHITELIST:"whitelist"},Condition:{CONFLICT:"conflict"}}},{}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-jid/index.js":[function(e,t,n){"use strict";function bareJID(e,t){return e?e+"@"+t:t}function fullJID(e,t,n){return n?bareJID(e,t)+"/"+n:bareJID(e,t)}var r=e("./lib/stringprep"),s=/^[\x00-\x7F]*$/;n.prep=function(e){var t=e.local,s=e.domain,i=e.resource,o=t;return t&&(t=r.nodeprep(t),o=n.unescape(t)),i&&(i=r.resourceprep(i)),"."===s[s.length-1]&&(s=s.slice(0,s.length-1)),s=r.nameprep(s.split(".").map(r.toUnicode).join(".")),{prepped:e.prepped||r.available,local:t,domain:s,resource:i,bare:bareJID(t,s),full:fullJID(t,s,i),unescapedLocal:o,unescapedBare:bareJID(o,s),unescapedFull:fullJID(o,s,i)}},n.parse=function(e,t){var r="",i="",o="";t=t||s.test(e);var a=e.indexOf("/");a>0&&(o=e.slice(a+1),e=e.slice(0,a));var c=e.indexOf("@");c>0&&(r=e.slice(0,c),e=e.slice(c+1)),i=e;var u=n.prep({local:r,domain:i,resource:o});return u.prepped=u.prepped||t,u},n.equal=function(e,t,r){return e=new n.JID(e),t=new n.JID(t),2===arguments.length&&(r=!0),e.local===t.local&&e.domain===t.domain&&e.resource===t.resource&&(!r||e.prepped&&t.prepped)},n.equalBare=function(e,t,r){return e=new n.JID(e),t=new n.JID(t),2===arguments.length&&(r=!0),e.local===t.local&&e.domain===t.domain&&(!r||e.prepped&&t.prepped)},n.isBare=function(e){e=new n.JID(e);var t=!!e.resource;return!t},n.isFull=function(e){e=new n.JID(e);var t=!!e.resource;return t},n.escape=function(e){return e.replace(/^\s+|\s+$/g,"").replace(/\\5c/g,"\\5c5c").replace(/\\20/g,"\\5c20").replace(/\\22/g,"\\5c22").replace(/\\26/g,"\\5c26").replace(/\\27/g,"\\5c27").replace(/\\2f/g,"\\5c2f").replace(/\\3a/g,"\\5c3a").replace(/\\3c/g,"\\5c3c").replace(/\\3e/g,"\\5c3e").replace(/\\40/g,"\\5c40").replace(/ /g,"\\20").replace(/\"/g,"\\22").replace(/\&/g,"\\26").replace(/\'/g,"\\27").replace(/\//g,"\\2f").replace(/:/g,"\\3a").replace(/</g,"\\3c").replace(/>/g,"\\3e").replace(/@/g,"\\40")},n.unescape=function(e){return e.replace(/\\20/g," ").replace(/\\22/g,'"').replace(/\\26/g,"&").replace(/\\27/g,"'").replace(/\\2f/g,"/").replace(/\\3a/g,":").replace(/\\3c/g,"<").replace(/\\3e/g,">").replace(/\\40/g,"@").replace(/\\5c/g,"\\")},n.create=function(e,t,r){return new n.JID(e,t,r)},n.JID=function JID(e,t,r){var i={};if(!e||t||r)if(t){var o=s.test(e)&&s.test(t);r&&(o=o&&s.test(r)),i=n.prep({local:n.escape(e),domain:t,resource:r,prepped:o})}else i={};else if("string"==typeof e)i=n.parse(e);else{if(!(e._isJID||e instanceof n.JID))throw new Error("Invalid argument type");i=e}this._isJID=!0,this.local=i.local||"",this.domain=i.domain||"",this.resource=i.resource||"",this.bare=i.bare||"",this.full=i.full||"",this.unescapedLocal=i.unescapedLocal||"",this.unescapedBare=i.unescapedBare||"",this.unescapedFull=i.unescapedFull||"",this.prepped=i.prepped},n.JID.prototype.toString=function(){return this.full},n.JID.prototype.toJSON=function(){return this.full}},{"./lib/stringprep":"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-jid/lib/stringprep-browser.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xmpp-jid/lib/stringprep-browser.js":[function(e,t,n){"use strict";var r=e("punycode");n.available=!1,n.toUnicode=r.toUnicode,n.nameprep=function(e){return e.toLowerCase()},n.nodeprep=function(e){return e.toLowerCase()},n.resourceprep=function(e){return e}},{punycode:"/Users/pedrogutierrez/Projects/stanza.io/node_modules/punycode/punycode.js"}],"/Users/pedrogutierrez/Projects/stanza.io/node_modules/xtend/immutable.js":[function(e,t,n){function extend(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var s in n)r.call(n,s)&&(e[s]=n[s])}return e}t.exports=extend;var r=Object.prototype.hasOwnProperty},{}]},{},["/Users/pedrogutierrez/Projects/stanza.io/index.js"])("/Users/pedrogutierrez/Projects/stanza.io/index.js")});
  