{"size": 135207, "ext": "js", "max_stars_repo_path": "qml/www/firebase-2.3.2.e275fb76.js", "max_stars_repo_name": "balcy/esviji-ubuntu-touch", "max_stars_repo_stars_event_min_datetime": "2020-05-09T23:34:33.000Z", "max_stars_repo_stars_event_max_datetime": "2020-05-09T23:34:33.000Z", "max_issues_repo_path": "qml/www/firebase-2.3.2.e275fb76.js", "max_issues_repo_name": "balcy/esviji-ubuntu-touch", "max_issues_repo_issues_event_min_datetime": "2020-05-09T09:31:40.000Z", "max_issues_repo_issues_event_max_datetime": "2020-08-12T23:27:23.000Z", "max_forks_repo_path": "qml/www/firebase-2.3.2.e275fb76.js", "max_forks_repo_name": "balcy/esviji-ubuntu-touch", "max_forks_repo_forks_event_min_datetime": "2020-08-12T15:56:46.000Z", "max_forks_repo_forks_event_max_datetime": "2020-08-12T15:56:46.000Z"}
{"max_stars_count": 1, "max_issues_count": 7, "max_forks_count": 1, "avg_line_length": 33801.75, "max_line_length": 134113, "alphanum_fraction": 0.6566376001}
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"djAK":[function(require,module,exports) {
function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(){var g,aa=this;function n(t){return void 0!==t}function ba(){}function ca(t){t.ub=function(){return t.uf?t.uf:t.uf=new t}}function da(t){var e=_typeof(t);if("object"==e){if(!t)return"null";if(t instanceof Array)return"array";if(t instanceof Object)return e;var n=Object.prototype.toString.call(t);if("[object Window]"==n)return"object";if("[object Array]"==n||"number"==typeof t.length&&void 0!==t.splice&&void 0!==t.propertyIsEnumerable&&!t.propertyIsEnumerable("splice"))return"array";if("[object Function]"==n||void 0!==t.call&&void 0!==t.propertyIsEnumerable&&!t.propertyIsEnumerable("call"))return"function"}else if("function"==e&&void 0===t.call)return"object";return e}function ea(t){return"array"==da(t)}function fa(t){var e=da(t);return"array"==e||"object"==e&&"number"==typeof t.length}function p(t){return"string"==typeof t}function ga(t){return"number"==typeof t}function ha(t){return"function"==da(t)}function ia(t){var e=_typeof(t);return"object"==e&&null!=t||"function"==e}function ja(t,e,n){return t.call.apply(t.bind,arguments)}function ka(t,e,n){if(!t)throw Error();if(2<arguments.length){var i=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,i),t.apply(e,n)}}return function(){return t.apply(e,arguments)}}function q(t,e,n){return(q=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ja:ka).apply(null,arguments)}var la=Date.now||function(){return+new Date};function ma(t,e){function n(){}n.prototype=e.prototype,t.bh=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.Yg=function(t,n,i){for(var r=Array(arguments.length-2),o=2;o<arguments.length;o++)r[o-2]=arguments[o];return e.prototype[n].apply(t,r)}}function r(t,e){for(var n in t)e.call(void 0,t[n],n,t)}function na(t,e){var n,i={};for(n in t)i[n]=e.call(void 0,t[n],n,t);return i}function oa(t,e){for(var n in t)if(!e.call(void 0,t[n],n,t))return!1;return!0}function pa(t){var e,n=0;for(e in t)n++;return n}function qa(t){for(var e in t)return e}function ra(t){var e,n=[],i=0;for(e in t)n[i++]=t[e];return n}function sa(t){var e,n=[],i=0;for(e in t)n[i++]=e;return n}function ta(t,e){for(var n in t)if(t[n]==e)return!0;return!1}function ua(t,e,n){for(var i in t)if(e.call(n,t[i],i,t))return i}function va(t,e){var n=ua(t,e,void 0);return n&&t[n]}function wa(t){for(var e in t)return!1;return!0}function xa(t){var e,n={};for(e in t)n[e]=t[e];return n}var ya="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function za(t,e){for(var n,i,r=1;r<arguments.length;r++){for(n in i=arguments[r])t[n]=i[n];for(var o=0;o<ya.length;o++)n=ya[o],Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}}function Aa(a){if(a=String(a),!/^\s*$/.test(a)&&/^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+a+")")}catch(b){}throw Error("Invalid JSON string: "+a)}function Ba(){this.Sd=void 0}function Ca(t,e,n){switch(_typeof(e)){case"string":Da(e,n);break;case"number":n.push(isFinite(e)&&!isNaN(e)?e:"null");break;case"boolean":n.push(e);break;case"undefined":n.push("null");break;case"object":if(null==e){n.push("null");break}if(ea(e)){var i=e.length;n.push("[");for(var r="",o=0;o<i;o++)n.push(r),r=e[o],Ca(t,t.Sd?t.Sd.call(e,String(o),r):r,n),r=",";n.push("]");break}for(o in n.push("{"),i="",e)Object.prototype.hasOwnProperty.call(e,o)&&("function"!=typeof(r=e[o])&&(n.push(i),Da(o,n),n.push(":"),Ca(t,t.Sd?t.Sd.call(e,o,r):r,n),i=","));n.push("}");break;case"function":break;default:throw Error("Unknown type: "+_typeof(e))}}var Ea={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\u000b"},Fa=/\uffff/.test("")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g,Ha;function Da(t,e){e.push('"',t.replace(Fa,function(t){if(t in Ea)return Ea[t];var e=t.charCodeAt(0),n="\\u";return 16>e?n+="000":256>e?n+="00":4096>e&&(n+="0"),Ea[t]=n+e.toString(16)}),'"')}function Ga(){return Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^la()).toString(36)}t:{var Ia=aa.navigator;if(Ia){var Ja=Ia.userAgent;if(Ja){Ha=Ja;break t}}Ha=""}function Ka(){this.Va=-1}function La(){this.Va=-1,this.Va=64,this.N=[],this.me=[],this.Wf=[],this.Ld=[],this.Ld[0]=128;for(var t=1;t<this.Va;++t)this.Ld[t]=0;this.de=this.ac=0,this.reset()}function Ma(t,e,n){n||(n=0);var i=t.Wf;if(p(e))for(var r=0;16>r;r++)i[r]=e.charCodeAt(n)<<24|e.charCodeAt(n+1)<<16|e.charCodeAt(n+2)<<8|e.charCodeAt(n+3),n+=4;else for(r=0;16>r;r++)i[r]=e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3],n+=4;for(r=16;80>r;r++){var o=i[r-3]^i[r-8]^i[r-14]^i[r-16];i[r]=4294967295&(o<<1|o>>>31)}e=t.N[0],n=t.N[1];var a,s=t.N[2],u=t.N[3],h=t.N[4];for(r=0;80>r;r++)40>r?20>r?(o=u^n&(s^u),a=1518500249):(o=n^s^u,a=1859775393):60>r?(o=n&s|u&(n|s),a=2400959708):(o=n^s^u,a=3395469782),o=(e<<5|e>>>27)+o+h+a+i[r]&4294967295,h=u,u=s,s=4294967295&(n<<30|n>>>2),n=e,e=o;t.N[0]=t.N[0]+e&4294967295,t.N[1]=t.N[1]+n&4294967295,t.N[2]=t.N[2]+s&4294967295,t.N[3]=t.N[3]+u&4294967295,t.N[4]=t.N[4]+h&4294967295}ma(La,Ka),La.prototype.reset=function(){this.N[0]=1732584193,this.N[1]=4023233417,this.N[2]=2562383102,this.N[3]=271733878,this.N[4]=3285377520,this.de=this.ac=0},La.prototype.update=function(t,e){if(null!=t){n(e)||(e=t.length);for(var i=e-this.Va,r=0,o=this.me,a=this.ac;r<e;){if(0==a)for(;r<=i;)Ma(this,t,r),r+=this.Va;if(p(t)){for(;r<e;)if(o[a]=t.charCodeAt(r),++r,++a==this.Va){Ma(this,o),a=0;break}}else for(;r<e;)if(o[a]=t[r],++r,++a==this.Va){Ma(this,o),a=0;break}}this.ac=a,this.de+=e}};var u=Array.prototype,Na=u.indexOf?function(t,e,n){return u.indexOf.call(t,e,n)}:function(t,e,n){if(n=null==n?0:0>n?Math.max(0,t.length+n):n,p(t))return p(e)&&1==e.length?t.indexOf(e,n):-1;for(;n<t.length;n++)if(n in t&&t[n]===e)return n;return-1},Oa=u.forEach?function(t,e,n){u.forEach.call(t,e,n)}:function(t,e,n){for(var i=t.length,r=p(t)?t.split(""):t,o=0;o<i;o++)o in r&&e.call(n,r[o],o,t)},Pa=u.filter?function(t,e,n){return u.filter.call(t,e,n)}:function(t,e,n){for(var i=t.length,r=[],o=0,a=p(t)?t.split(""):t,s=0;s<i;s++)if(s in a){var u=a[s];e.call(n,u,s,t)&&(r[o++]=u)}return r},Qa=u.map?function(t,e,n){return u.map.call(t,e,n)}:function(t,e,n){for(var i=t.length,r=Array(i),o=p(t)?t.split(""):t,a=0;a<i;a++)a in o&&(r[a]=e.call(n,o[a],a,t));return r},Ra=u.reduce?function(t,e,n,i){for(var r=[],o=1,a=arguments.length;o<a;o++)r.push(arguments[o]);return i&&(r[0]=q(e,i)),u.reduce.apply(t,r)}:function(t,e,n,i){var r=n;return Oa(t,function(n,o){r=e.call(i,r,n,o,t)}),r},Sa=u.every?function(t,e,n){return u.every.call(t,e,n)}:function(t,e,n){for(var i=t.length,r=p(t)?t.split(""):t,o=0;o<i;o++)if(o in r&&!e.call(n,r[o],o,t))return!1;return!0};function Ta(t,e){var n=Ua(t,e,void 0);return 0>n?null:p(t)?t.charAt(n):t[n]}function Ua(t,e,n){for(var i=t.length,r=p(t)?t.split(""):t,o=0;o<i;o++)if(o in r&&e.call(n,r[o],o,t))return o;return-1}function Va(t,e){var n=Na(t,e);0<=n&&u.splice.call(t,n,1)}function Wa(t,e,n){return 2>=arguments.length?u.slice.call(t,e):u.slice.call(t,e,n)}function Xa(t,e){t.sort(e||Ya)}function Ya(t,e){return t>e?1:t<e?-1:0}var Za=-1!=Ha.indexOf("Opera")||-1!=Ha.indexOf("OPR"),$a=-1!=Ha.indexOf("Trident")||-1!=Ha.indexOf("MSIE"),ab=-1!=Ha.indexOf("Gecko")&&-1==Ha.toLowerCase().indexOf("webkit")&&!(-1!=Ha.indexOf("Trident")||-1!=Ha.indexOf("MSIE")),bb=-1!=Ha.toLowerCase().indexOf("webkit"),b,a;a="",Za&&aa.opera?ha(a=aa.opera.version)&&a():(ab?b=/rv\:([^\);]+)(\)|;)/:$a?b=/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/:bb&&(b=/WebKit\/(\S+)/),b&&(a=(a=b.exec(Ha))?a[1]:""),$a&&(b=(b=aa.document)?b.documentMode:void 0)>parseFloat(a)&&String(b));var cb=null,db=null,eb=null;function fb(t,e){if(!fa(t))throw Error("encodeByteArray takes an array as a parameter");gb();for(var n=e?db:cb,i=[],r=0;r<t.length;r+=3){var o=t[r],a=r+1<t.length,s=a?t[r+1]:0,u=r+2<t.length,h=o>>2,c=(o=(3&o)<<4|s>>4,s=(15&s)<<2|(c=u?t[r+2]:0)>>6,63&c);u||(c=64,a||(s=64)),i.push(n[h],n[o],n[s],n[c])}return i.join("")}function gb(){if(!cb){cb={},db={},eb={};for(var t=0;65>t;t++)cb[t]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(t),db[t]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(t),eb[db[t]]=t,62<=t&&(eb["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(t)]=t)}}var hb=hb||"2.3.2";function v(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function w(t,e){if(Object.prototype.hasOwnProperty.call(t,e))return t[e]}function ib(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function jb(t){var e={};return ib(t,function(t,n){e[t]=n}),e}function kb(t){var e=[];return ib(t,function(t,n){ea(n)?Oa(n,function(n){e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))}),e.length?"&"+e.join("&"):""}function lb(t){var e={};return t=t.replace(/^\?/,"").split("&"),Oa(t,function(t){t&&(t=t.split("="),e[t[0]]=t[1])}),e}function x(t,e,n,i){var r;if(i<e?r="at least "+e:i>n&&(r=0===n?"none":"no more than "+n),r)throw Error(t+" failed: Was called with "+i+(1===i?" argument.":" arguments.")+" Expects "+r+".")}function y(t,e,n){var i="";switch(e){case 1:i=n?"first":"First";break;case 2:i=n?"second":"Second";break;case 3:i=n?"third":"Third";break;case 4:i=n?"fourth":"Fourth";break;default:throw Error("errorPrefix called with argumentNumber > 4.  Need to update it?")}return t+" failed: "+i+" argument "}function A(t,e,i,r){if((!r||n(i))&&!ha(i))throw Error(y(t,e,r)+"must be a valid function.")}function mb(t,e,i){if(n(i)&&(!ia(i)||null===i))throw Error(y(t,e,!0)+"must be a valid context object.")}function nb(t){return"undefined"!=typeof JSON&&n(JSON.parse)?JSON.parse(t):Aa(t)}function B(t){if("undefined"!=typeof JSON&&n(JSON.stringify))t=JSON.stringify(t);else{var e=[];Ca(new Ba,t,e),t=e.join("")}return t}function ob(){this.Wd=C}function pb(){}ob.prototype.j=function(t){return this.Wd.Q(t)},ob.prototype.toString=function(){return this.Wd.toString()},pb.prototype.qf=function(){return null},pb.prototype.ye=function(){return null};var qb=new pb;function rb(t,e,n){this.Tf=t,this.Ka=e,this.Kd=n}function vb(){this.tb=[]}function wb(t,e){for(var n=null,i=0;i<e.length;i++){var r=e[i],o=r.Zb();null===n||o.ca(n.Zb())||(t.tb.push(n),n=null),null===n&&(n=new xb(o)),n.add(r)}n&&t.tb.push(n)}function yb(t,e,n){wb(t,n),zb(t,function(t){return t.ca(e)})}function Ab(t,e,n){wb(t,n),zb(t,function(t){return t.contains(e)||e.contains(t)})}function zb(t,e){for(var n=!0,i=0;i<t.tb.length;i++){if(r=t.tb[i])if(e(r=r.Zb())){for(var r=t.tb[i],o=0;o<r.vd.length;o++){var a=r.vd[o];if(null!==a){r.vd[o]=null;var s=a.Vb();Bb&&Cb("event: "+a.toString()),Db(s)}}t.tb[i]=null}else n=!1}n&&(t.tb=[])}function xb(t){this.ra=t,this.vd=[]}function D(t,e,n,i){this.type=t,this.Ja=e,this.Wa=n,this.Ke=i,this.Qd=void 0}function Eb(t){return new D(Fb,t)}rb.prototype.qf=function(t){var e=this.Ka.O;return sb(e,t)?e.j().R(t):(e=null!=this.Kd?new tb(this.Kd,!0,!1):this.Ka.w(),this.Tf.xc(t,e))},rb.prototype.ye=function(t,e,n){var i=null!=this.Kd?this.Kd:ub(this.Ka);return 0===(t=this.Tf.ne(i,e,1,n,t)).length?null:t[0]},xb.prototype.add=function(t){this.vd.push(t)},xb.prototype.Zb=function(){return this.ra};var Fb="value";function Gb(t,e,n,i){this.ue=e,this.Zd=n,this.Qd=i,this.ud=t}function Hb(t,e,n){this.ue=t,this.error=e,this.path=n}function tb(t,e,n){this.A=t,this.ea=e,this.Ub=n}function Ib(t){return t.ea}function Jb(t){return t.Ub}function Kb(t,e){return e.e()?t.ea&&!t.Ub:sb(t,E(e))}function sb(t,e){return t.ea&&!t.Ub||t.A.Da(e)}function Lb(t){this.gg=t,this.Dd=null}function Mb(t,e){this.Of={},this.fd=new Lb(t),this.ba=e;var n=1e4+2e4*Math.random();setTimeout(q(this.If,this),Math.floor(n))}function Nb(){this.Ec={}}function Ob(t,e,i){n(i)||(i=1),v(t.Ec,e)||(t.Ec[e]=0),t.Ec[e]+=i}Gb.prototype.Zb=function(){var t=this.Zd.Ib();return"value"===this.ud?t.path:t.parent().path},Gb.prototype.ze=function(){return this.ud},Gb.prototype.Vb=function(){return this.ue.Vb(this)},Gb.prototype.toString=function(){return this.Zb().toString()+":"+this.ud+":"+B(this.Zd.mf())},Hb.prototype.Zb=function(){return this.path},Hb.prototype.ze=function(){return"cancel"},Hb.prototype.Vb=function(){return this.ue.Vb(this)},Hb.prototype.toString=function(){return this.path.toString()+":cancel"},tb.prototype.j=function(){return this.A},Lb.prototype.get=function(){var t=this.gg.get(),e=xa(t);if(this.Dd)for(var n in this.Dd)e[n]-=this.Dd[n];return this.Dd=t,e},Mb.prototype.If=function(){var t,e=this.fd.get(),n={},i=!1;for(t in e)0<e[t]&&v(this.Of,t)&&(n[t]=e[t],i=!0);i&&this.ba.Ue(n),setTimeout(q(this.If,this),Math.floor(6e5*Math.random()))},Nb.prototype.get=function(){return xa(this.Ec)};var Pb={},Qb={};function Rb(t){return t=t.toString(),Pb[t]||(Pb[t]=new Nb),Pb[t]}function Sb(t,e){var n=t.toString();return Qb[n]||(Qb[n]=e()),Qb[n]}function F(t,e){this.name=t,this.S=e}function Tb(t,e){return new F(t,e)}function Ub(t,e){return Vb(t.name,e.name)}function Wb(t,e){return Vb(t,e)}function Xb(t,e,n){this.type=Yb,this.source=t,this.path=e,this.Ga=n}function Zb(t,e){this.type=$b,this.source=t,this.path=e}function ac(t,e){this.La=t,this.wa=e||bc}function cc(t,e){for(var n,i=t.wa,r=null;!i.e();){if(0===(n=t.La(e,i.key))){if(i.left.e())return r?r.key:null;for(i=i.left;!i.right.e();)i=i.right;return i.key}0>n?i=i.left:0<n&&(r=i,i=i.right)}throw Error("Attempted to find predecessor key for a nonexistent key.  What gives?")}function dc(t,e,n,i,r){for(this.Ud=r||null,this.Fe=i,this.Pa=[],r=1;!t.e();)if(r=e?n(t.key,e):1,i&&(r*=-1),0>r)t=this.Fe?t.left:t.right;else{if(0===r){this.Pa.push(t);break}this.Pa.push(t),t=this.Fe?t.right:t.left}}function J(t){if(0===t.Pa.length)return null;var e,n=t.Pa.pop();if(e=t.Ud?t.Ud(n.key,n.value):{key:n.key,value:n.value},t.Fe)for(n=n.left;!n.e();)t.Pa.push(n),n=n.right;else for(n=n.right;!n.e();)t.Pa.push(n),n=n.left;return e}function ec(t){return 0===t.Pa.length?null:(e=(e=t.Pa)[e.length-1],t.Ud?t.Ud(e.key,e.value):{key:e.key,value:e.value});var e}function fc(t,e,n,i,r){this.key=t,this.value=e,this.color=null==n||n,this.left=null!=i?i:bc,this.right=null!=r?r:bc}function gc(t){return t.left.e()?t:gc(t.left)}function ic(t){return t.left.e()?bc:(t.left.fa()||t.left.left.fa()||(t=jc(t)),hc(t=t.Y(null,null,null,ic(t.left),null)))}function hc(t){return t.right.fa()&&!t.left.fa()&&(t=mc(t)),t.left.fa()&&t.left.left.fa()&&(t=kc(t)),t.left.fa()&&t.right.fa()&&(t=lc(t)),t}function jc(t){return(t=lc(t)).right.left.fa()&&(t=lc(t=mc(t=t.Y(null,null,null,null,kc(t.right))))),t}function mc(t){return t.right.Y(null,null,t.color,t.Y(null,null,!0,null,t.right.left),null)}function kc(t){return t.left.Y(null,null,t.color,null,t.Y(null,null,!0,t.left.right,null))}function lc(t){return t.Y(null,null,!t.color,t.left.Y(null,null,!t.left.color,null,null),t.right.Y(null,null,!t.right.color,null,null))}function nc(){}Xb.prototype.Xc=function(t){return this.path.e()?new Xb(this.source,G,this.Ga.R(t)):new Xb(this.source,H(this.path),this.Ga)},Xb.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" overwrite: "+this.Ga.toString()+")"},Zb.prototype.Xc=function(){return this.path.e()?new Zb(this.source,G):new Zb(this.source,H(this.path))},Zb.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" listen_complete)"},g=ac.prototype,g.Oa=function(t,e){return new ac(this.La,this.wa.Oa(t,e,this.La).Y(null,null,!1,null,null))},g.remove=function(t){return new ac(this.La,this.wa.remove(t,this.La).Y(null,null,!1,null,null))},g.get=function(t){for(var e,n=this.wa;!n.e();){if(0===(e=this.La(t,n.key)))return n.value;0>e?n=n.left:0<e&&(n=n.right)}return null},g.e=function(){return this.wa.e()},g.count=function(){return this.wa.count()},g.Sc=function(){return this.wa.Sc()},g.fc=function(){return this.wa.fc()},g.ia=function(t){return this.wa.ia(t)},g.Xb=function(t){return new dc(this.wa,null,this.La,!1,t)},g.Yb=function(t,e){return new dc(this.wa,t,this.La,!1,e)},g.$b=function(t,e){return new dc(this.wa,t,this.La,!0,e)},g.sf=function(t){return new dc(this.wa,null,this.La,!0,t)},g=fc.prototype,g.Y=function(t,e,n,i,r){return new fc(null!=t?t:this.key,null!=e?e:this.value,null!=n?n:this.color,null!=i?i:this.left,null!=r?r:this.right)},g.count=function(){return this.left.count()+1+this.right.count()},g.e=function(){return!1},g.ia=function(t){return this.left.ia(t)||t(this.key,this.value)||this.right.ia(t)},g.Sc=function(){return gc(this).key},g.fc=function(){return this.right.e()?this.key:this.right.fc()},g.Oa=function(t,e,n){var i,r;return hc(r=0>(i=n(t,(r=this).key))?r.Y(null,null,null,r.left.Oa(t,e,n),null):0===i?r.Y(null,e,null,null,null):r.Y(null,null,null,null,r.right.Oa(t,e,n)))},g.remove=function(t,e){var n,i;if(0>e(t,(n=this).key))n.left.e()||n.left.fa()||n.left.left.fa()||(n=jc(n)),n=n.Y(null,null,null,n.left.remove(t,e),null);else{if(n.left.fa()&&(n=kc(n)),n.right.e()||n.right.fa()||n.right.left.fa()||(n=lc(n)).left.left.fa()&&(n=lc(n=kc(n))),0===e(t,n.key)){if(n.right.e())return bc;i=gc(n.right),n=n.Y(i.key,i.value,null,null,ic(n.right))}n=n.Y(null,null,null,null,n.right.remove(t,e))}return hc(n)},g.fa=function(){return this.color},g=nc.prototype,g.Y=function(){return this},g.Oa=function(t,e){return new fc(t,e,null)},g.remove=function(){return this},g.count=function(){return 0},g.e=function(){return!0},g.ia=function(){return!1},g.Sc=function(){return null},g.fc=function(){return null},g.fa=function(){return!1};var bc=new nc;function oc(t,e){return t&&"object"===_typeof(t)?(K(".sv"in t,"Unexpected leaf node or priority contents"),e[t[".sv"]]):t}function pc(t,e){var n=new qc;return rc(t,new L(""),function(t,i){n.nc(t,sc(i,e))}),n}function sc(t,e){var n,i=oc(i=t.C().I(),e);if(t.K()){var r=oc(t.Ca(),e);return r!==t.Ca()||i!==t.C().I()?new tc(r,M(i)):t}return n=t,i!==t.C().I()&&(n=n.ga(new tc(i))),t.P(N,function(t,i){var r=sc(i,e);r!==i&&(n=n.U(t,r))}),n}function uc(){this.wc={}}function vc(t){this.Fc=t,this.Pd="firebase:"}function wc(t){try{if("undefined"!=typeof window&&void 0!==window[t]){var e=window[t];return e.setItem("firebase:sentinel","cache"),e.removeItem("firebase:sentinel"),new vc(e)}}catch(n){}return new uc}uc.prototype.set=function(t,e){null==e?delete this.wc[t]:this.wc[t]=e},uc.prototype.get=function(t){return v(this.wc,t)?this.wc[t]:null},uc.prototype.remove=function(t){delete this.wc[t]},uc.prototype.wf=!0,g=vc.prototype,g.set=function(t,e){null==e?this.Fc.removeItem(this.Pd+t):this.Fc.setItem(this.Pd+t,B(e))},g.get=function(t){return null==(t=this.Fc.getItem(this.Pd+t))?null:nb(t)},g.remove=function(t){this.Fc.removeItem(this.Pd+t)},g.wf=!1,g.toString=function(){return this.Fc.toString()};var xc=wc("localStorage"),yc=wc("sessionStorage");function zc(t,e,n,i,r){this.host=t.toLowerCase(),this.domain=this.host.substr(this.host.indexOf(".")+1),this.kb=e,this.hc=n,this.Wg=i,this.Od=r||"",this.Ya=xc.get("host:"+t)||this.host}function Ac(t,e){e!==t.Ya&&(t.Ya=e,"s-"===t.Ya.substr(0,2)&&xc.set("host:"+t.host,t.Ya))}function Bc(t,e,n){if(K("string"==typeof e,"typeof type must == string"),K("object"===_typeof(n),"typeof params must == object"),e===Cc)e=(t.kb?"wss://":"ws://")+t.Ya+"/.ws?";else{if(e!==Dc)throw Error("Unknown connection type: "+e);e=(t.kb?"https://":"http://")+t.Ya+"/.lp?"}t.host!==t.Ya&&(n.ns=t.hc);var i=[];return r(n,function(t,e){i.push(e+"="+t)}),e+i.join("&")}zc.prototype.toString=function(){var t=(this.kb?"https://":"http://")+this.host;return this.Od&&(t+="<"+this.Od+">"),t};var Ec=function(){var t=1;return function(){return t++}}();function K(t,e){if(!t)throw Fc(e)}function Fc(t){return Error("Firebase ("+hb+") INTERNAL ASSERT FAILED: "+t)}function Gc(t){try{var e;if("undefined"!=typeof atob)e=atob(t);else{gb();for(var n=eb,i=[],r=0;r<t.length;){var o=n[t.charAt(r++)],a=r<t.length?n[t.charAt(r)]:0,s=++r<t.length?n[t.charAt(r)]:64,u=++r<t.length?n[t.charAt(r)]:64;if(++r,null==o||null==a||null==s||null==u)throw Error();i.push(o<<2|a>>4),64!=s&&(i.push(a<<4&240|s>>2),64!=u&&i.push(s<<6&192|u))}if(8192>i.length)e=String.fromCharCode.apply(null,i);else{for(t="",n=0;n<i.length;n+=8192)t+=String.fromCharCode.apply(null,Wa(i,n,n+8192));e=t}}return e}catch(h){Cb("base64Decode failed: ",h)}return null}function Hc(t){var e=Ic(t);(t=new La).update(e);e=[];var n=8*t.de;56>t.ac?t.update(t.Ld,56-t.ac):t.update(t.Ld,t.Va-(t.ac-56));for(var i=t.Va-1;56<=i;i--)t.me[i]=255&n,n/=256;for(Ma(t,t.me),i=n=0;5>i;i++)for(var r=24;0<=r;r-=8)e[n]=t.N[i]>>r&255,++n;return fb(e)}function Jc(t){for(var e="",n=0;n<arguments.length;n++)e=fa(arguments[n])?e+Jc.apply(null,arguments[n]):"object"===_typeof(arguments[n])?e+B(arguments[n]):e+arguments[n],e+=" ";return e}var Bb=null,Kc=!0;function Cb(t){if(!0===Kc&&(Kc=!1,null===Bb&&!0===yc.get("logging_enabled")&&Lc(!0)),Bb){var e=Jc.apply(null,arguments);Bb(e)}}function Mc(t){return function(){Cb(t,arguments)}}function Nc(t){if("undefined"!=typeof console){var e="FIREBASE INTERNAL ERROR: "+Jc.apply(null,arguments);void 0!==console.error?console.error(e):console.log(e)}}function Oc(t){var e=Jc.apply(null,arguments);throw Error("FIREBASE FATAL ERROR: "+e)}function O(t){if("undefined"!=typeof console){var e="FIREBASE WARNING: "+Jc.apply(null,arguments);void 0!==console.warn?console.warn(e):console.log(e)}}function Pc(t){var e="",n="",i="",r="",o=!0,a="https",s=443;if(p(t)){var u=t.indexOf("//");for(0<=u&&(a=t.substring(0,u-1),t=t.substring(u+2)),-1===(u=t.indexOf("/"))&&(u=t.length),e=t.substring(0,u),r="",t=t.substring(u).split("/"),u=0;u<t.length;u++)if(0<t[u].length){var h=t[u];try{h=decodeURIComponent(h.replace(/\+/g," "))}catch(c){}r+="/"+h}3===(t=e.split(".")).length?(n=t[1],i=t[0].toLowerCase()):2===t.length&&(n=t[0]),0<=(u=e.indexOf(":"))&&(o="https"===a||"wss"===a,s=e.substring(u+1),isFinite(s)&&(s=String(s)),s=p(s)?/^\s*-?0x/i.test(s)?parseInt(s,16):parseInt(s,10):NaN)}return{host:e,port:s,domain:n,Tg:i,kb:o,scheme:a,$c:r}}function Qc(t){return ga(t)&&(t!=t||t==Number.POSITIVE_INFINITY||t==Number.NEGATIVE_INFINITY)}function Rc(t){if("complete"===document.readyState)t();else{var e=!1,n=function n(){document.body?e||(e=!0,t()):setTimeout(n,Math.floor(10))};document.addEventListener?(document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&n()}),window.attachEvent("onload",n))}}function Vb(t,e){if(t===e)return 0;if("[MIN_NAME]"===t||"[MAX_NAME]"===e)return-1;if("[MIN_NAME]"===e||"[MAX_NAME]"===t)return 1;var n=Sc(t),i=Sc(e);return null!==n?null!==i?0==n-i?t.length-e.length:n-i:-1:null!==i?1:t<e?-1:1}function Tc(t,e){if(e&&t in e)return e[t];throw Error("Missing required key ("+t+") in object: "+B(e))}function Uc(t){if("object"!==_typeof(t)||null===t)return B(t);var e,n=[];for(e in t)n.push(e);n.sort(),e="{";for(var i=0;i<n.length;i++)0!==i&&(e+=","),e+=B(n[i]),e+=":",e+=Uc(t[n[i]]);return e+"}"}function Vc(t,e){if(t.length<=e)return[t];for(var n=[],i=0;i<t.length;i+=e)i+e>t?n.push(t.substring(i,t.length)):n.push(t.substring(i,i+e));return n}function Wc(t,e){if(ea(t))for(var n=0;n<t.length;++n)e(n,t[n]);else r(t,e)}function Xc(t){var e,n,i,r;for(K(!Qc(t),"Invalid JSON number"),0===t?(i=n=0,e=-1/0==1/t?1:0):(e=0>t,(t=Math.abs(t))>=Math.pow(2,-1022)?(n=(i=Math.min(Math.floor(Math.log(t)/Math.LN2),1023))+1023,i=Math.round(t*Math.pow(2,52-i)-Math.pow(2,52))):(n=0,i=Math.round(t/Math.pow(2,-1074)))),r=[],t=52;t;--t)r.push(i%2?1:0),i=Math.floor(i/2);for(t=11;t;--t)r.push(n%2?1:0),n=Math.floor(n/2);for(r.push(e?1:0),r.reverse(),e=r.join(""),n="",t=0;64>t;t+=8)1===(i=parseInt(e.substr(t,8),2).toString(16)).length&&(i="0"+i),n+=i;return n.toLowerCase()}var Yc=/^-?\d{1,10}$/;function Sc(t){return Yc.test(t)&&(-2147483648<=(t=Number(t))&&2147483647>=t)?t:null}function Db(t){try{t()}catch(b){setTimeout(function(){throw O("Exception was thrown by user callback.",b.stack||""),b},Math.floor(0))}}function P(t,e){if(ha(t)){var n=Array.prototype.slice.call(arguments,1).slice();Db(function(){t.apply(null,n)})}}function Ic(t){for(var e=[],n=0,i=0;i<t.length;i++){var r=t.charCodeAt(i);55296<=r&&56319>=r&&(r-=55296,K(++i<t.length,"Surrogate pair missing trail surrogate."),r=65536+(r<<10)+(t.charCodeAt(i)-56320)),128>r?e[n++]=r:(2048>r?e[n++]=r>>6|192:(65536>r?e[n++]=r>>12|224:(e[n++]=r>>18|240,e[n++]=r>>12&63|128),e[n++]=r>>6&63|128),e[n++]=63&r|128)}return e}function Zc(t){for(var e=0,n=0;n<t.length;n++){var i=t.charCodeAt(n);128>i?e++:2048>i?e+=2:55296<=i&&56319>=i?(e+=4,n++):e+=3}return e}function $c(t){var e={},n={},i={},r="";try{var o=t.split(".");e=nb(Gc(o[0])||""),n=nb(Gc(o[1])||""),r=o[2],i=n.d||{};delete n.d}catch(a){}return{Zg:e,Bc:n,data:i,Qg:r}}function ad(t){return"object"===_typeof(t=$c(t).Bc)&&t.hasOwnProperty("iat")?w(t,"iat"):null}function bd(t){var e=(t=$c(t)).Bc;return!!t.Qg&&!!e&&"object"===_typeof(e)&&e.hasOwnProperty("iat")}function cd(t){this.W=t,this.g=t.n.g}function dd(t,e,n,i){var r=[],o=[];return Oa(e,function(e){"child_changed"===e.type&&t.g.Ad(e.Ke,e.Ja)&&o.push(new D("child_moved",e.Ja,e.Wa))}),ed(t,r,"child_removed",e,i,n),ed(t,r,"child_added",e,i,n),ed(t,r,"child_moved",o,i,n),ed(t,r,"child_changed",e,i,n),ed(t,r,Fb,e,i,n),r}function ed(t,e,n,i,r,o){Xa(i=Pa(i,function(t){return t.type===n}),q(t.hg,t)),Oa(i,function(n){var i=fd(t,n,o);Oa(r,function(r){r.Kf(n.type)&&e.push(r.createEvent(i,t.W))})})}function fd(t,e,n){return"value"!==e.type&&"child_removed"!==e.type&&(e.Qd=n.rf(e.Wa,e.Ja,t.g)),e}function gd(){this.bb={}}function hd(t,e){var n=e.type,i=e.Wa;K("child_added"==n||"child_changed"==n||"child_removed"==n,"Only child changes supported for tracking"),K(".priority"!==i,"Only non-priority child changes can be tracked.");var r=w(t.bb,i);if(r){var o=r.type;if("child_added"==n&&"child_removed"==o)t.bb[i]=new D("child_changed",e.Ja,i,r.Ja);else if("child_removed"==n&&"child_added"==o)delete t.bb[i];else if("child_removed"==n&&"child_changed"==o)t.bb[i]=new D("child_removed",r.Ke,i);else if("child_changed"==n&&"child_added"==o)t.bb[i]=new D("child_added",e.Ja,i);else{if("child_changed"!=n||"child_changed"!=o)throw Fc("Illegal combination of changes: "+e+" occurred after "+r);t.bb[i]=new D("child_changed",e.Ja,i,r.Ke)}}else t.bb[i]=e}function id(t,e,n){this.Rb=t,this.pb=e,this.rb=n||null}function jd(t,e,n){this.ha=t,this.pb=e,this.rb=n}function kd(t){this.g=t}function ld(t){var e;this.Be=new kd(t.g),this.g=t.g,t.ma?(e=md(t),e=t.g.Pc(nd(t),e)):e=t.g.Tc(),this.ed=e,t.pa?(e=od(t),t=t.g.Pc(pd(t),e)):t=t.g.Qc(),this.Gc=t}function qd(t){this.sa=new ld(t),this.g=t.g,K(t.ja,"Only valid if limit has been set"),this.ka=t.ka,this.Jb=!rd(t)}function sd(t,e,n,i,r,o){var a;if(t.Jb){var s=td(t.g);a=function(t,e){return s(e,t)}}else a=td(t.g);K(e.Db()==t.ka,"");var u=new F(n,i),h=t.Jb?ud(e,t.g):vd(e,t.g),c=t.sa.matches(u);if(e.Da(n)){var f=e.R(n);for(h=r.ye(t.g,h,t.Jb);null!=h&&(h.name==n||e.Da(h.name));)h=r.ye(t.g,h,t.Jb);return r=null==h?1:a(h,u),c&&!i.e()&&0<=r?(null!=o&&hd(o,new D("child_changed",i,n,f)),e.U(n,i)):(null!=o&&hd(o,new D("child_removed",f,n)),e=e.U(n,C),null!=h&&t.sa.matches(h)?(null!=o&&hd(o,new D("child_added",h.S,h.name)),e.U(h.name,h.S)):e)}return i.e()?e:c&&0<=a(h,u)?(null!=o&&(hd(o,new D("child_removed",h.S,h.name)),hd(o,new D("child_added",i,n))),e.U(n,i).U(h.name,C)):e}function wd(t,e){this.je=t,this.fg=e}function xd(t){this.V=t}function Hd(t,e,n,i,r,o){var a,s=e.O;if(null!=i.tc(n))return e;if(n.e())K(Ib(e.w()),"If change path is empty, we must have complete server data"),Jb(e.w())?(r=ub(e),i=i.yc(r instanceof R?r:C)):i=i.za(ub(e)),o=t.V.xa(e.O.j(),i,o);else{var u=E(n);if(".priority"==u)K(1==Kd(n),"Can't have a priority with additional path components"),o=s.j(),a=e.w().j(),o=null!=(i=i.ld(n,o,a))?t.V.ga(o,i):s.j();else{var h=H(n);sb(s,u)?(a=e.w().j(),i=null!=(i=i.ld(n,s.j(),a))?s.j().R(u).G(h,i):s.j().R(u)):i=i.xc(u,e.w()),o=null!=i?t.V.G(s.j(),u,i,h,r,o):s.j()}}return Fd(e,o,s.ea||n.e(),t.V.Na())}function Ad(t,e,n,i,r,o,a,s){var u=e.w();if(a=a?t.V:t.V.Wb(),n.e())i=a.xa(u.j(),i,null);else if(a.Na()&&!u.Ub)i=u.j().G(n,i),i=a.xa(u.j(),i,null);else{var h=E(n);if(!Kb(u,n)&&1<Kd(n))return e;var c=H(n);i=u.j().R(h).G(c,i),i=".priority"==h?a.ga(u.j(),i):a.G(u.j(),h,i,c,qb,null)}return u=u.ea||n.e(),Hd(t,e=new Id(e.O,new tb(i,u,a.Na())),n,r,new rb(r,e,o),s)}function yd(t,e,n,i,r,o,a){var s=e.O;if(r=new rb(r,e,o),n.e())a=t.V.xa(e.O.j(),i,a),t=Fd(e,a,!0,t.V.Na());else if(".priority"===(o=E(n)))a=t.V.ga(e.O.j(),i),t=Fd(e,a,s.ea,s.Ub);else{n=H(n);var u=s.j().R(o);if(!n.e()){var h=r.qf(o);i=null!=h?".priority"===Ld(n)&&h.Q(n.parent()).e()?h:h.G(n,i):C}u.ca(i)?t=e:(a=t.V.G(s.j(),o,i,n,r,a),t=Fd(e,a,s.ea,t.V.Na()))}return t}function Cd(t,e,n,i,r,o,a){var s=e;return Md(i,function(i,u){var h=n.u(i);sb(e.O,E(h))&&(s=yd(t,s,h,u,r,o,a))}),Md(i,function(i,u){var h=n.u(i);sb(e.O,E(h))||(s=yd(t,s,h,u,r,o,a))}),s}function Nd(t,e){return Md(e,function(e,n){t=t.G(e,n)}),t}function Dd(t,e,n,i,r,o,a,s){if(e.w().j().e()&&!Ib(e.w()))return e;var u=e;n=n.e()?i:Od(Pd,n,i);var h=e.w().j();return n.children.ia(function(n,i){if(h.Da(n)){var c=Nd(c=e.w().j().R(n),i);u=Ad(t,u,new L(n),c,r,o,a,s)}}),n.children.ia(function(n,i){var c=!sb(e.w(),n)&&null==i.value;h.Da(n)||c||(c=Nd(c=e.w().j().R(n),i),u=Ad(t,u,new L(n),c,r,o,a,s))}),u}function Gd(t,e,n,i,r,o,a){if(null!=r.tc(n))return e;var s=Jb(e.w()),u=e.w();if(null!=i.value){if(n.e()&&u.ea||Kb(u,n))return Ad(t,e,n,u.j().Q(n),r,o,s,a);if(n.e()){var h=Pd;return u.j().P(Qd,function(t,e){h=h.set(new L(t),e)}),Dd(t,e,n,h,r,o,s,a)}return e}return h=Pd,Md(i,function(t){var e=n.u(t);Kb(u,e)&&(h=h.set(t,u.j().Q(e)))}),Dd(t,e,n,h,r,o,s,a)}function Rd(){}cd.prototype.hg=function(t,e){if(null==t.Wa||null==e.Wa)throw Fc("Should only compare child_ events.");return this.g.compare(new F(t.Wa,t.Ja),new F(e.Wa,e.Ja))},g=id.prototype,g.Kf=function(t){return"value"===t},g.createEvent=function(t,e){var n=e.n.g;return new Gb("value",this,new Q(t.Ja,e.Ib(),n))},g.Vb=function(t){var e=this.rb;if("cancel"===t.ze()){K(this.pb,"Raising a cancel event on a listener with no cancel callback");var n=this.pb;return function(){n.call(e,t.error)}}var i=this.Rb;return function(){i.call(e,t.Zd)}},g.gf=function(t,e){return this.pb?new Hb(this,t,e):null},g.matches=function(t){return t instanceof id&&(!t.Rb||!this.Rb||t.Rb===this.Rb&&t.rb===this.rb)},g.tf=function(){return null!==this.Rb},g=jd.prototype,g.Kf=function(t){return("children_removed"===(t="children_added"===t?"child_added":t)?"child_removed":t)in this.ha},g.gf=function(t,e){return this.pb?new Hb(this,t,e):null},g.createEvent=function(t,e){K(null!=t.Wa,"Child events should have a childName.");var n=e.Ib().u(t.Wa);return new Gb(t.type,this,new Q(t.Ja,n,e.n.g),t.Qd)},g.Vb=function(t){var e=this.rb;if("cancel"===t.ze()){K(this.pb,"Raising a cancel event on a listener with no cancel callback");var n=this.pb;return function(){n.call(e,t.error)}}var i=this.ha[t.ud];return function(){i.call(e,t.Zd,t.Qd)}},g.matches=function(t){if(t instanceof jd){if(!this.ha||!t.ha)return!0;if(this.rb===t.rb)if((e=pa(t.ha))===pa(this.ha)){if(1===e){var e=qa(t.ha),n=qa(this.ha);return!(n!==e||t.ha[e]&&this.ha[n]&&t.ha[e]!==this.ha[n])}return oa(this.ha,function(e,n){return t.ha[n]===e})}}return!1},g.tf=function(){return null!==this.ha},g=kd.prototype,g.G=function(t,e,n,i,r,o){return K(t.Jc(this.g),"A node must be indexed if only a child is updated"),(r=t.R(e)).Q(i).ca(n.Q(i))&&r.e()==n.e()?t:(null!=o&&(n.e()?t.Da(e)?hd(o,new D("child_removed",r,e)):K(t.K(),"A child remove without an old child only makes sense on a leaf node"):r.e()?hd(o,new D("child_added",n,e)):hd(o,new D("child_changed",n,e,r))),t.K()&&n.e()?t:t.U(e,n).lb(this.g))},g.xa=function(t,e,n){return null!=n&&(t.K()||t.P(N,function(t,i){e.Da(t)||hd(n,new D("child_removed",i,t))}),e.K()||e.P(N,function(e,i){if(t.Da(e)){var r=t.R(e);r.ca(i)||hd(n,new D("child_changed",i,e,r))}else hd(n,new D("child_added",i,e))})),e.lb(this.g)},g.ga=function(t,e){return t.e()?C:t.ga(e)},g.Na=function(){return!1},g.Wb=function(){return this},g=ld.prototype,g.matches=function(t){return 0>=this.g.compare(this.ed,t)&&0>=this.g.compare(t,this.Gc)},g.G=function(t,e,n,i,r,o){return this.matches(new F(e,n))||(n=C),this.Be.G(t,e,n,i,r,o)},g.xa=function(t,e,n){e.K()&&(e=C);var i=(i=e.lb(this.g)).ga(C),r=this;return e.P(N,function(t,e){r.matches(new F(t,e))||(i=i.U(t,C))}),this.Be.xa(t,i,n)},g.ga=function(t){return t},g.Na=function(){return!0},g.Wb=function(){return this.Be},g=qd.prototype,g.G=function(t,e,n,i,r,o){return this.sa.matches(new F(e,n))||(n=C),t.R(e).ca(n)?t:t.Db()<this.ka?this.sa.Wb().G(t,e,n,i,r,o):sd(this,t,e,n,r,o)},g.xa=function(t,e,n){var i;if(e.K()||e.e())i=C.lb(this.g);else if(2*this.ka<e.Db()&&e.Jc(this.g)){i=C.lb(this.g),e=this.Jb?e.$b(this.sa.Gc,this.g):e.Yb(this.sa.ed,this.g);for(var r=0;0<e.Pa.length&&r<this.ka;){var o=J(e);if(!(this.Jb?0>=this.g.compare(this.sa.ed,o):0>=this.g.compare(o,this.sa.Gc)))break;i=i.U(o.name,o.S),r++}}else{var a,s,u;if(i=(i=e.lb(this.g)).ga(C),this.Jb){e=i.sf(this.g),a=this.sa.Gc,s=this.sa.ed;var h=td(this.g);u=function(t,e){return h(e,t)}}else e=i.Xb(this.g),a=this.sa.ed,s=this.sa.Gc,u=td(this.g);r=0;for(var c=!1;0<e.Pa.length;)o=J(e),!c&&0>=u(a,o)&&(c=!0),c&&r<this.ka&&0>=u(o,s)?r++:i=i.U(o.name,C)}return this.sa.Wb().xa(t,i,n)},g.ga=function(t){return t},g.Na=function(){return!0},g.Wb=function(){return this.sa.Wb()},xd.prototype.ab=function(t,e,n,i){var r,o=new gd;if(e.type===Yb)e.source.we?n=yd(this,t,e.path,e.Ga,n,i,o):(K(e.source.pf,"Unknown source."),r=e.source.af||Jb(t.w())&&!e.path.e(),n=Ad(this,t,e.path,e.Ga,n,i,r,o));else if(e.type===Bd)e.source.we?n=Cd(this,t,e.path,e.children,n,i,o):(K(e.source.pf,"Unknown source."),r=e.source.af||Jb(t.w()),n=Dd(this,t,e.path,e.children,n,i,r,o));else if(e.type===Ed)if(e.Vd)if(e=e.path,null!=n.tc(e))n=t;else{if(r=new rb(n,t,i),i=t.O.j(),e.e()||".priority"===E(e))Ib(t.w())?e=n.za(ub(t)):(K((e=t.w().j())instanceof R,"serverChildren would be complete if leaf node"),e=n.yc(e)),e=this.V.xa(i,e,o);else{var a=E(e),s=n.xc(a,t.w());null==s&&sb(t.w(),a)&&(s=i.R(a)),(e=null!=s?this.V.G(i,a,s,H(e),r,o):t.O.j().Da(a)?this.V.G(i,a,C,H(e),r,o):i).e()&&Ib(t.w())&&((i=n.za(ub(t))).K()&&(e=this.V.xa(e,i,o)))}i=Ib(t.w())||null!=n.tc(G),n=Fd(t,e,i,this.V.Na())}else n=Gd(this,t,e.path,e.Qb,n,i,o);else{if(e.type!==$b)throw Fc("Unknown operation type: "+e.type);i=e.path,r=(e=t.w()).j(),a=e.ea||i.e(),n=Hd(this,new Id(t.O,new tb(r,a,e.Ub)),i,n,qb,o)}return o=ra(o.bb),(e=(i=n).O).ea&&(r=e.j().K()||e.j().e(),a=Jd(t),(0<o.length||!t.O.ea||r&&!e.j().ca(a)||!e.j().C().ca(a.C()))&&o.push(Eb(Jd(i)))),new wd(n,o)};var Sd={};function td(t){return q(t.compare,t)}function Ud(t){K(!t.e()&&".priority"!==E(t),"Can't create PathIndex with empty path or .priority key"),this.cc=t}function Wd(){}Rd.prototype.Ad=function(t,e){return 0!==this.compare(new F("[MIN_NAME]",t),new F("[MIN_NAME]",e))},Rd.prototype.Tc=function(){return Td},ma(Ud,Rd),g=Ud.prototype,g.Ic=function(t){return!t.Q(this.cc).e()},g.compare=function(t,e){var n=t.S.Q(this.cc),i=e.S.Q(this.cc);return 0===(n=n.Dc(i))?Vb(t.name,e.name):n},g.Pc=function(t,e){var n=M(t);return new F(e,n=C.G(this.cc,n))},g.Qc=function(){return new F("[MAX_NAME]",C.G(this.cc,Vd))},g.toString=function(){return this.cc.slice().join("/")},ma(Wd,Rd),g=Wd.prototype,g.compare=function(t,e){var n=t.S.C(),i=e.S.C();return 0===(n=n.Dc(i))?Vb(t.name,e.name):n},g.Ic=function(t){return!t.C().e()},g.Ad=function(t,e){return!t.C().ca(e.C())},g.Tc=function(){return Td},g.Qc=function(){return new F("[MAX_NAME]",new tc("[PRIORITY-POST]",Vd))},g.Pc=function(t,e){return new F(e,new tc("[PRIORITY-POST]",M(t)))},g.toString=function(){return".priority"};var N=new Wd;function Xd(){}ma(Xd,Rd),g=Xd.prototype,g.compare=function(t,e){return Vb(t.name,e.name)},g.Ic=function(){throw Fc("KeyIndex.isDefinedOn not expected to be called.")},g.Ad=function(){return!1},g.Tc=function(){return Td},g.Qc=function(){return new F("[MAX_NAME]",C)},g.Pc=function(t){return K(p(t),"KeyIndex indexValue must always be a string."),new F(t,C)},g.toString=function(){return".key"};var Qd=new Xd;function Yd(){}ma(Yd,Rd),g=Yd.prototype,g.compare=function(t,e){var n=t.S.Dc(e.S);return 0===n?Vb(t.name,e.name):n},g.Ic=function(){return!0},g.Ad=function(t,e){return!t.ca(e)},g.Tc=function(){return Td},g.Qc=function(){return Zd},g.Pc=function(t,e){return new F(e,M(t))},g.toString=function(){return".value"};var $d=new Yd;function ae(){this.Tb=this.pa=this.Lb=this.ma=this.ja=!1,this.ka=0,this.Nb="",this.ec=null,this.xb="",this.bc=null,this.vb="",this.g=N}var be=new ae;function rd(t){return""===t.Nb?t.ma:"l"===t.Nb}function nd(t){return K(t.ma,"Only valid if start has been set"),t.ec}function md(t){return K(t.ma,"Only valid if start has been set"),t.Lb?t.xb:"[MIN_NAME]"}function pd(t){return K(t.pa,"Only valid if end has been set"),t.bc}function od(t){return K(t.pa,"Only valid if end has been set"),t.Tb?t.vb:"[MAX_NAME]"}function ce(t){var e=new ae;return e.ja=t.ja,e.ka=t.ka,e.ma=t.ma,e.ec=t.ec,e.Lb=t.Lb,e.xb=t.xb,e.pa=t.pa,e.bc=t.bc,e.Tb=t.Tb,e.vb=t.vb,e.g=t.g,e}function de(t,e){var n=ce(t);return n.g=e,n}function ee(t){var e={};if(t.ma&&(e.sp=t.ec,t.Lb&&(e.sn=t.xb)),t.pa&&(e.ep=t.bc,t.Tb&&(e.en=t.vb)),t.ja){e.l=t.ka;var n=t.Nb;""===n&&(n=rd(t)?"l":"r"),e.vf=n}return t.g!==N&&(e.i=t.g.toString()),e}function S(t){return!(t.ma||t.pa||t.ja)}function fe(t){return S(t)&&t.g==N}function ge(t){var e,n={};return fe(t)?n:(t.g===N?e="$priority":t.g===$d?e="$value":t.g===Qd?e="$key":(K(t.g instanceof Ud,"Unrecognized index type!"),e=t.g.toString()),n.orderBy=B(e),t.ma&&(n.startAt=B(t.ec),t.Lb&&(n.startAt+=","+B(t.xb))),t.pa&&(n.endAt=B(t.bc),t.Tb&&(n.endAt+=","+B(t.vb))),t.ja&&(rd(t)?n.limitToFirst=t.ka:n.limitToLast=t.ka),n)}function he(t,e){this.Bd=t,this.dc=e}function ie(t,e,n){return new he(na(t.Bd,function(i,r){var o=w(t.dc,r);if(K(o,"Missing index implementation for "+r),i===Sd){if(o.Ic(e.S)){for(var a=[],s=n.Xb(Tb),u=J(s);u;)u.name!=e.name&&a.push(u),u=J(s);return a.push(e),je(a,td(o))}return Sd}return a=i,(o=n.get(e.name))&&(a=a.remove(new F(e.name,o))),a.Oa(e,e.S)}),t.dc)}function ke(t,e,n){return new he(na(t.Bd,function(t){if(t===Sd)return t;var i=n.get(e.name);return i?t.remove(new F(e.name,i)):t}),t.dc)}g=ae.prototype,g.He=function(t){var e=ce(this);return e.ja=!0,e.ka=t,e.Nb="",e},g.Ie=function(t){var e=ce(this);return e.ja=!0,e.ka=t,e.Nb="l",e},g.Je=function(t){var e=ce(this);return e.ja=!0,e.ka=t,e.Nb="r",e},g.$d=function(t,e){var i=ce(this);return i.ma=!0,n(t)||(t=null),i.ec=t,null!=e?(i.Lb=!0,i.xb=e):(i.Lb=!1,i.xb=""),i},g.td=function(t,e){var i=ce(this);return i.pa=!0,n(t)||(t=null),i.bc=t,n(e)?(i.Tb=!0,i.vb=e):(i.ah=!1,i.vb=""),i},g.toString=function(){return B(ee(this))},he.prototype.get=function(t){var e=w(this.Bd,t);if(!e)throw Error("No index defined for "+t);return e===Sd?null:e};var le=new he({".priority":Sd},{".priority":N});function tc(t,e){this.B=t,K(n(this.B)&&null!==this.B,"LeafNode shouldn't be created with null/undefined value."),this.aa=e||C,me(this.aa),this.Cb=null}var ne=["object","boolean","number","string"];function R(t,e,n){this.m=t,(this.aa=e)&&me(this.aa),t.e()&&K(!this.aa||this.aa.e(),"An empty node cannot have a priority"),this.wb=n,this.Cb=null}g=tc.prototype,g.K=function(){return!0},g.C=function(){return this.aa},g.ga=function(t){return new tc(this.B,t)},g.R=function(t){return".priority"===t?this.aa:C},g.Q=function(t){return t.e()?this:".priority"===E(t)?this.aa:C},g.Da=function(){return!1},g.rf=function(){return null},g.U=function(t,e){return".priority"===t?this.ga(e):e.e()&&".priority"!==t?this:C.U(t,e).ga(this.aa)},g.G=function(t,e){var n=E(t);return null===n?e:e.e()&&".priority"!==n?this:(K(".priority"!==n||1===Kd(t),".priority must be the last token in a path"),this.U(n,C.G(H(t),e)))},g.e=function(){return!1},g.Db=function(){return 0},g.P=function(){return!1},g.I=function(t){return t&&!this.C().e()?{".value":this.Ca(),".priority":this.C().I()}:this.Ca()},g.hash=function(){if(null===this.Cb){var t="";this.aa.e()||(t+="priority:"+oe(this.aa.I())+":");var e=_typeof(this.B);t=t+(e+":"),t="number"===e?t+Xc(this.B):t+this.B;this.Cb=Hc(t)}return this.Cb},g.Ca=function(){return this.B},g.Dc=function(t){if(t===C)return 1;if(t instanceof R)return-1;K(t.K(),"Unknown node type");var e=_typeof(t.B),n=_typeof(this.B),i=Na(ne,e),r=Na(ne,n);return K(0<=i,"Unknown leaf type: "+e),K(0<=r,"Unknown leaf type: "+n),i===r?"object"===n?0:this.B<t.B?-1:this.B===t.B?0:1:r-i},g.lb=function(){return this},g.Jc=function(){return!0},g.ca=function(t){return t===this||!!t.K()&&(this.B===t.B&&this.aa.ca(t.aa))},g.toString=function(){return B(this.I(!0))},g=R.prototype,g.K=function(){return!1},g.C=function(){return this.aa||C},g.ga=function(t){return this.m.e()?this:new R(this.m,t,this.wb)},g.R=function(t){return".priority"===t?this.C():null===(t=this.m.get(t))?C:t},g.Q=function(t){var e=E(t);return null===e?this:this.R(e).Q(H(t))},g.Da=function(t){return null!==this.m.get(t)},g.U=function(t,e){if(K(e,"We should always be passing snapshot nodes"),".priority"===t)return this.ga(e);var n,i,r=new F(t,e);return e.e()?(n=this.m.remove(t),r=ke(this.wb,r,this.m)):(n=this.m.Oa(t,e),r=ie(this.wb,r,this.m)),i=n.e()?C:this.aa,new R(n,i,r)},g.G=function(t,e){var n=E(t);if(null===n)return e;K(".priority"!==E(t)||1===Kd(t),".priority must be the last token in a path");var i=this.R(n).G(H(t),e);return this.U(n,i)},g.e=function(){return this.m.e()},g.Db=function(){return this.m.count()};var pe=/^(0|[1-9]\d*)$/;function ud(t,e){var n;return(n=(n=qe(t,e))?(n=n.Sc())&&n.name:t.m.Sc())?new F(n,t.m.get(n)):null}function vd(t,e){var n;return(n=(n=qe(t,e))?(n=n.fc())&&n.name:t.m.fc())?new F(n,t.m.get(n)):null}function qe(t,e){return e===Qd?null:t.wb.get(e.toString())}function M(t,e){if(null===t)return C;var n=null;if("object"===_typeof(t)&&".priority"in t?n=t[".priority"]:void 0!==e&&(n=e),K(null===n||"string"==typeof n||"number"==typeof n||"object"===_typeof(n)&&".sv"in n,"Invalid priority type found: "+_typeof(n)),"object"===_typeof(t)&&".value"in t&&null!==t[".value"]&&(t=t[".value"]),"object"!==_typeof(t)||".sv"in t)return new tc(t,M(n));if(t instanceof Array){var i=C,o=t;return r(o,function(t,e){if(v(o,e)&&"."!==e.substring(0,1)){var n=M(t);!n.K()&&n.e()||(i=i.U(e,n))}}),i.ga(M(n))}var a=[],s=!1,u=t;if(ib(u,function(t){if("string"!=typeof t||"."!==t.substring(0,1)){var e=M(u[t]);e.e()||(s=s||!e.C().e(),a.push(new F(t,e)))}}),0==a.length)return C;var h=je(a,Ub,function(t){return t.name},Wb);if(s){var c=je(a,td(N));return new R(h,M(n),new he({".priority":c},{".priority":N}))}return new R(h,M(n),le)}g=R.prototype,g.I=function(t){if(this.e())return null;var e={},n=0,i=0,r=!0;if(this.P(N,function(o,a){e[o]=a.I(t),n++,r&&pe.test(o)?i=Math.max(i,Number(o)):r=!1}),!t&&r&&i<2*n){var o,a=[];for(o in e)a[o]=e[o];return a}return t&&!this.C().e()&&(e[".priority"]=this.C().I()),e},g.hash=function(){if(null===this.Cb){var t="";this.C().e()||(t+="priority:"+oe(this.C().I())+":"),this.P(N,function(e,n){var i=n.hash();""!==i&&(t+=":"+e+":"+i)}),this.Cb=""===t?"":Hc(t)}return this.Cb},g.rf=function(t,e,n){return(n=qe(this,n))?(t=cc(n,new F(t,e)))?t.name:null:cc(this.m,t)},g.P=function(t,e){var n=qe(this,t);return n?n.ia(function(t){return e(t.name,t.S)}):this.m.ia(e)},g.Xb=function(t){return this.Yb(t.Tc(),t)},g.Yb=function(t,e){if(n=qe(this,e))return n.Yb(t,function(t){return t});for(var n,i=ec(n=this.m.Yb(t.name,Tb));null!=i&&0>e.compare(i,t);)J(n),i=ec(n);return n},g.sf=function(t){return this.$b(t.Qc(),t)},g.$b=function(t,e){if(n=qe(this,e))return n.$b(t,function(t){return t});for(var n,i=ec(n=this.m.$b(t.name,Tb));null!=i&&0<e.compare(i,t);)J(n),i=ec(n);return n},g.Dc=function(t){return this.e()?t.e()?0:-1:t.K()||t.e()?1:t===Vd?-1:0},g.lb=function(t){if(t===Qd||ta(this.wb.dc,t.toString()))return this;var e=this.wb,n=this.m;K(t!==Qd,"KeyIndex always exists and isn't meant to be added to the IndexMap.");for(var i=[],r=!1,o=J(n=n.Xb(Tb));o;)r=r||t.Ic(o.S),i.push(o),o=J(n);return i=r?je(i,td(t)):Sd,r=t.toString(),(n=xa(e.dc))[r]=t,(t=xa(e.Bd))[r]=i,new R(this.m,this.aa,new he(t,n))},g.Jc=function(t){return t===Qd||ta(this.wb.dc,t.toString())},g.ca=function(t){if(t===this)return!0;if(t.K())return!1;if(this.C().ca(t.C())&&this.m.count()===t.m.count()){var e=this.Xb(N);t=t.Xb(N);for(var n=J(e),i=J(t);n&&i;){if(n.name!==i.name||!n.S.ca(i.S))return!1;n=J(e),i=J(t)}return null===n&&null===i}return!1},g.toString=function(){return B(this.I(!0))};var re=Math.log(2);function se(t){this.count=parseInt(Math.log(t+1)/re,10),this.jf=this.count-1,this.eg=t+1&parseInt(Array(this.count+1).join("1"),2)}function te(t){var e=!(t.eg&1<<t.jf);return t.jf--,e}function je(t,e,n,i){t.sort(e);var r=function(e){function i(e,i){var s=a-e,u=a;a-=e;u=function e(i,r){if(0==(a=r-i))return null;if(1==a){var o=t[i];return new fc(n?n(o):o,o.S,!1,null,null)}var a=e(i,o=parseInt(a/2,10)+i),s=e(o+1,r);o=t[o];return new fc(n?n(o):o,o.S,!1,a,s)}(s+1,u),s=t[s],u=new fc(n?n(s):s,s.S,i,null,u);r?r.left=u:o=u,r=u}for(var r=null,o=null,a=t.length,s=0;s<e.count;++s){var u=te(e),h=Math.pow(2,e.count-(s+1));u?i(h,!1):(i(h,!1),i(h,!0))}return o}(new se(t.length));return null!==r?new ac(i||e,r):new ac(i||e)}function oe(t){return"number"==typeof t?"number:"+Xc(t):"string:"+t}function me(t){if(t.K()){var e=t.I();K("string"==typeof e||"number"==typeof e||"object"===_typeof(e)&&v(e,".sv"),"Priority must be a string or number.")}else K(t===Vd||t.e(),"priority of unexpected type.");K(t===Vd||t.C().e(),"Priority nodes can't have a priority of their own.")}var C=new R(new ac(Wb),null,le);function ue(){R.call(this,new ac(Wb),C,le)}ma(ue,R),g=ue.prototype,g.Dc=function(t){return t===this?0:1},g.ca=function(t){return t===this},g.C=function(){return this},g.R=function(){return C},g.e=function(){return!1};var Vd=new ue,Td=new F("[MIN_NAME]",C),Zd=new F("[MAX_NAME]",Vd);function Id(t,e){this.O=t,this.Yd=e}function Fd(t,e,n,i){return new Id(new tb(e,n,i),t.Yd)}function Jd(t){return t.O.ea?t.O.j():null}function ub(t){return t.Yd.ea?t.Yd.j():null}function ve(t,e){this.W=t;var n=new kd((i=t.n).g),i=S(i)?new kd(i.g):i.ja?new qd(i):new ld(i);this.Hf=new xd(i);var r=e.w(),o=e.O,a=n.xa(C,r.j(),null),s=i.xa(C,o.j(),null);this.Ka=new Id(new tb(s,o.ea,i.Na()),new tb(a,r.ea,n.Na())),this.Xa=[],this.lg=new cd(t)}function we(t){return t.W}function ye(t,e){var n=t.Ka.O,i=[];return n.j().K()||n.j().P(N,function(t,e){i.push(new D("child_added",e,t))}),n.ea&&i.push(Eb(n.j())),xe(t,i,n.j(),e)}function xe(t,e,n,i){return dd(t.lg,e,n,i?[i]:t.Xa)}function ze(t,e,n){this.type=Bd,this.source=t,this.path=e,this.children=n}function Ae(t,e){this.f=Mc("p:rest:"),this.F=t,this.Gb=e,this.Aa=null,this.$={}}function Be(t,e){return n(e)?"tag$"+e:(K(fe(t.n),"should have a tag if it's not a default query."),t.path.toString())}function Ce(t,e,n,i){(n=n||{}).format="export",t.Aa&&(n.auth=t.Aa);var r=(t.F.kb?"https://":"http://")+t.F.host+e+"?"+kb(n);t.f("Sending REST request for "+r);var o=new XMLHttpRequest;o.onreadystatechange=function(){if(i&&4===o.readyState){t.f("REST Response for "+r+" received. status:",o.status,"response:",o.responseText);var e=null;if(200<=o.status&&300>o.status){try{e=nb(o.responseText)}catch(n){O("Failed to parse JSON response for "+r+": "+o.responseText)}i(null,e)}else 401!==o.status&&404!==o.status&&O("Got unsuccessful REST response for "+r+" Status: "+o.status),i(o.status);i=null}},o.open("GET",r,!0),o.send()}function De(t){K(ea(t)&&0<t.length,"Requires a non-empty array"),this.Xf=t,this.Oc={}}function Ee(t,e){K(Ta(t.Xf,function(t){return t===e}),"Unknown event: "+e)}Id.prototype.w=function(){return this.Yd},g=ve.prototype,g.w=function(){return this.Ka.w().j()},g.fb=function(t){var e=ub(this.Ka);return e&&(S(this.W.n)||!t.e()&&!e.R(E(t)).e())?e.Q(t):null},g.e=function(){return 0===this.Xa.length},g.Pb=function(t){this.Xa.push(t)},g.jb=function(t,e){var n=[];if(e){K(null==t,"A cancel should cancel all event registrations.");var i=this.W.path;Oa(this.Xa,function(t){(t=t.gf(e,i))&&n.push(t)})}if(t){for(var r=[],o=0;o<this.Xa.length;++o){var a=this.Xa[o];if(a.matches(t)){if(t.tf()){r=r.concat(this.Xa.slice(o+1));break}}else r.push(a)}this.Xa=r}else this.Xa=[];return n},g.ab=function(t,e,n){t.type===Bd&&null!==t.source.Hb&&(K(ub(this.Ka),"We should always have a full cache before handling merges"),K(Jd(this.Ka),"Missing event cache, even though we have a server cache"));var i=this.Ka;return t=this.Hf.ab(i,t,e,n),e=this.Hf,K((n=t.je).O.j().Jc(e.V.g),"Event snap not indexed"),K(n.w().j().Jc(e.V.g),"Server snap not indexed"),K(Ib(t.je.w())||!Ib(i.w()),"Once a server snap is complete, it should never go back"),this.Ka=t.je,xe(this,t.fg,t.je.O.j(),null)},ze.prototype.Xc=function(t){return this.path.e()?(t=this.children.subtree(new L(t))).e()?null:t.value?new Xb(this.source,G,t.value):new ze(this.source,G,t):(K(E(this.path)===t,"Can't get a merge for a child not on the path of the operation"),new ze(this.source,H(this.path),this.children))},ze.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"},g=Ae.prototype,g.yf=function(t,e,n,i){var r=t.path.toString();this.f("Listen called for "+r+" "+t.va());var o=Be(t,n),a={};this.$[o]=a,t=ge(t.n);var s=this;Ce(this,r+".json",t,function(t,e){var u=e;404===t&&(t=u=null),null===t&&s.Gb(r,u,!1,n),w(s.$,o)===a&&i(t?401==t?"permission_denied":"rest_error:"+t:"ok",null)})},g.Rf=function(t,e){var n=Be(t,e);delete this.$[n]},g.M=function(t,e){this.Aa=t;var n=(i=$c(t)).data,i=i.Bc&&i.Bc.exp;e&&e("ok",{auth:n,expires:i})},g.ge=function(t){this.Aa=null,t("ok",null)},g.Me=function(){},g.Cf=function(){},g.Jd=function(){},g.put=function(){},g.zf=function(){},g.Ue=function(){},De.prototype.fe=function(t,e){var n,i=(n=this.Oc[t]||[]).length;if(0<i){for(var r=Array(i),o=0;o<i;o++)r[o]=n[o];n=r}else n=[];for(i=0;i<n.length;i++)n[i].zc.apply(n[i].Ma,Array.prototype.slice.call(arguments,1))},De.prototype.Eb=function(t,e,n){Ee(this,t),this.Oc[t]=this.Oc[t]||[],this.Oc[t].push({zc:e,Ma:n}),(t=this.Ae(t))&&e.apply(n,t)},De.prototype.ic=function(t,e,n){Ee(this,t),t=this.Oc[t]||[];for(var i=0;i<t.length;i++)if(t[i].zc===e&&(!n||n===t[i].Ma)){t.splice(i,1);break}};var Fe=function(){var t=0,e=[];return function(n){var i=n===t;t=n;for(var r=Array(8),o=7;0<=o;o--)r[o]="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".charAt(n%64),n=Math.floor(n/64);if(K(0===n,"Cannot push at time == 0"),n=r.join(""),i){for(o=11;0<=o&&63===e[o];o--)e[o]=0;e[o]++}else for(o=0;12>o;o++)e[o]=Math.floor(64*Math.random());for(o=0;12>o;o++)n+="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".charAt(e[o]);return K(20===n.length,"nextPushId: Length should be 20."),n}}();function Ge(){if(De.call(this,["online"]),this.kc=!0,"undefined"!=typeof window&&void 0!==window.addEventListener){var t=this;window.addEventListener("online",function(){t.kc||(t.kc=!0,t.fe("online",!0))},!1),window.addEventListener("offline",function(){t.kc&&(t.kc=!1,t.fe("online",!1))},!1)}}function He(){var t,e;if(De.call(this,["visible"]),"undefined"!=typeof document&&void 0!==document.addEventListener&&(void 0!==document.hidden?(e="visibilitychange",t="hidden"):void 0!==document.mozHidden?(e="mozvisibilitychange",t="mozHidden"):void 0!==document.msHidden?(e="msvisibilitychange",t="msHidden"):void 0!==document.webkitHidden&&(e="webkitvisibilitychange",t="webkitHidden")),this.Ob=!0,e){var n=this;document.addEventListener(e,function(){var e=!document[t];e!==n.Ob&&(n.Ob=e,n.fe("visible",e))},!1)}}function L(t,e){if(1==arguments.length){this.o=t.split("/");for(var n=0,i=0;i<this.o.length;i++)0<this.o[i].length&&(this.o[n]=this.o[i],n++);this.o.length=n,this.Z=0}else this.o=t,this.Z=e}function T(t,e){var n=E(t);if(null===n)return e;if(n===E(e))return T(H(t),H(e));throw Error("INTERNAL ERROR: innerPath ("+e+") is not within outerPath ("+t+")")}function Ie(t,e){for(var n=t.slice(),i=e.slice(),r=0;r<n.length&&r<i.length;r++){var o=Vb(n[r],i[r]);if(0!==o)return o}return n.length===i.length?0:n.length<i.length?-1:1}function E(t){return t.Z>=t.o.length?null:t.o[t.Z]}function Kd(t){return t.o.length-t.Z}function H(t){var e=t.Z;return e<t.o.length&&e++,new L(t.o,e)}function Ld(t){return t.Z<t.o.length?t.o[t.o.length-1]:null}ma(Ge,De),Ge.prototype.Ae=function(t){return K("online"===t,"Unknown event type: "+t),[this.kc]},ca(Ge),ma(He,De),He.prototype.Ae=function(t){return K("visible"===t,"Unknown event type: "+t),[this.Ob]},ca(He),g=L.prototype,g.toString=function(){for(var t="",e=this.Z;e<this.o.length;e++)""!==this.o[e]&&(t+="/"+this.o[e]);return t||"/"},g.slice=function(t){return this.o.slice(this.Z+(t||0))},g.parent=function(){if(this.Z>=this.o.length)return null;for(var t=[],e=this.Z;e<this.o.length-1;e++)t.push(this.o[e]);return new L(t,0)},g.u=function(t){for(var e=[],n=this.Z;n<this.o.length;n++)e.push(this.o[n]);if(t instanceof L)for(n=t.Z;n<t.o.length;n++)e.push(t.o[n]);else for(t=t.split("/"),n=0;n<t.length;n++)0<t[n].length&&e.push(t[n]);return new L(e,0)},g.e=function(){return this.Z>=this.o.length},g.ca=function(t){if(Kd(this)!==Kd(t))return!1;for(var e=this.Z,n=t.Z;e<=this.o.length;e++,n++)if(this.o[e]!==t.o[n])return!1;return!0},g.contains=function(t){var e=this.Z,n=t.Z;if(Kd(this)>Kd(t))return!1;for(;e<this.o.length;){if(this.o[e]!==t.o[n])return!1;++e,++n}return!0};var G=new L("");function Je(t,e){this.Qa=t.slice(),this.Ha=Math.max(1,this.Qa.length),this.lf=e;for(var n=0;n<this.Qa.length;n++)this.Ha+=Zc(this.Qa[n]);Ke(this)}function Ke(t){if(768<t.Ha)throw Error(t.lf+"has a key path longer than 768 bytes ("+t.Ha+").");if(32<t.Qa.length)throw Error(t.lf+"path specified exceeds the maximum depth that can be written (32) or object contains a cycle "+Le(t))}function Le(t){return 0==t.Qa.length?"":"in property '"+t.Qa.join(".")+"'"}function Me(t,e){this.value=t,this.children=e||Ne}Je.prototype.push=function(t){0<this.Qa.length&&(this.Ha+=1),this.Qa.push(t),this.Ha+=Zc(t),Ke(this)},Je.prototype.pop=function(){var t=this.Qa.pop();this.Ha-=Zc(t),0<this.Qa.length&&--this.Ha};var Ne=new ac(function(t,e){return t===e?0:t<e?-1:1});function Oe(t){var e=Pd;return r(t,function(t,n){e=e.set(new L(n),t)}),e}function Pe(t,e,n){if(null!=t.value&&n(t.value))return{path:G,value:t.value};if(e.e())return null;var i=E(e);return null!==(t=t.children.get(i))?null!=(e=Pe(t,H(e),n))?{path:new L(i).u(e.path),value:e.value}:null:null}function Qe(t,e){return Pe(t,e,function(){return!0})}function Od(t,e,n){if(e.e())return n;var i=E(e);return i=(e=Od(t.children.get(i)||Pd,H(e),n)).e()?t.children.remove(i):t.children.Oa(i,e),new Me(t.value,i)}function Re(t,e){return Se(t,G,e)}function Se(t,e,n){var i={};return t.children.ia(function(t,r){i[t]=Se(r,e.u(t),n)}),n(e,t.value,i)}function Te(t,e,n){return Ue(t,e,G,n)}function Ue(t,e,n,i){var r=!!t.value&&i(n,t.value);return r||(e.e()?null:(r=E(e),(t=t.children.get(r))?Ue(t,H(e),n.u(r),i):null))}function Ve(t,e,n){We(t,e,G,n)}function We(t,e,n,i){if(e.e())return t;t.value&&i(n,t.value);var r=E(e);return(t=t.children.get(r))?We(t,H(e),n.u(r),i):Pd}function Md(t,e){Xe(t,G,e)}function Xe(t,e,n){t.children.ia(function(t,i){Xe(i,e.u(t),n)}),t.value&&n(e,t.value)}function Ye(t,e){t.children.ia(function(t,n){n.value&&e(t,n.value)})}g=Me.prototype,g.e=function(){return null===this.value&&this.children.e()},g.subtree=function(t){if(t.e())return this;var e=this.children.get(E(t));return null!==e?e.subtree(H(t)):Pd},g.set=function(t,e){if(t.e())return new Me(e,this.children);var n=E(t),i=(this.children.get(n)||Pd).set(H(t),e);n=this.children.Oa(n,i);return new Me(this.value,n)},g.remove=function(t){if(t.e())return this.children.e()?Pd:new Me(null,this.children);var e=E(t),n=this.children.get(e);return n?(e=(t=n.remove(H(t))).e()?this.children.remove(e):this.children.Oa(e,t),null===this.value&&e.e()?Pd:new Me(this.value,e)):this},g.get=function(t){if(t.e())return this.value;var e=this.children.get(E(t));return e?e.get(H(t)):null};var Pd=new Me(null);function Ze(t,e,n){this.type=Ed,this.source=$e,this.path=t,this.Qb=e,this.Vd=n}Me.prototype.toString=function(){var t={};return Md(this,function(e,n){t[e.toString()]=n.toString()}),B(t)},Ze.prototype.Xc=function(t){return this.path.e()?null!=this.Qb.value?(K(this.Qb.children.e(),"affectedTree should not have overlapping affected paths."),this):(t=this.Qb.subtree(new L(t)),new Ze(G,t,this.Vd)):(K(E(this.path)===t,"operationForChild called for unrelated child."),new Ze(H(this.path),this.Qb,this.Vd))},Ze.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" ack write revert="+this.Vd+" affectedTree="+this.Qb+")"};var Yb=0,Bd=1,Ed=2,$b=3;function af(t,e,n,i){this.we=t,this.pf=e,this.Hb=n,this.af=i,K(!i||e,"Tagged queries must be from server.")}var $e=new af(!0,!1,null,!1),bf=new af(!1,!0,null,!1);function cf(t){this.X=t}af.prototype.toString=function(){return this.we?"user":this.af?"server(queryID="+this.Hb+")":"server"};var df=new cf(new Me(null));function ef(t,e,n){if(e.e())return new cf(new Me(n));if(null!=(r=Qe(t.X,e))){var i=r.path,r=r.value;return e=T(i,e),r=r.G(e,n),new cf(t.X.set(i,r))}return new cf(t=Od(t.X,e,new Me(n)))}function ff(t,e,n){var i=t;return ib(n,function(t,n){i=ef(i,e.u(t),n)}),i}function gf(t,e){var n=Qe(t.X,e);return null!=n?t.X.get(n.path).Q(T(n.path,e)):null}function hf(t){var e=[],n=t.X.value;return null!=n?n.K()||n.P(N,function(t,n){e.push(new F(t,n))}):t.X.children.ia(function(t,n){null!=n.value&&e.push(new F(t,n.value))}),e}function jf(t,e){if(e.e())return t;var n=gf(t,e);return new cf(null!=n?new Me(n):t.X.subtree(e))}function kf(t,e,n){if(null!=e.value)return n.G(t,e.value);var i=null;return e.children.ia(function(e,r){".priority"===e?(K(null!==r.value,"Priority writes must always be leaf nodes"),i=r.value):n=kf(t.u(e),r,n)}),n.Q(t).e()||null===i||(n=n.G(t.u(".priority"),i)),n}function lf(){this.T=df,this.na=[],this.Mc=-1}function mf(t,e){for(var n=0;n<t.na.length;n++){var i=t.na[n];if(i.kd===e)return i}return null}function nf(t,e){return t.Ga?t.path.contains(e):!!ua(t.children,function(n,i){return t.path.u(i).contains(e)})}function pf(t){return t.visible}function of(t,e,n){for(var i=df,r=0;r<t.length;++r){var o=t[r];if(e(o)){var a=o.path;if(o.Ga)n.contains(a)?i=ef(i,a=T(n,a),o.Ga):a.contains(n)&&(a=T(a,n),i=ef(i,G,o.Ga.Q(a)));else{if(!o.children)throw Fc("WriteRecord should have .snap or .children");n.contains(a)?i=ff(i,a=T(n,a),o.children):a.contains(n)&&((a=T(a,n)).e()?i=ff(i,G,o.children):(o=w(o.children,E(a)))&&(o=o.Q(H(a)),i=ef(i,G,o)))}}}return i}function qf(t,e){this.Mb=t,this.X=e}function rf(){this.ya={}}function tf(t){return Pa(ra(t.ya),function(t){return!S(t.W.n)})}function uf(t,e){if(S(e.n))return sf(t);var n=e.va();return w(t.ya,n)}function sf(t){return va(t.ya,function(t){return S(t.W.n)})||null}function vf(t){this.ta=Pd,this.ib=new lf,this.$e={},this.mc={},this.Nc=t}function wf(t,e,i,r,o){var a=t.ib,s=o;return K(r>a.Mc,"Stacking an older write on top of newer ones"),n(s)||(s=!0),a.na.push({path:e,Ga:i,kd:r,visible:s}),s&&(a.T=ef(a.T,e,i)),a.Mc=r,o?xf(t,new Xb($e,e,i)):[]}function yf(t,e,n,i){var r=t.ib;return K(i>r.Mc,"Stacking an older merge on top of newer ones"),r.na.push({path:e,children:n,kd:i,visible:!0}),r.T=ff(r.T,e,n),r.Mc=i,n=Oe(n),xf(t,new ze($e,e,n))}function zf(t,e,n){n=n||!1;var i=mf(t.ib,e);if(t.ib.Rd(e)){var r=Pd;return null!=i.Ga?r=r.set(G,!0):ib(i.children,function(t,e){r=r.set(new L(t),e)}),xf(t,new Ze(i.path,r,n))}return[]}function Af(t,e,n){return n=Oe(n),xf(t,new ze(bf,e,n))}function Bf(t,e,n,i){if(null!=(i=Cf(t,i))){var r=Df(i);return i=r.path,r=r.Hb,e=T(i,e),Ef(t,i,n=new Xb(new af(!1,!0,r,!0),e,n))}return[]}function Ff(t,e,n,i){if(i=Cf(t,i)){var r=Df(i);return i=r.path,r=r.Hb,e=T(i,e),n=Oe(n),Ef(t,i,n=new ze(new af(!1,!0,r,!0),e,n))}return[]}function Jf(t){return Re(t,function(t,e,n){if(e&&null!=sf(e))return[sf(e)];var i=[];return e&&(i=tf(e)),r(n,function(t){i=i.concat(t)}),i})}function Nf(t,e){for(var n=0;n<e.length;++n){if(!S((i=e[n]).n)){var i=Gf(i),r=t.mc[i];delete t.mc[i],delete t.$e["_"+r]}}}function Lf(t){return S(t.n)&&!fe(t.n)?t.Ib():t}function If(t,e,n){var i=e.path,o=Mf(t,e);if(n=Kf(t,n),e=t.Nc.Xe(Lf(e),o,n.xd,n.H),i=t.ta.subtree(i),o)K(null==sf(i.value),"If we're adding a query, it shouldn't be shadowed");else for(o=Re(i,function(t,e,n){if(!t.e()&&e&&null!=sf(e))return[we(sf(e))];var i=[];return e&&(i=i.concat(Qa(tf(e),function(t){return t.W}))),r(n,function(t){i=i.concat(t)}),i}),i=0;i<o.length;++i)n=o[i],t.Nc.ae(Lf(n),Mf(t,n));return e}function Kf(t,e){var n=e.W,i=Mf(t,n);return{xd:function(){return(e.w()||C).hash()},H:function(e){if("ok"===e){if(i){var r=n.path;if(e=Cf(t,i)){var o=Df(e);e=o.path,o=o.Hb,r=T(e,r),r=new Zb(new af(!1,!0,o,!0),r),e=Ef(t,e,r)}else e=[]}else e=xf(t,new Zb(bf,n.path));return e}return r="Unknown Error","too_big"===e?r="The data requested exceeds the maximum size that can be accessed with a single request.":"permission_denied"==e?r="Client doesn't have permission to access the desired data.":"unavailable"==e&&(r="The service is unavailable"),(r=Error(e+": "+r)).code=e.toUpperCase(),t.jb(n,null,r)}}}function Gf(t){return t.path.toString()+"$"+t.va()}function Df(t){var e=t.indexOf("$");return K(-1!==e&&e<t.length-1,"Bad queryKey."),{Hb:t.substr(e+1),path:new L(t.substr(0,e))}}function Cf(t,e){var n=t.$e,i="_"+e;return i in n?n[i]:void 0}function Mf(t,e){var n=Gf(e);return w(t.mc,n)}cf.prototype.Rd=function(t){return t.e()?df:new cf(t=Od(this.X,t,Pd))},cf.prototype.e=function(){return this.X.e()},cf.prototype.apply=function(t){return kf(G,this.X,t)},g=lf.prototype,g.Rd=function(t){var e=Ua(this.na,function(e){return e.kd===t});K(0<=e,"removeWrite called with nonexistent writeId.");var n=this.na[e];this.na.splice(e,1);for(var i=n.visible,o=!1,a=this.na.length-1;i&&0<=a;){var s=this.na[a];s.visible&&(a>=e&&nf(s,n.path)?i=!1:n.path.contains(s.path)&&(o=!0)),a--}if(i){if(o)this.T=of(this.na,pf,G),this.Mc=0<this.na.length?this.na[this.na.length-1].kd:-1;else if(n.Ga)this.T=this.T.Rd(n.path);else{var u=this;r(n.children,function(t,e){u.T=u.T.Rd(n.path.u(e))})}return!0}return!1},g.za=function(t,e,n,i){if(n||i){var r=jf(this.T,t);return!i&&r.e()?e:i||null!=e||null!=gf(r,G)?(r=of(this.na,function(e){return(e.visible||i)&&(!n||!(0<=Na(n,e.kd)))&&(e.path.contains(t)||t.contains(e.path))},t),e=e||C,r.apply(e)):null}return null!=(r=gf(this.T,t))?r:(r=jf(this.T,t)).e()?e:null!=e||null!=gf(r,G)?(e=e||C,r.apply(e)):null},g.yc=function(t,e){var n=C,i=gf(this.T,t);if(i)i.K()||i.P(N,function(t,e){n=n.U(t,e)});else if(e){var r=jf(this.T,t);e.P(N,function(t,e){var i=jf(r,new L(t)).apply(e);n=n.U(t,i)}),Oa(hf(r),function(t){n=n.U(t.name,t.S)})}else r=jf(this.T,t),Oa(hf(r),function(t){n=n.U(t.name,t.S)});return n},g.ld=function(t,e,n,i){return K(n||i,"Either existingEventSnap or existingServerSnap must exist"),t=t.u(e),null!=gf(this.T,t)?null:(t=jf(this.T,t)).e()?i.Q(e):t.apply(i.Q(e))},g.xc=function(t,e,n){t=t.u(e);var i=gf(this.T,t);return null!=i?i:sb(n,e)?jf(this.T,t).apply(n.j().R(e)):null},g.tc=function(t){return gf(this.T,t)},g.ne=function(t,e,n,i,r,o){var a;if(null==(a=gf(t=jf(this.T,t),G))){if(null==e)return[];a=t.apply(e)}if((a=a.lb(o)).e()||a.K())return[];for(e=[],t=td(o),o=J(r=r?a.$b(n,o):a.Yb(n,o));o&&e.length<i;)0!==t(o,n)&&e.push(o),o=J(r);return e},g=qf.prototype,g.za=function(t,e,n){return this.X.za(this.Mb,t,e,n)},g.yc=function(t){return this.X.yc(this.Mb,t)},g.ld=function(t,e,n){return this.X.ld(this.Mb,t,e,n)},g.tc=function(t){return this.X.tc(this.Mb.u(t))},g.ne=function(t,e,n,i,r){return this.X.ne(this.Mb,t,e,n,i,r)},g.xc=function(t,e){return this.X.xc(this.Mb,t,e)},g.u=function(t){return new qf(this.Mb.u(t),this.X)},g=rf.prototype,g.e=function(){return wa(this.ya)},g.ab=function(t,e,n){var i=t.source.Hb;if(null!==i)return K(null!=(i=w(this.ya,i)),"SyncTree gave us an op for an invalid query."),i.ab(t,e,n);var o=[];return r(this.ya,function(i){o=o.concat(i.ab(t,e,n))}),o},g.Pb=function(t,e,n,i,r){var o=t.va();if(!(a=w(this.ya,o))){var a,s=!1;(a=n.za(r?i:null))?s=!0:(a=i instanceof R?n.yc(i):C,s=!1),a=new ve(t,new Id(new tb(a,s,!1),new tb(i,r,!1))),this.ya[o]=a}return a.Pb(e),ye(a,e)},g.jb=function(t,e,n){var i=t.va(),o=[],a=[],s=null!=sf(this);if("default"===i){var u=this;r(this.ya,function(t,i){a=a.concat(t.jb(e,n)),t.e()&&(delete u.ya[i],S(t.W.n)||o.push(t.W))})}else{var h=w(this.ya,i);h&&(a=a.concat(h.jb(e,n)),h.e()&&(delete this.ya[i],S(h.W.n)||o.push(h.W)))}return s&&null==sf(this)&&o.push(new U(t.k,t.path)),{Kg:o,mg:a}},g.fb=function(t){var e=null;return r(this.ya,function(n){e=e||n.fb(t)}),e},vf.prototype.Pb=function(t,e){var n=t.path,i=null,r=!1;Ve(this.ta,n,function(t,e){var o=T(t,n);i=i||e.fb(o),r=r||null!=sf(e)});var o,a=this.ta.get(n);a?(r=r||null!=sf(a),i=i||a.fb(G)):(a=new rf,this.ta=this.ta.set(n,a)),null!=i?o=!0:(o=!1,i=C,Ye(this.ta.subtree(n),function(t,e){var n=e.fb(G);n&&(i=i.U(t,n))}));var s=null!=uf(a,t);if(!s&&!S(t.n)){var u=Gf(t);K(!(u in this.mc),"View does not exist, but we have a tag");var h=Hf++;this.mc[u]=h,this.$e["_"+h]=u}return o=a.Pb(t,e,new qf(n,this.ib),i,o),s||r||(a=uf(a,t),o=o.concat(If(this,t,a))),o},vf.prototype.jb=function(t,e,n){var i=t.path,r=this.ta.get(i),o=[];if(r&&("default"===t.va()||null!=uf(r,t))){o=r.jb(t,e,n),r.e()&&(this.ta=this.ta.remove(i)),r=o.Kg,o=o.mg,e=-1!==Ua(r,function(t){return S(t.n)});var a=Te(this.ta,i,function(t,e){return null!=sf(e)});if(e&&!a&&!(i=this.ta.subtree(i)).e()){i=Jf(i);for(var s=0;s<i.length;++s){var u=(h=i[s]).W,h=Kf(this,h);this.Nc.Xe(Lf(u),Mf(this,u),h.xd,h.H)}}if(!a&&0<r.length&&!n)if(e)this.Nc.ae(Lf(t),null);else{var c=this;Oa(r,function(t){t.va();var e=c.mc[Gf(t)];c.Nc.ae(Lf(t),e)})}Nf(this,r)}return o},vf.prototype.za=function(t,e){var n=this.ib,i=Te(this.ta,t,function(e,n){var i=T(e,t);if(i=n.fb(i))return i});return n.za(t,i,e,!0)};var Hf=1;function Ef(t,e,n){var i=t.ta.get(e);return K(i,"Missing sync point for query tag that we're tracking"),i.ab(n,new qf(e,t.ib),null)}function xf(t,e){return Of(t,e,t.ta,null,new qf(G,t.ib))}function Of(t,e,n,i,r){if(e.path.e())return Pf(t,e,n,i,r);var o=n.get(G);null==i&&null!=o&&(i=o.fb(G));var a=[],s=E(e.path),u=e.Xc(s);if((n=n.children.get(s))&&u){var h=i?i.R(s):null;s=r.u(s),a=a.concat(Of(t,u,n,h,s))}return o&&(a=a.concat(o.ab(e,r,i))),a}function Pf(t,e,n,i,r){var o=n.get(G);null==i&&null!=o&&(i=o.fb(G));var a=[];return n.children.ia(function(n,o){var s=i?i.R(n):null,u=r.u(n),h=e.Xc(n);h&&(a=a.concat(Pf(t,h,o,s,u)))}),o&&(a=a.concat(o.ab(e,r,i))),a}function Qf(){this.children={},this.nd=0,this.value=null}function Rf(t,e,n){this.Gd=t||"",this.Zc=e||null,this.A=n||new Qf}function Sf(t,e){for(var n,i=e instanceof L?e:new L(e),r=t;null!==(n=E(i));)r=new Rf(n,r,w(r.A.children,n)||new Qf),i=H(i);return r}function Tf(t,e){K(void 0!==e,"Cannot set value to undefined"),t.A.value=e,Uf(t)}function Vf(t,e,n,i){n&&!i&&e(t),t.P(function(t){Vf(t,e,!0,i)}),n&&i&&e(t)}function Wf(t,e){for(var n=t.parent();null!==n&&!e(n);)n=n.parent()}function Uf(t){if(null!==t.Zc){var e=t.Zc,n=t.Gd,i=t.e(),r=v(e.A.children,n);i&&r?(delete e.A.children[n],e.A.nd--,Uf(e)):i||r||(e.A.children[n]=t.A,e.A.nd++,Uf(e))}}g=Rf.prototype,g.Ca=function(){return this.A.value},g.clear=function(){this.A.value=null,this.A.children={},this.A.nd=0,Uf(this)},g.wd=function(){return 0<this.A.nd},g.e=function(){return null===this.Ca()&&!this.wd()},g.P=function(t){var e=this;r(this.A.children,function(n,i){t(new Rf(i,e,n))})},g.path=function(){return new L(null===this.Zc?this.Gd:this.Zc.path()+"/"+this.Gd)},g.name=function(){return this.Gd},g.parent=function(){return this.Zc};var Xf=/[\[\].#$\/\u0000-\u001F\u007F]/,Yf=/[\[\].#$\u0000-\u001F\u007F]/,Zf=/^[a-zA-Z][a-zA-Z._\-+]+$/;function $f(t){return p(t)&&0!==t.length&&!Xf.test(t)}function ag(t){return null===t||p(t)||ga(t)&&!Qc(t)||ia(t)&&v(t,".sv")}function bg(t,e,i,r){r&&!n(e)||cg(y(t,1,r),e,i)}function cg(t,e,i){if(i instanceof L&&(i=new Je(i,t)),!n(e))throw Error(t+"contains undefined "+Le(i));if(ha(e))throw Error(t+"contains a function "+Le(i)+" with contents: "+e.toString());if(Qc(e))throw Error(t+"contains "+e.toString()+" "+Le(i));if(p(e)&&e.length>10485760/3&&10485760<Zc(e))throw Error(t+"contains a string greater than 10485760 utf8 bytes "+Le(i)+" ('"+e.substring(0,50)+"...')");if(ia(e)){var r=!1,o=!1;if(ib(e,function(e,n){if(".value"===e)r=!0;else if(".priority"!==e&&".sv"!==e&&(o=!0,!$f(e)))throw Error(t+" contains an invalid key ("+e+") "+Le(i)+'.  Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');i.push(e),cg(t,n,i),i.pop()}),r&&o)throw Error(t+' contains ".value" child '+Le(i)+" in addition to actual children.")}}function dg(t,e){var n,i;for(n=0;n<e.length;n++)for(var r=(i=e[n]).slice(),o=0;o<r.length;o++)if((".priority"!==r[o]||o!==r.length-1)&&!$f(r[o]))throw Error(t+"contains an invalid key ("+r[o]+") in path "+i.toString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');for(e.sort(Ie),r=null,n=0;n<e.length;n++){if(i=e[n],null!==r&&r.contains(i))throw Error(t+"contains a path "+r.toString()+" that is ancestor of another path "+i.toString());r=i}}function eg(t,e,n){var i=y(t,1,!1);if(!ia(e)||ea(e))throw Error(i+" must be an object containing the children to replace.");var r=[];ib(e,function(t,e){var o=new L(t);if(cg(i,e,n.u(o)),".priority"===Ld(o)&&!ag(e))throw Error(i+"contains an invalid value for '"+o.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");r.push(o)}),dg(i,r)}function fg(t,e,n){if(Qc(n))throw Error(y(t,e,!1)+"is "+n.toString()+", but must be a valid Firebase priority (a string, finite number, server value, or null).");if(!ag(n))throw Error(y(t,e,!1)+"must be a valid Firebase priority (a string, finite number, server value, or null).")}function gg(t,e,i){if(!i||n(e))switch(e){case"value":case"child_added":case"child_removed":case"child_changed":case"child_moved":break;default:throw Error(y(t,1,i)+'must be a valid event type: "value", "child_added", "child_removed", "child_changed", or "child_moved".')}}function hg(t,e){if(n(e)&&!$f(e))throw Error(y(t,2,!0)+'was an invalid key: "'+e+'".  Firebase keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]").')}function ig(t,e){if(!p(e)||0===e.length||Yf.test(e))throw Error(y(t,1,!1)+'was an invalid path: "'+e+'". Paths must be non-empty strings and can\'t contain ".", "#", "$", "[", or "]"')}function jg(t,e){if(".info"===E(e))throw Error(t+" failed: Can't modify data under /.info/")}function kg(t,e){if(!p(e))throw Error(y(t,1,!1)+"must be a valid credential (a string).")}function lg(t,e,n){if(!p(n))throw Error(y(t,e,!1)+"must be a valid string.")}function mg(t,e){if(lg(t,1,e),!Zf.test(e))throw Error(y(t,1,!1)+"'"+e+"' is not a valid authentication provider.")}function ng(t,e,i,r){if((!r||n(i))&&(!ia(i)||null===i))throw Error(y(t,e,r)+"must be a valid object.")}function og(t,e,n){if(!ia(e)||!v(e,n))throw Error(y(t,1,!1)+'must contain the key "'+n+'"');if(!p(w(e,n)))throw Error(y(t,1,!1)+'must contain the key "'+n+'" with type "string"')}function pg(){this.set={}}function qg(t,e){r(t.set,function(t,n){e(n,t)})}function qc(){this.m=this.B=null}function rg(t,e){if(e.e())return t.B=null,t.m=null,!0;if(null!==t.B){if(t.B.K())return!1;var n=t.B;return t.B=null,n.P(N,function(e,n){t.nc(new L(e),n)}),rg(t,e)}return null===t.m||(n=E(e),e=H(e),t.m.contains(n)&&rg(t.m.get(n),e)&&t.m.remove(n),!!t.m.e()&&(t.m=null,!0))}function rc(t,e,n){null!==t.B?n(e,t.B):t.P(function(t,i){rc(i,new L(e.toString()+"/"+t),n)})}g=pg.prototype,g.add=function(t,e){this.set[t]=null===e||e},g.contains=function(t){return v(this.set,t)},g.get=function(t){return this.contains(t)?this.set[t]:void 0},g.remove=function(t){delete this.set[t]},g.clear=function(){this.set={}},g.e=function(){return wa(this.set)},g.count=function(){return pa(this.set)},g.keys=function(){var t=[];return r(this.set,function(e,n){t.push(n)}),t},qc.prototype.find=function(t){if(null!=this.B)return this.B.Q(t);if(t.e()||null==this.m)return null;var e=E(t);return t=H(t),this.m.contains(e)?this.m.get(e).find(t):null},qc.prototype.nc=function(t,e){if(t.e())this.B=e,this.m=null;else if(null!==this.B)this.B=this.B.G(t,e);else{null==this.m&&(this.m=new pg);var n=E(t);this.m.contains(n)||this.m.add(n,new qc),n=this.m.get(n),t=H(t),n.nc(t,e)}},qc.prototype.P=function(t){null!==this.m&&qg(this.m,function(e,n){t(e,n)})};var sg="auth.firebase.com";function tg(t,e,n){this.od=t||{},this.ee=e||{},this.$a=n||{},this.od.remember||(this.od.remember="default")}var ug=["remember","redirectTo"];function vg(t){var e={},n={};return ib(t||{},function(t,i){0<=Na(ug,t)?e[t]=i:n[t]=i}),new tg(e,{},n)}function wg(t,e){this.Qe=["session",t.Od,t.hc].join(":"),this.be=e}function xg(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function yg(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(xg())}function zg(){return"undefined"!=typeof location&&/^file:\//.test(location.href)}function Ag(t){var e=xg();if(""===e)return!1;if("Microsoft Internet Explorer"===navigator.appName){if((e=e.match(/MSIE ([0-9]{1,}[\.0-9]{0,})/))&&1<e.length)return parseFloat(e[1])>=t}else if(-1<e.indexOf("Trident")&&(e=e.match(/rv:([0-9]{2,2}[\.0-9]{0,})/))&&1<e.length)return parseFloat(e[1])>=t;return!1}function Bg(){var t,e=window.opener.frames;for(t=e.length-1;0<=t;t--)try{if(e[t].location.protocol===window.location.protocol&&e[t].location.host===window.location.host&&"__winchan_relay_frame"===e[t].name)return e[t]}catch(n){}return null}function Cg(t,e,n){t.attachEvent?t.attachEvent("on"+e,n):t.addEventListener&&t.addEventListener(e,n,!1)}function Dg(t,e,n){t.detachEvent?t.detachEvent("on"+e,n):t.removeEventListener&&t.removeEventListener(e,n,!1)}function Eg(t){/^https?:\/\//.test(t)||(t=window.location.href);var e=/^(https?:\/\/[\-_a-zA-Z\.0-9:]+)/.exec(t);return e?e[1]:t}function Fg(t){var e="";try{var n=lb(t=t.replace("#",""));n&&v(n,"__firebase_request_key")&&(e=w(n,"__firebase_request_key"))}catch(i){}return e}function Gg(){var t=Pc(sg);return t.scheme+"://"+t.host+"/v2"}function Hg(t){return Gg()+"/"+t+"/auth/channel"}function Ig(t){var e=this;if(this.Ac=t,this.ce="*",Ag(8)?this.Rc=this.zd=Bg():(this.Rc=window.opener,this.zd=window),!e.Rc)throw"Unable to find relay frame";Cg(this.zd,"message",q(this.jc,this)),Cg(this.zd,"message",q(this.Bf,this));try{Jg(this,{a:"ready"})}catch(n){Cg(this.Rc,"load",function(){Jg(e,{a:"ready"})})}Cg(window,"unload",q(this.Bg,this))}function Jg(t,e){e=B(e),Ag(8)?t.Rc.doPost(e,t.ce):t.Rc.postMessage(e,t.ce)}function Kg(t){this.pc=Ga()+Ga()+Ga(),this.Ef=t}wg.prototype.set=function(t,e){if(!e){if(!this.be.length)throw Error("fb.login.SessionManager : No storage options available!");e=this.be[0]}e.set(this.Qe,t)},wg.prototype.get=function(){var t=Qa(this.be,q(this.qg,this));return Xa(t=Pa(t,function(t){return null!==t}),function(t,e){return ad(e.token)-ad(t.token)}),0<t.length?t.shift():null},wg.prototype.qg=function(t){try{var e=t.get(this.Qe);if(e&&e.token)return e}catch(n){}return null},wg.prototype.clear=function(){var t=this;Oa(this.be,function(e){e.remove(t.Qe)})},Ig.prototype.jc=function(t){var e,n=this;try{e=nb(t.data)}catch(i){}e&&"request"===e.a&&(Dg(window,"message",this.jc),this.ce=t.origin,this.Ac&&setTimeout(function(){n.Ac(n.ce,e.d,function(t,e){n.dg=!e,n.Ac=void 0,Jg(n,{a:"response",d:t,forceKeepWindowOpen:e})})},0))},Ig.prototype.Bg=function(){try{Dg(this.zd,"message",this.Bf)}catch(a){}this.Ac&&(Jg(this,{a:"error",d:"unknown closed window"}),this.Ac=void 0);try{window.close()}catch(b){}},Ig.prototype.Bf=function(t){if(this.dg&&"die"===t.data)try{window.close()}catch(b){}},Kg.prototype.open=function(t,e){yc.set("redirect_request_id",this.pc),yc.set("redirect_request_id",this.pc),e.requestId=this.pc,e.redirectTo=e.redirectTo||window.location.href,t+=(/\?/.test(t)?"":"?")+kb(e),window.location=t},Kg.isAvailable=function(){return!zg()&&!yg()},Kg.prototype.Cc=function(){return"redirect"};var Lg={NETWORK_ERROR:"Unable to contact the Firebase server.",SERVER_ERROR:"An unknown server error occurred.",TRANSPORT_UNAVAILABLE:"There are no login transports available for the requested method.",REQUEST_INTERRUPTED:"The browser redirected the page before the login request could complete.",USER_CANCELLED:"The user cancelled authentication."};function Mg(t){var e=Error(w(Lg,t),t);return e.code=t,e}function Ng(t){var e;(e=!t.window_features)||(e=-1!==(e=xg()).indexOf("Fennec/")||-1!==e.indexOf("Firefox/")&&-1!==e.indexOf("Android")),e&&(t.window_features=void 0),t.window_name||(t.window_name="_blank"),this.options=t}function Og(t){t.method||(t.method="GET"),t.headers||(t.headers={}),t.headers.content_type||(t.headers.content_type="application/json"),t.headers.content_type=t.headers.content_type.toLowerCase(),this.options=t}function Pg(t){this.pc=Ga()+Ga()+Ga(),this.Ef=t}function Qg(t){t.callback_parameter||(t.callback_parameter="callback"),this.options=t,window.__firebase_auth_jsonp=window.__firebase_auth_jsonp||{}}function Rg(t,e,n){setTimeout(function(){try{var i=document.createElement("script");i.type="text/javascript",i.id=t,i.async=!0,i.src=e,i.onerror=function(){var e=document.getElementById(t);null!==e&&e.parentNode.removeChild(e),n&&n(Mg("NETWORK_ERROR"))};var r=document.getElementsByTagName("head");(r&&0!=r.length?r[0]:document.documentElement).appendChild(i)}catch(o){n&&n(Mg("NETWORK_ERROR"))}},0)}function Sg(t,e,n,i){De.call(this,["auth_status"]),this.F=t,this.df=e,this.Vg=n,this.Le=i,this.sc=new wg(t,[xc,yc]),this.mb=null,this.Se=!1,Tg(this)}function Tg(t){yc.get("redirect_request_id")&&Ug(t);var e=t.sc.get();e&&e.token?(Vg(t,e),t.df(e.token,function(n,i){Wg(t,n,i,!1,e.token,e)},function(e,n){Xg(t,"resumeSession()",e,n)})):Vg(t,null)}function Yg(t,e,n,i,r,o){"firebaseio-demo.com"===t.F.domain&&O("Firebase authentication is not supported on demo Firebases (*.firebaseio-demo.com). To secure your Firebase, create a production Firebase at https://www.firebase.com."),t.df(e,function(o,a){Wg(t,o,a,!0,e,n,i||{},r)},function(e,n){Xg(t,"auth()",e,n,o)})}function Zg(t,e){t.sc.clear(),Vg(t,null),t.Vg(function(t,n){if("ok"===t)P(e,null);else{var i=(t||"error").toUpperCase(),r=i;n&&(r+=": "+n),(r=Error(r)).code=i,P(e,r)}})}function Wg(t,e,n,i,r,o,a,s){"ok"===e?(i&&(e=n.auth,o.auth=e,o.expires=n.expires,o.token=bd(r)?r:"",n=null,e&&v(e,"uid")?n=w(e,"uid"):v(o,"uid")&&(n=w(o,"uid")),o.uid=n,n="custom",e&&v(e,"provider")?n=w(e,"provider"):v(o,"provider")&&(n=w(o,"provider")),o.provider=n,t.sc.clear(),bd(r)&&(n=xc,"sessionOnly"===(a=a||{}).remember&&(n=yc),"none"!==a.remember&&t.sc.set(o,n)),Vg(t,o)),P(s,null,o)):(t.sc.clear(),Vg(t,null),o=t=(e||"error").toUpperCase(),n&&(o+=": "+n),(o=Error(o)).code=t,P(s,o))}function Xg(t,e,n,i,r){O(e+" was canceled: "+i),t.sc.clear(),Vg(t,null),(t=Error(i)).code=n.toUpperCase(),P(r,t)}function $g(t,e,n,i,r){ah(t),bh(t,[Og,Qg],"/auth/"+e,n=new tg(i||{},{},n||{}),r)}function ch(t,e,n,i){ah(t);var r=[Ng,Pg];n=vg(n),"anonymous"===e||"password"===e?setTimeout(function(){P(i,Mg("TRANSPORT_UNAVAILABLE"))},0):(n.ee.window_features="menubar=yes,modal=yes,alwaysRaised=yeslocation=yes,resizable=yes,scrollbars=yes,status=yes,height=625,width=625,top="+("object"===("undefined"==typeof screen?"undefined":_typeof(screen))?.5*(screen.height-625):0)+",left="+("object"===("undefined"==typeof screen?"undefined":_typeof(screen))?.5*(screen.width-625):0),n.ee.relay_url=Hg(t.F.hc),n.ee.requestWithCredential=q(t.qc,t),bh(t,r,"/auth/"+e,n,i))}function Ug(t){if(n=yc.get("redirect_request_id")){var e=yc.get("redirect_client_options");yc.remove("redirect_request_id"),yc.remove("redirect_client_options");var n,i=[Og,Qg];e=new tg(e,{},n={requestId:n,requestKey:Fg(document.location.hash)});t.Se=!0;try{document.location.hash=document.location.hash.replace(/&__firebase_request_key=([a-zA-z0-9]*)/,"")}catch(r){}bh(t,i,"/auth/session",e,function(){this.Se=!1}.bind(t))}}function bh(t,e,n,i,r){dh(t,e,n,i,function(e,n){!e&&n&&n.token&&n.uid?Yg(t,n.token,n,i.od,function(t,e){t?P(r,t):P(r,null,e)}):P(r,e||Mg("UNKNOWN_ERROR"))})}function dh(t,e,n,i,r){0===(e=Pa(e,function(t){return"function"==typeof t.isAvailable&&t.isAvailable()})).length?setTimeout(function(){P(r,Mg("TRANSPORT_UNAVAILABLE"))},0):(e=new(e.shift())(i.ee),(i=jb(i.$a)).v="js-"+hb,i.transport=e.Cc(),i.suppress_status_codes=!0,t=Gg()+"/"+t.F.hc+n,e.open(t,i,function(t,e){if(t)P(r,t);else if(e&&e.error){var n=Error(e.error.message);n.code=e.error.code,n.details=e.error.details,P(r,n)}else P(r,null,e)}))}function Vg(t,e){var n=null!==t.mb||null!==e;t.mb=e,n&&t.fe("auth_status",e),t.Le(null!==e)}function ah(t){var e=t.F;if("firebaseio.com"!==e.domain&&"firebaseio-demo.com"!==e.domain&&"auth.firebase.com"===sg)throw Error("This custom Firebase server ('"+t.F.domain+"') does not support delegated login.")}Ng.prototype.open=function(t,e,n){function i(t){if(o&&(document.body.removeChild(o),o=void 0),c&&(c=clearInterval(c)),Dg(window,"message",r),Dg(window,"unload",i),h&&!t)try{h.close()}catch(e){a.postMessage("die",u)}h=a=void 0}function r(t){if(t.origin===u)try{var e=nb(t.data);"ready"===e.a?a.postMessage(f,u):"error"===e.a?(i(!1),n&&(n(e.d),n=null)):"response"===e.a&&(i(e.forceKeepWindowOpen),n&&(n(null,e.d),n=null))}catch(r){}}var o,a,s=Ag(8);if(!this.options.relay_url)return n(Error("invalid arguments: origin of url and relay_url must match"));var u=Eg(t);if(u!==Eg(this.options.relay_url))n&&setTimeout(function(){n(Error("invalid arguments: origin of url and relay_url must match"))},0);else{s&&((o=document.createElement("iframe")).setAttribute("src",this.options.relay_url),o.style.display="none",o.setAttribute("name","__winchan_relay_frame"),document.body.appendChild(o),a=o.contentWindow),t+=(/\?/.test(t)?"":"?")+kb(e);var h=window.open(t,this.options.window_name,this.options.window_features);a||(a=h);var c=setInterval(function(){h&&h.closed&&(i(!1),n&&(n(Mg("USER_CANCELLED")),n=null))},500),f=B({a:"request",d:e});Cg(window,"unload",i),Cg(window,"message",r)}},Ng.isAvailable=function(){var t;return(t="postMessage"in window&&!zg())&&((t=yg()||"undefined"!=typeof navigator&&(!!xg().match(/Windows Phone/)||!!window.Windows&&/^ms-appx:/.test(location.href)))||(t=xg(),t="undefined"!=typeof navigator&&"undefined"!=typeof window&&!!(t.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i)||t.match(/CriOS/)||t.match(/Twitter for iPhone/)||t.match(/FBAN\/FBIOS/)||window.navigator.standalone)),t=!t),t&&!xg().match(/PhantomJS/)},Ng.prototype.Cc=function(){return"popup"},Og.prototype.open=function(t,e,n){function i(){n&&(n(Mg("REQUEST_INTERRUPTED")),n=null)}var r,o=new XMLHttpRequest,a=this.options.method.toUpperCase();if(Cg(window,"beforeunload",i),o.onreadystatechange=function(){if(n&&4===o.readyState){var t;if(200<=o.status&&300>o.status){try{t=nb(o.responseText)}catch(e){}n(null,t)}else 500<=o.status&&600>o.status?n(Mg("SERVER_ERROR")):n(Mg("NETWORK_ERROR"));n=null,Dg(window,"beforeunload",i)}},"GET"===a)t+=(/\?/.test(t)?"":"?")+kb(e),r=null;else{var s=this.options.headers.content_type;"application/json"===s&&(r=B(e)),"application/x-www-form-urlencoded"===s&&(r=kb(e))}for(var u in o.open(a,t,!0),za(t={"X-Requested-With":"XMLHttpRequest",Accept:"application/json;text/plain"},this.options.headers),t)o.setRequestHeader(u,t[u]);o.send(r)},Og.isAvailable=function(){var t;return(t=!!window.XMLHttpRequest)&&(t=!((t=xg()).match(/MSIE/)||t.match(/Trident/))||Ag(10)),t},Og.prototype.Cc=function(){return"json"},Pg.prototype.open=function(t,e,n){function i(){n&&(n(Mg("USER_CANCELLED")),n=null)}var r,o=this,a=Pc(sg);e.requestId=this.pc,e.redirectTo=a.scheme+"://"+a.host+"/blank/page.html",t+=/\?/.test(t)?"":"?",t+=kb(e),(r=window.open(t,"_blank","location=no"))&&ha(r.addEventListener)?(r.addEventListener("loadstart",function(t){var e;if(e=t&&t.url)t:{try{var s=document.createElement("a");s.href=t.url,e=s.host===a.host&&"/blank/page.html"===s.pathname;break t}catch(u){}e=!1}e&&(t=Fg(t.url),r.removeEventListener("exit",i),r.close(),t=new tg(null,null,{requestId:o.pc,requestKey:t}),o.Ef.requestWithCredential("/auth/session",t,n),n=null)}),r.addEventListener("exit",i)):n(Mg("TRANSPORT_UNAVAILABLE"))},Pg.isAvailable=function(){return yg()},Pg.prototype.Cc=function(){return"redirect"},Qg.prototype.open=function(t,e,n){function i(){n&&(n(Mg("REQUEST_INTERRUPTED")),n=null)}var r="fn"+(new Date).getTime()+Math.floor(99999*Math.random());e[this.options.callback_parameter]="__firebase_auth_jsonp."+r,t+=(/\?/.test(t)?"":"?")+kb(e),Cg(window,"beforeunload",i),window.__firebase_auth_jsonp[r]=function(t){n&&(n(null,t),n=null),setTimeout(function(){window.__firebase_auth_jsonp[r]=void 0,wa(window.__firebase_auth_jsonp)&&(window.__firebase_auth_jsonp=void 0);try{var t=document.getElementById(r);t&&t.parentNode.removeChild(t)}catch(e){}},1),Dg(window,"beforeunload",i)},Rg(r,t,n)},Qg.isAvailable=function(){return"undefined"!=typeof document&&null!=document.createElement},Qg.prototype.Cc=function(){return"json"},ma(Sg,De),g=Sg.prototype,g.xe=function(){return this.mb||null},g.se=function(t,e){ah(this);var n=vg(t);n.$a._method="POST",this.qc("/users",n,function(t,n){t?P(e,t):P(e,t,n)})},g.Te=function(t,e){var n=this;ah(this);var i="/users/"+encodeURIComponent(t.email),r=vg(t);r.$a._method="DELETE",this.qc(i,r,function(t,i){!t&&i&&i.uid&&n.mb&&n.mb.uid&&n.mb.uid===i.uid&&Zg(n),P(e,t)})},g.pe=function(t,e){ah(this);var n="/users/"+encodeURIComponent(t.email)+"/password",i=vg(t);i.$a._method="PUT",i.$a.password=t.newPassword,this.qc(n,i,function(t){P(e,t)})},g.oe=function(t,e){ah(this);var n="/users/"+encodeURIComponent(t.oldEmail)+"/email",i=vg(t);i.$a._method="PUT",i.$a.email=t.newEmail,i.$a.password=t.password,this.qc(n,i,function(t){P(e,t)})},g.Ve=function(t,e){ah(this);var n="/users/"+encodeURIComponent(t.email)+"/password",i=vg(t);i.$a._method="POST",this.qc(n,i,function(t){P(e,t)})},g.qc=function(t,e,n){dh(this,[Og,Qg],t,e,n)},g.Ae=function(t){return K("auth_status"===t,'initial event must be of type "auth_status"'),this.Se?null:[this.mb]};var Cc="websocket",Dc="long_polling",ih,jh;function eh(t){this.jc=t,this.Nd=[],this.Sb=0,this.qe=-1,this.Fb=null}function fh(t,e,n){t.qe=e,t.Fb=n,t.qe<t.Sb&&(t.Fb(),t.Fb=null)}function gh(t,e,n){for(t.Nd[e]=n;t.Nd[t.Sb];){var i=t.Nd[t.Sb];delete t.Nd[t.Sb];for(var r=0;r<i.length;++r)if(i[r]){var o=t;Db(function(){o.jc(i[r])})}if(t.Sb===t.qe){t.Fb&&(clearTimeout(t.Fb),t.Fb(),t.Fb=null);break}t.Sb++}}function hh(t,e,n,i){this.re=t,this.f=Mc(t),this.nb=this.ob=0,this.Ua=Rb(e),this.Qf=n,this.Hc=!1,this.Bb=i,this.jd=function(t){return Bc(e,Dc,t)}}function lh(t,e){var n=B(e).length;t.nb+=n,Ob(t.Ua,"bytes_received",n)}function kh(t,e,n,i){if(this.jd=i,this.hb=n,this.Pe=new pg,this.ad=[],this.te=Math.floor(1e8*Math.random()),this.Xd=!0,this.he=Ec(),window["pLPCommand"+this.he]=t,window["pRTLPCB"+this.he]=e,(t=document.createElement("iframe")).style.display="none",!document.body)throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";document.body.appendChild(t);try{t.contentWindow.document||Cb("No IE domain setting required")}catch(r){t.src="javascript:void((function(){document.open();document.domain='"+document.domain+"';document.close();})())"}t.contentDocument?t.eb=t.contentDocument:t.contentWindow?t.eb=t.contentWindow.document:t.document&&(t.eb=t.document),this.Ea=t,t="",this.Ea.src&&"javascript:"===this.Ea.src.substr(0,11)&&(t='<script>document.domain="'+document.domain+'";<\/script>'),t="<html><body>"+t+"</body></html>";try{this.Ea.eb.open(),this.Ea.eb.write(t),this.Ea.eb.close()}catch(o){Cb("frame writing exception"),o.stack&&Cb(o.stack),Cb(o)}}function nh(t){if(t.le&&t.Xd&&t.Pe.count()<(0<t.ad.length?2:1)){t.te++,(e={}).id=t.ug,e.pw=t.vg,e.ser=t.te;for(var e=t.jd(e),n="",i=0;0<t.ad.length&&1870>=t.ad[0].kf.length+30+n.length;){var r=t.ad.shift();n=n+"&seg"+i+"="+r.Mg+"&ts"+i+"="+r.Ug+"&d"+i+"="+r.kf;i++}return oh(t,e+n,t.te),!0}return!1}function oh(t,e,n){function i(){t.Pe.remove(n),nh(t)}t.Pe.add(n,1);var r=setTimeout(i,Math.floor(25e3));mh(t,e,function(){clearTimeout(r),i()})}function mh(t,e,n){setTimeout(function(){try{if(t.Xd){var i=t.Ea.eb.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.onload=i.onreadystatechange=function(){var t=i.readyState;t&&"loaded"!==t&&"complete"!==t||(i.onload=i.onreadystatechange=null,i.parentNode&&i.parentNode.removeChild(i),n())},i.onerror=function(){Cb("Long-poll script failed to load: "+e),t.Xd=!1,t.close()},t.Ea.eb.body.appendChild(i)}}catch(r){}},Math.floor(1))}hh.prototype.open=function(t,e){this.hf=0,this.la=e,this.Af=new eh(t),this.zb=!1;var n=this;this.qb=setTimeout(function(){n.f("Timed out trying to connect."),n.gb(),n.qb=null},Math.floor(3e4)),Rc(function(){if(!n.zb){n.Sa=new kh(function(t,e,i,r,o){if(lh(n,arguments),n.Sa)if(n.qb&&(clearTimeout(n.qb),n.qb=null),n.Hc=!0,"start"==t)n.id=e,n.Gf=i;else{if("close"!==t)throw Error("Unrecognized command received: "+t);e?(n.Sa.Xd=!1,fh(n.Af,e,function(){n.gb()})):n.gb()}},function(t,e){lh(n,arguments),gh(n.Af,t,e)},function(){n.gb()},n.jd);var t={start:"t"};t.ser=Math.floor(1e8*Math.random()),n.Sa.he&&(t.cb=n.Sa.he),t.v="5",n.Qf&&(t.s=n.Qf),n.Bb&&(t.ls=n.Bb),"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(t.r="f"),t=n.jd(t),n.f("Connecting via long-poll to "+t),mh(n.Sa,t,function(){})}})},hh.prototype.start=function(){var t=this.Sa,e=this.Gf;for(t.ug=this.id,t.vg=e,t.le=!0;nh(t););t=this.id,e=this.Gf,this.gc=document.createElement("iframe");var n={dframe:"t"};n.id=t,n.pw=e,this.gc.src=this.jd(n),this.gc.style.display="none",document.body.appendChild(this.gc)},hh.isAvailable=function(){return ih||!jh&&"undefined"!=typeof document&&null!=document.createElement&&!("object"===("undefined"==typeof window?"undefined":_typeof(window))&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))&&!("object"===("undefined"==typeof Windows?"undefined":_typeof(Windows))&&"object"===_typeof(Windows.Xg))&&!0},g=hh.prototype,g.Ed=function(){},g.dd=function(){this.zb=!0,this.Sa&&(this.Sa.close(),this.Sa=null),this.gc&&(document.body.removeChild(this.gc),this.gc=null),this.qb&&(clearTimeout(this.qb),this.qb=null)},g.gb=function(){this.zb||(this.f("Longpoll is closing itself"),this.dd(),this.la&&(this.la(this.Hc),this.la=null))},g.close=function(){this.zb||(this.f("Longpoll is being closed."),this.dd())},g.send=function(t){t=B(t),this.ob+=t.length,Ob(this.Ua,"bytes_sent",t.length),t=Vc(t=fb(t=Ic(t),!0),1840);for(var e=0;e<t.length;e++){var n=this.Sa;n.ad.push({Mg:this.hf,Ug:t.length,kf:t[e]}),n.le&&nh(n),this.hf++}},kh.prototype.close=function(){if(this.le=!1,this.Ea){this.Ea.eb.body.innerHTML="";var t=this;setTimeout(function(){null!==t.Ea&&(document.body.removeChild(t.Ea),t.Ea=null)},Math.floor(0))}var e=this.hb;e&&(this.hb=null,e())};var ph=null,rh;function qh(t,e,n,i){this.re=t,this.f=Mc(this.re),this.frames=this.Kc=null,this.nb=this.ob=this.bf=0,this.Ua=Rb(e),t={v:"5"},"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(t.r="f"),n&&(t.s=n),i&&(t.ls=i),this.ef=Bc(e,Cc,t)}function th(t,e){if(t.frames.push(e),t.frames.length==t.bf){var n=t.frames.join("");t.frames=null,n=nb(n),t.zg(n)}}function sh(t){clearInterval(t.Kc),t.Kc=setInterval(function(){t.ua&&t.ua.send("0"),sh(t)},Math.floor(45e3))}function uh(t){vh(this,t)}"undefined"!=typeof MozWebSocket?ph=MozWebSocket:"undefined"!=typeof WebSocket&&(ph=WebSocket),qh.prototype.open=function(t,e){this.hb=e,this.zg=t,this.f("Websocket connecting to "+this.ef),this.Hc=!1,xc.set("previous_websocket_failure",!0);try{this.ua=new ph(this.ef)}catch(r){this.f("Error instantiating WebSocket.");var n=r.message||r.data;return n&&this.f(n),void this.gb()}var i=this;this.ua.onopen=function(){i.f("Websocket connected."),i.Hc=!0},this.ua.onclose=function(){i.f("Websocket connection was disconnected."),i.ua=null,i.gb()},this.ua.onmessage=function(t){if(null!==i.ua)if(t=t.data,i.nb+=t.length,Ob(i.Ua,"bytes_received",t.length),sh(i),null!==i.frames)th(i,t);else{t:{if(K(null===i.frames,"We already have a frame buffer"),6>=t.length){var e=Number(t);if(!isNaN(e)){i.bf=e,i.frames=[],t=null;break t}}i.bf=1,i.frames=[]}null!==t&&th(i,t)}},this.ua.onerror=function(t){i.f("WebSocket error.  Closing connection."),(t=t.message||t.data)&&i.f(t),i.gb()}},qh.prototype.start=function(){},qh.isAvailable=function(){var t=!1;if("undefined"!=typeof navigator&&navigator.userAgent){var e=navigator.userAgent.match(/Android ([0-9]{0,}\.[0-9]{0,})/);e&&1<e.length&&4.4>parseFloat(e[1])&&(t=!0)}return!t&&null!==ph&&!rh},qh.responsesRequiredToBeHealthy=2,qh.healthyTimeout=3e4,g=qh.prototype,g.Ed=function(){xc.remove("previous_websocket_failure")},g.send=function(t){sh(this),t=B(t),this.ob+=t.length,Ob(this.Ua,"bytes_sent",t.length),1<(t=Vc(t,16384)).length&&this.ua.send(String(t.length));for(var e=0;e<t.length;e++)this.ua.send(t[e])},g.dd=function(){this.zb=!0,this.Kc&&(clearInterval(this.Kc),this.Kc=null),this.ua&&(this.ua.close(),this.ua=null)},g.gb=function(){this.zb||(this.f("WebSocket is closing itself"),this.dd(),this.hb&&(this.hb(this.Hc),this.hb=null))},g.close=function(){this.zb||(this.f("WebSocket is being closed"),this.dd())};var wh=[hh,qh];function vh(t,e){var n=qh&&qh.isAvailable(),i=n&&!(xc.wf||!0===xc.get("previous_websocket_failure"));if(e.Wg&&(n||O("wss:// URL used, but browser isn't known to support websockets.  Trying anyway."),i=!0),i)t.gd=[qh];else{var r=t.gd=[];Wc(wh,function(t,e){e&&e.isAvailable()&&r.push(e)})}}function xh(t){if(0<t.gd.length)return t.gd[0];throw Error("No transports available")}function yh(t,e,n,i,r,o,a){this.id=t,this.f=Mc("c:"+this.id+":"),this.jc=n,this.Wc=i,this.la=r,this.Ne=o,this.F=e,this.Md=[],this.ff=0,this.Pf=new uh(e),this.Ta=0,this.Bb=a,this.f("Connection created"),zh(this)}function zh(t){var e=xh(t.Pf);t.J=new e("c:"+t.id+":"+t.ff++,t.F,void 0,t.Bb),t.Re=e.responsesRequiredToBeHealthy||0;var n=Ah(t,t.J),i=Bh(t,t.J);t.hd=t.J,t.cd=t.J,t.D=null,t.Ab=!1,setTimeout(function(){t.J&&t.J.open(n,i)},Math.floor(0)),0<(e=e.healthyTimeout||0)&&(t.yd=setTimeout(function(){t.yd=null,t.Ab||(t.J&&102400<t.J.nb?(t.f("Connection exceeded healthy timeout but has received "+t.J.nb+" bytes.  Marking connection healthy."),t.Ab=!0,t.J.Ed()):t.J&&10240<t.J.ob?t.f("Connection exceeded healthy timeout but has sent "+t.J.ob+" bytes.  Leaving connection alive."):(t.f("Closing unhealthy connection after timeout."),t.close()))},Math.floor(e)))}function Bh(t,e){return function(n){e===t.J?(t.J=null,n||0!==t.Ta?1===t.Ta&&t.f("Realtime connection lost."):(t.f("Realtime connection failed."),"s-"===t.F.Ya.substr(0,2)&&(xc.remove("host:"+t.F.host),t.F.Ya=t.F.host)),t.close()):e===t.D?(t.f("Secondary connection lost."),n=t.D,t.D=null,t.hd!==n&&t.cd!==n||t.close()):t.f("closing an old connection")}}function Ah(t,e){return function(n){if(2!=t.Ta)if(e===t.cd){var i=Tc("t",n);if(n=Tc("d",n),"c"==i){if(i=Tc("t",n),"d"in n)if(n=n.d,"h"===i){i=n.ts;var r=n.v,o=n.h;t.Nf=n.s,Ac(t.F,o),0==t.Ta&&(t.J.start(),Ch(t,t.J,i),"5"!==r&&O("Protocol version mismatch detected"),(n=1<(n=t.Pf).gd.length?n.gd[1]:null)&&Dh(t,n))}else if("n"===i){for(t.f("recvd end transmission on primary"),t.cd=t.D,n=0;n<t.Md.length;++n)t.Id(t.Md[n]);t.Md=[],Eh(t)}else"s"===i?(t.f("Connection shutdown command received. Shutting down..."),t.Ne&&(t.Ne(n),t.Ne=null),t.la=null,t.close()):"r"===i?(t.f("Reset packet received.  New host: "+n),Ac(t.F,n),1===t.Ta?t.close():(Fh(t),zh(t))):"e"===i?Nc("Server Error: "+n):"o"===i?(t.f("got pong on primary."),Gh(t),Hh(t)):Nc("Unknown control packet command: "+i)}else"d"==i&&t.Id(n)}else if(e===t.D)if(i=Tc("t",n),n=Tc("d",n),"c"==i)"t"in n&&("a"===(n=n.t)?Ih(t):"r"===n?(t.f("Got a reset on secondary, closing it"),t.D.close(),t.hd!==t.D&&t.cd!==t.D||t.close()):"o"===n&&(t.f("got pong on secondary."),t.Mf--,Ih(t)));else{if("d"!=i)throw Error("Unknown protocol layer: "+i);t.Md.push(n)}else t.f("message on old connection")}}function Eh(t){t.hd===t.D&&t.cd===t.D&&(t.f("cleaning up and promoting a connection: "+t.D.re),t.J=t.D,t.D=null)}function Ih(t){0>=t.Mf?(t.f("Secondary connection is healthy."),t.Ab=!0,t.D.Ed(),t.D.start(),t.f("sending client ack on secondary"),t.D.send({t:"c",d:{t:"a",d:{}}}),t.f("Ending transmission on primary"),t.J.send({t:"c",d:{t:"n",d:{}}}),t.hd=t.D,Eh(t)):(t.f("sending ping on secondary."),t.D.send({t:"c",d:{t:"p",d:{}}}))}function Gh(t){t.Ab||(t.Re--,0>=t.Re&&(t.f("Primary connection is healthy."),t.Ab=!0,t.J.Ed()))}function Dh(t,e){t.D=new e("c:"+t.id+":"+t.ff++,t.F,t.Nf),t.Mf=e.responsesRequiredToBeHealthy||0,t.D.open(Ah(t,t.D),Bh(t,t.D)),setTimeout(function(){t.D&&(t.f("Timed out trying to upgrade."),t.D.close())},Math.floor(6e4))}function Ch(t,e,n){t.f("Realtime connection established."),t.J=e,t.Ta=1,t.Wc&&(t.Wc(n,t.Nf),t.Wc=null),0===t.Re?(t.f("Primary connection is healthy."),t.Ab=!0):setTimeout(function(){Hh(t)},Math.floor(5e3))}function Hh(t){t.Ab||1!==t.Ta||(t.f("sending ping on primary."),Jh(t,{t:"c",d:{t:"p",d:{}}}))}function Jh(t,e){if(1!==t.Ta)throw"Connection is not connected";t.hd.send(e)}function Fh(t){t.f("Shutting down all connections"),t.J&&(t.J.close(),t.J=null),t.D&&(t.D.close(),t.D=null),t.yd&&(clearTimeout(t.yd),t.yd=null)}function Kh(t,e,n,i){this.id=Lh++,this.f=Mc("p:"+this.id+":"),this.xf=this.Ee=!1,this.$={},this.qa=[],this.Yc=0,this.Vc=[],this.oa=!1,this.Za=1e3,this.Fd=3e5,this.Gb=e,this.Uc=n,this.Oe=i,this.F=t,this.sb=this.Aa=this.Ia=this.Bb=this.We=null,this.Ob=!1,this.Td={},this.Lg=0,this.nf=!0,this.Lc=this.Ge=null,Mh(this,0),He.ub().Eb("visible",this.Cg,this),-1===t.host.indexOf("fblocal")&&Ge.ub().Eb("online",this.Ag,this)}yh.prototype.Fa=function(t){Jh(this,{t:"d",d:t})},yh.prototype.Id=function(t){Gh(this),this.jc(t)},yh.prototype.close=function(){2!==this.Ta&&(this.f("Closing realtime connection."),this.Ta=2,Fh(this),this.la&&(this.la(),this.la=null))};var Lh=0,Nh=0;function Oh(t,e){var n=e.Ig,i=n.path.toString(),r=n.va();t.f("Listen on "+i+" for "+r);var o={p:i};e.tag&&(o.q=ee(n.n),o.t=e.tag),o.h=e.xd(),t.Fa("q",o,function(o){var a=o.d,s=o.s;if(a&&"object"===_typeof(a)&&v(a,"w")){var u=w(a,"w");ea(u)&&0<=Na(u,"no_index")&&O('Using an unspecified index. Consider adding ".indexOn": "'+n.n.g.toString()+'" at '+n.path.toString()+" to your security rules for better performance")}(t.$[i]&&t.$[i][r])===e&&(t.f("listen response",o),"ok"!==s&&Ph(t,i,r),e.H&&e.H(s,a))})}function Qh(t){var e=t.Aa;t.oa&&e&&t.Fa("auth",{cred:e.ig},function(n){var i=n.s;n=n.d||"error","ok"!==i&&t.Aa===e&&delete t.Aa,e.of?"ok"!==i&&e.md&&e.md(i,n):(e.of=!0,e.zc&&e.zc(i,n))})}function Rh(t,e,n,i,r){n={p:n,d:i},t.f("onDisconnect "+e,n),t.Fa(e,n,function(t){r&&setTimeout(function(){r(t.s,t.d)},Math.floor(0))})}function Sh(t,e,i,r,o,a){r={p:i,d:r},n(a)&&(r.h=a),t.qa.push({action:e,Jf:r,H:o}),t.Yc++,e=t.qa.length-1,t.oa?Th(t,e):t.f("Buffering put: "+i)}function Th(t,e){var n=t.qa[e].action,i=t.qa[e].Jf,r=t.qa[e].H;t.qa[e].Jg=t.oa,t.Fa(n,i,function(i){t.f(n+" response",i),delete t.qa[e],t.Yc--,0===t.Yc&&(t.qa=[]),r&&r(i.s,i.d)})}function Mh(t,e){K(!t.Ia,"Scheduling a connect when we're already connected/ing?"),t.sb&&clearTimeout(t.sb),t.sb=setTimeout(function(){t.sb=null,Wh(t)},Math.floor(e))}function Wh(t){if(Xh(t)){t.f("Making a connection attempt"),t.Ge=(new Date).getTime(),t.Lc=null;var e=q(t.Id,t),n=q(t.Wc,t),i=q(t.Df,t),r=t.id+":"+Nh++;t.Ia=new yh(r,t.F,e,n,i,function(e){O(e+" ("+t.F.toString()+")"),t.xf=!0},t.Bb)}}function Uh(t,e,n){(t=Ph(t,e,n=n?Qa(n,function(t){return Uc(t)}).join("$"):"default"))&&t.H&&t.H("permission_denied")}function Ph(t,e,i){var r;return e=new L(e).toString(),n(t.$[e])?(r=t.$[e][i],delete t.$[e][i],0===pa(t.$[e])&&delete t.$[e]):r=void 0,r}function Vh(t){Qh(t),r(t.$,function(e){r(e,function(e){Oh(t,e)})});for(var e=0;e<t.qa.length;e++)t.qa[e]&&Th(t,e);for(;t.Vc.length;)e=t.Vc.shift(),Rh(t,e.action,e.$c,e.data,e.H)}function Xh(t){var e;return e=Ge.ub().kc,!t.xf&&!t.Ee&&e}g=Kh.prototype,g.Fa=function(t,e,n){var i=++this.Lg;t={r:i,a:t,b:e},this.f(B(t)),K(this.oa,"sendRequest call when we're not connected not allowed."),this.Ia.Fa(t),n&&(this.Td[i]=n)},g.yf=function(t,e,n,i){var r=t.va(),o=t.path.toString();this.f("Listen called for "+o+" "+r),this.$[o]=this.$[o]||{},K(fe(t.n)||!S(t.n),"listen() called for non-default but complete query"),K(!this.$[o][r],"listen() called twice for same path/queryId."),t={H:i,xd:e,Ig:t,tag:n},this.$[o][r]=t,this.oa&&Oh(this,t)},g.M=function(t,e,n){this.Aa={ig:t,of:!1,zc:e,md:n},this.f("Authenticating using credential: "+t),Qh(this),(e=40==t.length)||(e="object"===_typeof(t=$c(t).Bc)&&!0===w(t,"admin")),e&&(this.f("Admin auth credential detected.  Reducing max reconnect time."),this.Fd=3e4)},g.ge=function(t){delete this.Aa,this.oa&&this.Fa("unauth",{},function(e){t(e.s,e.d)})},g.Rf=function(t,e){var n=t.path.toString(),i=t.va();if(this.f("Unlisten called for "+n+" "+i),K(fe(t.n)||!S(t.n),"unlisten() called for non-default but complete query"),Ph(this,n,i)&&this.oa){var r=ee(t.n);this.f("Unlisten on "+n+" for "+i),n={p:n},e&&(n.q=r,n.t=e),this.Fa("n",n)}},g.Me=function(t,e,n){this.oa?Rh(this,"o",t,e,n):this.Vc.push({$c:t,action:"o",data:e,H:n})},g.Cf=function(t,e,n){this.oa?Rh(this,"om",t,e,n):this.Vc.push({$c:t,action:"om",data:e,H:n})},g.Jd=function(t,e){this.oa?Rh(this,"oc",t,null,e):this.Vc.push({$c:t,action:"oc",data:null,H:e})},g.put=function(t,e,n,i){Sh(this,"p",t,e,n,i)},g.zf=function(t,e,n,i){Sh(this,"m",t,e,n,i)},g.Ue=function(t){this.oa&&(t={c:t},this.f("reportStats",t),this.Fa("s",t,function(t){"ok"!==t.s&&this.f("reportStats","Error sending stats: "+t.d)}))},g.Id=function(t){if("r"in t){this.f("from server: "+B(t));var e=t.r,n=this.Td[e];n&&(delete this.Td[e],n(t.b))}else{if("error"in t)throw"A server-side error has occurred: "+t.error;"a"in t&&(e=t.a,n=t.b,this.f("handleServerMessage",e,n),"d"===e?this.Gb(n.p,n.d,!1,n.t):"m"===e?this.Gb(n.p,n.d,!0,n.t):"c"===e?Uh(this,n.p,n.q):"ac"===e?(t=n.s,e=n.d,n=this.Aa,delete this.Aa,n&&n.md&&n.md(t,e)):"sd"===e?this.We?this.We(n):"msg"in n&&"undefined"!=typeof console&&console.log("FIREBASE: "+n.msg.replace("\n","\nFIREBASE: ")):Nc("Unrecognized action received from server: "+B(e)+"\nAre you using the latest client?"))}},g.Wc=function(t,e){if(this.f("connection ready"),this.oa=!0,this.Lc=(new Date).getTime(),this.Oe({serverTimeOffset:t-(new Date).getTime()}),this.Bb=e,this.nf){var n={};n["sdk.js."+hb.replace(/\./g,"-")]=1,yg()&&(n["framework.cordova"]=1),this.Ue(n)}Vh(this),this.nf=!1,this.Uc(!0)},g.Cg=function(t){t&&!this.Ob&&this.Za===this.Fd&&(this.f("Window became visible.  Reducing delay."),this.Za=1e3,this.Ia||Mh(this,0)),this.Ob=t},g.Ag=function(t){t?(this.f("Browser went online."),this.Za=1e3,this.Ia||Mh(this,0)):(this.f("Browser went offline.  Killing connection."),this.Ia&&this.Ia.close())},g.Df=function(){this.f("data client disconnected"),this.oa=!1,this.Ia=null;for(var t=0;t<this.qa.length;t++){var e=this.qa[t];e&&"h"in e.Jf&&e.Jg&&(e.H&&e.H("disconnect"),delete this.qa[t],this.Yc--)}0===this.Yc&&(this.qa=[]),this.Td={},Xh(this)&&(this.Ob?this.Lc&&(3e4<(new Date).getTime()-this.Lc&&(this.Za=1e3),this.Lc=null):(this.f("Window isn't visible.  Delaying reconnect."),this.Za=this.Fd,this.Ge=(new Date).getTime()),t=Math.max(0,this.Za-((new Date).getTime()-this.Ge)),t*=Math.random(),this.f("Trying to reconnect in "+t+"ms"),Mh(this,t),this.Za=Math.min(this.Fd,1.3*this.Za)),this.Uc(!1)},g.yb=function(){this.Ee=!0,this.Ia?this.Ia.close():(this.sb&&(clearTimeout(this.sb),this.sb=null),this.oa&&this.Df())},g.rc=function(){this.Ee=!1,this.Za=1e3,this.Ia||Mh(this,0)};var V={og:function(){ih=rh=!0}};function Q(t,e,n){this.A=t,this.W=e,this.g=n}function Yh(t,e){this.F=t,this.Ua=Rb(t),this.fd=null,this.da=new vb,this.Hd=1,this.Ra=null,e||0<=("object"===("undefined"==typeof window?"undefined":_typeof(window))&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)?(this.ba=new Ae(this.F,q(this.Gb,this)),setTimeout(q(this.Uc,this,!0),0)):this.ba=this.Ra=new Kh(this.F,q(this.Gb,this),q(this.Uc,this),q(this.Oe,this)),this.Sg=Sb(t,q(function(){return new Mb(this.Ua,this.ba)},this)),this.uc=new Rf,this.Ce=new ob;var n=this;this.Cd=new vf({Xe:function(t,e,i,r){return e=[],(i=n.Ce.j(t.path)).e()||(e=xf(n.Cd,new Xb(bf,t.path,i)),setTimeout(function(){r("ok")},0)),e},ae:ba}),Zh(this,"connected",!1),this.la=new qc,this.M=new Sg(t,q(this.ba.M,this.ba),q(this.ba.ge,this.ba),q(this.Le,this)),this.sd=0,this.De=null,this.L=new vf({Xe:function(t,e,i,r){return n.ba.yf(t,i,e,function(e,i){var o=r(e,i);Ab(n.da,t.path,o)}),[]},ae:function(t,e){n.ba.Rf(t,e)}})}function $h(t){return t=t.Ce.j(new L(".info/serverTimeOffset")).I()||0,(new Date).getTime()+t}function ai(t){return(t=t={timestamp:$h(t)}).timestamp=t.timestamp||(new Date).getTime(),t}function Zh(t,e,n){e=new L("/.info/"+e),n=M(n);var i=t.Ce;i.Wd=i.Wd.G(e,n),n=xf(t.Cd,new Xb(bf,e,n)),Ab(t.da,e,n)}function ci(t){t.f("onDisconnectEvents");var e=ai(t),n=[];rc(pc(t.la,e),G,function(e,i){n=n.concat(xf(t.L,new Xb(bf,e,i)));var r=ei(t,e);bi(t,r)}),t.la=new qc,Ab(t.da,G,n)}function fi(t,e,n,i){var r=M(n);t.ba.Me(e.toString(),r.I(!0),function(n,o){"ok"===n&&t.la.nc(e,r),di(i,n,o)})}function gi(t,e,n,i,r){var o=M(n,i);t.ba.Me(e.toString(),o.I(!0),function(n,i){"ok"===n&&t.la.nc(e,o),di(r,n,i)})}function hi(t,e,n,i){var r,o=!0;for(r in n)o=!1;o?(Cb("onDisconnect().update() called with empty data.  Don't do anything."),di(i,"ok")):t.ba.Cf(e.toString(),n,function(r,o){if("ok"===r)for(var a in n){var s=M(n[a]);t.la.nc(e.u(a),s)}di(i,r,o)})}function ii(t,e,n){n=".info"===E(e.path)?t.Cd.Pb(e,n):t.L.Pb(e,n),yb(t.da,e.path,n)}function di(t,e,n){t&&Db(function(){if("ok"==e)t(null);else{var i=(e||"error").toUpperCase(),r=i;n&&(r+=": "+n),(r=Error(r)).code=i,t(r)}})}function ji(t,e,i,r,o){function a(){}t.f("transaction on "+e);var s=new U(t,e);if(s.Eb("value",a),i={path:e,update:i,H:r,status:null,Ff:Ec(),cf:o,Lf:0,ie:function(){s.ic("value",a)},ke:null,Ba:null,pd:null,qd:null,rd:null},r=t.L.za(e,void 0)||C,i.pd=r,n(r=i.update(r.I()))){cg("transaction failed: Data returned ",r,i.path),i.status=1;var u=(o=Sf(t.uc,e)).Ca()||[];u.push(i),Tf(o,u),"object"===_typeof(r)&&null!==r&&v(r,".priority")?K(ag(u=w(r,".priority")),"Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null."):u=(t.L.za(e)||C).C().I(),o=ai(t),o=sc(r=M(r,u),o),i.qd=r,i.rd=o,i.Ba=t.Hd++,i=wf(t.L,e,o,i.Ba,i.cf),Ab(t.da,e,i),ki(t)}else i.ie(),i.qd=null,i.rd=null,i.H&&(t=new Q(i.pd,new U(t,i.path),N),i.H(null,!1,t))}function ki(t,e){var n=e||t.uc;if(e||li(t,n),null!==n.Ca()){var i=mi(t,n);K(0<i.length,"Sending zero length transaction queue"),Sa(i,function(t){return 1===t.status})&&ni(t,n.path(),i)}else n.wd()&&n.P(function(e){ki(t,e)})}function ni(t,e,n){for(var i=Qa(n,function(t){return t.Ba}),r=(i=r=t.L.za(e,i)||C,r.hash()),o=0;o<n.length;o++){var a=n[o];K(1===a.status,"tryToSendTransactionQueue_: items in queue should all be run."),a.status=2,a.Lf++;var s=T(e,a.path);i=i.G(s,a.qd)}i=i.I(!0),t.ba.put(e.toString(),i,function(i){t.f("transaction put response",{path:e.toString(),status:i});var r=[];if("ok"===i){for(i=[],o=0;o<n.length;o++){if(n[o].status=3,r=r.concat(zf(t.L,n[o].Ba)),n[o].H){var a=n[o].rd,s=new U(t,n[o].path);i.push(q(n[o].H,null,null,!0,new Q(a,s,N)))}n[o].ie()}for(li(t,Sf(t.uc,e)),ki(t),Ab(t.da,e,r),o=0;o<i.length;o++)Db(i[o])}else{if("datastale"===i)for(o=0;o<n.length;o++)n[o].status=4===n[o].status?5:1;else for(O("transaction at "+e.toString()+" failed: "+i),o=0;o<n.length;o++)n[o].status=5,n[o].ke=i;bi(t,e)}},r)}function bi(t,e){var n,i=(n=oi(t,e)).path();return pi(t,n=mi(t,n),i),i}function pi(t,e,i){if(0!==e.length){for(var r=[],o=[],a=Qa(e,function(t){return t.Ba}),s=0;s<e.length;s++){var u,h=e[s],c=T(i,h.path),f=!1;if(K(null!==c,"rerunTransactionsUnderNode_: relativePath should not be null."),5===h.status)f=!0,u=h.ke,o=o.concat(zf(t.L,h.Ba,!0));else if(1===h.status)if(25<=h.Lf)f=!0,u="maxretry",o=o.concat(zf(t.L,h.Ba,!0));else{var l=t.L.za(h.path,a)||C;h.pd=l;var d=e[s].update(l.I());n(d)?(cg("transaction failed: Data returned ",d,h.path),c=M(d),"object"===_typeof(d)&&null!=d&&v(d,".priority")||(c=c.ga(l.C())),l=h.Ba,d=sc(c,d=ai(t)),h.qd=c,h.rd=d,h.Ba=t.Hd++,Va(a,l),o=(o=o.concat(wf(t.L,h.path,d,h.Ba,h.cf))).concat(zf(t.L,l,!0))):(f=!0,u="nodata",o=o.concat(zf(t.L,h.Ba,!0)))}Ab(t.da,i,o),o=[],f&&(e[s].status=3,setTimeout(e[s].ie,Math.floor(0)),e[s].H&&("nodata"===u?(h=new U(t,e[s].path),r.push(q(e[s].H,null,null,!1,new Q(e[s].pd,h,N)))):r.push(q(e[s].H,null,Error(u),!1,null))))}for(li(t,t.uc),s=0;s<r.length;s++)Db(r[s]);ki(t)}}function oi(t,e){for(var n,i=t.uc;null!==(n=E(e))&&null===i.Ca();)i=Sf(i,n),e=H(e);return i}function mi(t,e){var n=[];return qi(t,e,n),n.sort(function(t,e){return t.Ff-e.Ff}),n}function qi(t,e,n){var i=e.Ca();if(null!==i)for(var r=0;r<i.length;r++)n.push(i[r]);e.P(function(e){qi(t,e,n)})}function li(t,e){var n=e.Ca();if(n){for(var i=0,r=0;r<n.length;r++)3!==n[r].status&&(n[i]=n[r],i++);n.length=i,Tf(e,0<n.length?n:null)}e.P(function(e){li(t,e)})}function ei(t,e){var n=oi(t,e).path(),i=Sf(t.uc,e);return Wf(i,function(e){ri(t,e)}),ri(t,i),Vf(i,function(e){ri(t,e)}),n}function ri(t,e){var n=e.Ca();if(null!==n){for(var i=[],r=[],o=-1,a=0;a<n.length;a++)4!==n[a].status&&(2===n[a].status?(K(o===a-1,"All SENT items should be at beginning of queue."),o=a,n[a].status=4,n[a].ke="set"):(K(1===n[a].status,"Unexpected transaction status in abort"),n[a].ie(),r=r.concat(zf(t.L,n[a].Ba,!0)),n[a].H&&i.push(q(n[a].H,null,Error("set"),!1,null))));for(-1===o?Tf(e,null):n.length=o+1,Ab(t.da,e.path(),r),a=0;a<i.length;a++)Db(i[a])}}function W(){this.oc={},this.Sf=!1}function X(t,e){this.bd=t,this.ra=e}function Y(t,e,n,i){this.k=t,this.path=e,this.n=n,this.lc=i}function si(t){var e=null,n=null;if(t.ma&&(e=nd(t)),t.pa&&(n=pd(t)),t.g===Qd){if(t.ma){if("[MIN_NAME]"!=md(t))throw Error("Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().");if("string"!=typeof e)throw Error("Query: When ordering by key, the argument passed to startAt(), endAt(),or equalTo() must be a string.")}if(t.pa){if("[MAX_NAME]"!=od(t))throw Error("Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().");if("string"!=typeof n)throw Error("Query: When ordering by key, the argument passed to startAt(), endAt(),or equalTo() must be a string.")}}else if(t.g===N){if(null!=e&&!ag(e)||null!=n&&!ag(n))throw Error("Query: When ordering by priority, the first argument passed to startAt(), endAt(), or equalTo() must be a valid priority value (null, a number, or a string).")}else if(K(t.g instanceof Ud||t.g===$d,"unknown index type."),null!=e&&"object"===_typeof(e)||null!=n&&"object"===_typeof(n))throw Error("Query: First argument passed to startAt(), endAt(), or equalTo() cannot be an object.")}function ti(t){if(t.ma&&t.pa&&t.ja&&(!t.ja||""===t.Nb))throw Error("Query: Can't combine startAt(), endAt(), and limit(). Use limitToFirst() or limitToLast() instead.")}function ui(t,e){if(!0===t.lc)throw Error(e+": You can't combine multiple orderBy calls.")}function vi(t,e,n){var i={cancel:null,Ma:null};if(e&&n)i.cancel=e,A(t,3,i.cancel,!0),i.Ma=n,mb(t,4,i.Ma);else if(e)if("object"===_typeof(e)&&null!==e)i.Ma=e;else{if("function"!=typeof e)throw Error(y(t,3,!0)+" must either be a cancel callback or a context object.");i.cancel=e}return i}V.forceLongPolling=V.og,V.pg=function(){jh=!0},V.forceWebSockets=V.pg,V.Pg=function(t,e){t.k.Ra.We=e},V.setSecurityDebugCallback=V.Pg,V.Ye=function(t,e){t.k.Ye(e)},V.stats=V.Ye,V.Ze=function(t,e){t.k.Ze(e)},V.statsIncrementCounter=V.Ze,V.sd=function(t){return t.k.sd},V.dataUpdateCount=V.sd,V.sg=function(t,e){t.k.De=e},V.interceptServerData=V.sg,V.yg=function(t){new Ig(t)},V.onPopupOpen=V.yg,V.Ng=function(t){sg=t},V.setAuthenticationServer=V.Ng,Q.prototype.I=function(){return x("Firebase.DataSnapshot.val",0,0,arguments.length),this.A.I()},Q.prototype.val=Q.prototype.I,Q.prototype.mf=function(){return x("Firebase.DataSnapshot.exportVal",0,0,arguments.length),this.A.I(!0)},Q.prototype.exportVal=Q.prototype.mf,Q.prototype.ng=function(){return x("Firebase.DataSnapshot.exists",0,0,arguments.length),!this.A.e()},Q.prototype.exists=Q.prototype.ng,Q.prototype.u=function(t){x("Firebase.DataSnapshot.child",0,1,arguments.length),ga(t)&&(t=String(t)),ig("Firebase.DataSnapshot.child",t);var e=new L(t),n=this.W.u(e);return new Q(this.A.Q(e),n,N)},Q.prototype.child=Q.prototype.u,Q.prototype.Da=function(t){x("Firebase.DataSnapshot.hasChild",1,1,arguments.length),ig("Firebase.DataSnapshot.hasChild",t);var e=new L(t);return!this.A.Q(e).e()},Q.prototype.hasChild=Q.prototype.Da,Q.prototype.C=function(){return x("Firebase.DataSnapshot.getPriority",0,0,arguments.length),this.A.C().I()},Q.prototype.getPriority=Q.prototype.C,Q.prototype.forEach=function(t){if(x("Firebase.DataSnapshot.forEach",1,1,arguments.length),A("Firebase.DataSnapshot.forEach",1,t,!1),this.A.K())return!1;var e=this;return!!this.A.P(this.g,function(n,i){return t(new Q(i,e.W.u(n),N))})},Q.prototype.forEach=Q.prototype.forEach,Q.prototype.wd=function(){return x("Firebase.DataSnapshot.hasChildren",0,0,arguments.length),!this.A.K()&&!this.A.e()},Q.prototype.hasChildren=Q.prototype.wd,Q.prototype.name=function(){return O("Firebase.DataSnapshot.name() being deprecated. Please use Firebase.DataSnapshot.key() instead."),x("Firebase.DataSnapshot.name",0,0,arguments.length),this.key()},Q.prototype.name=Q.prototype.name,Q.prototype.key=function(){return x("Firebase.DataSnapshot.key",0,0,arguments.length),this.W.key()},Q.prototype.key=Q.prototype.key,Q.prototype.Db=function(){return x("Firebase.DataSnapshot.numChildren",0,0,arguments.length),this.A.Db()},Q.prototype.numChildren=Q.prototype.Db,Q.prototype.Ib=function(){return x("Firebase.DataSnapshot.ref",0,0,arguments.length),this.W},Q.prototype.ref=Q.prototype.Ib,g=Yh.prototype,g.toString=function(){return(this.F.kb?"https://":"http://")+this.F.host},g.name=function(){return this.F.hc},g.Gb=function(t,e,n,i){this.sd++;var r=new L(t);e=this.De?this.De(t,e):e,t=[],i?n?(e=na(e,function(t){return M(t)}),t=Ff(this.L,r,e,i)):(e=M(e),t=Bf(this.L,r,e,i)):n?(i=na(e,function(t){return M(t)}),t=Af(this.L,r,i)):(i=M(e),t=xf(this.L,new Xb(bf,r,i))),i=r,0<t.length&&(i=bi(this,r)),Ab(this.da,i,t)},g.Uc=function(t){Zh(this,"connected",t),!1===t&&ci(this)},g.Oe=function(t){var e=this;Wc(t,function(t,n){Zh(e,n,t)})},g.Le=function(t){Zh(this,"authenticated",t)},g.Kb=function(t,e,n,i){this.f("set",{path:t.toString(),value:e,$g:n});var r=ai(this),o=(r=sc(e=M(e,n),r),this.Hd++);r=wf(this.L,t,r,o,!0);wb(this.da,r);var a=this;this.ba.put(t.toString(),e.I(!0),function(e,n){var r="ok"===e;r||O("set at "+t+" failed: "+e),r=zf(a.L,o,!r),Ab(a.da,t,r),di(i,e,n)}),bi(this,r=ei(this,t)),Ab(this.da,r,[])},g.update=function(t,e,n){this.f("update",{path:t.toString(),value:e});var i=!0,o=ai(this),a={};if(r(e,function(t,e){i=!1;var n=M(t);a[e]=sc(n,o)}),i)Cb("update() called with empty data.  Don't do anything."),di(n,"ok");else{var s=this.Hd++,u=yf(this.L,t,a,s);wb(this.da,u);var h=this;this.ba.zf(t.toString(),e,function(e,i){(r="ok"===e)||O("update at "+t+" failed: "+e);var r=zf(h.L,s,!r),o=t;0<r.length&&(o=bi(h,t)),Ab(h.da,o,r),di(n,e,i)}),bi(this,e=ei(this,t)),Ab(this.da,t,[])}},g.Jd=function(t,e){var n=this;this.ba.Jd(t.toString(),function(i,r){"ok"===i&&rg(n.la,t),di(e,i,r)})},g.yb=function(){this.Ra&&this.Ra.yb()},g.rc=function(){this.Ra&&this.Ra.rc()},g.Ye=function(t){if("undefined"!=typeof console){t?(this.fd||(this.fd=new Lb(this.Ua)),t=this.fd.get()):t=this.Ua.get();var e,n=Ra(sa(t),function(t,e){return Math.max(e.length,t)},0);for(e in t){for(var i=t[e],r=e.length;r<n+2;r++)e+=" ";console.log(e+i)}}},g.Ze=function(t){Ob(this.Ua,t),this.Sg.Of[t]=!0},g.f=function(t){var e="";this.Ra&&(e=this.Ra.id+":"),Cb(e,arguments)},W.prototype.yb=function(){for(var t in this.oc)this.oc[t].yb()},W.prototype.rc=function(){for(var t in this.oc)this.oc[t].rc()},W.prototype.ve=function(){this.Sf=!0},ca(W),W.prototype.interrupt=W.prototype.yb,W.prototype.resume=W.prototype.rc,X.prototype.cancel=function(t){x("Firebase.onDisconnect().cancel",0,1,arguments.length),A("Firebase.onDisconnect().cancel",1,t,!0),this.bd.Jd(this.ra,t||null)},X.prototype.cancel=X.prototype.cancel,X.prototype.remove=function(t){x("Firebase.onDisconnect().remove",0,1,arguments.length),jg("Firebase.onDisconnect().remove",this.ra),A("Firebase.onDisconnect().remove",1,t,!0),fi(this.bd,this.ra,null,t)},X.prototype.remove=X.prototype.remove,X.prototype.set=function(t,e){x("Firebase.onDisconnect().set",1,2,arguments.length),jg("Firebase.onDisconnect().set",this.ra),bg("Firebase.onDisconnect().set",t,this.ra,!1),A("Firebase.onDisconnect().set",2,e,!0),fi(this.bd,this.ra,t,e)},X.prototype.set=X.prototype.set,X.prototype.Kb=function(t,e,n){x("Firebase.onDisconnect().setWithPriority",2,3,arguments.length),jg("Firebase.onDisconnect().setWithPriority",this.ra),bg("Firebase.onDisconnect().setWithPriority",t,this.ra,!1),fg("Firebase.onDisconnect().setWithPriority",2,e),A("Firebase.onDisconnect().setWithPriority",3,n,!0),gi(this.bd,this.ra,t,e,n)},X.prototype.setWithPriority=X.prototype.Kb,X.prototype.update=function(t,e){if(x("Firebase.onDisconnect().update",1,2,arguments.length),jg("Firebase.onDisconnect().update",this.ra),ea(t)){for(var n={},i=0;i<t.length;++i)n[""+i]=t[i];t=n,O("Passing an Array to Firebase.onDisconnect().update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.")}eg("Firebase.onDisconnect().update",t,this.ra),A("Firebase.onDisconnect().update",2,e,!0),hi(this.bd,this.ra,t,e)},X.prototype.update=X.prototype.update,g=Y.prototype,g.Ib=function(){return x("Query.ref",0,0,arguments.length),new U(this.k,this.path)},g.Eb=function(t,e,n,i){x("Query.on",2,4,arguments.length),gg("Query.on",t,!1),A("Query.on",2,e,!1);var r=vi("Query.on",n,i);if("value"===t)ii(this.k,this,new id(e,r.cancel||null,r.Ma||null));else{var o={};o[t]=e,ii(this.k,this,new jd(o,r.cancel,r.Ma))}return e},g.ic=function(t,e,n){x("Query.off",0,3,arguments.length),gg("Query.off",t,!0),A("Query.off",2,e,!0),mb("Query.off",3,n);var i=null,r=null;"value"===t?i=new id(e||null,null,n||null):t&&(e&&((r={})[t]=e),i=new jd(r,null,n||null)),r=this.k,i=".info"===E(this.path)?r.Cd.jb(this,i):r.L.jb(this,i),yb(r.da,this.path,i)},g.Dg=function(t,e){function n(a){o&&(o=!1,r.ic(t,n),e.call(i.Ma,a))}x("Query.once",2,4,arguments.length),gg("Query.once",t,!1),A("Query.once",2,e,!1);var i=vi("Query.once",arguments[2],arguments[3]),r=this,o=!0;this.Eb(t,n,function(e){r.ic(t,n),i.cancel&&i.cancel.call(i.Ma,e)})},g.He=function(t){if(O("Query.limit() being deprecated. Please use Query.limitToFirst() or Query.limitToLast() instead."),x("Query.limit",1,1,arguments.length),!ga(t)||Math.floor(t)!==t||0>=t)throw Error("Query.limit: First argument must be a positive integer.");if(this.n.ja)throw Error("Query.limit: Limit was already set (by another call to limit, limitToFirst, orlimitToLast.");var e=this.n.He(t);return ti(e),new Y(this.k,this.path,e,this.lc)},g.Ie=function(t){if(x("Query.limitToFirst",1,1,arguments.length),!ga(t)||Math.floor(t)!==t||0>=t)throw Error("Query.limitToFirst: First argument must be a positive integer.");if(this.n.ja)throw Error("Query.limitToFirst: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new Y(this.k,this.path,this.n.Ie(t),this.lc)},g.Je=function(t){if(x("Query.limitToLast",1,1,arguments.length),!ga(t)||Math.floor(t)!==t||0>=t)throw Error("Query.limitToLast: First argument must be a positive integer.");if(this.n.ja)throw Error("Query.limitToLast: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new Y(this.k,this.path,this.n.Je(t),this.lc)},g.Eg=function(t){if(x("Query.orderByChild",1,1,arguments.length),"$key"===t)throw Error('Query.orderByChild: "$key" is invalid.  Use Query.orderByKey() instead.');if("$priority"===t)throw Error('Query.orderByChild: "$priority" is invalid.  Use Query.orderByPriority() instead.');if("$value"===t)throw Error('Query.orderByChild: "$value" is invalid.  Use Query.orderByValue() instead.');ig("Query.orderByChild",t),ui(this,"Query.orderByChild");var e=new L(t);if(e.e())throw Error("Query.orderByChild: cannot pass in empty path.  Use Query.orderByValue() instead.");return e=new Ud(e),si(e=de(this.n,e)),new Y(this.k,this.path,e,!0)},g.Fg=function(){x("Query.orderByKey",0,0,arguments.length),ui(this,"Query.orderByKey");var t=de(this.n,Qd);return si(t),new Y(this.k,this.path,t,!0)},g.Gg=function(){x("Query.orderByPriority",0,0,arguments.length),ui(this,"Query.orderByPriority");var t=de(this.n,N);return si(t),new Y(this.k,this.path,t,!0)},g.Hg=function(){x("Query.orderByValue",0,0,arguments.length),ui(this,"Query.orderByValue");var t=de(this.n,$d);return si(t),new Y(this.k,this.path,t,!0)},g.$d=function(t,e){x("Query.startAt",0,2,arguments.length),bg("Query.startAt",t,this.path,!0),hg("Query.startAt",e);var i=this.n.$d(t,e);if(ti(i),si(i),this.n.ma)throw Error("Query.startAt: Starting point was already set (by another call to startAt or equalTo).");return n(t)||(e=t=null),new Y(this.k,this.path,i,this.lc)},g.td=function(t,e){x("Query.endAt",0,2,arguments.length),bg("Query.endAt",t,this.path,!0),hg("Query.endAt",e);var n=this.n.td(t,e);if(ti(n),si(n),this.n.pa)throw Error("Query.endAt: Ending point was already set (by another call to endAt or equalTo).");return new Y(this.k,this.path,n,this.lc)},g.kg=function(t,e){if(x("Query.equalTo",1,2,arguments.length),bg("Query.equalTo",t,this.path,!1),hg("Query.equalTo",e),this.n.ma)throw Error("Query.equalTo: Starting point was already set (by another call to endAt or equalTo).");if(this.n.pa)throw Error("Query.equalTo: Ending point was already set (by another call to endAt or equalTo).");return this.$d(t,e).td(t,e)},g.toString=function(){x("Query.toString",0,0,arguments.length);for(var t=this.path,e="",n=t.Z;n<t.o.length;n++)""!==t.o[n]&&(e+="/"+encodeURIComponent(String(t.o[n])));return this.k.toString()+(e||"/")},g.va=function(){var t=Uc(ee(this.n));return"{}"===t?"default":t},Y.prototype.ref=Y.prototype.Ib,Y.prototype.on=Y.prototype.Eb,Y.prototype.off=Y.prototype.ic,Y.prototype.once=Y.prototype.Dg,Y.prototype.limit=Y.prototype.He,Y.prototype.limitToFirst=Y.prototype.Ie,Y.prototype.limitToLast=Y.prototype.Je,Y.prototype.orderByChild=Y.prototype.Eg,Y.prototype.orderByKey=Y.prototype.Fg,Y.prototype.orderByPriority=Y.prototype.Gg,Y.prototype.orderByValue=Y.prototype.Hg,Y.prototype.startAt=Y.prototype.$d,Y.prototype.endAt=Y.prototype.td,Y.prototype.equalTo=Y.prototype.kg,Y.prototype.toString=Y.prototype.toString;var Z={};function U(t,e){var n,i,r;if(t instanceof Yh)n=t,i=e;else{var o;if(x("new Firebase",1,2,arguments.length),n=(i=Pc(arguments[0])).Tg,"firebase"===i.domain&&Oc(i.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),n&&"undefined"!=n||Oc("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),i.kb||"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&O("Insecure Firebase access from a secure page. Please use https in calls to new Firebase()."),n=new zc(i.host,i.kb,n,"ws"===i.scheme||"wss"===i.scheme),r=(i=new L(i.$c)).toString(),!(o=!p(n.host)||0===n.host.length||!$f(n.hc))&&(o=0!==r.length)&&(r&&(r=r.replace(/^\/*\.info(\/|$)/,"/")),o=!(p(r)&&0!==r.length&&!Yf.test(r))),o)throw Error(y("new Firebase",1,!1)+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".');if(e)if(e instanceof W)r=e;else{if(!p(e))throw Error("Expected a valid Firebase.Context for second argument to new Firebase()");r=W.ub(),n.Od=e}else r=W.ub();o=n.toString();var a=w(r.oc,o);a||(a=new Yh(n,r.Sf),r.oc[o]=a),n=a}Y.call(this,n,i,be,!1)}Z.vc=Kh,Z.DataConnection=Z.vc,Kh.prototype.Rg=function(t,e){this.Fa("q",{p:t},e)},Z.vc.prototype.simpleListen=Z.vc.prototype.Rg,Kh.prototype.jg=function(t,e){this.Fa("echo",{d:t},e)},Z.vc.prototype.echo=Z.vc.prototype.jg,Kh.prototype.interrupt=Kh.prototype.yb,Z.Vf=yh,Z.RealTimeConnection=Z.Vf,yh.prototype.sendRequest=yh.prototype.Fa,yh.prototype.close=yh.prototype.close,Z.rg=function(t){var e=Kh.prototype.put;return Kh.prototype.put=function(i,r,o,a){n(a)&&(a=t()),e.call(this,i,r,o,a)},function(){Kh.prototype.put=e}},Z.hijackHash=Z.rg,Z.Uf=zc,Z.ConnectionTarget=Z.Uf,Z.va=function(t){return t.va()},Z.queryIdentifier=Z.va,Z.tg=function(t){return t.k.Ra.$},Z.listens=Z.tg,Z.ve=function(t){t.ve()},Z.forceRestClient=Z.ve,ma(U,Y);var wi=U,xi=["Firebase"],yi=aa,zi;xi[0]in yi||!yi.execScript||yi.execScript("var "+xi[0]);for(;xi.length&&(zi=xi.shift());)!xi.length&&n(wi)?yi[zi]=wi:yi=yi[zi]?yi[zi]:yi[zi]={};function Lc(t,e){K(!e||!0===t||!1===t,"Can't turn on custom loggers persistently."),!0===t?("undefined"!=typeof console&&("function"==typeof console.log?Bb=q(console.log,console):"object"===_typeof(console.log)&&(Bb=function(t){console.log(t)})),e&&yc.set("logging_enabled",!0)):t?Bb=t:(Bb=null,yc.remove("logging_enabled"))}U.goOffline=function(){x("Firebase.goOffline",0,0,arguments.length),W.ub().yb()},U.goOnline=function(){x("Firebase.goOnline",0,0,arguments.length),W.ub().rc()},U.enableLogging=Lc,U.ServerValue={TIMESTAMP:{".sv":"timestamp"}},U.SDK_VERSION=hb,U.INTERNAL=V,U.Context=W,U.TEST_ACCESS=Z,U.prototype.name=function(){return O("Firebase.name() being deprecated. Please use Firebase.key() instead."),x("Firebase.name",0,0,arguments.length),this.key()},U.prototype.name=U.prototype.name,U.prototype.key=function(){return x("Firebase.key",0,0,arguments.length),this.path.e()?null:Ld(this.path)},U.prototype.key=U.prototype.key,U.prototype.u=function(t){if(x("Firebase.child",1,1,arguments.length),ga(t))t=String(t);else if(!(t instanceof L))if(null===E(this.path)){var e=t;e&&(e=e.replace(/^\/*\.info(\/|$)/,"/")),ig("Firebase.child",e)}else ig("Firebase.child",t);return new U(this.k,this.path.u(t))},U.prototype.child=U.prototype.u,U.prototype.parent=function(){x("Firebase.parent",0,0,arguments.length);var t=this.path.parent();return null===t?null:new U(this.k,t)},U.prototype.parent=U.prototype.parent,U.prototype.root=function(){x("Firebase.ref",0,0,arguments.length);for(var t=this;null!==t.parent();)t=t.parent();return t},U.prototype.root=U.prototype.root,U.prototype.set=function(t,e){x("Firebase.set",1,2,arguments.length),jg("Firebase.set",this.path),bg("Firebase.set",t,this.path,!1),A("Firebase.set",2,e,!0),this.k.Kb(this.path,t,null,e||null)},U.prototype.set=U.prototype.set,U.prototype.update=function(t,e){if(x("Firebase.update",1,2,arguments.length),jg("Firebase.update",this.path),ea(t)){for(var n={},i=0;i<t.length;++i)n[""+i]=t[i];t=n,O("Passing an Array to Firebase.update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.")}eg("Firebase.update",t,this.path),A("Firebase.update",2,e,!0),this.k.update(this.path,t,e||null)},U.prototype.update=U.prototype.update,U.prototype.Kb=function(t,e,n){if(x("Firebase.setWithPriority",2,3,arguments.length),jg("Firebase.setWithPriority",this.path),bg("Firebase.setWithPriority",t,this.path,!1),fg("Firebase.setWithPriority",2,e),A("Firebase.setWithPriority",3,n,!0),".length"===this.key()||".keys"===this.key())throw"Firebase.setWithPriority failed: "+this.key()+" is a read-only object.";this.k.Kb(this.path,t,e,n||null)},U.prototype.setWithPriority=U.prototype.Kb,U.prototype.remove=function(t){x("Firebase.remove",0,1,arguments.length),jg("Firebase.remove",this.path),A("Firebase.remove",1,t,!0),this.set(null,t)},U.prototype.remove=U.prototype.remove,U.prototype.transaction=function(t,e,i){if(x("Firebase.transaction",1,3,arguments.length),jg("Firebase.transaction",this.path),A("Firebase.transaction",1,t,!1),A("Firebase.transaction",2,e,!0),n(i)&&"boolean"!=typeof i)throw Error(y("Firebase.transaction",3,!0)+"must be a boolean.");if(".length"===this.key()||".keys"===this.key())throw"Firebase.transaction failed: "+this.key()+" is a read-only object.";void 0===i&&(i=!0),ji(this.k,this.path,t,e||null,i)},U.prototype.transaction=U.prototype.transaction,U.prototype.Og=function(t,e){x("Firebase.setPriority",1,2,arguments.length),jg("Firebase.setPriority",this.path),fg("Firebase.setPriority",1,t),A("Firebase.setPriority",2,e,!0),this.k.Kb(this.path.u(".priority"),t,null,e)},U.prototype.setPriority=U.prototype.Og,U.prototype.push=function(t,e){x("Firebase.push",0,2,arguments.length),jg("Firebase.push",this.path),bg("Firebase.push",t,this.path,!0),A("Firebase.push",2,e,!0);var n=$h(this.k);n=Fe(n),n=this.u(n);return null!=t&&n.set(t,e),n},U.prototype.push=U.prototype.push,U.prototype.hb=function(){return jg("Firebase.onDisconnect",this.path),new X(this.k,this.path)},U.prototype.onDisconnect=U.prototype.hb,U.prototype.M=function(t,e,n){O("FirebaseRef.auth() being deprecated. Please use FirebaseRef.authWithCustomToken() instead."),x("Firebase.auth",1,3,arguments.length),kg("Firebase.auth",t),A("Firebase.auth",2,e,!0),A("Firebase.auth",3,e,!0),Yg(this.k.M,t,{},{remember:"none"},e,n)},U.prototype.auth=U.prototype.M,U.prototype.ge=function(t){x("Firebase.unauth",0,1,arguments.length),A("Firebase.unauth",1,t,!0),Zg(this.k.M,t)},U.prototype.unauth=U.prototype.ge,U.prototype.xe=function(){return x("Firebase.getAuth",0,0,arguments.length),this.k.M.xe()},U.prototype.getAuth=U.prototype.xe,U.prototype.xg=function(t,e){x("Firebase.onAuth",1,2,arguments.length),A("Firebase.onAuth",1,t,!1),mb("Firebase.onAuth",2,e),this.k.M.Eb("auth_status",t,e)},U.prototype.onAuth=U.prototype.xg,U.prototype.wg=function(t,e){x("Firebase.offAuth",1,2,arguments.length),A("Firebase.offAuth",1,t,!1),mb("Firebase.offAuth",2,e),this.k.M.ic("auth_status",t,e)},U.prototype.offAuth=U.prototype.wg,U.prototype.Zf=function(t,e,n){x("Firebase.authWithCustomToken",2,3,arguments.length),kg("Firebase.authWithCustomToken",t),A("Firebase.authWithCustomToken",2,e,!1),ng("Firebase.authWithCustomToken",3,n,!0),Yg(this.k.M,t,{},n||{},e)},U.prototype.authWithCustomToken=U.prototype.Zf,U.prototype.$f=function(t,e,n){x("Firebase.authWithOAuthPopup",2,3,arguments.length),mg("Firebase.authWithOAuthPopup",t),A("Firebase.authWithOAuthPopup",2,e,!1),ng("Firebase.authWithOAuthPopup",3,n,!0),ch(this.k.M,t,n,e)},U.prototype.authWithOAuthPopup=U.prototype.$f,U.prototype.ag=function(t,e,n){x("Firebase.authWithOAuthRedirect",2,3,arguments.length),mg("Firebase.authWithOAuthRedirect",t),A("Firebase.authWithOAuthRedirect",2,e,!1),ng("Firebase.authWithOAuthRedirect",3,n,!0);var i=this.k.M;ah(i);var r=[Kg],o=vg(n);"anonymous"===t||"firebase"===t?P(e,Mg("TRANSPORT_UNAVAILABLE")):(yc.set("redirect_client_options",o.od),bh(i,r,"/auth/"+t,o,e))},U.prototype.authWithOAuthRedirect=U.prototype.ag,U.prototype.bg=function(t,e,n,i){x("Firebase.authWithOAuthToken",3,4,arguments.length),mg("Firebase.authWithOAuthToken",t),A("Firebase.authWithOAuthToken",3,n,!1),ng("Firebase.authWithOAuthToken",4,i,!0),p(e)?(lg("Firebase.authWithOAuthToken",2,e),$g(this.k.M,t+"/token",{access_token:e},i,n)):(ng("Firebase.authWithOAuthToken",2,e,!1),$g(this.k.M,t+"/token",e,i,n))},U.prototype.authWithOAuthToken=U.prototype.bg,U.prototype.Yf=function(t,e){x("Firebase.authAnonymously",1,2,arguments.length),A("Firebase.authAnonymously",1,t,!1),ng("Firebase.authAnonymously",2,e,!0),$g(this.k.M,"anonymous",{},e,t)},U.prototype.authAnonymously=U.prototype.Yf,U.prototype.cg=function(t,e,n){x("Firebase.authWithPassword",2,3,arguments.length),ng("Firebase.authWithPassword",1,t,!1),og("Firebase.authWithPassword",t,"email"),og("Firebase.authWithPassword",t,"password"),A("Firebase.authWithPassword",2,e,!1),ng("Firebase.authWithPassword",3,n,!0),$g(this.k.M,"password",t,n,e)},U.prototype.authWithPassword=U.prototype.cg,U.prototype.se=function(t,e){x("Firebase.createUser",2,2,arguments.length),ng("Firebase.createUser",1,t,!1),og("Firebase.createUser",t,"email"),og("Firebase.createUser",t,"password"),A("Firebase.createUser",2,e,!1),this.k.M.se(t,e)},U.prototype.createUser=U.prototype.se,U.prototype.Te=function(t,e){x("Firebase.removeUser",2,2,arguments.length),ng("Firebase.removeUser",1,t,!1),og("Firebase.removeUser",t,"email"),og("Firebase.removeUser",t,"password"),A("Firebase.removeUser",2,e,!1),this.k.M.Te(t,e)},U.prototype.removeUser=U.prototype.Te,U.prototype.pe=function(t,e){x("Firebase.changePassword",2,2,arguments.length),ng("Firebase.changePassword",1,t,!1),og("Firebase.changePassword",t,"email"),og("Firebase.changePassword",t,"oldPassword"),og("Firebase.changePassword",t,"newPassword"),A("Firebase.changePassword",2,e,!1),this.k.M.pe(t,e)},U.prototype.changePassword=U.prototype.pe,U.prototype.oe=function(t,e){x("Firebase.changeEmail",2,2,arguments.length),ng("Firebase.changeEmail",1,t,!1),og("Firebase.changeEmail",t,"oldEmail"),og("Firebase.changeEmail",t,"newEmail"),og("Firebase.changeEmail",t,"password"),A("Firebase.changeEmail",2,e,!1),this.k.M.oe(t,e)},U.prototype.changeEmail=U.prototype.oe,U.prototype.Ve=function(t,e){x("Firebase.resetPassword",2,2,arguments.length),ng("Firebase.resetPassword",1,t,!1),og("Firebase.resetPassword",t,"email"),A("Firebase.resetPassword",2,e,!1),this.k.M.Ve(t,e)},U.prototype.resetPassword=U.prototype.Ve}();
},{}]},{},["djAK"], null)
