diff --git a/angular2/.gitignore b/angular2/.gitignore
index ef430a6..23f36f4 100644
--- a/angular2/.gitignore
+++ b/angular2/.gitignore
@@ -1,2 +1,4 @@
-todo.js
-node_modules
\ No newline at end of file
+.DS_Store
+node_modules
+app/**/*.js
+app/**/*.map
diff --git a/angular2/README.md b/angular2/README.md
index 6443133..a246c13 100644
--- a/angular2/README.md
+++ b/angular2/README.md
@@ -10,13 +10,20 @@ npm start
**Build**
```
-node node_modules/typescript/lib/tsc.js
+npm run build
```
**Run server**
+
+```
+npm run server
+```
+
+or
+
```
-node node_modules/http-server/bin/http-server -p 8080
+./node_modules/.bin/http-server -p 8080
```
'-p' sets the port to use, default port is 8080. If it is taken pick any port that is free.
-After server is started open 'localhost:8080' in a browser.
\ No newline at end of file
+After server is started open 'localhost:8080' in a browser.
diff --git a/angular2/app/app.component.html b/angular2/app/app.component.html
new file mode 100644
index 0000000..607b70a
--- /dev/null
+++ b/angular2/app/app.component.html
@@ -0,0 +1,23 @@
+
+
+
todos
+
+
+ 0">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/angular2/app/app.component.ts b/angular2/app/app.component.ts
new file mode 100644
index 0000000..b2a08b9
--- /dev/null
+++ b/angular2/app/app.component.ts
@@ -0,0 +1,59 @@
+import { Component } from '@angular/core';
+import { TodoStore, Todo } from './services/store';
+
+@Component({
+ selector: 'todo-app',
+ templateUrl: 'app/app.component.html',
+ viewProviders: [TodoStore]
+})
+export class TodoComponent {
+ todoStore: TodoStore;
+ newTodoText = '';
+
+ constructor(todoStore: TodoStore) {
+ this.todoStore = todoStore;
+ }
+
+ stopEditing(todo: Todo, editedTitle: string) {
+ todo.title = editedTitle;
+ todo.editing = false;
+ }
+
+ cancelEditingTodo(todo: Todo) {
+ todo.editing = false;
+ }
+
+ updateEditingTodo(todo: Todo, editedTitle: string) {
+ editedTitle = editedTitle.trim();
+ todo.editing = false;
+
+ if (editedTitle.length === 0) {
+ return this.todoStore.remove(todo);
+ }
+
+ todo.title = editedTitle;
+ }
+
+ editTodo(todo: Todo) {
+ todo.editing = true;
+ }
+
+ removeCompleted() {
+ this.todoStore.removeCompleted();
+ }
+
+ toggleCompletion(todo: Todo) {
+ this.todoStore.toggleCompletion(todo);
+ }
+
+ remove(todo: Todo){
+ this.todoStore.remove(todo);
+ }
+
+ addTodo() {
+ if (this.newTodoText.trim().length) {
+ this.todoStore.add(this.newTodoText);
+ this.newTodoText = '';
+ }
+ }
+}
diff --git a/angular2/app/app.main.ts b/angular2/app/app.main.ts
new file mode 100644
index 0000000..4b90aea
--- /dev/null
+++ b/angular2/app/app.main.ts
@@ -0,0 +1,4 @@
+import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
+import { TodoModule } from './app.module';
+const platform = platformBrowserDynamic();
+platform.bootstrapModule(TodoModule);
diff --git a/angular2/app/app.module.ts b/angular2/app/app.module.ts
new file mode 100644
index 0000000..6d534ef
--- /dev/null
+++ b/angular2/app/app.module.ts
@@ -0,0 +1,14 @@
+import { NgModule } from '@angular/core';
+import { FormsModule } from '@angular/forms'
+import { BrowserModule } from '@angular/platform-browser';
+import { TodoComponent } from './app.component';
+
+@NgModule({
+ imports: [
+ BrowserModule,
+ FormsModule
+ ],
+ declarations: [ TodoComponent ],
+ bootstrap: [ TodoComponent ]
+})
+export class TodoModule { }
diff --git a/angular2/app/services/store.ts b/angular2/app/services/store.ts
new file mode 100644
index 0000000..d5755eb
--- /dev/null
+++ b/angular2/app/services/store.ts
@@ -0,0 +1,80 @@
+import { Injectable } from '@angular/core';
+
+export class Todo {
+ completed: boolean;
+ editing: boolean;
+
+ private _title: string;
+ get title() {
+ return this._title;
+ }
+ set title(value: string) {
+ this._title = value.trim();
+ }
+
+ constructor(title: string) {
+ this.completed = false;
+ this.editing = false;
+ this.title = title.trim();
+ }
+}
+
+@Injectable()
+export class TodoStore {
+ todos: Array;
+
+ constructor() {
+ let persistedTodos = JSON.parse(localStorage.getItem('angular2-todos') || '[]');
+ // Normalize back into classes
+ this.todos = persistedTodos.map( (todo: {_title: string, completed: boolean}) => {
+ let ret = new Todo(todo._title);
+ ret.completed = todo.completed;
+ return ret;
+ });
+ }
+
+ private updateStore() {
+ localStorage.setItem('angular2-todos', JSON.stringify(this.todos));
+ }
+
+ private getWithCompleted(completed: boolean) {
+ return this.todos.filter((todo: Todo) => todo.completed === completed);
+ }
+
+ allCompleted() {
+ return this.todos.length === this.getCompleted().length;
+ }
+
+ setAllTo(completed: boolean) {
+ this.todos.forEach((t: Todo) => t.completed = completed);
+ this.updateStore();
+ }
+
+ removeCompleted() {
+ this.todos = this.getWithCompleted(false);
+ this.updateStore();
+ }
+
+ getRemaining() {
+ return this.getWithCompleted(false);
+ }
+
+ getCompleted() {
+ return this.getWithCompleted(true);
+ }
+
+ toggleCompletion(todo: Todo) {
+ todo.completed = !todo.completed;
+ this.updateStore();
+ }
+
+ remove(todo: Todo) {
+ this.todos.splice(this.todos.indexOf(todo), 1);
+ this.updateStore();
+ }
+
+ add(title: string) {
+ this.todos.push(new Todo(title));
+ this.updateStore();
+ }
+}
diff --git a/angular2/app/todo.ts b/angular2/app/todo.ts
deleted file mode 100644
index 838b483..0000000
--- a/angular2/app/todo.ts
+++ /dev/null
@@ -1,73 +0,0 @@
-import {Component, bootstrap, NgFor, provide} from 'angular2/angular2';
-import {AngularFire, FirebaseArray} from '../firebase/angularfire';
-
-@Component({
- selector: 'todo-app',
- providers: [
- AngularFire,
- provide(Firebase, { useValue: new Firebase('https://webapi.firebaseio-demo.com/test') })
- ],
- directives: [NgFor],
- templateUrl: 'todo.html'
-})
-class TodoApp {
- todoService: FirebaseArray;
- todoEdit: any;
-
- constructor(sync: AngularFire) {
- this.todoService = sync.asArray();
- this.todoEdit = null;
- }
- enterTodo($event, newTodo) {
- if($event.which === 13) { // ENTER_KEY
- this.addTodo(newTodo.value);
- newTodo.value = '';
- }
- }
- editTodo($event, todo) {
- this.todoEdit = todo;
- }
- doneEditing($event, todo) {
- var which = $event.which;
- var target = $event.target;
- if(which === 13) {
- todo.title = target.value;
- this.todoService.save(todo);
- this.todoEdit = null;
- } else if (which === 27) {
- this.todoEdit = null;
- target.value = todo.title;
- }
- }
- addTodo(newTitle) {
- this.todoService.add({
- title: newTitle,
- completed: false
- });
- }
- completeMe(todo) {
- todo.completed = !todo.completed;
- this.todoService.save(todo);
- }
- deleteMe(todo) {
- this.todoService.remove(todo);
- }
- toggleAll($event) {
- var isComplete = $event.target.checked;
- this.todoService.list.forEach((todo)=> {
- todo.completed = isComplete;
- this.todoService.save(todo);
- });
- }
- clearCompleted() {
- var toClear = {};
- this.todoService.list.forEach((todo) => {
- if(todo.completed) {
- toClear[todo._key] = null;
- }
- });
- this.todoService.bulkUpdate(toClear);
- }
-
-}
-bootstrap(TodoApp);
diff --git a/angular2/css/base.css b/angular2/css/base.css
deleted file mode 100644
index 502f06c..0000000
--- a/angular2/css/base.css
+++ /dev/null
@@ -1,379 +0,0 @@
-@charset "utf-8";
-
-button {
- margin: 0;
- padding: 0;
- border: 0;
- background: none;
- font-size: 100%;
- vertical-align: baseline;
- font-family: inherit;
- font-weight: inherit;
- color: inherit;
- -webkit-appearance: none;
- -ms-appearance: none;
- appearance: none;
- -webkit-font-smoothing: antialiased;
- -moz-font-smoothing: antialiased;
- -ms-font-smoothing: antialiased;
- font-smoothing: antialiased;
-}
-
-button,
-input[type="checkbox"] {
- outline: none;
-}
-
-.hidden {
- display: none;
-}
-
-.visible {
- display: block !important;
-}
-
-#todoapp {
- background: #fff;
- margin: 130px 0 40px 0;
- position: relative;
- box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2),
- 0 25px 50px 0 rgba(0, 0, 0, 0.1);
-}
-
-#todoapp input::-webkit-input-placeholder {
- font-style: italic;
- font-weight: 300;
- color: #e6e6e6;
-}
-
-#todoapp input::-moz-placeholder {
- font-style: italic;
- font-weight: 300;
- color: #e6e6e6;
-}
-
-#todoapp input::input-placeholder {
- font-style: italic;
- font-weight: 300;
- color: #e6e6e6;
-}
-
-#todoapp h1 {
- position: absolute;
- top: -155px;
- width: 100%;
- font-size: 100px;
- font-weight: 100;
- text-align: center;
- color: rgba(175, 47, 47, 0.15);
- -webkit-text-rendering: optimizeLegibility;
- -moz-text-rendering: optimizeLegibility;
- -ms-text-rendering: optimizeLegibility;
- text-rendering: optimizeLegibility;
-}
-
-#new-todo,
-.edit {
- position: relative;
- margin: 0;
- width: 100%;
- font-size: 24px;
- font-family: inherit;
- font-weight: inherit;
- line-height: 1.4em;
- border: 0;
- outline: none;
- color: inherit;
- padding: 6px;
- border: 1px solid #999;
- box-shadow: inset 0 -1px 5px 0 rgba(0, 0, 0, 0.2);
- -ms-box-sizing: border-box;
- box-sizing: border-box;
- -webkit-font-smoothing: antialiased;
- -moz-font-smoothing: antialiased;
- -ms-font-smoothing: antialiased;
- font-smoothing: antialiased;
-}
-
-#new-todo {
- padding: 16px 16px 16px 60px;
- border: none;
- background: rgba(0, 0, 0, 0.003);
- box-shadow: inset 0 -2px 1px rgba(0,0,0,0.03);
-}
-
-#main {
- position: relative;
- z-index: 2;
- border-top: 1px solid #e6e6e6;
-}
-
-label[for='toggle-all'] {
- display: none;
-}
-
-#toggle-all {
- position: absolute;
- top: -55px;
- left: -12px;
- width: 60px;
- height: 34px;
- text-align: center;
- border: none; /* Mobile Safari */
-}
-
-#toggle-all:before {
- content: '❯';
- font-size: 22px;
- color: #e6e6e6;
- padding: 10px 27px 10px 27px;
-}
-
-#toggle-all:checked:before {
- color: #737373;
-}
-
-#todo-list {
- margin: 0;
- padding: 0;
- list-style: none;
-}
-
-#todo-list li {
- position: relative;
- font-size: 24px;
- border-bottom: 1px solid #ededed;
-}
-
-#todo-list li:last-child {
- border-bottom: none;
-}
-
-#todo-list li.editing {
- border-bottom: none;
- padding: 0;
-}
-
-#todo-list li.editing .edit {
- display: block;
- width: 506px;
- padding: 13px 17px 12px 17px;
- margin: 0 0 0 43px;
-}
-
-#todo-list li.editing .view {
- display: none;
-}
-
-#todo-list li .toggle {
- text-align: center;
- width: 40px;
- /* auto, since non-WebKit browsers doesn't support input styling */
- height: auto;
- position: absolute;
- top: 0;
- bottom: 0;
- margin: auto 0;
- border: none; /* Mobile Safari */
- -webkit-appearance: none;
- -ms-appearance: none;
- appearance: none;
-}
-
-#todo-list li .toggle:after {
- content: url('data:image/svg+xml;utf8,');
-}
-
-#todo-list li .toggle:checked:after {
- content: url('data:image/svg+xml;utf8,');
-}
-
-#todo-list li label {
- white-space: pre;
- word-break: break-word;
- padding: 15px 60px 15px 15px;
- margin-left: 45px;
- display: block;
- line-height: 1.2;
- transition: color 0.4s;
-}
-
-#todo-list li.completed label {
- color: #d9d9d9;
- text-decoration: line-through;
-}
-
-#todo-list li .destroy {
- display: none;
- position: absolute;
- top: 0;
- right: 10px;
- bottom: 0;
- width: 40px;
- height: 40px;
- margin: auto 0;
- font-size: 30px;
- color: #cc9a9a;
- margin-bottom: 11px;
- transition: color 0.2s ease-out;
-}
-
-#todo-list li .destroy:hover {
- color: #af5b5e;
-}
-
-#todo-list li .destroy:after {
- content: '×';
-}
-
-#todo-list li:hover .destroy {
- display: block;
-}
-
-#todo-list li .edit {
- display: none;
-}
-
-#todo-list li.editing:last-child {
- margin-bottom: -1px;
-}
-
-#footer {
- color: #777;
- padding: 10px 15px;
- height: 20px;
- text-align: center;
- border-top: 1px solid #e6e6e6;
-}
-
-#footer:before {
- content: '';
- position: absolute;
- right: 0;
- bottom: 0;
- left: 0;
- height: 50px;
- overflow: hidden;
- box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2),
- 0 8px 0 -3px #f6f6f6,
- 0 9px 1px -3px rgba(0, 0, 0, 0.2),
- 0 16px 0 -6px #f6f6f6,
- 0 17px 2px -6px rgba(0, 0, 0, 0.2);
-}
-
-#todo-count {
- float: left;
- text-align: left;
-}
-
-#todo-count strong {
- font-weight: 300;
-}
-
-#filters {
- margin: 0;
- padding: 0;
- list-style: none;
- position: absolute;
- right: 0;
- left: 0;
-}
-
-#filters li {
- display: inline;
-}
-
-#filters li a {
- color: inherit;
- margin: 3px;
- padding: 3px 7px;
- text-decoration: none;
- border: 1px solid transparent;
- border-radius: 3px;
-}
-
-#filters li a.selected,
-#filters li a:hover {
- border-color: rgba(175, 47, 47, 0.1);
-}
-
-#filters li a.selected {
- border-color: rgba(175, 47, 47, 0.2);
-}
-
-#clear-completed,
-html #clear-completed:active {
- float: right;
- position: relative;
- line-height: 20px;
- text-decoration: none;
- cursor: pointer;
- visibility: hidden;
- position: relative;
-}
-
-#clear-completed::after {
- visibility: visible;
- content: 'Clear completed';
- position: absolute;
- right: 0;
- white-space: nowrap;
-}
-
-#clear-completed:hover::after {
- text-decoration: underline;
-}
-
-#info {
- margin: 65px auto 0;
- color: #bfbfbf;
- font-size: 10px;
- text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
- text-align: center;
-}
-
-#info p {
- line-height: 1;
-}
-
-#info a {
- color: inherit;
- text-decoration: none;
- font-weight: 400;
-}
-
-#info a:hover {
- text-decoration: underline;
-}
-
-/*
-Hack to remove background from Mobile Safari.
-Can't use it globally since it destroys checkboxes in Firefox
-*/
-@media screen and (-webkit-min-device-pixel-ratio:0) {
- #toggle-all,
- #todo-list li .toggle {
- background: none;
- }
-
- #todo-list li .toggle {
- height: 40px;
- }
-
- #toggle-all {
- -webkit-transform: rotate(90deg);
- transform: rotate(90deg);
- -webkit-appearance: none;
- appearance: none;
- }
-}
-
-@media (max-width: 430px) {
- #footer {
- height: 50px;
- }
-
- #filters {
- bottom: 10px;
- }
-}
diff --git a/angular2/css/bg.png b/angular2/css/bg.png
deleted file mode 100644
index b2a7600..0000000
Binary files a/angular2/css/bg.png and /dev/null differ
diff --git a/angular2/firebase/angularfire.d.ts b/angular2/firebase/angularfire.d.ts
deleted file mode 100644
index 409657b..0000000
--- a/angular2/firebase/angularfire.d.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-///
-
-export declare class AngularFire {
- asArray(): FirebaseArray;
-}
-
-export interface FirebaseArray {
- getItem(recOrIndex: any): any
- getChild(recOrIndex: any): any;
- add(newData: any): void;
- remove(recOrIndex: any): void;
- save(recOrIndex: any): void;
- keyify(snap: any): any;
- created(snap: any): void;
- moved(snap: any): void;
- updated(snap: any): void;
- removed(snap: any): void;
- bulkUpdate(items: Object): void;
- spliceOut(key: any): void;
- indexFor(key: any): number;
- getRecord(key: any): any;
- list: any[];
-}
diff --git a/angular2/firebase/angularfire.js b/angular2/firebase/angularfire.js
deleted file mode 100644
index 52deb96..0000000
--- a/angular2/firebase/angularfire.js
+++ /dev/null
@@ -1,106 +0,0 @@
-if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
- switch (arguments.length) {
- case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
- case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
- case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
- }
-};
-if (typeof __metadata !== "function") __metadata = function (k, v) {
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
-};
-define(["require", "exports", 'angular2/angular2'], function (require, exports, angular2_1) {
- var AngularFire = (function () {
- function AngularFire(ref) {
- this.ref = ref;
- }
- AngularFire.prototype.asArray = function () {
- return new FirebaseArray(this.ref);
- };
- AngularFire = __decorate([
- angular2_1.Component(),
- __metadata('design:paramtypes', [(typeof Firebase !== 'undefined' && Firebase) || Object])
- ], AngularFire);
- return AngularFire;
- })();
- exports.AngularFire = AngularFire;
- /*
- FirebaseArray
-
- */
- var FirebaseArray = (function () {
- function FirebaseArray(ref) {
- this.ref = ref;
- this.list = [];
- // listen for changes at the Firebase instance
- this.ref.on('child_added', this.created.bind(this), this.error);
- this.ref.on('child_moved', this.moved.bind(this), this.error);
- this.ref.on('child_changed', this.updated.bind(this), this.error);
- this.ref.on('child_removed', this.removed.bind(this), this.error);
- // determine when initial load is completed
- // ref.once('value', function() { resolve(null); }, resolve);
- }
- FirebaseArray.prototype.getItem = function (recOrIndex) {
- var item = recOrIndex;
- if (typeof (recOrIndex) === "number") {
- item = this.getRecord(recOrIndex);
- }
- return item;
- };
- FirebaseArray.prototype.getChild = function (recOrIndex) {
- var item = this.getItem(recOrIndex);
- return this.ref.child(item._key);
- };
- FirebaseArray.prototype.add = function (rec) {
- this.ref.push(rec);
- };
- FirebaseArray.prototype.remove = function (recOrIndex) {
- this.getChild(recOrIndex).remove();
- };
- FirebaseArray.prototype.save = function (recOrIndex) {
- var item = this.getItem(recOrIndex);
- this.getChild(recOrIndex).update(item);
- };
- FirebaseArray.prototype.keyify = function (snap) {
- var item = snap.val();
- item._key = snap.key();
- return item;
- };
- FirebaseArray.prototype.created = function (snap) {
- var addedValue = this.keyify(snap);
- this.list.push(addedValue);
- };
- FirebaseArray.prototype.moved = function (snap) {
- var key = snap.key();
- this.spliceOut(key);
- };
- FirebaseArray.prototype.updated = function (snap) {
- var key = snap.key();
- var indexToUpdate = this.indexFor(key);
- this.list[indexToUpdate] = this.keyify(snap);
- };
- FirebaseArray.prototype.removed = function (snap) {
- var key = snap.key();
- this.spliceOut(key);
- };
- FirebaseArray.prototype.bulkUpdate = function (items) {
- this.ref.update(items);
- };
- FirebaseArray.prototype.spliceOut = function (key) {
- var i = this.indexFor(key);
- if (i > -1) {
- return this.list.splice(i, 1)[0];
- }
- return null;
- };
- FirebaseArray.prototype.indexFor = function (key) {
- var record = this.getRecord(key);
- return this.list.indexOf(record);
- };
- FirebaseArray.prototype.getRecord = function (key) {
- return this.list.find(function (item) { return key === item._key; });
- };
- return FirebaseArray;
- })();
- exports.FirebaseArray = FirebaseArray;
-});
diff --git a/angular2/firebase/firebase.d.ts b/angular2/firebase/firebase.d.ts
deleted file mode 100644
index 5e58cca..0000000
--- a/angular2/firebase/firebase.d.ts
+++ /dev/null
@@ -1,308 +0,0 @@
-// Type definitions for Firebase API 2.0.2
-// Project: https://www.firebase.com/docs/javascript/firebase
-// Definitions by: Vincent Botone , Shin1 Kashimura
-// Definitions: https://github.com/borisyankov/DefinitelyTyped
-
-interface FirebaseAuthResult {
- auth: any;
- expires: number;
-}
-
-interface FirebaseDataSnapshot {
- /**
- * Gets the JavaScript object representation of the DataSnapshot.
- */
- val(): any;
- /**
- * Gets a DataSnapshot for the location at the specified relative path.
- */
- child(childPath: string): FirebaseDataSnapshot;
- /**
- * Enumerates through the DataSnapshot’s children (in the default order).
- */
- forEach(childAction: (childSnapshot: FirebaseDataSnapshot) => void): boolean;
- forEach(childAction: (childSnapshot: FirebaseDataSnapshot) => boolean): boolean;
- /**
- * Returns true if the specified child exists.
- */
- hasChild(childPath: string): boolean;
- /**
- * Returns true if the DataSnapshot has any children.
- */
- hasChildren(): boolean;
- /**
- * Gets the key name of the location that generated this DataSnapshot.
- */
- key(): string;
- /**
- * @deprecated Use key() instead.
- * Gets the key name of the location that generated this DataSnapshot.
- */
- name(): string;
- /**
- * Gets the number of children for this DataSnapshot.
- */
- numChildren(): number;
- /**
- * Gets the Firebase reference for the location that generated this DataSnapshot.
- */
- ref(): Firebase;
- /**
- * Gets the priority of the data in this DataSnapshot.
- * @returns {string, number, null} The priority, or null if no priority was set.
- */
- getPriority(): any; // string or number
- /**
- * Exports the entire contents of the DataSnapshot as a JavaScript object.
- */
- exportVal(): Object;
-}
-
-interface FirebaseOnDisconnect {
- /**
- * Ensures the data at this location is set to the specified value when the client is disconnected
- * (due to closing the browser, navigating to a new page, or network issues).
- */
- set(value: any, onComplete?: (error: any) => void): void;
- /**
- * Ensures the data at this location is set to the specified value and priority when the client is disconnected
- * (due to closing the browser, navigating to a new page, or network issues).
- */
- setWithPriority(value: any, priority: string, onComplete?: (error: any) => void): void;
- setWithPriority(value: any, priority: number, onComplete?: (error: any) => void): void;
- /**
- * Writes the enumerated children at this Firebase location when the client is disconnected
- * (due to closing the browser, navigating to a new page, or network issues).
- */
- update(value: Object, onComplete?: (error: any) => void): void;
- /**
- * Ensures the data at this location is deleted when the client is disconnected
- * (due to closing the browser, navigating to a new page, or network issues).
- */
- remove(onComplete?: (error: any) => void): void;
- /**
- * Cancels all previously queued onDisconnect() set or update events for this location and all children.
- */
- cancel(onComplete?: (error: any) => void): void;
-}
-
-interface FirebaseQuery {
- /**
- * Listens for data changes at a particular location.
- */
- on(eventType: string, callback: (dataSnapshot: FirebaseDataSnapshot, prevChildName?: string) => void, cancelCallback?: (error: any) => void, context?: Object): (dataSnapshot: FirebaseDataSnapshot, prevChildName?: string) => void;
- /**
- * Detaches a callback previously attached with on().
- */
- off(eventType?: string, callback?: (dataSnapshot: FirebaseDataSnapshot, prevChildName?: string) => void, context?: Object): void;
- /**
- * Listens for exactly one event of the specified event type, and then stops listening.
- */
- once(eventType: string, successCallback: (dataSnapshot: FirebaseDataSnapshot) => void, context?: Object): void;
- once(eventType: string, successCallback: (dataSnapshot: FirebaseDataSnapshot) => void, failureCallback?: (error: any) => void, context?: Object): void;
- /**
- * Generates a new Query object ordered by the specified child key.
- */
- orderByChild(key: string): FirebaseQuery;
- /**
- * Generates a new Query object ordered by key name.
- */
- orderByKey(): FirebaseQuery;
- /**
- * Generates a new Query object ordered by priority.
- */
- orderByPriority(): FirebaseQuery;
- /**
- * @deprecated Use limitToFirst() and limitToLast() instead.
- * Generates a new Query object limited to the specified number of children.
- */
- limit(limit: number): FirebaseQuery;
- /**
- * Creates a Query with the specified starting point.
- * The generated Query includes children which match the specified starting point.
- */
- startAt(value: string, key?: string): FirebaseQuery;
- startAt(value: number, key?: string): FirebaseQuery;
- /**
- * Creates a Query with the specified ending point.
- * The generated Query includes children which match the specified ending point.
- */
- endAt(value: string, key?: string): FirebaseQuery;
- endAt(value: number, key?: string): FirebaseQuery;
- /**
- * Creates a Query which includes children which match the specified value.
- */
- equalTo(value: string, key?: string): FirebaseQuery;
- equalTo(value: number, key?: string): FirebaseQuery;
- /**
- * Generates a new Query object limited to the first certain number of children.
- */
- limitToFirst(limit: number): FirebaseQuery;
- /**
- * Generates a new Query object limited to the last certain number of children.
- */
- limitToLast(limit: number): FirebaseQuery;
- /**
- * Gets a Firebase reference to the Query's location.
- */
- ref(): Firebase;
-}
-
-interface Firebase extends FirebaseQuery {
- /**
- * @deprecated Use authWithCustomToken() instead.
- * Authenticates a Firebase client using the provided authentication token or Firebase Secret.
- */
- auth(authToken: string, onComplete?: (error: any, result: FirebaseAuthResult) => void, onCancel?:(error: any) => void): void;
- /**
- * Authenticates a Firebase client using an authentication token or Firebase Secret.
- */
- authWithCustomToken(autoToken: string, onComplete: (error: any, authData: FirebaseAuthData) => void, options?:Object): void;
- /**
- * Authenticates a Firebase client using a new, temporary guest account.
- */
- authAnonymously(onComplete: (error: any, authData: FirebaseAuthData) => void, options?: Object): void;
- /**
- * Authenticates a Firebase client using an email / password combination.
- */
- authWithPassword(credentials: FirebaseCredentials, onComplete: (error: any, authData: FirebaseAuthData) => void, options?: Object): void;
- /**
- * Authenticates a Firebase client using a popup-based OAuth flow.
- */
- authWithOAuthPopup(provider: string, onComplete:(error: any, authData: FirebaseAuthData) => void, options?: Object): void;
- /**
- * Authenticates a Firebase client using a redirect-based OAuth flow.
- */
- authWithOAuthRedirect(provider: string, onComplete: (error: any) => void, options?: Object): void;
- /**
- * Authenticates a Firebase client using OAuth access tokens or credentials.
- */
- authWithOAuthToken(provider: string, credentials: string, onComplete: (error: any, authData: FirebaseAuthData) => void, options?: Object): void;
- authWithOAuthToken(provider: string, credentials: Object, onComplete: (error: any, authData: FirebaseAuthData) => void, options?: Object): void;
- /**
- * Synchronously access the current authentication state of the client.
- */
- getAuth(): FirebaseAuthData;
- /**
- * Listen for changes to the client's authentication state.
- */
- onAuth(onComplete: (authData: FirebaseAuthData) => void, context?: Object): void;
- /**
- * Detaches a callback previously attached with onAuth().
- */
- offAuth(onComplete: (authData: FirebaseAuthData) => void, context?: Object): void;
- /**
- * Unauthenticates a Firebase client.
- */
- unauth(): void;
- /**
- * Gets a Firebase reference for the location at the specified relative path.
- */
- child(childPath: string): Firebase;
- /**
- * Gets a Firebase reference to the parent location.
- */
- parent(): Firebase;
- /**
- * Gets a Firebase reference to the root of the Firebase.
- */
- root(): Firebase;
- /**
- * Returns the last token in a Firebase location.
- */
- key(): string;
- /**
- * @deprecated Use key() instead.
- * Returns the last token in a Firebase location.
- */
- name(): string;
- /**
- * Gets the absolute URL corresponding to this Firebase reference's location.
- */
- toString(): string;
- /**
- * Writes data to this Firebase location.
- */
- set(value: any, onComplete?: (error: any) => void): void;
- /**
- * Writes the enumerated children to this Firebase location.
- */
- update(value: Object, onComplete?: (error: any) => void): void;
- /**
- * Removes the data at this Firebase location.
- */
- remove(onComplete?: (error: any) => void): void;
- /**
- * Generates a new child location using a unique name and returns a Firebase reference to it.
- * @returns {Firebase} A Firebase reference for the generated location.
- */
- push(value?: any, onComplete?: (error: any) => void): Firebase;
- /**
- * Writes data to this Firebase location. Like set() but also specifies the priority for that data.
- */
- setWithPriority(value: any, priority: string, onComplete?: (error: any) => void): void;
- setWithPriority(value: any, priority: number, onComplete?: (error: any) => void): void;
- /**
- * Sets a priority for the data at this Firebase location.
- */
- setPriority(priority: string, onComplete?: (error: any) => void): void;
- setPriority(priority: number, onComplete?: (error: any) => void): void;
- /**
- * Atomically modifies the data at this location.
- */
- transaction(updateFunction: (currentData: any)=> any, onComplete?: (error: any, committed: boolean, snapshot: FirebaseDataSnapshot) => void, applyLocally?: boolean): void;
- /**
- * Creates a new user account using an email / password combination.
- */
- createUser(credentials: FirebaseCredentials, onComplete: (error: any) => void): void;
- /**
- * Change the password of an existing user using an email / password combination.
- */
- changePassword(credentials: { email: string; oldPassword: string; newPassword: string }, onComplete: (error: any) => void): void;
- /**
- * Removes an existing user account using an email / password combination.
- */
- removeUser(credentials: FirebaseCredentials, onComplete: (error: any) => void): void;
- /**
- * Sends a password-reset email to the owner of the account, containing a token that may be used to authenticate and change the user password.
- */
- resetPassword(credentials: { email: string }, onComplete: (error: any) => void): void;
- onDisconnect(): FirebaseOnDisconnect;
-}
-interface FirebaseStatic {
- /**
- * Constructs a new Firebase reference from a full Firebase URL.
- */
- new (firebaseURL: string): Firebase;
- /**
- * Manually disconnects the Firebase client from the server and disables automatic reconnection.
- */
- goOffline(): void;
- /**
- * Manually reestablishes a connection to the Firebase server and enables automatic reconnection.
- */
- goOnline(): void;
-
- ServerValue: {
- /**
- * A placeholder value for auto-populating the current timestamp
- * (time since the Unix epoch, in milliseconds) by the Firebase servers.
- */
- TIMESTAMP: any;
- };
-}
-declare var Firebase: FirebaseStatic;
-
-// Reference: https://www.firebase.com/docs/web/api/firebase/getauth.html
-interface FirebaseAuthData {
- uid: string;
- provider: string;
- token: string;
- expires: number;
- auth: Object;
-}
-
-interface FirebaseCredentials {
- email: string;
- password: string;
-}
\ No newline at end of file
diff --git a/angular2/firebase/firebase.js b/angular2/firebase/firebase.js
deleted file mode 100644
index ff5d7cc..0000000
--- a/angular2/firebase/firebase.js
+++ /dev/null
@@ -1,245 +0,0 @@
-/*! @license Firebase v0.0.0 - License: https://www.firebase.com/terms/terms-of-service.html */ (function() {var h,aa=this;function m(a){return void 0!==a}function ba(){}function ca(a){a.Nb=function(){return a.kf?a.kf:a.kf=new a}}
-function da(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
-else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ea(a){return"array"==da(a)}function fa(a){var b=da(a);return"array"==b||"object"==b&&"number"==typeof a.length}function p(a){return"string"==typeof a}function ga(a){return"number"==typeof a}function ha(a){return"function"==da(a)}function ia(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ja(a,b,c){return a.call.apply(a.bind,arguments)}
-function ka(a,b,c){if(!a)throw Error();if(2b?e+="000":256>b?e+="00":4096>b&&(e+="0");return ra[a]=e+b.toString(16)}),'"')};function ta(a){return"undefined"!==typeof JSON&&m(JSON.parse)?JSON.parse(a):na(a)}function r(a){if("undefined"!==typeof JSON&&m(JSON.stringify))a=JSON.stringify(a);else{var b=[];pa(new oa,a,b);a=b.join("")}return a};function s(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function t(a,b){if(Object.prototype.hasOwnProperty.call(a,b))return a[b]}function ua(a,b){for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&b(c,a[c])}function va(a){var b={};ua(a,function(a,d){b[a]=d});return b};function wa(a){this.tc=a;this.Ed="firebase:"}h=wa.prototype;h.set=function(a,b){null==b?this.tc.removeItem(this.Ed+a):this.tc.setItem(this.Ed+a,r(b))};h.get=function(a){a=this.tc.getItem(this.Ed+a);return null==a?null:ta(a)};h.remove=function(a){this.tc.removeItem(this.Ed+a)};h.lf=!1;h.toString=function(){return this.tc.toString()};function xa(){this.nc={}}xa.prototype.set=function(a,b){null==b?delete this.nc[a]:this.nc[a]=b};xa.prototype.get=function(a){return s(this.nc,a)?this.nc[a]:null};xa.prototype.remove=function(a){delete this.nc[a]};xa.prototype.lf=!0;function ya(a){try{if("undefined"!==typeof window&&"undefined"!==typeof window[a]){var b=window[a];b.setItem("firebase:sentinel","cache");b.removeItem("firebase:sentinel");return new wa(b)}}catch(c){}return new xa}var za=ya("localStorage"),Aa=ya("sessionStorage");function Ba(a,b,c,d,e){this.host=a.toLowerCase();this.domain=this.host.substr(this.host.indexOf(".")+1);this.Ab=b;this.tb=c;this.Dg=d;this.Dd=e||"";this.Ma=za.get("host:"+a)||this.host}function Ca(a,b){b!==a.Ma&&(a.Ma=b,"s-"===a.Ma.substr(0,2)&&za.set("host:"+a.host,a.Ma))}Ba.prototype.toString=function(){var a=(this.Ab?"https://":"http://")+this.host;this.Dd&&(a+="<"+this.Dd+">");return a};function Da(){this.Sa=-1};function Ea(){this.Sa=-1;this.Sa=64;this.R=[];this.be=[];this.Ef=[];this.Ad=[];this.Ad[0]=128;for(var a=1;ae;e++)d[e]=b.charCodeAt(c)<<24|b.charCodeAt(c+1)<<16|b.charCodeAt(c+2)<<8|b.charCodeAt(c+3),c+=4;else for(e=0;16>e;e++)d[e]=b[c]<<24|b[c+1]<<16|b[c+2]<<8|b[c+3],c+=4;for(e=16;80>e;e++){var f=d[e-3]^d[e-8]^d[e-14]^d[e-16];d[e]=(f<<1|f>>>31)&4294967295}b=a.R[0];c=a.R[1];for(var g=a.R[2],k=a.R[3],l=a.R[4],n,e=0;80>e;e++)40>e?20>e?(f=k^c&(g^k),n=1518500249):(f=c^g^k,n=1859775393):60>e?(f=c&g|k&(c|g),n=2400959708):(f=c^g^k,n=3395469782),f=(b<<
-5|b>>>27)+f+l+n+d[e]&4294967295,l=k,k=g,g=(c<<30|c>>>2)&4294967295,c=b,b=f;a.R[0]=a.R[0]+b&4294967295;a.R[1]=a.R[1]+c&4294967295;a.R[2]=a.R[2]+g&4294967295;a.R[3]=a.R[3]+k&4294967295;a.R[4]=a.R[4]+l&4294967295}
-Ea.prototype.update=function(a,b){m(b)||(b=a.length);for(var c=b-this.Sa,d=0,e=this.be,f=this.Sb;dc?Math.max(0,a.length+c):c;if(p(a))return p(b)&&1==b.length?a.indexOf(b,c):-1;for(;cc?null:p(a)?a.charAt(c):a[c]}function Oa(a,b,c){for(var d=a.length,e=p(a)?a.split(""):a,f=0;f=arguments.length?v.slice.call(a,b):v.slice.call(a,b,c)}function Ra(a,b){a.sort(b||Sa)}function Sa(a,b){return a>b?1:aparseFloat(a))?String(b):a})();var ab=null,bb=null,cb=null;function db(a,b){if(!fa(a))throw Error("encodeByteArray takes an array as a parameter");eb();for(var c=b?bb:ab,d=[],e=0;e>2,f=(f&3)<<4|k>>4,k=(k&15)<<2|n>>6,n=n&63;l||(n=64,g||(k=64));d.push(c[u],c[f],c[k],c[n])}return d.join("")}
-function eb(){if(!ab){ab={};bb={};cb={};for(var a=0;65>a;a++)ab[a]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(a),bb[a]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(a),cb[bb[a]]=a}};var fb=function(){var a=1;return function(){return a++}}();function w(a,b){if(!a)throw gb(b);}function gb(a){return Error("Firebase INTERNAL ASSERT FAILED:"+a)}
-function hb(a){try{var b;if("undefined"!==typeof atob)b=atob(a);else{eb();for(var c=cb,d=[],e=0;e>4);64!=k&&(d.push(g<<4&240|k>>2),64!=l&&d.push(k<<6&192|l))}if(8192>d.length)b=String.fromCharCode.apply(null,d);else{a="";for(c=0;ca.Sb?a.update(a.Ad,56-a.Sb):a.update(a.Ad,a.Sa-(a.Sb-56));for(var d=a.Sa-1;56<=d;d--)a.be[d]=c&255,c/=256;Fa(a,a.be);for(d=c=0;5>d;d++)for(var e=24;0<=e;e-=8)b[c]=a.R[d]>>e&255,++c;return db(b)}
-function lb(a){for(var b="",c=0;ca?c.push(a.substring(d,a.length)):c.push(a.substring(d,d+b));return c}function Ab(a,b){if(ea(a))for(var c=0;ca,a=Math.abs(a),a>=Math.pow(2,-1022)?(d=Math.min(Math.floor(Math.log(a)/Math.LN2),1023),c=d+1023,d=Math.round(a*Math.pow(2,52-d)-Math.pow(2,52))):(c=0,d=Math.round(a/Math.pow(2,-1074))));e=[];for(a=52;a;a-=1)e.push(d%2?1:0),d=Math.floor(d/2);for(a=11;a;a-=1)e.push(c%2?1:0),c=Math.floor(c/2);e.push(b?1:0);e.reverse();b=e.join("");c="";for(a=0;64>a;a+=8)d=parseInt(b.substr(a,8),2).toString(16),1===d.length&&
-(d="0"+d),c+=d;return c.toLowerCase()}var Cb=/^-?\d{1,10}$/;function wb(a){return Cb.test(a)&&(a=Number(a),-2147483648<=a&&2147483647>=a)?a:null}function Db(a){try{a()}catch(b){setTimeout(function(){y("Exception was thrown by user callback.",b.stack||"");throw b;},Math.floor(0))}}function A(a,b){if(ha(a)){var c=Array.prototype.slice.call(arguments,1).slice();Db(function(){a.apply(null,c)})}};function Eb(a,b,c,d){this.le=b;this.Nd=c;this.Fd=d;this.jd=a}Eb.prototype.Qb=function(){var a=this.Nd.cc();return"value"===this.jd?a.path:a.parent().path};Eb.prototype.pe=function(){return this.jd};Eb.prototype.Lb=function(){return this.le.Lb(this)};Eb.prototype.toString=function(){return this.Qb().toString()+":"+this.jd+":"+r(this.Nd.bf())};function Fb(a,b,c){this.le=a;this.error=b;this.path=c}Fb.prototype.Qb=function(){return this.path};Fb.prototype.pe=function(){return"cancel"};
-Fb.prototype.Lb=function(){return this.le.Lb(this)};Fb.prototype.toString=function(){return this.path.toString()+":cancel"};function B(a,b,c,d){this.type=a;this.Ha=b;this.Ua=c;this.De=d;this.Fd=void 0}function Gb(a){return new B(Hb,a)}var Hb="value";function Ib(a,b,c){this.Hb=a;this.kb=b;this.mb=c||null}h=Ib.prototype;h.wf=function(a){return"value"===a};h.createEvent=function(a,b){var c=b.n.g;return new Eb("value",this,new C(a.Ha,b.cc(),c))};h.Lb=function(a){var b=this.mb;if("cancel"===a.pe()){w(this.kb,"Raising a cancel event on a listener with no cancel callback");var c=this.kb;return function(){c.call(b,a.error)}}var d=this.Hb;return function(){d.call(b,a.Nd)}};h.Ye=function(a,b){return this.kb?new Fb(this,a,b):null};
-h.matches=function(a){return a instanceof Ib?a.Hb&&this.Hb?a.Hb===this.Hb&&a.mb===this.mb:!0:!1};h.hf=function(){return null!==this.Hb};function Jb(a,b,c){this.da=a;this.kb=b;this.mb=c}h=Jb.prototype;h.wf=function(a){a="children_added"===a?"child_added":a;return("children_removed"===a?"child_removed":a)in this.da};h.Ye=function(a,b){return this.kb?new Fb(this,a,b):null};
-h.createEvent=function(a,b){w(null!=a.Ua,"Child events should have a childName.");var c=b.cc().o(a.Ua);return new Eb(a.type,this,new C(a.Ha,c,b.n.g),a.Fd)};h.Lb=function(a){var b=this.mb;if("cancel"===a.pe()){w(this.kb,"Raising a cancel event on a listener with no cancel callback");var c=this.kb;return function(){c.call(b,a.error)}}var d=this.da[a.jd];return function(){d.call(b,a.Nd,a.Fd)}};
-h.matches=function(a){if(a instanceof Jb){if(!this.da||!a.da)return!0;if(this.mb===a.mb){var b=Kb(a.da);if(b===Kb(this.da)){if(1===b){var b=Lb(a.da),c=Lb(this.da);return c===b&&(!a.da[b]||!this.da[c]||a.da[b]===this.da[c])}return Mb(this.da,function(b,c){return a.da[c]===b})}}}return!1};h.hf=function(){return null!==this.da};function kb(a){for(var b=[],c=0,d=0;d=e&&(e-=55296,d++,w(de?b[c++]=e:(2048>e?b[c++]=e>>6|192:(65536>e?b[c++]=e>>12|224:(b[c++]=e>>18|240,b[c++]=e>>12&63|128),b[c++]=e>>6&63|128),b[c++]=e&63|128)}return b};function D(a,b,c,d){var e;dc&&(e=0===c?"none":"no more than "+c);if(e)throw Error(a+" failed: Was called with "+d+(1===d?" argument.":" arguments.")+" Expects "+e+".");}function F(a,b,c){var d="";switch(b){case 1:d=c?"first":"First";break;case 2:d=c?"second":"Second";break;case 3:d=c?"third":"Third";break;case 4:d=c?"fourth":"Fourth";break;default:throw Error("errorPrefix called with argumentNumber > 4. Need to update it?");}return a=a+" failed: "+(d+" argument ")}
-function G(a,b,c,d){if((!d||m(c))&&!ha(c))throw Error(F(a,b,d)+"must be a valid function.");}function Nb(a,b,c){if(m(c)&&(!ia(c)||null===c))throw Error(F(a,b,!0)+"must be a valid context object.");};var Ob=/[\[\].#$\/\u0000-\u001F\u007F]/,Pb=/[\[\].#$\u0000-\u001F\u007F]/;function Qb(a){return p(a)&&0!==a.length&&!Ob.test(a)}function Rb(a){return null===a||p(a)||ga(a)&&!tb(a)||ia(a)&&s(a,".sv")}function Sb(a,b,c){c&&!m(b)||Tb(F(a,1,c),b)}
-function Tb(a,b,c,d){c||(c=0);var e=d||[];if(!m(b))throw Error(a+"contains undefined"+Ub(e));if(ha(b))throw Error(a+"contains a function"+Ub(e)+" with contents: "+b.toString());if(tb(b))throw Error(a+"contains "+b.toString()+Ub(e));if(1E310485760/3&&10485760=this.g.compare(this.Vc,a)&&0>=this.g.compare(a,this.vc)};h.C=function(a,b,c,d,e){this.matches(new M(b,c))||(c=L);return this.re.C(a,b,c,d,e)};h.oa=function(a,b,c){b.M()&&(b=L);var d=b.Fb(this.g),d=d.Z(L),e=this;b.U(K,function(a,b){e.matches(new M(a,b))||(d=d.P(a,L))});return this.re.oa(a,d,c)};
-h.Z=function(a){return a};h.ya=function(){return!0};h.Mb=function(){return this.re};function jc(a,b){return vb(a.name,b.name)}function kc(a,b){return vb(a,b)};function lc(){}var mc={};function nc(a){return q(a.compare,a)}lc.prototype.jf=function(a,b){return 0!==this.compare(new M("[MIN_NAME]",a),new M("[MIN_NAME]",b))};lc.prototype.Ce=function(){return oc};function pc(a){this.Ub=a}ma(pc,lc);h=pc.prototype;h.ue=function(a){return!a.K(this.Ub).e()};h.compare=function(a,b){var c=a.Y.K(this.Ub),d=b.Y.K(this.Ub),c=c.he(d);return 0===c?vb(a.name,b.name):c};h.Ae=function(a,b){var c=N(a),c=L.P(this.Ub,c);return new M(b,c)};
-h.Be=function(){var a=L.P(this.Ub,qc);return new M("[MAX_NAME]",a)};h.toString=function(){return this.Ub};var K=new pc(".priority");function rc(){}ma(rc,lc);h=rc.prototype;h.compare=function(a,b){return vb(a.name,b.name)};h.ue=function(){throw gb("KeyIndex.isDefinedOn not expected to be called.");};h.jf=function(){return!1};h.Ce=function(){return oc};h.Be=function(){return new M("[MAX_NAME]",L)};h.Ae=function(a){w(p(a),"KeyIndex indexValue must always be a string.");return new M(a,L)};
-h.toString=function(){return".key"};var sc=new rc;function tc(){}tc.prototype.ef=function(){return null};tc.prototype.oe=function(){return null};var uc=new tc;function vc(a,b,c){this.Bf=a;this.Ia=b;this.zd=c}vc.prototype.ef=function(a){var b=this.Ia.F;if(wc(b,a))return b.j().K(a);b=null!=this.zd?new xc(this.zd,!0,!1):this.Ia.u();return this.Bf.Ta(a,b)};vc.prototype.oe=function(a,b,c){var d=null!=this.zd?this.zd:yc(this.Ia);a=this.Bf.ce(d,b,1,c,a);return 0===a.length?null:a[0]};function zc(){this.Za={}}
-function dc(a,b){var c=b.type,d=b.Ua;w("child_added"==c||"child_changed"==c||"child_removed"==c,"Only child changes supported for tracking");w(".priority"!==d,"Only non-priority child changes can be tracked.");var e=t(a.Za,d);if(e){var f=e.type;if("child_added"==c&&"child_removed"==f)a.Za[d]=new B("child_changed",b.Ha,d,e.Ha);else if("child_removed"==c&&"child_added"==f)delete a.Za[d];else if("child_removed"==c&&"child_changed"==f)a.Za[d]=new B("child_removed",e.De,d);else if("child_changed"==c&&
-"child_added"==f)a.Za[d]=new B("child_added",b.Ha,d);else if("child_changed"==c&&"child_changed"==f)a.Za[d]=new B("child_changed",b.Ha,d,e.De);else throw gb("Illegal combination of changes: "+b+" occurred after "+e);}else a.Za[d]=b};function M(a,b){this.name=a;this.Y=b}function Ac(a,b){return new M(a,b)};function Bc(a){this.ma=new ec(a);this.g=a.g;w(a.ka,"Only valid if limit has been set");this.sa=a.sa;this.zb=!(""===a.Eb?a.ia:"l"===a.Eb)}h=Bc.prototype;h.C=function(a,b,c,d,e){this.ma.matches(new M(b,c))||(c=L);return a.K(b).ea(c)?a:a.ub()=this.g.compare(this.ma.Vc,f):0>=this.g.compare(f,this.ma.vc))d=d.P(f.name,f.Y),e++;else break}}else{d=b.Fb(this.g);d=d.Z(L);var k,l,n;if(this.zb){b=d.gf(this.g);k=this.ma.vc;l=this.ma.Vc;var u=nc(this.g);n=function(a,b){return u(b,a)}}else b=d.Ob(this.g),k=this.ma.Vc,
-l=this.ma.vc,n=nc(this.g);for(var e=0,x=!1;0=n(k,f)&&(x=!0),(g=x&&e=n(f,l))?e++:d=d.P(f.name,L)}return this.ma.Mb().oa(a,d,c)};h.Z=function(a){return a};h.ya=function(){return!0};h.Mb=function(){return this.ma.Mb()};
-function Cc(a,b,c,d,e,f){var g;if(a.zb){var k=nc(a.g);g=function(a,b){return k(b,a)}}else g=nc(a.g);w(b.ub()==a.sa,"");var l=new M(c,d),n=a.zb?Dc(b,a.g):Ec(b,a.g),u=a.ma.matches(l);if(b.Da(c)){var x=b.K(c),n=e.oe(a.g,n,a.zb);null!=n&&n.name==c&&(n=e.oe(a.g,n,a.zb));e=null==n?1:g(n,l);if(u&&!d.e()&&0<=e)return null!=f&&dc(f,new B("child_changed",d,c,x)),b.P(c,d);null!=f&&dc(f,new B("child_removed",x,c));b=b.P(c,L);return null!=n&&a.ma.matches(n)?(null!=f&&dc(f,new B("child_added",n.Y,n.name)),b.P(n.name,
-n.Y)):b}return d.e()?b:u&&0<=g(n,l)?(null!=f&&(dc(f,new B("child_removed",n.Y,n.name)),dc(f,new B("child_added",d,c))),b.P(c,d).P(n.name,L)):b};function Fc(){this.uc=this.qa=this.jc=this.ia=this.ka=!1;this.sa=0;this.Eb="";this.zc=null;this.Wb="";this.yc=null;this.Tb="";this.g=K}var Gc=new Fc;function gc(a){w(a.ia,"Only valid if start has been set");return a.zc}function fc(a){w(a.ia,"Only valid if start has been set");return a.jc?a.Wb:"[MIN_NAME]"}function ic(a){w(a.qa,"Only valid if end has been set");return a.yc}function hc(a){w(a.qa,"Only valid if end has been set");return a.uc?a.Tb:"[MAX_NAME]"}
-function Hc(a){var b=new Fc;b.ka=a.ka;b.sa=a.sa;b.ia=a.ia;b.zc=a.zc;b.jc=a.jc;b.Wb=a.Wb;b.qa=a.qa;b.yc=a.yc;b.uc=a.uc;b.Tb=a.Tb;b.g=a.g;return b}h=Fc.prototype;h.xe=function(a){var b=Hc(this);b.ka=!0;b.sa=a;b.Eb="";return b};h.ye=function(a){var b=Hc(this);b.ka=!0;b.sa=a;b.Eb="l";return b};h.ze=function(a){var b=Hc(this);b.ka=!0;b.sa=a;b.Eb="r";return b};h.Od=function(a,b){var c=Hc(this);c.ia=!0;m(a)||(a=null);c.zc=a;null!=b?(c.jc=!0,c.Wb=b):(c.jc=!1,c.Wb="");return c};
-h.hd=function(a,b){var c=Hc(this);c.qa=!0;m(a)||(a=null);c.yc=a;m(b)?(c.uc=!0,c.Tb=b):(c.Ig=!1,c.Tb="");return c};function Ic(a,b){var c=Hc(a);c.g=b;return c}function Jc(a){var b={};a.ia&&(b.sp=a.zc,a.jc&&(b.sn=a.Wb));a.qa&&(b.ep=a.yc,a.uc&&(b.en=a.Tb));if(a.ka){b.l=a.sa;var c=a.Eb;""===c&&(c=a.ia?"l":"r");b.vf=c}a.g!==K&&(b.i=a.g.toString());return b}function Kc(a){return!(a.ia||a.qa||a.ka)}h.toString=function(){return r(Jc(this))};function P(a,b,c,d){this.k=a;this.path=b;this.n=c;this.ac=d}
-function Lc(a){var b=null,c=null;a.ia&&(b=gc(a));a.qa&&(c=ic(a));if(a.g===sc){if(a.ia){if("[MIN_NAME]"!=fc(a))throw Error("Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().");if(null!=b&&"string"!==typeof b)throw Error("Query: When ordering by key, the argument passed to startAt(), endAt(),or equalTo() must be a string.");}if(a.qa){if("[MAX_NAME]"!=hc(a))throw Error("Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().");if(null!=
-c&&"string"!==typeof c)throw Error("Query: When ordering by key, the argument passed to startAt(), endAt(),or equalTo() must be a string.");}}else if(a.g===K){if(null!=b&&!Rb(b)||null!=c&&!Rb(c))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(w(a.g instanceof pc,"unknown index type."),null!=b&&"object"===typeof b||null!=c&&"object"===typeof c)throw Error("Query: First argument passed to startAt(), endAt(), or equalTo() cannot be an object.");
-}function Mc(a){if(a.ia&&a.qa&&a.ka&&(!a.ka||""===a.Eb))throw Error("Query: Can't combine startAt(), endAt(), and limit(). Use limitToFirst() or limitToLast() instead.");}function Nc(a,b){if(!0===a.ac)throw Error(b+": You can't combine multiple orderBy calls.");}P.prototype.cc=function(){D("Query.ref",0,0,arguments.length);return new Q(this.k,this.path)};P.prototype.ref=P.prototype.cc;
-P.prototype.vb=function(a,b,c,d){D("Query.on",2,4,arguments.length);Xb("Query.on",a,!1);G("Query.on",2,b,!1);var e=Oc("Query.on",c,d);if("value"===a)Pc(this.k,this,new Ib(b,e.cancel||null,e.Ka||null));else{var f={};f[a]=b;Pc(this.k,this,new Jb(f,e.cancel,e.Ka))}return b};P.prototype.on=P.prototype.vb;
-P.prototype.Zb=function(a,b,c){D("Query.off",0,3,arguments.length);Xb("Query.off",a,!0);G("Query.off",2,b,!0);Nb("Query.off",3,c);var d=null,e=null;"value"===a?d=new Ib(b||null,null,c||null):a&&(b&&(e={},e[a]=b),d=new Jb(e,null,c||null));e=this.k;d=".info"===H(this.path)?e.qd.gb(this,d):e.N.gb(this,d);Qc(e.$,this.path,d)};P.prototype.off=P.prototype.Zb;
-P.prototype.lg=function(a,b){function c(g){f&&(f=!1,e.Zb(a,c),b.call(d.Ka,g))}D("Query.once",2,4,arguments.length);Xb("Query.once",a,!1);G("Query.once",2,b,!1);var d=Oc("Query.once",arguments[2],arguments[3]),e=this,f=!0;this.vb(a,c,function(b){e.Zb(a,c);d.cancel&&d.cancel.call(d.Ka,b)})};P.prototype.once=P.prototype.lg;
-P.prototype.xe=function(a){y("Query.limit() being deprecated. Please use Query.limitToFirst() or Query.limitToLast() instead.");D("Query.limit",1,1,arguments.length);if(!ga(a)||Math.floor(a)!==a||0>=a)throw Error("Query.limit: First argument must be a positive integer.");if(this.n.ka)throw Error("Query.limit: Limit was already set (by another call to limit, limitToFirst, orlimitToLast.");var b=this.n.xe(a);Mc(b);return new P(this.k,this.path,b,this.ac)};P.prototype.limit=P.prototype.xe;
-P.prototype.ye=function(a){D("Query.limitToFirst",1,1,arguments.length);if(!ga(a)||Math.floor(a)!==a||0>=a)throw Error("Query.limitToFirst: First argument must be a positive integer.");if(this.n.ka)throw Error("Query.limitToFirst: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new P(this.k,this.path,this.n.ye(a),this.ac)};P.prototype.limitToFirst=P.prototype.ye;
-P.prototype.ze=function(a){D("Query.limitToLast",1,1,arguments.length);if(!ga(a)||Math.floor(a)!==a||0>=a)throw Error("Query.limitToLast: First argument must be a positive integer.");if(this.n.ka)throw Error("Query.limitToLast: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new P(this.k,this.path,this.n.ze(a),this.ac)};P.prototype.limitToLast=P.prototype.ze;
-P.prototype.mg=function(a){D("Query.orderByChild",1,1,arguments.length);if("$key"===a)throw Error('Query.orderByChild: "$key" is invalid. Use Query.orderByKey() instead.');if("$priority"===a)throw Error('Query.orderByChild: "$priority" is invalid. Use Query.orderByPriority() instead.');Yb("Query.orderByChild",1,a,!1);Nc(this,"Query.orderByChild");var b=Ic(this.n,new pc(a));Lc(b);return new P(this.k,this.path,b,!0)};P.prototype.orderByChild=P.prototype.mg;
-P.prototype.ng=function(){D("Query.orderByKey",0,0,arguments.length);Nc(this,"Query.orderByKey");var a=Ic(this.n,sc);Lc(a);return new P(this.k,this.path,a,!0)};P.prototype.orderByKey=P.prototype.ng;P.prototype.og=function(){D("Query.orderByPriority",0,0,arguments.length);Nc(this,"Query.orderByPriority");var a=Ic(this.n,K);Lc(a);return new P(this.k,this.path,a,!0)};P.prototype.orderByPriority=P.prototype.og;
-P.prototype.Od=function(a,b){D("Query.startAt",0,2,arguments.length);Sb("Query.startAt",a,!0);Yb("Query.startAt",2,b,!0);var c=this.n.Od(a,b);Mc(c);Lc(c);if(this.n.ia)throw Error("Query.startAt: Starting point was already set (by another call to startAt or equalTo).");m(a)||(b=a=null);return new P(this.k,this.path,c,this.ac)};P.prototype.startAt=P.prototype.Od;
-P.prototype.hd=function(a,b){D("Query.endAt",0,2,arguments.length);Sb("Query.endAt",a,!0);Yb("Query.endAt",2,b,!0);var c=this.n.hd(a,b);Mc(c);Lc(c);if(this.n.qa)throw Error("Query.endAt: Ending point was already set (by another call to endAt or equalTo).");return new P(this.k,this.path,c,this.ac)};P.prototype.endAt=P.prototype.hd;
-P.prototype.Tf=function(a,b){D("Query.equalTo",1,2,arguments.length);Sb("Query.equalTo",a,!1);Yb("Query.equalTo",2,b,!0);if(this.n.ia)throw Error("Query.equalTo: Starting point was already set (by another call to endAt or equalTo).");if(this.n.qa)throw Error("Query.equalTo: Ending point was already set (by another call to endAt or equalTo).");return this.Od(a,b).hd(a,b)};P.prototype.equalTo=P.prototype.Tf;P.prototype.Fa=function(){var a=yb(Jc(this.n));return"{}"===a?"default":a};
-function Oc(a,b,c){var d={cancel:null,Ka:null};if(b&&c)d.cancel=b,G(a,3,d.cancel,!0),d.Ka=c,Nb(a,4,d.Ka);else if(b)if("object"===typeof b&&null!==b)d.Ka=b;else if("function"===typeof b)d.cancel=b;else throw Error(F(a,3,!0)+" must either be a cancel callback or a context object.");return d};function R(a,b){if(1==arguments.length){this.w=a.split("/");for(var c=0,d=0;d=a.w.length?null:a.w[a.ca]}function Rc(a){return a.w.length-a.ca}function S(a){var b=a.ca;b=this.w.length)return null;for(var a=[],b=this.ca;b=this.w.length};var T=new R("");function U(a,b){var c=H(a);if(null===c)return b;if(c===H(b))return U(S(a),S(b));throw Error("INTERNAL ERROR: innerPath ("+b+") is not within outerPath ("+a+")");}
-R.prototype.ea=function(a){if(Rc(this)!==Rc(a))return!1;for(var b=this.ca,c=a.ca;b<=this.w.length;b++,c++)if(this.w[b]!==a.w[c])return!1;return!0};R.prototype.contains=function(a){var b=this.ca,c=a.ca;if(Rc(this)>Rc(a))return!1;for(;bb?c=c.left:0c?d=d.left:0e)a=this.ve?a.left:a.right;else if(0===e){this.Na.push(a);break}else this.Na.push(a),a=this.ve?a.right:a.left}
-function O(a){if(0===a.Na.length)return null;var b=a.Na.pop(),c;c=a.Id?a.Id(b.key,b.value):{key:b.key,value:b.value};if(a.ve)for(b=b.left;!b.e();)a.Na.push(b),b=b.right;else for(b=b.right;!b.e();)a.Na.push(b),b=b.left;return c}function dd(a){if(0===a.Na.length)return null;var b;b=a.Na;b=b[b.length-1];return a.Id?a.Id(b.key,b.value):{key:b.key,value:b.value}}function ed(a,b,c,d,e){this.key=a;this.value=b;this.color=null!=c?c:!0;this.left=null!=d?d:ad;this.right=null!=e?e:ad}h=ed.prototype;
-h.X=function(a,b,c,d,e){return new ed(null!=a?a:this.key,null!=b?b:this.value,null!=c?c:this.color,null!=d?d:this.left,null!=e?e:this.right)};h.count=function(){return this.left.count()+1+this.right.count()};h.e=function(){return!1};h.fa=function(a){return this.left.fa(a)||a(this.key,this.value)||this.right.fa(a)};function gd(a){return a.left.e()?a:gd(a.left)}h.Hc=function(){return gd(this).key};h.Xb=function(){return this.right.e()?this.key:this.right.Xb()};
-h.La=function(a,b,c){var d,e;e=this;d=c(a,e.key);e=0>d?e.X(null,null,null,e.left.La(a,b,c),null):0===d?e.X(null,b,null,null,null):e.X(null,null,null,null,e.right.La(a,b,c));return hd(e)};function id(a){if(a.left.e())return ad;a.left.ba()||a.left.left.ba()||(a=jd(a));a=a.X(null,null,null,id(a.left),null);return hd(a)}
-h.remove=function(a,b){var c,d;c=this;if(0>b(a,c.key))c.left.e()||c.left.ba()||c.left.left.ba()||(c=jd(c)),c=c.X(null,null,null,c.left.remove(a,b),null);else{c.left.ba()&&(c=kd(c));c.right.e()||c.right.ba()||c.right.left.ba()||(c=ld(c),c.left.left.ba()&&(c=kd(c),c=ld(c)));if(0===b(a,c.key)){if(c.right.e())return ad;d=gd(c.right);c=c.X(d.key,d.value,null,null,id(c.right))}c=c.X(null,null,null,null,c.right.remove(a,b))}return hd(c)};h.ba=function(){return this.color};
-function hd(a){a.right.ba()&&!a.left.ba()&&(a=md(a));a.left.ba()&&a.left.left.ba()&&(a=kd(a));a.left.ba()&&a.right.ba()&&(a=ld(a));return a}function jd(a){a=ld(a);a.right.left.ba()&&(a=a.X(null,null,null,null,kd(a.right)),a=md(a),a=ld(a));return a}function md(a){return a.right.X(null,null,a.color,a.X(null,null,!0,null,a.right.left),null)}function kd(a){return a.left.X(null,null,a.color,null,a.X(null,null,!0,a.left.right,null))}
-function ld(a){return a.X(null,null,!a.color,a.left.X(null,null,!a.left.color,null,null),a.right.X(null,null,!a.right.color,null,null))}function nd(){}h=nd.prototype;h.X=function(){return this};h.La=function(a,b){return new ed(a,b,null)};h.remove=function(){return this};h.count=function(){return 0};h.e=function(){return!0};h.fa=function(){return!1};h.Hc=function(){return null};h.Xb=function(){return null};h.ba=function(){return!1};var ad=new nd;function od(a,b){this.D=a;w(m(this.D)&&null!==this.D,"LeafNode shouldn't be created with null/undefined value.");this.ha=b||L;pd(this.ha);this.sb=null}h=od.prototype;h.M=function(){return!0};h.L=function(){return this.ha};h.Z=function(a){return new od(this.D,a)};h.K=function(a){return".priority"===a?this.ha:L};h.ra=function(a){return a.e()?this:".priority"===H(a)?this.ha:L};h.Da=function(){return!1};h.ff=function(){return null};
-h.P=function(a,b){return".priority"===a?this.Z(b):b.e()&&".priority"!==a?this:L.P(a,b).Z(this.ha)};h.C=function(a,b){var c=H(a);if(null===c)return b;if(b.e()&&".priority"!==c)return this;w(".priority"!==c||1===Rc(a),".priority must be the last token in a path");return this.P(c,L.C(S(a),b))};h.e=function(){return!1};h.ub=function(){return 0};h.I=function(a){return a&&!this.L().e()?{".value":this.za(),".priority":this.L().I()}:this.za()};
-h.hash=function(){if(null===this.sb){var a="";this.ha.e()||(a+="priority:"+qd(this.ha.I())+":");var b=typeof this.D,a=a+(b+":"),a="number"===b?a+Bb(this.D):a+this.D;this.sb=jb(a)}return this.sb};h.za=function(){return this.D};h.he=function(a){if(a===L)return 1;if(a instanceof V)return-1;w(a.M(),"Unknown node type");var b=typeof a.D,c=typeof this.D,d=Ha(rd,b),e=Ha(rd,c);w(0<=d,"Unknown leaf type: "+b);w(0<=e,"Unknown leaf type: "+c);return d===e?"object"===c?0:this.Db.compare(d,a);)O(c),d=dd(c);return c};h.gf=function(a){return this.Rb(a.Be(),a)};h.Rb=function(a,b){var c=zd(this,b);if(c)return c.Rb(a,function(a){return a});for(var c=this.m.Rb(a.name,Ac),d=dd(c);null!=d&&0=a.length){var b=Number(a);if(!isNaN(b)){e.Te=b;e.frames=[];a=null;break a}}e.Te=1;e.frames=[]}null!==a&&de(e,a)}};this.ta.onerror=function(a){e.f("WebSocket error. Closing connection.");(a=a.message||a.data)&&e.f(a);e.eb()}};ae.prototype.start=function(){};
-ae.isAvailable=function(){var a=!1;if("undefined"!==typeof navigator&&navigator.userAgent){var b=navigator.userAgent.match(/Android ([0-9]{0,}\.[0-9]{0,})/);b&&1parseFloat(b[1])&&(a=!0)}return!a&&null!==$d&&!be};ae.responsesRequiredToBeHealthy=2;ae.healthyTimeout=3E4;h=ae.prototype;h.sd=function(){za.remove("previous_websocket_failure")};function de(a,b){a.frames.push(b);if(a.frames.length==a.Te){var c=a.frames.join("");a.frames=null;c=ta(c);a.hg(c)}}
-h.send=function(a){ce(this);a=r(a);this.jb+=a.length;Td(this.Ra,"bytes_sent",a.length);a=zb(a,16384);1document.domain="'+document.domain+'";\x3c/script>');a=""+a+"";try{this.Ba.ab.open(),this.Ba.ab.write(a),this.Ba.ab.close()}catch(f){ib("frame writing exception"),f.stack&&ib(f.stack),ib(f)}}
-me.prototype.close=function(){this.ae=!1;if(this.Ba){this.Ba.ab.body.innerHTML="";var a=this;setTimeout(function(){null!==a.Ba&&(document.body.removeChild(a.Ba),a.Ba=null)},Math.floor(0))}var b=this.fb;b&&(this.fb=null,b())};
-function pe(a){if(a.ae&&a.Kd&&a.Ie.count()<(0=a.Pc[0].af.length+30+c.length){var e=a.Pc.shift(),c=c+"&seg"+d+"="+e.tg+"&ts"+d+"="+e.Bg+"&d"+d+"="+e.af;d++}else break;qe(a,b+c,a.ke);return!0}return!1}function qe(a,b,c){function d(){a.Ie.remove(c);pe(a)}a.Ie.add(c);var e=setTimeout(d,Math.floor(25E3));oe(a,b,function(){clearTimeout(e);d()})}
-function oe(a,b,c){setTimeout(function(){try{if(a.Kd){var d=a.Ba.ab.createElement("script");d.type="text/javascript";d.async=!0;d.src=b;d.onload=d.onreadystatechange=function(){var a=d.readyState;a&&"loaded"!==a&&"complete"!==a||(d.onload=d.onreadystatechange=null,d.parentNode&&d.parentNode.removeChild(d),c())};d.onerror=function(){ib("Long-poll script failed to load: "+b);a.Kd=!1;a.close()};a.Ba.ab.body.appendChild(d)}}catch(e){}},Math.floor(1))};function re(a){se(this,a)}var te=[je,ae];function se(a,b){var c=ae&&ae.isAvailable(),d=c&&!(za.lf||!0===za.get("previous_websocket_failure"));b.Dg&&(c||y("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),d=!0);if(d)a.Xc=[ae];else{var e=a.Xc=[];Ab(te,function(a,b){b&&b.isAvailable()&&e.push(b)})}}function ue(a){if(0=a.yf?(a.f("Secondary connection is healthy."),a.rb=!0,a.B.sd(),a.B.start(),a.f("sending client ack on secondary"),a.B.send({t:"c",d:{t:"a",d:{}}}),a.f("Ending transmission on primary"),a.J.send({t:"c",d:{t:"n",d:{}}}),a.Yc=a.B,Be(a)):(a.f("sending ping on secondary."),a.B.send({t:"c",d:{t:"p",d:{}}}))}ve.prototype.xd=function(a){De(this);this.$b(a)};function De(a){a.rb||(a.Ke--,0>=a.Ke&&(a.f("Primary connection is healthy."),a.rb=!0,a.J.sd()))}
-function Ae(a,b){a.B=new b("c:"+a.id+":"+a.Xe++,a.O,a.Md);a.yf=b.responsesRequiredToBeHealthy||0;a.B.open(xe(a,a.B),ye(a,a.B));setTimeout(function(){a.B&&(a.f("Timed out trying to upgrade."),a.B.close())},Math.floor(6E4))}function ze(a,b,c){a.f("Realtime connection established.");a.J=b;a.Qa=1;a.Jc&&(a.Jc(c),a.Jc=null);0===a.Ke?(a.f("Primary connection is healthy."),a.rb=!0):setTimeout(function(){Ee(a)},Math.floor(5E3))}
-function Ee(a){a.rb||1!==a.Qa||(a.f("sending ping on primary."),Ge(a,{t:"c",d:{t:"p",d:{}}}))}function Ge(a,b){if(1!==a.Qa)throw"Connection is not connected";a.Yc.send(b)}ve.prototype.close=function(){2!==this.Qa&&(this.f("Closing realtime connection."),this.Qa=2,Ce(this),this.ga&&(this.ga(),this.ga=null))};function Ce(a){a.f("Shutting down all connections");a.J&&(a.J.close(),a.J=null);a.B&&(a.B.close(),a.B=null);a.nd&&(clearTimeout(a.nd),a.nd=null)};function He(a){var b={},c={},d={},e="";try{var f=a.split("."),b=ta(hb(f[0])||""),c=ta(hb(f[1])||""),e=f[2],d=c.d||{};delete c.d}catch(g){}return{Gg:b,fe:c,data:d,xg:e}}function Ie(a){a=He(a).fe;return"object"===typeof a&&a.hasOwnProperty("iat")?t(a,"iat"):null}function Je(a){a=He(a);var b=a.fe;return!!a.xg&&!!b&&"object"===typeof b&&b.hasOwnProperty("iat")};function Ke(a,b,c,d){this.id=Le++;this.f=pb("p:"+this.id+":");this.Cb=!0;this.Aa={};this.la=[];this.Mc=0;this.Ic=[];this.ja=!1;this.Wa=1E3;this.td=3E5;this.yd=b;this.wd=c;this.He=d;this.O=a;this.Oe=null;this.Rc={};this.sg=0;this.Cc=this.we=null;Me(this,0);Id.Nb().vb("visible",this.kg,this);-1===a.host.indexOf("fblocal")&&Jd.Nb().vb("online",this.ig,this)}var Le=0,Ne=0;h=Ke.prototype;
-h.Ca=function(a,b,c){var d=++this.sg;a={r:d,a:a,b:b};this.f(r(a));w(this.ja,"sendRequest call when we're not connected not allowed.");this.Oa.Ca(a);c&&(this.Rc[d]=c)};function Oe(a,b,c,d,e){var f=b.Fa(),g=b.path.toString();a.f("Listen called for "+g+" "+f);a.Aa[g]=a.Aa[g]||{};w(!a.Aa[g][f],"listen() called twice for same path/queryId.");b={H:e,md:c,pg:Jc(b.n),tag:d};a.Aa[g][f]=b;a.ja&&Pe(a,g,f,b)}
-function Pe(a,b,c,d){a.f("Listen on "+b+" for "+c);var e={p:b};d.tag&&(e.q=d.pg,e.t=d.tag);e.h=d.md();a.Ca("q",e,function(e){if((a.Aa[b]&&a.Aa[b][c])===d){a.f("listen response",e);var g=e.s;"ok"!==g&&Qe(a,b,c);e=e.d;d.H&&d.H(g,e)}})}h.Q=function(a,b,c){this.Ib={Rf:a,cf:!1,pc:b,ad:c};this.f("Authenticating using credential: "+a);Re(this);(b=40==a.length)||(a=He(a).fe,b="object"===typeof a&&!0===t(a,"admin"));b&&(this.f("Admin auth credential detected. Reducing max reconnect time."),this.td=3E4)};
-h.Ue=function(a){delete this.Ib;this.ja&&this.Ca("unauth",{},function(b){a(b.s,b.d)})};function Re(a){var b=a.Ib;a.ja&&b&&a.Ca("auth",{cred:b.Rf},function(c){var d=c.s;c=c.d||"error";"ok"!==d&&a.Ib===b&&delete a.Ib;b.cf?"ok"!==d&&b.ad&&b.ad(d,c):(b.cf=!0,b.pc&&b.pc(d,c))})}function Se(a,b,c,d){a.ja?Te(a,"o",b,c,d):a.Ic.push({Oc:b,action:"o",data:c,H:d})}function Ue(a,b,c,d){a.ja?Te(a,"om",b,c,d):a.Ic.push({Oc:b,action:"om",data:c,H:d})}
-h.Fe=function(a,b){this.ja?Te(this,"oc",a,null,b):this.Ic.push({Oc:a,action:"oc",data:null,H:b})};function Te(a,b,c,d,e){c={p:c,d:d};a.f("onDisconnect "+b,c);a.Ca(b,c,function(a){e&&setTimeout(function(){e(a.s,a.d)},Math.floor(0))})}h.put=function(a,b,c,d){Ve(this,"p",a,b,c,d)};function We(a,b,c,d){Ve(a,"m",b,c,d,void 0)}function Ve(a,b,c,d,e,f){d={p:c,d:d};m(f)&&(d.h=f);a.la.push({action:b,uf:d,H:e});a.Mc++;b=a.la.length-1;a.ja?Xe(a,b):a.f("Buffering put: "+c)}
-function Xe(a,b){var c=a.la[b].action,d=a.la[b].uf,e=a.la[b].H;a.la[b].qg=a.ja;a.Ca(c,d,function(d){a.f(c+" response",d);delete a.la[b];a.Mc--;0===a.Mc&&(a.la=[]);e&&e(d.s,d.d)})}
-h.xd=function(a){if("r"in a){this.f("from server: "+r(a));var b=a.r,c=this.Rc[b];c&&(delete this.Rc[b],c(a.b))}else{if("error"in a)throw"A server-side error has occurred: "+a.error;"a"in a&&(b=a.a,c=a.b,this.f("handleServerMessage",b,c),"d"===b?this.yd(c.p,c.d,!1,c.t):"m"===b?this.yd(c.p,c.d,!0,c.t):"c"===b?Ye(this,c.p,c.q):"ac"===b?(a=c.s,b=c.d,c=this.Ib,delete this.Ib,c&&c.ad&&c.ad(a,b)):"sd"===b?this.Oe?this.Oe(c):"msg"in c&&"undefined"!==typeof console&&console.log("FIREBASE: "+c.msg.replace("\n",
-"\nFIREBASE: ")):qb("Unrecognized action received from server: "+r(b)+"\nAre you using the latest client?"))}};h.Jc=function(a){this.f("connection ready");this.ja=!0;this.Cc=(new Date).getTime();this.He({serverTimeOffset:a-(new Date).getTime()});Ze(this);this.wd(!0)};function Me(a,b){w(!a.Oa,"Scheduling a connect when we're already connected/ing?");a.Kb&&clearTimeout(a.Kb);a.Kb=setTimeout(function(){a.Kb=null;$e(a)},Math.floor(b))}
-h.kg=function(a){a&&!this.lc&&this.Wa===this.td&&(this.f("Window became visible. Reducing delay."),this.Wa=1E3,this.Oa||Me(this,0));this.lc=a};h.ig=function(a){a?(this.f("Browser went online. Reconnecting."),this.Wa=1E3,this.Cb=!0,this.Oa||Me(this,0)):(this.f("Browser went offline. Killing connection; don't reconnect."),this.Cb=!1,this.Oa&&this.Oa.close())};
-h.of=function(){this.f("data client disconnected");this.ja=!1;this.Oa=null;for(var a=0;ae.status){try{a=ta(e.responseText)}catch(b){}c(null,a)}else 500<=e.status&&600>e.status?c(W("SERVER_ERROR")):c(W("NETWORK_ERROR"));c=null;rf(window,"beforeunload",d)}};if("GET"===f)a+=(/\?/.test(a)?"":"?")+uf(b),g=null;else{var k=this.options.headers.content_type;
-"application/json"===k&&(g=r(b));"application/x-www-form-urlencoded"===k&&(g=uf(b))}e.open(f,a,!0);a={"X-Requested-With":"XMLHttpRequest",Accept:"application/json;text/plain"};Rd(a,this.options.headers);for(var l in a)e.setRequestHeader(l,a[l]);e.send(g)};yf.isAvailable=function(){return!!window.XMLHttpRequest&&"string"===typeof(new XMLHttpRequest).responseType&&(!(navigator.userAgent.match(/MSIE/)||navigator.userAgent.match(/Trident/))||xf())};yf.prototype.rc=function(){return"json"};function zf(a){a=a||{};this.Sc=Ga()+Ga()+Ga();this.pf=a||{}}
-zf.prototype.open=function(a,b,c){function d(){c&&(c(W("USER_CANCELLED")),c=null)}var e=this,f=sb(kf),g;b.requestId=this.Sc;b.redirectTo=f.scheme+"://"+f.host+"/blank/page.html";a+=/\?/.test(a)?"":"?";a+=uf(b);(g=window.open(a,"_blank","location=no"))&&ha(g.addEventListener)?(g.addEventListener("loadstart",function(a){var b;if(b=a&&a.url)a:{var n=a.url;try{var u=document.createElement("a");u.href=n;b=u.host===f.host&&"/blank/page.html"===u.pathname;break a}catch(x){}b=!1}b&&(a=tf(a.url),g.removeEventListener("exit",
-d),g.close(),a=new lf(null,null,{requestId:e.Sc,requestKey:a}),e.pf.requestWithCredential("/auth/session",a,c),c=null)}),g.addEventListener("exit",d)):c(W("TRANSPORT_UNAVAILABLE"))};zf.isAvailable=function(){return wf()};zf.prototype.rc=function(){return"redirect"};function Af(a){a=a||{};if(!a.window_features||-1!==navigator.userAgent.indexOf("Fennec/")||-1!==navigator.userAgent.indexOf("Firefox/")&&-1!==navigator.userAgent.indexOf("Android"))a.window_features=void 0;a.window_name||(a.window_name="_blank");a.relay_url||(a.relay_url=vf()+"/auth/channel");this.options=a}
-Af.prototype.open=function(a,b,c){function d(a){g&&(document.body.removeChild(g),g=void 0);u&&(u=clearInterval(u));rf(window,"message",e);rf(window,"unload",d);if(n&&!a)try{n.close()}catch(b){k.postMessage("die",l)}n=k=void 0}function e(a){if(a.origin===l)try{var b=ta(a.data);"ready"===b.a?k.postMessage(x,l):"error"===b.a?(d(!1),c&&(c(b.d),c=null)):"response"===b.a&&(d(b.forceKeepWindowOpen),c&&(c(null,b.d),c=null))}catch(e){}}var f=xf(),g,k,l=sf(a);if(l!==sf(this.options.relay_url))c&&setTimeout(function(){c(Error("invalid arguments: origin of url and relay_url must match"))},
-0);else{f&&(g=document.createElement("iframe"),g.setAttribute("src",this.options.relay_url),g.style.display="none",g.setAttribute("name","__winchan_relay_frame"),document.body.appendChild(g),k=g.contentWindow);a+=(/\?/.test(a)?"":"?")+uf(b);var n=window.open(a,this.options.window_name,this.options.window_features);k||(k=n);var u=setInterval(function(){n&&n.closed&&(d(!1),c&&(c(W("USER_CANCELLED")),c=null))},500),x=r({a:"request",d:b});qf(window,"unload",d);qf(window,"message",e)}};
-Af.isAvailable=function(){return"postMessage"in window&&!/^file:\//.test(location.href)&&!(wf()||navigator.userAgent.match(/Windows Phone/)||window.Windows&&/^ms-appx:/.test(location.href)||navigator.userAgent.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i)||navigator.userAgent.match(/CriOS/)||navigator.userAgent.match(/Twitter for iPhone/)||navigator.userAgent.match(/FBAN\/FBIOS/)||window.navigator.standalone)&&!navigator.userAgent.match(/PhantomJS/)};Af.prototype.rc=function(){return"popup"};function Bf(a){a=a||{};a.callback_parameter||(a.callback_parameter="callback");this.options=a;window.__firebase_auth_jsonp=window.__firebase_auth_jsonp||{}}
-Bf.prototype.open=function(a,b,c){function d(){c&&(c(W("REQUEST_INTERRUPTED")),c=null)}function e(){setTimeout(function(){window.__firebase_auth_jsonp[f]=void 0;Od(window.__firebase_auth_jsonp)&&(window.__firebase_auth_jsonp=void 0);try{var a=document.getElementById(f);a&&a.parentNode.removeChild(a)}catch(b){}},1);rf(window,"beforeunload",d)}var f="fn"+(new Date).getTime()+Math.floor(99999*Math.random());b[this.options.callback_parameter]="__firebase_auth_jsonp."+f;a+=(/\?/.test(a)?"":"?")+uf(b);
-qf(window,"beforeunload",d);window.__firebase_auth_jsonp[f]=function(a){c&&(c(null,a),c=null);e()};Cf(f,a,c)};
-function Cf(a,b,c){setTimeout(function(){try{var d=document.createElement("script");d.type="text/javascript";d.id=a;d.async=!0;d.src=b;d.onerror=function(){var b=document.getElementById(a);null!==b&&b.parentNode.removeChild(b);c&&c(W("NETWORK_ERROR"))};var e=document.getElementsByTagName("head");(e&&0!=e.length?e[0]:document.documentElement).appendChild(d)}catch(f){c&&c(W("NETWORK_ERROR"))}},0)}Bf.isAvailable=function(){return!wf()};Bf.prototype.rc=function(){return"json"};function Df(a,b){this.Je=["session",a.Dd,a.tb].join(":");this.Rd=b}Df.prototype.set=function(a,b){if(!b)if(this.Rd.length)b=this.Rd[0];else throw Error("fb.login.SessionManager : No storage options available!");b.set(this.Je,a)};Df.prototype.get=function(){var a=Ka(this.Rd,q(this.Zf,this)),a=Ja(a,function(a){return null!==a});Ra(a,function(a,c){return Ie(c.token)-Ie(a.token)});return 0=b&&Wg(g,c.path)?d=!1:c.path.contains(g.path)&&(e=!0));f--}if(d){if(e)this.T=Xg(this.wa,Yg,T),this.Dc=0f.Dc,"Stacking an older write on top of newer ones");m(g)||(g=!0);f.wa.push({path:b,Ga:c,Zd:d,visible:g});g&&(f.T=Pg(f.T,b,c));f.Dc=d;return e?ih(a,new $g(bh,b,c)):[]}function jh(a,b,c,d){var e=a.xb;w(d>e.Dc,"Stacking an older merge on top of newer ones");e.wa.push({path:b,children:c,Zd:d,visible:!0});e.T=Qg(e.T,b,c);e.Dc=d;c=yg(c);return ih(a,new dh(bh,b,c))}
-function kh(a,b,c){c=c||!1;b=a.xb.Gd(b);return null==b?[]:ih(a,new ah(b,c))}function lh(a,b,c){c=yg(c);return ih(a,new dh(fh,b,c))}function mh(a,b,c,d){d=Pd(a.Wc,"_"+d);if(null!=d){var e=nh(d);d=e.path;e=e.yb;b=U(d,b);c=new $g(new eh(!1,!0,e,!0),b,c);return oh(a,d,c)}return[]}function ph(a,b,c,d){if(d=Pd(a.Wc,"_"+d)){var e=nh(d);d=e.path;e=e.yb;b=U(d,b);c=yg(c);c=new dh(new eh(!1,!0,e,!0),b,c);return oh(a,d,c)}return[]}
-gh.prototype.Gb=function(a,b){var c=a.path,d=null,e=!1;Fg(this.na,c,function(a,b){var f=U(a,c);d=b.bb(f);e=e||null!=Kg(b);return!d});var f=this.na.get(c);f?(e=e||null!=Kg(f),d=d||f.bb(T)):(f=new Jg,this.na=this.na.set(c,f));var g;null!=d?g=!0:(g=!1,d=L,Ig(this.na.subtree(c),function(a,b){var c=b.bb(T);c&&(d=d.P(a,c))}));var k=null!=Mg(f,a);if(!k&&!Kc(a.n)){var l=qh(a);w(!(l in this.bc),"View does not exist, but we have a tag");var n=rh++;this.bc[l]=n;this.Wc["_"+n]=l}g=f.Gb(a,b,new Zg(c,this.xb),
-d,g);k||e||(f=Mg(f,a),g=g.concat(sh(this,a,f)));return g};
-gh.prototype.gb=function(a,b,c){var d=a.path,e=this.na.get(d),f=[];if(e&&("default"===a.Fa()||null!=Mg(e,a))){f=e.gb(a,b,c);e.e()&&(this.na=this.na.remove(d));e=f.rg;f=f.Vf;b=-1!==Oa(e,function(a){return Kc(a.n)});var g=Dg(this.na,d,function(a,b){return null!=Kg(b)});if(b&&!g&&(d=this.na.subtree(d),!d.e()))for(var d=th(d),k=0;kf;f++)b[f]=Math.floor(64*Math.random());for(f=0;12>f;f++)c+="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".charAt(b[f]);w(20===c.length,"NextPushId: Length should be 20.");
-return c}}();function Q(a,b){var c,d,e;if(a instanceof zh)c=a,d=b;else{D("new Firebase",1,2,arguments.length);d=sb(arguments[0]);c=d.Ag;"firebase"===d.domain&&rb(d.host+" is no longer supported. Please use .firebaseio.com instead");c||rb("Cannot parse Firebase url. Please use https://.firebaseio.com");d.Ab||"undefined"!==typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&y("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().");
-c=new Ba(d.host,d.Ab,c,"ws"===d.scheme||"wss"===d.scheme);d=new R(d.Oc);e=d.toString();var f;!(f=!p(c.host)||0===c.host.length||!Qb(c.tb))&&(f=0!==e.length)&&(e&&(e=e.replace(/^\/*\.info(\/|$)/,"/")),f=!(p(e)&&0!==e.length&&!Pb.test(e)));if(f)throw Error(F("new Firebase",1,!1)+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".');if(b)if(b instanceof X)e=b;else if(p(b))e=X.Nb(),c.Dd=b;else throw Error("Expected a valid Firebase.Context for second argument to new Firebase()");
-else e=X.Nb();f=c.toString();var g=t(e.ec,f);g||(g=new zh(c),e.ec[f]=g);c=g}P.call(this,c,d,Gc,!1)}ma(Q,P);"object"===typeof module&&module.exports?module.exports=Q:"function"==typeof aa.define&&aa.define.amd?aa.define(function(){return Q}):aa.Firebase=Q;Q.prototype.name=function(){y("Firebase.name() being deprecated. Please use Firebase.key() instead.");D("Firebase.name",0,0,arguments.length);return this.key()};Q.prototype.name=Q.prototype.name;
-Q.prototype.key=function(){D("Firebase.key",0,0,arguments.length);return this.path.e()?null:Sc(this.path)};Q.prototype.key=Q.prototype.key;Q.prototype.o=function(a){D("Firebase.child",1,1,arguments.length);if(ga(a))a=String(a);else if(!(a instanceof R))if(null===H(this.path)){var b=a;b&&(b=b.replace(/^\/*\.info(\/|$)/,"/"));Zb("Firebase.child",b)}else Zb("Firebase.child",a);return new Q(this.k,this.path.o(a))};Q.prototype.child=Q.prototype.o;
-Q.prototype.parent=function(){D("Firebase.parent",0,0,arguments.length);var a=this.path.parent();return null===a?null:new Q(this.k,a)};Q.prototype.parent=Q.prototype.parent;Q.prototype.root=function(){D("Firebase.ref",0,0,arguments.length);for(var a=this;null!==a.parent();)a=a.parent();return a};Q.prototype.root=Q.prototype.root;
-Q.prototype.toString=function(){D("Firebase.toString",0,0,arguments.length);var a;if(null===this.parent())a=this.k.toString();else{a=this.parent().toString()+"/";var b=this.key();a+=encodeURIComponent(String(b))}return a};Q.prototype.toString=Q.prototype.toString;Q.prototype.set=function(a,b){D("Firebase.set",1,2,arguments.length);$b("Firebase.set",this.path);Sb("Firebase.set",a,!1);G("Firebase.set",2,b,!0);this.k.Bb(this.path,a,null,b||null)};Q.prototype.set=Q.prototype.set;
-Q.prototype.update=function(a,b){D("Firebase.update",1,2,arguments.length);$b("Firebase.update",this.path);if(ea(a)){for(var c={},d=0;d
-
+
ng2do
-
+
+
+
+
+
+
+
+
-
-
-
-
- Loading...
+
+
-
-
\ No newline at end of file
+
+
+
+ Loading...
+
+