UNPKG

consensus

Version:

vote for topics for your next meeting

1 lines 25 kB
(function(){function t(t,e,n){if(t.addEventListener)t.addEventListener(e,n,!1);else{if(!t.attachEvent)throw Error("not supported or DOM not loaded");t.attachEvent("on"+e,function(){n.call(t)})}}function e(t){var e,n,o,i,r=u(t);return e=r.left,o=r.top,n=e+t.offsetWidth,i=o+t.offsetHeight,{left:e,right:n,top:o,bottom:i}}function n(t,e){for(var n in e)e.hasOwnProperty(n)&&(t.style[n]=e[n])}function o(t,o){var i=e(t);n(o,{position:"absolute",left:i.left+"px",top:i.top+"px",width:t.offsetWidth+"px",height:t.offsetHeight+"px"})}function i(t){return t.replace(/.*(\/|\\)/,"")}function r(t){return-1!==t.indexOf(".")?t.replace(/.*[.]/,""):""}function a(t,e){var n=RegExp("\\b"+e+"\\b");return n.test(t.className)}function s(t,e){a(t,e)||(t.className+=" "+e)}function c(t,e){var n=RegExp("\\b"+e+"\\b");t.className=t.className.replace(n,"")}function l(t){t.parentNode.removeChild(t)}if(document.documentElement.getBoundingClientRect)var u=function(t){var e=t.getBoundingClientRect(),n=t.ownerDocument,o=n.body,i=n.documentElement,r=i.clientTop||o.clientTop||0,a=i.clientLeft||o.clientLeft||0,s=1;if(o.getBoundingClientRect){var c=o.getBoundingClientRect();s=(c.right-c.left)/o.clientWidth}s>1&&(r=0,a=0);var l=e.top/s+(window.pageYOffset||i&&i.scrollTop/s||o.scrollTop/s)-r,u=e.left/s+(window.pageXOffset||i&&i.scrollLeft/s||o.scrollLeft/s)-a;return{top:l,left:u}};else var u=function(t){var e=0,n=0;do e+=t.offsetTop||0,n+=t.offsetLeft||0,t=t.offsetParent;while(t);return{left:n,top:e}};var p=function(){var t=document.createElement("div");return function(e){t.innerHTML=e;var n=t.firstChild;return t.removeChild(n)}}();(function(){var t=0;return function(){return"ValumsAjaxUpload"+t++}})(),window.AjaxUpload=function(e,n){this._settings={action:"upload.php",name:"userfile",data:{},autoSubmit:!0,responseType:!1,hoverClass:"hover",disabledClass:"disabled",onChange:function(){},onSubmit:function(){},onComplete:function(){}};for(var o in n)n.hasOwnProperty(o)&&(this._settings[o]=n[o]);if(e.jquery?e=e[0]:"string"==typeof e&&(/^#.*/.test(e)&&(e=e.slice(1)),e=document.getElementById(e)),!e||1!==e.nodeType)throw Error("Please make sure that you're passing a valid element");"A"==e.nodeName.toUpperCase()&&t(e,"click",function(t){t&&t.preventDefault?t.preventDefault():window.event&&(window.event.returnValue=!1)}),this._button=e,this._input=null,this._disabled=!1,this.enable(),this._rerouteClicks()},AjaxUpload.prototype={setData:function(t){this._settings.data=t},disable:function(){s(this._button,this._settings.disabledClass),this._disabled=!0;var t=this._button.nodeName.toUpperCase();("INPUT"==t||"BUTTON"==t)&&this._button.setAttribute("disabled","disabled"),this._input&&(this._input.parentNode.style.visibility="hidden")},enable:function(){c(this._button,this._settings.disabledClass),this._button.removeAttribute("disabled"),this._disabled=!1},_createInput:function(){var e=this,o=document.createElement("input");o.setAttribute("type","file"),o.setAttribute("name",this._settings.name),n(o,{position:"absolute",right:0,margin:0,padding:0,fontSize:"480px",cursor:"pointer"});var a=document.createElement("div");if(n(a,{display:"block",position:"absolute",overflow:"hidden",margin:0,padding:0,opacity:0,direction:"ltr",zIndex:2147483583}),"0"!==a.style.opacity){if(a.filters===void 0)throw Error("Opacity not supported by the browser");a.style.filter="alpha(opacity=0)"}t(o,"change",function(){if(o&&""!==o.value){var t=i(o.value);return!1===e._settings.onChange.call(e,t,r(t))?(e._clearInput(),void 0):(e._settings.autoSubmit&&e.submit(),void 0)}}),t(o,"mouseover",function(){s(e._button,e._settings.hoverClass)}),t(o,"mouseout",function(){c(e._button,e._settings.hoverClass),o.parentNode&&(o.parentNode.style.visibility="hidden")}),a.appendChild(o),document.body.appendChild(a),this._input=o},_clearInput:function(){this._input&&(l(this._input.parentNode),this._input=null,this._createInput(),c(this._button,this._settings.hoverClass))},_rerouteClicks:function(){var e=this;t(e._button,"mouseover",function(){if(!e._disabled){e._input||e._createInput();var t=e._input.parentNode;o(e._button,t),t.style.visibility="visible"}})},_createIframe:function(){return document.getElementsByTagName("iframe")[0]},_createForm:function(t){var e=this._settings,n=p('<form method="post" enctype="multipart/form-data"></form>');n.setAttribute("action",this._createIframe().getAttribute("src")),n.setAttribute("target",t.name),n.style.display="none",document.body.appendChild(n);for(var o in e.data)if(e.data.hasOwnProperty(o)){var i=document.createElement("input");i.setAttribute("type","hidden"),i.setAttribute("name",o),i.setAttribute("value",e.data[o]),n.appendChild(i)}return n},_getResponse:function(e,n){var o=!1,i=this,r=this._settings;t(e,"load",function(){r.onComplete.call(i,n),o=!0})},submit:function(){var t=this,e=this._settings;if(this._input&&""!==this._input.value){var n=i(this._input.value);if(!1===e.onSubmit.call(this,n,r(n)))return this._clearInput(),void 0;if(-1==this._settings.allowedExtensions.indexOf(r(this._input.value)))return alert("Only "+this._settings.allowedExtensions.join(", ")+" "+(1==this._settings.allowedExtensions.length?"is":"are")+" allowed");var o=this._createIframe(),a=this._createForm(o);l(this._input.parentNode),c(t._button,t._settings.hoverClass),a.appendChild(this._input),a.submit(),this._getResponse(o,n),this._createInput()}}}})(),function(t,e,n,o,i,r){function a(t,e){var n=typeof t[e];return"function"==n||!("object"!=n||!t[e])||"unknown"==n}function s(t,e){return!("object"!=typeof t[e]||!t[e])}function c(t){return"[object Array]"===Object.prototype.toString.call(t)}function l(){var t="Shockwave Flash",e="application/x-shockwave-flash";if(!b(navigator.plugins)&&"object"==typeof navigator.plugins[t]){var n=navigator.plugins[t].description;n&&!b(navigator.mimeTypes)&&navigator.mimeTypes[e]&&navigator.mimeTypes[e].enabledPlugin&&(M=n.match(/\d+/g))}if(!M){var o;try{o=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"),M=Array.prototype.slice.call(o.GetVariable("$version").match(/(\d+),(\d+),(\d+),(\d+)/),1),o=null}catch(i){}}if(!M)return!1;var r=parseInt(M[0],10),a=parseInt(M[1],10);return N=r>9&&a>0,!0}function u(){if(!W){W=!0;for(var t=0;X.length>t;t++)X[t]();X.length=0}}function p(t,e){return W?(t.call(e),void 0):(X.push(function(){t.call(e)}),void 0)}function d(){var t=parent;if(""!==H)for(var e=0,n=H.split(".");n.length>e;e++)t=t[n[e]];return t.easyXDM}function f(e){return t.easyXDM=L,H=e,H&&(U="easyXDM_"+H.replace(".","_")+"_"),B}function h(t){return t.match(I)[3]}function m(t){return t.match(I)[4]||""}function g(t){var e=t.toLowerCase().match(I),n=e[2],o=e[3],i=e[4]||"";return("http:"==n&&":80"==i||"https:"==n&&":443"==i)&&(i=""),n+"//"+o+i}function v(t){if(t=t.replace(j,"$1/"),!t.match(/^(http||https):\/\//)){var e="/"===t.substring(0,1)?"":n.pathname;"/"!==e.substring(e.length-1)&&(e=e.substring(0,e.lastIndexOf("/")+1)),t=n.protocol+"//"+n.host+e+t}for(;D.test(t);)t=t.replace(D,"");return t}function y(t,e){var n="",o=t.indexOf("#");-1!==o&&(n=t.substring(o),t=t.substring(0,o));var i=[];for(var a in e)e.hasOwnProperty(a)&&i.push(a+"="+r(e[a]));return t+(J?"#":-1==t.indexOf("?")?"?":"&")+i.join("&")+n}function b(t){return t===void 0}function w(t,e,n){var o;for(var i in e)e.hasOwnProperty(i)&&(i in t?(o=e[i],"object"==typeof o?w(t[i],o,n):n||(t[i]=e[i])):t[i]=e[i]);return t}function _(){var t=e.body.appendChild(e.createElement("form")),n=t.appendChild(e.createElement("input"));n.name=U+"TEST"+A,T=n!==t.elements[n.name],e.body.removeChild(t)}function k(t){b(T)&&_();var n;T?n=e.createElement('<iframe name="'+t.props.name+'"/>'):(n=e.createElement("IFRAME"),n.name=t.props.name),n.id=n.name=t.props.name,delete t.props.name,"string"==typeof t.container&&(t.container=e.getElementById(t.container)),t.container||(w(n.style,{position:"absolute",top:"-2000px",left:"0px"}),t.container=e.body);var o=t.props.src;if(t.props.src="javascript:false",w(n,t.props),n.border=n.frameBorder=0,n.allowTransparency=!0,t.container.appendChild(n),t.onLoad&&S(n,"load",t.onLoad),t.usePost){var i,r=t.container.appendChild(e.createElement("form"));if(r.target=n.name,r.action=o,r.method="POST","object"==typeof t.usePost)for(var a in t.usePost)t.usePost.hasOwnProperty(a)&&(T?i=e.createElement('<input name="'+a+'"/>'):(i=e.createElement("INPUT"),i.name=a),i.value=t.usePost[a],r.appendChild(i));r.submit(),r.parentNode.removeChild(r)}else n.src=o;return t.props.src=o,n}function x(t,e){"string"==typeof t&&(t=[t]);for(var n,o=t.length;o--;)if(n=t[o],n=RegExp("^"==n.substr(0,1)?n:"^"+n.replace(/(\*)/g,".$1").replace(/\?/g,".")+"$"),n.test(e))return!0;return!1}function O(o){var i,r=o.protocol;if(o.isHost=o.isHost||b(q.xdm_p),J=o.hash||!1,o.props||(o.props={}),o.isHost)o.remote=v(o.remote),o.channel=o.channel||"default"+A++,o.secret=Math.random().toString(16).substring(2),b(r)&&(r=g(n.href)==g(o.remote)?"4":a(t,"postMessage")||a(e,"postMessage")?"1":o.swf&&a(t,"ActiveXObject")&&l()?"6":"Gecko"===navigator.product&&"frameElement"in t&&-1==navigator.userAgent.indexOf("WebKit")?"5":o.remoteHelper?"2":"0");else if(o.channel=q.xdm_c.replace(/["'<>\\]/g,""),o.secret=q.xdm_s,o.remote=q.xdm_e.replace(/["'<>\\]/g,""),r=q.xdm_p,o.acl&&!x(o.acl,o.remote))throw Error("Access denied for "+o.remote);switch(o.protocol=r,r){case"0":if(w(o,{interval:100,delay:2e3,useResize:!0,useParent:!1,usePolling:!1},!0),o.isHost){if(!o.local){for(var s,c=n.protocol+"//"+n.host,u=e.body.getElementsByTagName("img"),p=u.length;p--;)if(s=u[p],s.src.substring(0,c.length)===c){o.local=s.src;break}o.local||(o.local=t)}var d={xdm_c:o.channel,xdm_p:0};o.local===t?(o.usePolling=!0,o.useParent=!0,o.local=n.protocol+"//"+n.host+n.pathname+n.search,d.xdm_e=o.local,d.xdm_pa=1):d.xdm_e=v(o.local),o.container&&(o.useResize=!1,d.xdm_po=1),o.remote=y(o.remote,d)}else w(o,{channel:q.xdm_c,remote:q.xdm_e,useParent:!b(q.xdm_pa),usePolling:!b(q.xdm_po),useResize:o.useParent?!1:o.useResize});i=[new B.stack.HashTransport(o),new B.stack.ReliableBehavior({}),new B.stack.QueueBehavior({encode:!0,maxLength:4e3-o.remote.length}),new B.stack.VerifyBehavior({initiate:o.isHost})];break;case"1":i=[new B.stack.PostMessageTransport(o)];break;case"2":o.remoteHelper=v(o.remoteHelper),i=[new B.stack.NameTransport(o),new B.stack.QueueBehavior,new B.stack.VerifyBehavior({initiate:o.isHost})];break;case"3":i=[new B.stack.NixTransport(o)];break;case"4":i=[new B.stack.SameOriginTransport(o)];break;case"5":i=[new B.stack.FrameElementTransport(o)];break;case"6":M||l(),i=[new B.stack.FlashTransport(o)]}return i.push(new B.stack.QueueBehavior({lazy:o.lazy,remove:!0})),i}function E(t){for(var e,n={incoming:function(t,e){this.up.incoming(t,e)},outgoing:function(t,e){this.down.outgoing(t,e)},callback:function(t){this.up.callback(t)},init:function(){this.down.init()},destroy:function(){this.down.destroy()}},o=0,i=t.length;i>o;o++)e=t[o],w(e,n,!0),0!==o&&(e.down=t[o-1]),o!==i-1&&(e.up=t[o+1]);return e}function C(t){t.up.down=t.down,t.down.up=t.up,t.up=t.down=null}var T,M,N,S,R,P=this,A=Math.floor(1e4*Math.random()),F=Function.prototype,I=/^((http.?:)\/\/([^:\/\s]+)(:\d+)*)/,D=/[\-\w]+\/\.\.\//,j=/([^:])\/\//g,H="",B={},L=t.easyXDM,U="easyXDM_",J=!1;if(a(t,"addEventListener"))S=function(t,e,n){t.addEventListener(e,n,!1)},R=function(t,e,n){t.removeEventListener(e,n,!1)};else{if(!a(t,"attachEvent"))throw Error("Browser not supported");S=function(t,e,n){t.attachEvent("on"+e,n)},R=function(t,e,n){t.detachEvent("on"+e,n)}}var z,W=!1,X=[];if("readyState"in e?(z=e.readyState,W="complete"==z||~navigator.userAgent.indexOf("AppleWebKit/")&&("loaded"==z||"interactive"==z)):W=!!e.body,!W){if(a(t,"addEventListener"))S(e,"DOMContentLoaded",u);else if(S(e,"readystatechange",function(){"complete"==e.readyState&&u()}),e.documentElement.doScroll&&t===top){var V=function(){if(!W){try{e.documentElement.doScroll("left")}catch(t){return o(V,1),void 0}u()}};V()}S(t,"load",u)}var q=function(t){t=t.substring(1).split("&");for(var e,n={},o=t.length;o--;)e=t[o].split("="),n[e[0]]=i(e[1]);return n}(/xdm_e=/.test(n.search)?n.search:n.hash),G=function(){var t={},e={a:[1,2,3]},n='{"a":[1,2,3]}';return"undefined"!=typeof JSON&&"function"==typeof JSON.stringify&&JSON.stringify(e).replace(/\s/g,"")===n?JSON:(Object.toJSON&&Object.toJSON(e).replace(/\s/g,"")===n&&(t.stringify=Object.toJSON),"function"==typeof String.prototype.evalJSON&&(e=n.evalJSON(),e.a&&3===e.a.length&&3===e.a[2]&&(t.parse=function(t){return t.evalJSON()})),t.stringify&&t.parse?(G=function(){return t},t):null)};w(B,{version:"2.4.15.0",query:q,stack:{},apply:w,getJSONObject:G,whenReady:p,noConflict:f}),B.DomHelper={on:S,un:R,requiresJSON:function(n){s(t,"JSON")||e.write('<script type="text/javascript" src="'+n+'"><'+"/script>")}},function(){var t={};B.Fn={set:function(e,n){t[e]=n},get:function(e,n){var o=t[e];return n&&delete t[e],o}}}(),B.Socket=function(t){var e=E(O(t).concat([{incoming:function(e,n){t.onMessage(e,n)},callback:function(e){t.onReady&&t.onReady(e)}}])),n=g(t.remote);this.origin=g(t.remote),this.destroy=function(){e.destroy()},this.postMessage=function(t){e.outgoing(t,n)},e.init()},B.Rpc=function(t,e){if(e.local)for(var n in e.local)if(e.local.hasOwnProperty(n)){var o=e.local[n];"function"==typeof o&&(e.local[n]={method:o})}var i=E(O(t).concat([new B.stack.RpcBehavior(this,e),{callback:function(e){t.onReady&&t.onReady(e)}}]));this.origin=g(t.remote),this.destroy=function(){i.destroy()},i.init()},B.stack.SameOriginTransport=function(t){var e,i,r,a;return e={outgoing:function(t,e,n){r(t),n&&n()},destroy:function(){i&&(i.parentNode.removeChild(i),i=null)},onDOMReady:function(){a=g(t.remote),t.isHost?(w(t.props,{src:y(t.remote,{xdm_e:n.protocol+"//"+n.host+n.pathname,xdm_c:t.channel,xdm_p:4}),name:U+t.channel+"_provider"}),i=k(t),B.Fn.set(t.channel,function(t){return r=t,o(function(){e.up.callback(!0)},0),function(t){e.up.incoming(t,a)}})):(r=d().Fn.get(t.channel,!0)(function(t){e.up.incoming(t,a)}),o(function(){e.up.callback(!0)},0))},init:function(){p(e.onDOMReady,e)}}},B.stack.FlashTransport=function(t){function i(t){o(function(){a.up.incoming(t,c)},0)}function r(n){var o=t.swf+"?host="+t.isHost,i="easyXDM_swf_"+Math.floor(1e4*Math.random());B.Fn.set("flash_loaded"+n.replace(/[\-.]/g,"_"),function(){B.stack.FlashTransport[n].swf=l=u.firstChild;for(var t=B.stack.FlashTransport[n].queue,e=0;t.length>e;e++)t[e]();t.length=0}),t.swfContainer?u="string"==typeof t.swfContainer?e.getElementById(t.swfContainer):t.swfContainer:(u=e.createElement("div"),w(u.style,N&&t.swfNoThrottle?{height:"20px",width:"20px",position:"fixed",right:0,top:0}:{height:"1px",width:"1px",position:"absolute",overflow:"hidden",right:0,top:0}),e.body.appendChild(u));var r="callback=flash_loaded"+n.replace(/[\-.]/g,"_")+"&proto="+P.location.protocol+"&domain="+h(P.location.href)+"&port="+m(P.location.href)+"&ns="+H;u.innerHTML="<object height='20' width='20' type='application/x-shockwave-flash' id='"+i+"' data='"+o+"'>"+"<param name='allowScriptAccess' value='always'></param>"+"<param name='wmode' value='transparent'>"+"<param name='movie' value='"+o+"'></param>"+"<param name='flashvars' value='"+r+"'></param>"+"<embed type='application/x-shockwave-flash' FlashVars='"+r+"' allowScriptAccess='always' wmode='transparent' src='"+o+"' height='1' width='1'></embed>"+"</object>"}var a,s,c,l,u;return a={outgoing:function(e,n,o){l.postMessage(t.channel,""+e),o&&o()},destroy:function(){try{l.destroyChannel(t.channel)}catch(e){}l=null,s&&(s.parentNode.removeChild(s),s=null)},onDOMReady:function(){c=t.remote,B.Fn.set("flash_"+t.channel+"_init",function(){o(function(){a.up.callback(!0)})}),B.Fn.set("flash_"+t.channel+"_onMessage",i),t.swf=v(t.swf);var e=h(t.swf),u=function(){B.stack.FlashTransport[e].init=!0,l=B.stack.FlashTransport[e].swf,l.createChannel(t.channel,t.secret,g(t.remote),t.isHost),t.isHost&&(N&&t.swfNoThrottle&&w(t.props,{position:"fixed",right:0,top:0,height:"20px",width:"20px"}),w(t.props,{src:y(t.remote,{xdm_e:g(n.href),xdm_c:t.channel,xdm_p:6,xdm_s:t.secret}),name:U+t.channel+"_provider"}),s=k(t))};B.stack.FlashTransport[e]&&B.stack.FlashTransport[e].init?u():B.stack.FlashTransport[e]?B.stack.FlashTransport[e].queue.push(u):(B.stack.FlashTransport[e]={queue:[u]},r(e))},init:function(){p(a.onDOMReady,a)}}},B.stack.PostMessageTransport=function(e){function i(t){if(t.origin)return g(t.origin);if(t.uri)return g(t.uri);if(t.domain)return n.protocol+"//"+t.domain;throw"Unable to retrieve the origin of the event"}function r(t){var n=i(t);n==l&&t.data.substring(0,e.channel.length+1)==e.channel+" "&&a.up.incoming(t.data.substring(e.channel.length+1),n)}var a,s,c,l;return a={outgoing:function(t,n,o){c.postMessage(e.channel+" "+t,n||l),o&&o()},destroy:function(){R(t,"message",r),s&&(c=null,s.parentNode.removeChild(s),s=null)},onDOMReady:function(){if(l=g(e.remote),e.isHost){var i=function(n){n.data==e.channel+"-ready"&&(c="postMessage"in s.contentWindow?s.contentWindow:s.contentWindow.document,R(t,"message",i),S(t,"message",r),o(function(){a.up.callback(!0)},0))};S(t,"message",i),w(e.props,{src:y(e.remote,{xdm_e:g(n.href),xdm_c:e.channel,xdm_p:1}),name:U+e.channel+"_provider"}),s=k(e)}else S(t,"message",r),c="postMessage"in t.parent?t.parent:t.parent.document,c.postMessage(e.channel+"-ready",l),o(function(){a.up.callback(!0)},0)},init:function(){p(a.onDOMReady,a)}}},B.stack.FrameElementTransport=function(i){var r,a,s,c;return r={outgoing:function(t,e,n){s.call(this,t),n&&n()},destroy:function(){a&&(a.parentNode.removeChild(a),a=null)},onDOMReady:function(){c=g(i.remote),i.isHost?(w(i.props,{src:y(i.remote,{xdm_e:g(n.href),xdm_c:i.channel,xdm_p:5}),name:U+i.channel+"_provider"}),a=k(i),a.fn=function(t){return delete a.fn,s=t,o(function(){r.up.callback(!0)},0),function(t){r.up.incoming(t,c)}}):(e.referrer&&g(e.referrer)!=q.xdm_e&&(t.top.location=q.xdm_e),s=t.frameElement.fn(function(t){r.up.incoming(t,c)}),r.up.callback(!0))},init:function(){p(r.onDOMReady,r)}}},B.stack.NameTransport=function(t){function e(e){var n=t.remoteHelper+(s?"#_3":"#_2")+t.channel;c.contentWindow.sendMessage(e,n)}function n(){s?2!==++u&&s||a.up.callback(!0):(e("ready"),a.up.callback(!0))}function i(t){a.up.incoming(t,f)}function r(){d&&o(function(){d(!0)},0)}var a,s,c,l,u,d,f,h;return a={outgoing:function(t,n,o){d=o,e(t)},destroy:function(){c.parentNode.removeChild(c),c=null,s&&(l.parentNode.removeChild(l),l=null)},onDOMReady:function(){s=t.isHost,u=0,f=g(t.remote),t.local=v(t.local),s?(B.Fn.set(t.channel,function(e){s&&"ready"===e&&(B.Fn.set(t.channel,i),n())}),h=y(t.remote,{xdm_e:t.local,xdm_c:t.channel,xdm_p:2}),w(t.props,{src:h+"#"+t.channel,name:U+t.channel+"_provider"}),l=k(t)):(t.remoteHelper=t.remote,B.Fn.set(t.channel,i));var e=function(){var i=c||this;R(i,"load",e),B.Fn.set(t.channel+"_load",r),function a(){"function"==typeof i.contentWindow.sendMessage?n():o(a,50)}()};c=k({props:{src:t.local+"#_4"+t.channel},onLoad:e})},init:function(){p(a.onDOMReady,a)}}},B.stack.HashTransport=function(e){function n(t){if(m){var n=e.remote+"#"+f++ +"_"+t;(c||!v?m.contentWindow:m).location=n}}function i(t){d=t,s.up.incoming(d.substring(d.indexOf("_")+1),y)}function r(){if(h){var t=h.location.href,e="",n=t.indexOf("#");-1!=n&&(e=t.substring(n)),e&&e!=d&&i(e)}}function a(){l=setInterval(r,u)}var s,c,l,u,d,f,h,m,v,y;return s={outgoing:function(t){n(t)},destroy:function(){t.clearInterval(l),(c||!v)&&m.parentNode.removeChild(m),m=null},onDOMReady:function(){if(c=e.isHost,u=e.interval,d="#"+e.channel,f=0,v=e.useParent,y=g(e.remote),c){if(w(e.props,{src:e.remote,name:U+e.channel+"_provider"}),v)e.onLoad=function(){h=t,a(),s.up.callback(!0)};else{var n=0,i=e.delay/50;(function r(){if(++n>i)throw Error("Unable to reference listenerwindow");try{h=m.contentWindow.frames[U+e.channel+"_consumer"]}catch(t){}h?(a(),s.up.callback(!0)):o(r,50)})()}m=k(e)}else h=t,a(),v?(m=parent,s.up.callback(!0)):(w(e,{props:{src:e.remote+"#"+e.channel+new Date,name:U+e.channel+"_consumer"},onLoad:function(){s.up.callback(!0)}}),m=k(e))},init:function(){p(s.onDOMReady,s)}}},B.stack.ReliableBehavior=function(){var t,e,n=0,o=0,i="";return t={incoming:function(r,a){var s=r.indexOf("_"),c=r.substring(0,s).split(",");r=r.substring(s+1),c[0]==n&&(i="",e&&(e(!0),e=null)),r.length>0&&(t.down.outgoing(c[1]+","+n+"_"+i,a),o!=c[1]&&(o=c[1],t.up.incoming(r,a)))},outgoing:function(r,a,s){i=r,e=s,t.down.outgoing(o+","+ ++n+"_"+r,a)}}},B.stack.QueueBehavior=function(t){function e(){if(t.remove&&0===s.length)return C(n),void 0;if(!c&&0!==s.length&&!a){c=!0;var i=s.shift();n.down.outgoing(i.data,i.origin,function(t){c=!1,i.callback&&o(function(){i.callback(t)},0),e()})}}var n,a,s=[],c=!0,l="",u=0,p=!1,d=!1;return n={init:function(){b(t)&&(t={}),t.maxLength&&(u=t.maxLength,d=!0),t.lazy?p=!0:n.down.init()},callback:function(t){c=!1;var o=n.up;e(),o.callback(t)},incoming:function(e,o){if(d){var r=e.indexOf("_"),a=parseInt(e.substring(0,r),10);l+=e.substring(r+1),0===a&&(t.encode&&(l=i(l)),n.up.incoming(l,o),l="")}else n.up.incoming(e,o)},outgoing:function(o,i,a){t.encode&&(o=r(o));var c,l=[];if(d){for(;0!==o.length;)c=o.substring(0,u),o=o.substring(c.length),l.push(c);for(;c=l.shift();)s.push({data:l.length+"_"+c,origin:i,callback:0===l.length?a:null})}else s.push({data:o,origin:i,callback:a});p?n.down.init():e()},destroy:function(){a=!0,n.down.destroy()}}},B.stack.VerifyBehavior=function(t){function e(){o=Math.random().toString(16).substring(2),n.down.outgoing(o)}var n,o,i;return n={incoming:function(r,a){var s=r.indexOf("_");-1===s?r===o?n.up.callback(!0):i||(i=r,t.initiate||e(),n.down.outgoing(r)):r.substring(0,s)===i&&n.up.incoming(r.substring(s+1),a)},outgoing:function(t,e,i){n.down.outgoing(o+"_"+t,e,i)},callback:function(){t.initiate&&e()}}},B.stack.RpcBehavior=function(t,e){function n(t){t.jsonrpc="2.0",r.down.outgoing(a.stringify(t))}function o(t,e){var o=Array.prototype.slice;return function(){var i,r=arguments.length,a={method:e};r>0&&"function"==typeof arguments[r-1]?(r>1&&"function"==typeof arguments[r-2]?(i={success:arguments[r-2],error:arguments[r-1]},a.params=o.call(arguments,0,r-2)):(i={success:arguments[r-1]},a.params=o.call(arguments,0,r-1)),l[""+ ++s]=i,a.id=s):a.params=o.call(arguments,0),t.namedParams&&1===a.params.length&&(a.params=a.params[0]),n(a)}}function i(t,e,o,i){if(!o)return e&&n({id:e,error:{code:-32601,message:"Procedure not found."}}),void 0;var r,a;e?(r=function(t){r=F,n({id:e,result:t})},a=function(t,o){a=F;var i={id:e,error:{code:-32099,message:t}};o&&(i.error.data=o),n(i)}):r=a=F,c(i)||(i=[i]);try{var s=o.method.apply(o.scope,i.concat([r,a]));b(s)||r(s)}catch(l){a(l.message)}}var r,a=e.serializer||G(),s=0,l={};return r={incoming:function(t){var o=a.parse(t);if(o.method)e.handle?e.handle(o,n):i(o.method,o.id,e.local[o.method],o.params);else{var r=l[o.id];o.error?r.error&&r.error(o.error):r.success&&r.success(o.result),delete l[o.id]}},init:function(){if(e.remote)for(var n in e.remote)e.remote.hasOwnProperty(n)&&(t[n]=o(e.remote[n],n));r.down.init()},destroy:function(){for(var n in e.remote)e.remote.hasOwnProperty(n)&&t.hasOwnProperty(n)&&delete t[n];r.down.destroy()}}},P.easyXDM=B}(window,document,location,window.setTimeout,decodeURIComponent,encodeURIComponent);var AvatarsIO;AvatarsIO=function(){function t(t){this.token=t}return t.prototype.create=function(e){return new t.Uploader(this.token,e)},t}(),AvatarsIO.Uploader=function(){function t(t,e){this.token=t,this.input=e,this.initialize(),this.emit("init")}return t.prototype.identifier="",t.prototype.host="http://avatars.io",t.prototype.allowedExtensions=["jpg","jpeg","png","gif","JPG","JPEG","PNG","GIF"],t.prototype.initialize=function(){var t,e=this;return t=""+this.host+"/v1/upload?authorization="+this.token+(this.identifier.length>0?"&shortcut="+this.identifier:""),this.socket=new easyXDM.Socket({remote:t,onMessage:function(t){return t?e.emit("complete",[t]):e.emit("error")}}),this.widget?void 0:this.widget=new AjaxUpload(this.input,{action:t,name:"avatar",allowedExtensions:this.allowedExtensions,onSubmit:function(){return e.emit("start")}})},t.prototype.setHost=function(t){this.host=null!=t?t:"http://avatars.io"},t.prototype.setIdentifier=function(t){var e=this;return this.identifier=null!=t?t:"",setTimeout(function(){return e.socket&&e.socket.destroy(),e.initialize()},100)},t.prototype.setAlbum=function(){return this.setIdentifier.apply(this,arguments)},t.prototype.setAlbumID=function(){return this.setAlbum.apply(this,arguments)},t.prototype.setAllowedExtensions=function(t){var e,n,o,i;for(this.allowedExtensions=null!=t?t:[],i=this.allowedExtensions,n=0,o=i.length;o>n;n++)e=i[n],this.allowedExtensions.push(e.toUpperCase());return this.widget?this.widget._settings.allowedExtensions=this.allowedExtensions:void 0},t.prototype.listeners={},t.prototype.on=function(t,e){return this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e)},t.prototype.emit=function(t,e,n){var o,i,r,a;if(null==n&&(n=this),this.listeners[t]){for(a=this.listeners[t],i=0,r=a.length;r>i;i++)o=a[i],o.apply(n,e);return void 0}},t}();