From dcccdeb72a9b8ee1e6a03bf4dcf9492e952bca82 Mon Sep 17 00:00:00 2001 From: Uri Goldshtein Date: Mon, 22 Feb 2016 14:19:09 +0200 Subject: [PATCH] chore(release): Release 1.3.7-beta.1 --- bower.json | 2 +- dist/angular-meteor.bundle.js | 4425 ++++++++++++----------- dist/angular-meteor.bundle.min.js | 6 +- dist/angular-meteor.min.js | 4 +- dist/angular-meteor.min.js.map | 2 +- package.json | 1 - packages/angular-meteor-data/.versions | 20 +- packages/angular-meteor-data/package.js | 4 +- packages/angular-templates/.versions | 2 +- packages/angular-templates/package.js | 2 +- packages/angular-with-blaze/.versions | 4 +- packages/angular-with-blaze/package.js | 4 +- packages/angular/.versions | 6 +- packages/angular/package.js | 6 +- 14 files changed, 2252 insertions(+), 2236 deletions(-) diff --git a/bower.json b/bower.json index 0d51b5fc2..a6d284a0a 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "angular-meteor", "main": "./dist/angular-meteor.bundle.min.js", - "version": "1.3.6", + "version": "1.3.7-beta.1", "homepage": "https://github.com/Urigo/angular-meteor", "authors": [ "Uri Goldshtein " diff --git a/dist/angular-meteor.bundle.js b/dist/angular-meteor.bundle.js index 7dc31058e..636474e3f 100644 --- a/dist/angular-meteor.bundle.js +++ b/dist/angular-meteor.bundle.js @@ -9363,2201 +9363,2236 @@ var Promise = Package.promise.Promise; (function(){ -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// // -// packages/angular-meteor-data/lib/diff-array.js // -// // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // -/*global // - angular, _, Package // - */ // - // -'use strict'; // 5 - // -var _module = angular.module('diffArray', ['getUpdates']); // 7 - // -_module.factory('diffArray', ['getUpdates', function (getUpdates) { // 9 - var LocalCollection = Package.minimongo.LocalCollection; // 11 - var idStringify = LocalCollection._idStringify || Package['mongo-id'].MongoID.idStringify; // 12 - var idParse = LocalCollection._idParse || Package['mongo-id'].MongoID.idParse; // 13 - // - // Calculates the differences between `lastSeqArray` and // - // `seqArray` and calls appropriate functions from `callbacks`. // - // Reuses Minimongo's diff algorithm implementation. // - // XXX Should be replaced with the original diffArray function here: // - // https://github.com/meteor/meteor/blob/devel/packages/observe-sequence/observe_sequence.js#L152 // - // When it will become nested as well, tracking here: https://github.com/meteor/meteor/issues/3764 // - function diffArray(lastSeqArray, seqArray, callbacks, preventNestedDiff) { // 21 - preventNestedDiff = !!preventNestedDiff; // 22 - // - var diffFn = Package.minimongo.LocalCollection._diffQueryOrderedChanges || Package['diff-sequence'].DiffSequence.diffQueryOrderedChanges; - // - var oldObjIds = []; // 27 - var newObjIds = []; // 28 - var posOld = {}; // maps from idStringify'd ids // 29 - var posNew = {}; // ditto // 30 - var posCur = {}; // 31 - var lengthCur = lastSeqArray.length; // 32 - // - _.each(seqArray, function (doc, i) { // 34 - newObjIds.push({ _id: doc._id }); // 35 - posNew[idStringify(doc._id)] = i; // 36 - }); // - // - _.each(lastSeqArray, function (doc, i) { // 39 - oldObjIds.push({ _id: doc._id }); // 40 - posOld[idStringify(doc._id)] = i; // 41 - posCur[idStringify(doc._id)] = i; // 42 - }); // - // - // Arrays can contain arbitrary objects. We don't diff the // - // objects. Instead we always fire 'changedAt' callback on every // - // object. The consumer of `observe-sequence` should deal with // - // it appropriately. // - diffFn(oldObjIds, newObjIds, { // 49 - addedBefore: function (id, doc, before) { // 50 - var position = before ? posCur[idStringify(before)] : lengthCur; // 51 - // - _.each(posCur, function (pos, id) { // 53 - if (pos >= position) posCur[id]++; // 54 - }); // - // - lengthCur++; // 57 - posCur[idStringify(id)] = position; // 58 - // - callbacks.addedAt(id, seqArray[posNew[idStringify(id)]], position, before); // 60 - }, // - // - movedBefore: function (id, before) { // 68 - var prevPosition = posCur[idStringify(id)]; // 69 - var position = before ? posCur[idStringify(before)] : lengthCur - 1; // 70 - // - _.each(posCur, function (pos, id) { // 72 - if (pos >= prevPosition && pos <= position) posCur[id]--;else if (pos <= prevPosition && pos >= position) posCur[id]++; - }); // - // - posCur[idStringify(id)] = position; // 79 - // - callbacks.movedTo(id, seqArray[posNew[idStringify(id)]], prevPosition, position, before); // 81 - }, // - removed: function (id) { // 89 - var prevPosition = posCur[idStringify(id)]; // 90 - // - _.each(posCur, function (pos, id) { // 92 - if (pos >= prevPosition) posCur[id]--; // 93 - }); // - // - delete posCur[idStringify(id)]; // 96 - lengthCur--; // 97 - // - callbacks.removedAt(id, lastSeqArray[posOld[idStringify(id)]], prevPosition); // 99 - } // - }); // - // - _.each(posNew, function (pos, idString) { // 107 - if (!_.has(posOld, idString)) return; // 108 - // - var id = idParse(idString); // 110 - var newItem = seqArray[pos] || {}; // 111 - var oldItem = lastSeqArray[posOld[idString]]; // 112 - var updates = getUpdates(oldItem, newItem, preventNestedDiff); // 113 - // - if (!_.isEmpty(updates)) callbacks.changedAt(id, updates, pos, oldItem); // 115 - }); // - } // - // - diffArray.shallow = function (lastSeqArray, seqArray, callbacks) { // 120 - return diffArray(lastSeqArray, seqArray, callbacks, true); // 121 - }; // - // - diffArray.deepCopyChanges = function (oldItem, newItem) { // 124 - var setDiff = getUpdates(oldItem, newItem).$set; // 125 - // - _.each(setDiff, function (v, deepKey) { // 127 - setDeep(oldItem, deepKey, v); // 128 - }); // - }; // - // - diffArray.deepCopyRemovals = function (oldItem, newItem) { // 132 - var unsetDiff = getUpdates(oldItem, newItem).$unset; // 133 - // - _.each(unsetDiff, function (v, deepKey) { // 135 - unsetDeep(oldItem, deepKey); // 136 - }); // - }; // - // - // Finds changes between two collections // - diffArray.getChanges = function (newCollection, oldCollection, diffMethod) { // 141 - var changes = { added: [], removed: [], changed: [] }; // 142 - // - diffMethod(oldCollection, newCollection, { // 144 - addedAt: function (id, item, index) { // 145 - changes.added.push({ item: item, index: index }); // 146 - }, // - // - removedAt: function (id, item, index) { // 149 - changes.removed.push({ item: item, index: index }); // 150 - }, // - // - changedAt: function (id, updates, index, oldItem) { // 153 - changes.changed.push({ selector: id, modifier: updates }); // 154 - }, // - // - movedTo: function (id, item, fromIndex, toIndex) { // 157 - // XXX do we need this? // - } // - }); // - // - return changes; // 162 - }; // - // - var setDeep = function (obj, deepKey, v) { // 165 - var split = deepKey.split('.'); // 166 - var initialKeys = _.initial(split); // 167 - var lastKey = _.last(split); // 168 - // - initialKeys.reduce(function (subObj, k, i) { // 170 - var nextKey = split[i + 1]; // 171 - // - if (isNumStr(nextKey)) { // 173 - if (subObj[k] === null) subObj[k] = []; // 174 - if (subObj[k].length == parseInt(nextKey)) subObj[k].push(null); // 175 - } else if (subObj[k] === null || !isHash(subObj[k])) { // - subObj[k] = {}; // 179 - } // - // - return subObj[k]; // 182 - }, obj); // - // - var deepObj = getDeep(obj, initialKeys); // 185 - deepObj[lastKey] = v; // 186 - return v; // 187 - }; // - // - var unsetDeep = function (obj, deepKey) { // 190 - var split = deepKey.split('.'); // 191 - var initialKeys = _.initial(split); // 192 - var lastKey = _.last(split); // 193 - var deepObj = getDeep(obj, initialKeys); // 194 - // - if (_.isArray(deepObj) && isNumStr(lastKey)) return !!deepObj.splice(lastKey, 1);else return delete deepObj[lastKey]; - }; // - // - var getDeep = function (obj, keys) { // 202 - return keys.reduce(function (subObj, k) { // 203 - return subObj[k]; // 204 - }, obj); // - }; // - // - var isHash = function (obj) { // 208 - return _.isObject(obj) && Object.getPrototypeOf(obj) === Object.prototype; // 209 - }; // - // - var isNumStr = function (str) { // 213 - return str.match(/^\d+$/); // 214 - }; // - // - return diffArray; // 217 -}]); // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -}).call(this); - - - - - - -(function(){ - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// // -// packages/angular-meteor-data/lib/get-updates.js // -// // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // -/*global // - angular, _ // - */ // - // -'use strict'; // 5 - // -// https://github.com/DAB0mB/get-updates // -(function () { // 8 - var module = angular.module('getUpdates', []); // 9 - // - var utils = (function () { // 11 - var rip = function (obj, level) { // 12 - if (level < 1) return {}; // 13 - // - return _.reduce(obj, function (clone, v, k) { // 15 - v = _.isObject(v) ? rip(v, --level) : v; // 16 - clone[k] = v; // 17 - return clone; // 18 - }, {}); // - }; // - // - var toPaths = function (obj) { // 22 - var keys = getKeyPaths(obj); // 23 - var values = getDeepValues(obj); // 24 - return _.object(keys, values); // 25 - }; // - // - var getKeyPaths = function (obj) { // 28 - var keys = _.keys(obj).map(function (k) { // 29 - var v = obj[k]; // 30 - if (!_.isObject(v) || _.isEmpty(v) || _.isArray(v)) return k; // 31 - // - return getKeyPaths(v).map(function (subKey) { // 33 - return k + '.' + subKey; // 34 - }); // - }); // - // - return _.flatten(keys); // 38 - }; // - // - var getDeepValues = function (obj, arr) { // 41 - arr = arr || []; // 42 - // - _.values(obj).forEach(function (v) { // 44 - if (!_.isObject(v) || _.isEmpty(v) || _.isArray(v)) arr.push(v);else getDeepValues(v, arr); // 45 - }); // - // - return arr; // 51 - }; // - // - var flatten = function (arr) { // 54 - return arr.reduce(function (flattened, v, i) { // 55 - if (_.isArray(v) && !_.isEmpty(v)) flattened.push.apply(flattened, flatten(v));else flattened.push(v); // 56 - // - return flattened; // 61 - }, []); // - }; // - // - var setFilled = function (obj, k, v) { // 65 - if (!_.isEmpty(v)) obj[k] = v; // 66 - }; // - // - var assert = function (result, msg) { // 69 - if (!result) throwErr(msg); // 70 - }; // - // - var throwErr = function (msg) { // 73 - throw Error('get-updates error - ' + msg); // 74 - }; // - // - return { // 77 - rip: rip, // 78 - toPaths: toPaths, // 79 - getKeyPaths: getKeyPaths, // 80 - getDeepValues: getDeepValues, // 81 - setFilled: setFilled, // 82 - assert: assert, // 83 - throwErr: throwErr // 84 - }; // - })(); // - // - var getDifference = (function () { // 88 - var getDifference = function (src, dst, isShallow) { // 89 - var level; // 90 - // - if (isShallow > 1) level = isShallow;else if (isShallow) level = 1; // 92 - // - if (level) { // 97 - src = utils.rip(src, level); // 98 - dst = utils.rip(dst, level); // 99 - } // - // - return compare(src, dst); // 102 - }; // - // - var compare = function (src, dst) { // 105 - var srcKeys = _.keys(src); // 106 - var dstKeys = _.keys(dst); // 107 - // - var keys = _.chain([]).concat(srcKeys).concat(dstKeys).uniq().without('$$hashKey').value(); // 109 - // - return keys.reduce(function (diff, k) { // 116 - var srcValue = src[k]; // 117 - var dstValue = dst[k]; // 118 - // - if (_.isDate(srcValue) && _.isDate(dstValue)) { // 120 - if (srcValue.getTime() != dstValue.getTime()) diff[k] = dstValue; // 121 - } // - // - if (_.isObject(srcValue) && _.isObject(dstValue)) { // 124 - var valueDiff = getDifference(srcValue, dstValue); // 125 - utils.setFilled(diff, k, valueDiff); // 126 - } else if (srcValue !== dstValue) { // - diff[k] = dstValue; // 130 - } // - // - return diff; // 133 - }, {}); // - }; // - // - return getDifference; // 137 - })(); // - // - var getUpdates = (function () { // 140 - var getUpdates = function (src, dst, isShallow) { // 141 - utils.assert(_.isObject(src), 'first argument must be an object'); // 142 - utils.assert(_.isObject(dst), 'second argument must be an object'); // 143 - // - var diff = getDifference(src, dst, isShallow); // 145 - var paths = utils.toPaths(diff); // 146 - // - var set = createSet(paths); // 148 - var unset = createUnset(paths); // 149 - var pull = createPull(unset); // 150 - // - var updates = {}; // 152 - utils.setFilled(updates, '$set', set); // 153 - utils.setFilled(updates, '$unset', unset); // 154 - utils.setFilled(updates, '$pull', pull); // 155 - // - return updates; // 157 - }; // - // - var createSet = function (paths) { // 160 - var undefinedKeys = getUndefinedKeys(paths); // 161 - return _.omit(paths, undefinedKeys); // 162 - }; // - // - var createUnset = function (paths) { // 165 - var undefinedKeys = getUndefinedKeys(paths); // 166 - var unset = _.pick(paths, undefinedKeys); // 167 - // - return _.reduce(unset, function (result, v, k) { // 169 - result[k] = true; // 170 - return result; // 171 - }, {}); // - }; // - // - var createPull = function (unset) { // 175 - var arrKeyPaths = _.keys(unset).map(function (k) { // 176 - var split = k.match(/(.*)\.\d+$/); // 177 - return split && split[1]; // 178 - }); // - // - return _.compact(arrKeyPaths).reduce(function (pull, k) { // 181 - pull[k] = null; // 182 - return pull; // 183 - }, {}); // - }; // - // - var getUndefinedKeys = function (obj) { // 187 - return _.keys(obj).filter(function (k) { // 188 - var v = obj[k]; // 189 - return _.isUndefined(v); // 190 - }); // - }; // - // - return getUpdates; // 194 - })(); // - // - module.value('getUpdates', getUpdates); // 197 -})(); // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -}).call(this); - - - - - - -(function(){ - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// // -// packages/angular-meteor-data/modules/angular-meteor-subscribe.js // -// // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // -/*global // - angular, Meteor // - */ // - // -'use strict'; // 5 -var angularMeteorSubscribe = angular.module('angular-meteor.subscribe', []); // 6 - // -angularMeteorSubscribe.service('$meteorSubscribe', ['$q', '$angularMeteorSettings', function ($q, $angularMeteorSettings) { - // - var self = this; // 11 - // - this._subscribe = function (scope, deferred, args) { // 13 - if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.subscribe] Please note that this module is deprecated since 1.3.0 and will be removed in 1.4.0! Replace it with the new syntax described here: http://www.angular-meteor.com/api/1.3.6/subscribe. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); - // - var subscription = null; // 17 - var lastArg = args[args.length - 1]; // 18 - // - // User supplied onStop callback // - // save it for later use and remove // - // from subscription arguments // - if (angular.isObject(lastArg) && angular.isFunction(lastArg.onStop)) { // 23 - var onStop = lastArg.onStop; // 25 - // - args.pop(); // 27 - } // - // - args.push({ // 30 - onReady: function () { // 31 - deferred.resolve(subscription); // 32 - }, // - onStop: function (err) { // 34 - if (!deferred.promise.$$state.status) { // 35 - if (err) deferred.reject(err);else deferred.reject(new Meteor.Error("Subscription Stopped", "Subscription stopped by a call to stop method. Either by the client or by the server.")); - } else if (onStop) // - // After promise was resolved or rejected // - // call user supplied onStop callback. // - onStop.apply(this, Array.prototype.slice.call(arguments)); // 44 - } // - }); // - // - subscription = Meteor.subscribe.apply(scope, args); // 49 - // - return subscription; // 51 - }; // - // - this.subscribe = function () { // 54 - var deferred = $q.defer(); // 55 - var args = Array.prototype.slice.call(arguments); // 56 - var subscription = null; // 57 - // - self._subscribe(this, deferred, args); // 59 - // - return deferred.promise; // 61 - }; // -}]); // - // -angularMeteorSubscribe.run(['$rootScope', '$q', '$meteorSubscribe', function ($rootScope, $q, $meteorSubscribe) { // 65 - Object.getPrototypeOf($rootScope).$meteorSubscribe = function () { // 67 - var deferred = $q.defer(); // 68 - var args = Array.prototype.slice.call(arguments); // 69 - // - var subscription = $meteorSubscribe._subscribe(this, deferred, args); // 71 - // - this.$on('$destroy', function () { // 73 - subscription.stop(); // 74 - }); // - // - return deferred.promise; // 77 - }; // -}]); // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -}).call(this); - - - - - - -(function(){ - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// // -// packages/angular-meteor-data/modules/angular-meteor-stopper.js // -// // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // -/*global // - angular // - */ // - // -'use strict'; // 5 - // -var angularMeteorStopper = angular.module('angular-meteor.stopper', ['angular-meteor.subscribe']); // 7 - // -angularMeteorStopper.factory('$meteorStopper', ['$q', '$meteorSubscribe', function ($q, $meteorSubscribe) { // 10 - function $meteorStopper($meteorEntity) { // 12 - return function () { // 13 - var args = Array.prototype.slice.call(arguments); // 14 - var meteorEntity = $meteorEntity.apply(this, args); // 15 - // - angular.extend(meteorEntity, $meteorStopper); // 17 - meteorEntity.$$scope = this; // 18 - // - this.$on('$destroy', function () { // 20 - meteorEntity.stop(); // 21 - if (meteorEntity.subscription) meteorEntity.subscription.stop(); // 22 - }); // - // - return meteorEntity; // 25 - }; // - } // - // - $meteorStopper.subscribe = function () { // 29 - var args = Array.prototype.slice.call(arguments); // 30 - this.subscription = $meteorSubscribe._subscribe(this.$$scope, $q.defer(), args); // 31 - return this; // 32 - }; // - // - return $meteorStopper; // 35 -}]); // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -}).call(this); - - - - - - -(function(){ - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// // -// packages/angular-meteor-data/modules/angular-meteor-collection.js // -// // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // -/*global // - angular, _, Tracker, check, Match, Mongo // - */ // - // -'use strict'; // 5 - // -var angularMeteorCollection = angular.module('angular-meteor.collection', ['angular-meteor.stopper', 'angular-meteor.subscribe', 'angular-meteor.utils', 'diffArray']); - // -// The reason angular meteor collection is a factory function and not something // -// that inherit from array comes from here: // -// http://perfectionkills.com/how-ecmascript-5-still-does-not-allow-to-subclass-an-array/ // -// We went with the direct extensions approach. // -angularMeteorCollection.factory('AngularMeteorCollection', ['$q', '$meteorSubscribe', '$meteorUtils', '$rootScope', '$timeout', 'diffArray', '$angularMeteorSettings', function ($q, $meteorSubscribe, $meteorUtils, $rootScope, $timeout, diffArray, $angularMeteorSettings) { - // - function AngularMeteorCollection(curDefFunc, collection, diffArrayFunc, autoClientSave) { // 18 - if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.$meteorCollection] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorCollection. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); - // - var data = []; // 22 - // Server backup data to evaluate what changes come from client // - // after each server update. // - data._serverBackup = []; // 25 - // Array differ function. // - data._diffArrayFunc = diffArrayFunc; // 27 - // Handler of the cursor observer. // - data._hObserve = null; // 29 - // On new cursor autorun handler // - // (autorun for reactive variables). // - data._hNewCurAutorun = null; // 32 - // On new data autorun handler // - // (autorun for cursor.fetch). // - data._hDataAutorun = null; // 35 - // - if (angular.isDefined(collection)) { // 37 - data.$$collection = collection; // 38 - } else { // - var cursor = curDefFunc(); // 40 - data.$$collection = $meteorUtils.getCollectionByName(cursor.collection.name); // 41 - } // - // - _.extend(data, AngularMeteorCollection); // 44 - data._startCurAutorun(curDefFunc, autoClientSave); // 45 - // - return data; // 47 - } // - // - AngularMeteorCollection._startCurAutorun = function (curDefFunc, autoClientSave) { // 50 - var self = this; // 51 - // - self._hNewCurAutorun = Tracker.autorun(function () { // 53 - // When the reactive func gets recomputated we need to stop any previous // - // observeChanges. // - Tracker.onInvalidate(function () { // 56 - self._stopCursor(); // 57 - }); // - // - if (autoClientSave) self._setAutoClientSave(); // 60 - self._updateCursor(curDefFunc(), autoClientSave); // 61 - }); // - }; // - // - AngularMeteorCollection.subscribe = function () { // 65 - $meteorSubscribe.subscribe.apply(this, arguments); // 66 - return this; // 67 - }; // - // - AngularMeteorCollection.save = function (docs, useUnsetModifier) { // 70 - // save whole collection // - if (!docs) docs = this; // 72 - // save single doc // - docs = [].concat(docs); // 74 - // - var promises = docs.map(function (doc) { // 76 - return this._upsertDoc(doc, useUnsetModifier); // 77 - }, this); // - // - return $meteorUtils.promiseAll(promises); // 80 - }; // - // - AngularMeteorCollection._upsertDoc = function (doc, useUnsetModifier) { // 83 - var deferred = $q.defer(); // 84 - var collection = this.$$collection; // 85 - var createFulfill = _.partial($meteorUtils.fulfill, deferred, null); // 86 - // - // delete $$hashkey // - doc = $meteorUtils.stripDollarPrefixedKeys(doc); // 89 - var docId = doc._id; // 90 - var isExist = collection.findOne(docId); // 91 - // - // update // - if (isExist) { // 94 - // Deletes _id property (from the copy) so that // - // it can be $set using update. // - delete doc._id; // 97 - var modifier = useUnsetModifier ? { $unset: doc } : { $set: doc }; // 98 - // NOTE: do not use #upsert() method, since it does not exist in some collections // - collection.update(docId, modifier, createFulfill(function () { // 100 - return { _id: docId, action: 'updated' }; // 101 - })); // - } // - // insert // - else { // - collection.insert(doc, createFulfill(function (id) { // 106 - return { _id: id, action: 'inserted' }; // 107 - })); // - } // - // - return deferred.promise; // 111 - }; // - // - // performs $pull operations parallely. // - // used for handling splice operations returned from getUpdates() to prevent conflicts. // - // see issue: https://github.com/Urigo/angular-meteor/issues/793 // - AngularMeteorCollection._updateDiff = function (selector, update, callback) { // 117 - callback = callback || angular.noop; // 118 - var setters = _.omit(update, '$pull'); // 119 - var updates = [setters]; // 120 - // - _.each(update.$pull, function (pull, prop) { // 122 - var puller = {}; // 123 - puller[prop] = pull; // 124 - updates.push({ $pull: puller }); // 125 - }); // - // - this._updateParallel(selector, updates, callback); // 128 - }; // - // - // performs each update operation parallely // - AngularMeteorCollection._updateParallel = function (selector, updates, callback) { // 132 - var self = this; // 133 - var done = _.after(updates.length, callback); // 134 - // - var next = function (err, affectedDocsNum) { // 136 - if (err) return callback(err); // 137 - done(null, affectedDocsNum); // 138 - }; // - // - _.each(updates, function (update) { // 141 - self.$$collection.update(selector, update, next); // 142 - }); // - }; // - // - AngularMeteorCollection.remove = function (keyOrDocs) { // 146 - var keys; // 147 - // - // remove whole collection // - if (!keyOrDocs) { // 150 - keys = _.pluck(this, '_id'); // 151 - } // - // remove docs // - else { // - keyOrDocs = [].concat(keyOrDocs); // 155 - // - keys = _.map(keyOrDocs, function (keyOrDoc) { // 157 - return keyOrDoc._id || keyOrDoc; // 158 - }); // - } // - // - // Checks if all keys are correct. // - check(keys, [Match.OneOf(String, Mongo.ObjectID)]); // 163 - // - var promises = keys.map(function (key) { // 165 - return this._removeDoc(key); // 166 - }, this); // - // - return $meteorUtils.promiseAll(promises); // 169 - }; // - // - AngularMeteorCollection._removeDoc = function (id) { // 172 - var deferred = $q.defer(); // 173 - var collection = this.$$collection; // 174 - var fulfill = $meteorUtils.fulfill(deferred, null, { _id: id, action: 'removed' }); // 175 - collection.remove(id, fulfill); // 176 - return deferred.promise; // 177 - }; // - // - AngularMeteorCollection._updateCursor = function (cursor, autoClientSave) { // 180 - var self = this; // 181 - // XXX - consider adding an option for a non-orderd result for faster performance // - if (self._hObserve) self._stopObserving(); // 183 - // - self._hObserve = cursor.observe({ // 186 - addedAt: function (doc, atIndex) { // 187 - self.splice(atIndex, 0, doc); // 188 - self._serverBackup.splice(atIndex, 0, doc); // 189 - self._setServerUpdateMode(); // 190 - }, // - // - changedAt: function (doc, oldDoc, atIndex) { // 193 - diffArray.deepCopyChanges(self[atIndex], doc); // 194 - diffArray.deepCopyRemovals(self[atIndex], doc); // 195 - self._serverBackup[atIndex] = self[atIndex]; // 196 - self._setServerUpdateMode(); // 197 - }, // - // - movedTo: function (doc, fromIndex, toIndex) { // 200 - self.splice(fromIndex, 1); // 201 - self.splice(toIndex, 0, doc); // 202 - self._serverBackup.splice(fromIndex, 1); // 203 - self._serverBackup.splice(toIndex, 0, doc); // 204 - self._setServerUpdateMode(); // 205 - }, // - // - removedAt: function (oldDoc) { // 208 - var removedIndex = $meteorUtils.findIndexById(self, oldDoc); // 209 - // - if (removedIndex != -1) { // 211 - self.splice(removedIndex, 1); // 212 - self._serverBackup.splice(removedIndex, 1); // 213 - self._setServerUpdateMode(); // 214 - } else { // - // If it's been removed on client then it's already not in collection // - // itself but still is in the _serverBackup. // - removedIndex = $meteorUtils.findIndexById(self._serverBackup, oldDoc); // 218 - // - if (removedIndex != -1) { // 220 - self._serverBackup.splice(removedIndex, 1); // 221 - } // - } // - } // - }); // - // - self._hDataAutorun = Tracker.autorun(function () { // 227 - cursor.fetch(); // 228 - if (self._serverMode) self._unsetServerUpdateMode(autoClientSave); // 229 - }); // - }; // - // - AngularMeteorCollection._stopObserving = function () { // 233 - this._hObserve.stop(); // 234 - this._hDataAutorun.stop(); // 235 - delete this._serverMode; // 236 - delete this._hUnsetTimeout; // 237 - }; // - // - AngularMeteorCollection._setServerUpdateMode = function (name) { // 240 - this._serverMode = true; // 241 - // To simplify server update logic, we don't follow // - // updates from the client at the same time. // - this._unsetAutoClientSave(); // 244 - }; // - // - // Here we use $timeout to combine multiple updates that go // - // each one after another. // - AngularMeteorCollection._unsetServerUpdateMode = function (autoClientSave) { // 249 - var self = this; // 250 - // - if (self._hUnsetTimeout) { // 252 - $timeout.cancel(self._hUnsetTimeout); // 253 - self._hUnsetTimeout = null; // 254 - } // - // - self._hUnsetTimeout = $timeout(function () { // 257 - self._serverMode = false; // 258 - // Finds updates that was potentially done from the client side // - // and saves them. // - var changes = diffArray.getChanges(self, self._serverBackup, self._diffArrayFunc); // 261 - self._saveChanges(changes); // 262 - // After, continues following client updates. // - if (autoClientSave) self._setAutoClientSave(); // 264 - }, 0); // - }; // - // - AngularMeteorCollection.stop = function () { // 268 - this._stopCursor(); // 269 - this._hNewCurAutorun.stop(); // 270 - }; // - // - AngularMeteorCollection._stopCursor = function () { // 273 - this._unsetAutoClientSave(); // 274 - // - if (this._hObserve) { // 276 - this._hObserve.stop(); // 277 - this._hDataAutorun.stop(); // 278 - } // - // - this.splice(0); // 281 - this._serverBackup.splice(0); // 282 - }; // - // - AngularMeteorCollection._unsetAutoClientSave = function (name) { // 285 - if (this._hRegAutoBind) { // 286 - this._hRegAutoBind(); // 287 - this._hRegAutoBind = null; // 288 - } // - }; // - // - AngularMeteorCollection._setAutoClientSave = function () { // 292 - var self = this; // 293 - // - // Always unsets auto save to keep only one $watch handler. // - self._unsetAutoClientSave(); // 296 - // - self._hRegAutoBind = $rootScope.$watch(function () { // 298 - return self; // 299 - }, function (nItems, oItems) { // - if (nItems === oItems) return; // 301 - // - var changes = diffArray.getChanges(self, oItems, self._diffArrayFunc); // 303 - self._unsetAutoClientSave(); // 304 - self._saveChanges(changes); // 305 - self._setAutoClientSave(); // 306 - }, true); // - }; // - // - AngularMeteorCollection._saveChanges = function (changes) { // 310 - var self = this; // 311 - // - // Saves added documents // - // Using reversed iteration to prevent indexes from changing during splice // - var addedDocs = changes.added.reverse().map(function (descriptor) { // 315 - self.splice(descriptor.index, 1); // 316 - return descriptor.item; // 317 - }); // - // - if (addedDocs.length) self.save(addedDocs); // 320 - // - // Removes deleted documents // - var removedDocs = changes.removed.map(function (descriptor) { // 323 - return descriptor.item; // 324 - }); // - // - if (removedDocs.length) self.remove(removedDocs); // 327 - // - // Updates changed documents // - changes.changed.forEach(function (descriptor) { // 330 - self._updateDiff(descriptor.selector, descriptor.modifier); // 331 - }); // - }; // - // - return AngularMeteorCollection; // 335 -}]); // - // -angularMeteorCollection.factory('$meteorCollectionFS', ['$meteorCollection', 'diffArray', '$angularMeteorSettings', function ($meteorCollection, diffArray, $angularMeteorSettings) { - function $meteorCollectionFS(reactiveFunc, autoClientSave, collection) { // 341 - // - if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.$meteorCollectionFS] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/files. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); - return new $meteorCollection(reactiveFunc, autoClientSave, collection, diffArray.shallow); // 345 - } // - // - return $meteorCollectionFS; // 348 -}]); // - // -angularMeteorCollection.factory('$meteorCollection', ['AngularMeteorCollection', '$rootScope', 'diffArray', function (AngularMeteorCollection, $rootScope, diffArray) { - function $meteorCollection(reactiveFunc, autoClientSave, collection, diffFn) { // 354 - // Validate parameters // - if (!reactiveFunc) { // 356 - throw new TypeError('The first argument of $meteorCollection is undefined.'); // 357 - } // - // - if (!(angular.isFunction(reactiveFunc) || angular.isFunction(reactiveFunc.find))) { // 360 - throw new TypeError('The first argument of $meteorCollection must be a function or ' + 'a have a find function property.'); - } // - // - if (!angular.isFunction(reactiveFunc)) { // 366 - collection = angular.isDefined(collection) ? collection : reactiveFunc; // 367 - reactiveFunc = _.bind(reactiveFunc.find, reactiveFunc); // 368 - } // - // - // By default auto save - true. // - autoClientSave = angular.isDefined(autoClientSave) ? autoClientSave : true; // 372 - diffFn = diffFn || diffArray; // 373 - return new AngularMeteorCollection(reactiveFunc, collection, diffFn, autoClientSave); // 374 - } // - // - return $meteorCollection; // 377 -}]); // - // -angularMeteorCollection.run(['$rootScope', '$meteorCollection', '$meteorCollectionFS', '$meteorStopper', function ($rootScope, $meteorCollection, $meteorCollectionFS, $meteorStopper) { - var scopeProto = Object.getPrototypeOf($rootScope); // 383 - scopeProto.$meteorCollection = $meteorStopper($meteorCollection); // 384 - scopeProto.$meteorCollectionFS = $meteorStopper($meteorCollectionFS); // 385 -}]); // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -}).call(this); - - - - - - -(function(){ - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// // -// packages/angular-meteor-data/modules/angular-meteor-object.js // -// // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // -/*global // - angular, _, Mongo // -*/ // - // -'use strict'; // 5 - // -var angularMeteorObject = angular.module('angular-meteor.object', ['angular-meteor.utils', 'angular-meteor.subscribe', 'angular-meteor.collection', 'getUpdates', 'diffArray']); - // -angularMeteorObject.factory('AngularMeteorObject', ['$q', '$meteorSubscribe', '$meteorUtils', 'diffArray', 'getUpdates', 'AngularMeteorCollection', '$angularMeteorSettings', function ($q, $meteorSubscribe, $meteorUtils, diffArray, getUpdates, AngularMeteorCollection, $angularMeteorSettings) { - // - // A list of internals properties to not watch for, nor pass to the Document on update and etc. // - AngularMeteorObject.$$internalProps = ['$$collection', '$$options', '$$id', '$$hashkey', '$$internalProps', '$$scope', 'bind', 'save', 'reset', 'subscribe', 'stop', 'autorunComputation', 'unregisterAutoBind', 'unregisterAutoDestroy', 'getRawObject', '_auto', '_setAutos', '_eventEmitter', '_serverBackup', '_updateDiff', '_updateParallel', '_getId']; - // - function AngularMeteorObject(collection, selector, options) { // 21 - if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.$meteorObject] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorObject. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); - // Make data not be an object so we can extend it to preserve // - // Collection Helpers and the like // - var helpers = collection._helpers; // 26 - var data = _.isFunction(helpers) ? Object.create(helpers.prototype) : {}; // 27 - var doc = collection.findOne(selector, options); // 28 - var collectionExtension = _.pick(AngularMeteorCollection, '_updateParallel'); // 29 - _.extend(data, doc); // 30 - _.extend(data, AngularMeteorObject); // 31 - _.extend(data, collectionExtension); // 32 - // - // Omit options that may spoil document finding // - data.$$options = _.omit(options, 'skip', 'limit'); // 35 - data.$$collection = collection; // 36 - data.$$id = data._getId(selector); // 37 - data._serverBackup = doc || {}; // 38 - // - return data; // 40 - } // - // - AngularMeteorObject.getRawObject = function () { // 43 - return angular.copy(_.omit(this, this.$$internalProps)); // 44 - }; // - // - AngularMeteorObject.subscribe = function () { // 47 - $meteorSubscribe.subscribe.apply(this, arguments); // 48 - return this; // 49 - }; // - // - AngularMeteorObject.save = function (custom) { // 52 - var deferred = $q.defer(); // 53 - var collection = this.$$collection; // 54 - var createFulfill = _.partial($meteorUtils.fulfill, deferred, null); // 55 - var oldDoc = collection.findOne(this.$$id); // 56 - var mods; // 57 - // - // update // - if (oldDoc) { // 60 - if (custom) mods = { $set: custom };else { // 61 - mods = getUpdates(oldDoc, this.getRawObject()); // 64 - // If there are no updates, there is nothing to do here, returning // - if (_.isEmpty(mods)) { // 66 - return $q.when({ action: 'updated' }); // 67 - } // - } // - // - // NOTE: do not use #upsert() method, since it does not exist in some collections // - this._updateDiff(mods, createFulfill({ action: 'updated' })); // 72 - } // - // insert // - else { // - if (custom) mods = _.clone(custom);else mods = this.getRawObject(); // 76 - // - mods._id = mods._id || this.$$id; // 81 - collection.insert(mods, createFulfill({ action: 'inserted' })); // 82 - } // - // - return deferred.promise; // 85 - }; // - // - AngularMeteorObject._updateDiff = function (update, callback) { // 88 - var selector = this.$$id; // 89 - AngularMeteorCollection._updateDiff.call(this, selector, update, callback); // 90 - }; // - // - AngularMeteorObject.reset = function (keepClientProps) { // 93 - var self = this; // 94 - var options = this.$$options; // 95 - var id = this.$$id; // 96 - var doc = this.$$collection.findOne(id, options); // 97 - // - if (doc) { // 99 - // extend SubObject // - var docKeys = _.keys(doc); // 101 - var docExtension = _.pick(doc, docKeys); // 102 - var clientProps; // 103 - // - _.extend(self, docExtension); // 105 - _.extend(self._serverBackup, docExtension); // 106 - // - if (keepClientProps) { // 108 - clientProps = _.intersection(_.keys(self), _.keys(self._serverBackup)); // 109 - } else { // - clientProps = _.keys(self); // 111 - } // - // - var serverProps = _.keys(doc); // 114 - var removedKeys = _.difference(clientProps, serverProps, self.$$internalProps); // 115 - // - removedKeys.forEach(function (prop) { // 117 - delete self[prop]; // 118 - delete self._serverBackup[prop]; // 119 - }); // - } else { // - _.keys(this.getRawObject()).forEach(function (prop) { // 124 - delete self[prop]; // 125 - }); // - // - self._serverBackup = {}; // 128 - } // - }; // - // - AngularMeteorObject.stop = function () { // 132 - if (this.unregisterAutoDestroy) this.unregisterAutoDestroy(); // 133 - // - if (this.unregisterAutoBind) this.unregisterAutoBind(); // 136 - // - if (this.autorunComputation && this.autorunComputation.stop) this.autorunComputation.stop(); // 139 - }; // - // - AngularMeteorObject._getId = function (selector) { // 143 - var options = _.extend({}, this.$$options, { // 144 - fields: { _id: 1 }, // 145 - reactive: false, // 146 - transform: null // 147 - }); // - // - var doc = this.$$collection.findOne(selector, options); // 150 - // - if (doc) return doc._id; // 152 - if (selector instanceof Mongo.ObjectID) return selector; // 153 - if (_.isString(selector)) return selector; // 154 - return new Mongo.ObjectID(); // 155 - }; // - // - return AngularMeteorObject; // 158 -}]); // - // -angularMeteorObject.factory('$meteorObject', ['$rootScope', '$meteorUtils', 'getUpdates', 'AngularMeteorObject', function ($rootScope, $meteorUtils, getUpdates, AngularMeteorObject) { - function $meteorObject(collection, id, auto, options) { // 165 - // Validate parameters // - if (!collection) { // 167 - throw new TypeError("The first argument of $meteorObject is undefined."); // 168 - } // - // - if (!angular.isFunction(collection.findOne)) { // 171 - throw new TypeError("The first argument of $meteorObject must be a function or a have a findOne function property."); - } // - // - var data = new AngularMeteorObject(collection, id, options); // 175 - // Making auto default true - http://stackoverflow.com/a/15464208/1426570 // - data._auto = auto !== false; // 177 - _.extend(data, $meteorObject); // 178 - data._setAutos(); // 179 - return data; // 180 - } // - // - $meteorObject._setAutos = function () { // 183 - var self = this; // 184 - // - this.autorunComputation = $meteorUtils.autorun($rootScope, function () { // 186 - self.reset(true); // 187 - }); // - // - // Deep watches the model and performs autobind // - this.unregisterAutoBind = this._auto && $rootScope.$watch(function () { // 191 - return self.getRawObject(); // 192 - }, function (item, oldItem) { // - if (item !== oldItem) self.save(); // 194 - }, true); // - // - this.unregisterAutoDestroy = $rootScope.$on('$destroy', function () { // 197 - if (self && self.stop) self.pop(); // 198 - }); // - }; // - // - return $meteorObject; // 202 -}]); // - // -angularMeteorObject.run(['$rootScope', '$meteorObject', '$meteorStopper', function ($rootScope, $meteorObject, $meteorStopper) { - var scopeProto = Object.getPrototypeOf($rootScope); // 208 - scopeProto.$meteorObject = $meteorStopper($meteorObject); // 209 -}]); // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -}).call(this); - - - - - - -(function(){ - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// // -// packages/angular-meteor-data/modules/angular-meteor-ironrouter.js // -// // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // -angular.module('angular-meteor.ironrouter', []).run(['$compile', '$document', '$rootScope', function ($compile, $document, $rootScope) { - var Router = (Package['iron:router'] || {}).Router; // 10 - if (!Router) return; // 11 - // - var isLoaded = false; // 13 - // - // Recompile after iron:router builds page // - Router.onAfterAction(function (req, res, next) { // 16 - Tracker.afterFlush(function () { // 17 - if (isLoaded) return; // 18 - $compile($document)($rootScope); // 19 - if (!$rootScope.$$phase) $rootScope.$apply(); // 20 - isLoaded = true; // 21 - }); // - }); // -}]); // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -}).call(this); - - - - - - -(function(){ - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// // -// packages/angular-meteor-data/modules/angular-meteor-user.js // -// // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // -/*global // - angular, _, Package, Meteor // - */ // - // -'use strict'; // 5 - // -var angularMeteorUser = angular.module('angular-meteor.user', ['angular-meteor.utils', 'angular-meteor.core']); // 7 - // -// requires package 'accounts-password' // -angularMeteorUser.service('$meteorUser', ['$rootScope', '$meteorUtils', '$q', '$angularMeteorSettings', function ($rootScope, $meteorUtils, $q, $angularMeteorSettings) { - // - var pack = Package['accounts-base']; // 17 - if (!pack) return; // 18 - // - var self = this; // 20 - var Accounts = pack.Accounts; // 21 - // - this.waitForUser = function () { // 23 - if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.waitForUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); - // - var deferred = $q.defer(); // 27 - // - $meteorUtils.autorun($rootScope, function () { // 29 - if (!Meteor.loggingIn()) deferred.resolve(Meteor.user()); // 30 - }, true); // - // - return deferred.promise; // 34 - }; // - // - this.requireUser = function () { // 37 - if (!$angularMeteorSettings.suppressWarnings) { // 38 - console.warn('[angular-meteor.requireUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); - } // - // - var deferred = $q.defer(); // 42 - // - $meteorUtils.autorun($rootScope, function () { // 44 - if (!Meteor.loggingIn()) { // 45 - if (Meteor.user() === null) deferred.reject("AUTH_REQUIRED");else deferred.resolve(Meteor.user()); // 46 - } // - }, true); // - // - return deferred.promise; // 53 - }; // - // - this.requireValidUser = function (validatorFn) { // 56 - if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.requireValidUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); - // - return self.requireUser(true).then(function (user) { // 60 - var valid = validatorFn(user); // 61 - // - if (valid === true) return user;else if (typeof valid === "string") return $q.reject(valid);else return $q.reject("FORBIDDEN"); - }); // - }; // - // - this.loginWithPassword = $meteorUtils.promissor(Meteor, 'loginWithPassword'); // 72 - this.createUser = $meteorUtils.promissor(Accounts, 'createUser'); // 73 - this.changePassword = $meteorUtils.promissor(Accounts, 'changePassword'); // 74 - this.forgotPassword = $meteorUtils.promissor(Accounts, 'forgotPassword'); // 75 - this.resetPassword = $meteorUtils.promissor(Accounts, 'resetPassword'); // 76 - this.verifyEmail = $meteorUtils.promissor(Accounts, 'verifyEmail'); // 77 - this.logout = $meteorUtils.promissor(Meteor, 'logout'); // 78 - this.logoutOtherClients = $meteorUtils.promissor(Meteor, 'logoutOtherClients'); // 79 - this.loginWithFacebook = $meteorUtils.promissor(Meteor, 'loginWithFacebook'); // 80 - this.loginWithTwitter = $meteorUtils.promissor(Meteor, 'loginWithTwitter'); // 81 - this.loginWithGoogle = $meteorUtils.promissor(Meteor, 'loginWithGoogle'); // 82 - this.loginWithGithub = $meteorUtils.promissor(Meteor, 'loginWithGithub'); // 83 - this.loginWithMeteorDeveloperAccount = $meteorUtils.promissor(Meteor, 'loginWithMeteorDeveloperAccount'); // 84 - this.loginWithMeetup = $meteorUtils.promissor(Meteor, 'loginWithMeetup'); // 85 - this.loginWithWeibo = $meteorUtils.promissor(Meteor, 'loginWithWeibo'); // 86 -}]); // - // -angularMeteorUser.run(['$rootScope', '$angularMeteorSettings', '$$Core', function ($rootScope, $angularMeteorSettings, $$Core) { - // - var ScopeProto = Object.getPrototypeOf($rootScope); // 94 - _.extend(ScopeProto, $$Core); // 95 - // - $rootScope.autorun(function () { // 97 - if (!Meteor.user) return; // 98 - $rootScope.currentUser = Meteor.user(); // 99 - $rootScope.loggingIn = Meteor.loggingIn(); // 100 - }); // -}]); // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -}).call(this); - - - - - - -(function(){ - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// // -// packages/angular-meteor-data/modules/angular-meteor-methods.js // -// // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // -/*global // - angular, _, Meteor // - */ // - // -'use strict'; // 5 - // -var angularMeteorMethods = angular.module('angular-meteor.methods', ['angular-meteor.utils']); // 7 - // -angularMeteorMethods.service('$meteorMethods', ['$q', '$meteorUtils', '$angularMeteorSettings', function ($q, $meteorUtils, $angularMeteorSettings) { - this.call = function () { // 12 - if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.$meteor.call] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/methods. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); - // - var deferred = $q.defer(); // 16 - var fulfill = $meteorUtils.fulfill(deferred); // 17 - var args = _.toArray(arguments).concat(fulfill); // 18 - Meteor.call.apply(this, args); // 19 - return deferred.promise; // 20 - }; // -}]); // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -}).call(this); - - - - - - -(function(){ - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// // -// packages/angular-meteor-data/modules/angular-meteor-session.js // -// // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // -/*global // - angular, Session // - */ // - // -'use strict'; // 5 -var angularMeteorSession = angular.module('angular-meteor.session', ['angular-meteor.utils']); // 6 - // -angularMeteorSession.factory('$meteorSession', ['$meteorUtils', '$parse', '$angularMeteorSettings', function ($meteorUtils, $parse, $angularMeteorSettings) { - return function (session) { // 10 - // - return { // 12 - // - bind: function (scope, model) { // 14 - if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.session.bind] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://www.angular-meteor.com/api/1.3.0/session. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); - // - var getter = $parse(model); // 18 - var setter = getter.assign; // 19 - $meteorUtils.autorun(scope, function () { // 20 - setter(scope, Session.get(session)); // 21 - }); // - // - scope.$watch(model, function (newItem, oldItem) { // 24 - Session.set(session, getter(scope)); // 25 - }, true); // - } // - }; // - }; // -}]); // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -}).call(this); - - - - - - -(function(){ - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// // -// packages/angular-meteor-data/modules/angular-meteor-utils.js // -// // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // -/*global // - angular, _, Tracker, EJSON, FS, Mongo // - */ // - // -'use strict'; // 5 - // -var angularMeteorUtils = angular.module('angular-meteor.utils', []); // 7 - // -angularMeteorUtils.service('$meteorUtils', ['$q', '$timeout', '$angularMeteorSettings', function ($q, $timeout, $angularMeteorSettings) { - // - var self = this; // 13 - // - this.autorun = function (scope, fn) { // 15 - if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.utils.autorun] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.6/autorun. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); - // - // wrapping around Deps.autorun // - var comp = Tracker.autorun(function (c) { // 21 - fn(c); // 22 - // this is run immediately for the first call // - // but after that, we need to $apply to start Angular digest // - if (!c.firstRun) $timeout(angular.noop, 0); // 25 - }); // - // - // stop autorun when scope is destroyed // - scope.$on('$destroy', function () { // 29 - comp.stop(); // 30 - }); // - // - // return autorun object so that it can be stopped manually // - return comp; // 34 - }; // - // - // Borrowed from angularFire // - // https://github.com/firebase/angularfire/blob/master/src/utils.js#L445-L454 // - this.stripDollarPrefixedKeys = function (data) { // 39 - if (!_.isObject(data) || data instanceof Date || data instanceof File || EJSON.toJSONValue(data).$type === 'oid' || typeof FS === 'object' && data instanceof FS.File) return data; - // - var out = _.isArray(data) ? [] : {}; // 47 - // - _.each(data, function (v, k) { // 49 - if (typeof k !== 'string' || k.charAt(0) !== '$') out[k] = self.stripDollarPrefixedKeys(v); // 50 - }); // - // - return out; // 54 - }; // - // - // Returns a callback which fulfills promise // - this.fulfill = function (deferred, boundError, boundResult) { // 58 - return function (err, result) { // 59 - if (err) deferred.reject(boundError === null ? err : boundError);else if (typeof boundResult == "function") deferred.resolve(boundResult === null ? result : boundResult(result));else deferred.resolve(boundResult === null ? result : boundResult); - }; // - }; // - // - // creates a function which invokes method with the given arguments and returns a promise // - this.promissor = function (obj, method) { // 70 - return function () { // 71 - var deferred = $q.defer(); // 72 - var fulfill = self.fulfill(deferred); // 73 - var args = _.toArray(arguments).concat(fulfill); // 74 - obj[method].apply(obj, args); // 75 - return deferred.promise; // 76 - }; // - }; // - // - // creates a $q.all() promise and call digestion loop on fulfillment // - this.promiseAll = function (promises) { // 81 - var allPromise = $q.all(promises); // 82 - // - allPromise['finally'](function () { // 84 - // calls digestion loop with no conflicts // - $timeout(angular.noop); // 86 - }); // - // - return allPromise; // 89 - }; // - // - this.getCollectionByName = function (string) { // 92 - return Mongo.Collection.get(string); // 93 - }; // - // - this.findIndexById = function (collection, doc) { // 96 - var foundDoc = _.find(collection, function (colDoc) { // 97 - // EJSON.equals used to compare Mongo.ObjectIDs and Strings. // - return EJSON.equals(colDoc._id, doc._id); // 99 - }); // - // - return _.indexOf(collection, foundDoc); // 102 - }; // -}]); // - // -angularMeteorUtils.run(['$rootScope', '$meteorUtils', function ($rootScope, $meteorUtils) { // 107 - Object.getPrototypeOf($rootScope).$meteorAutorun = function (fn) { // 110 - return $meteorUtils.autorun(this, fn); // 111 - }; // -}]); // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -}).call(this); - - - - - - -(function(){ - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// // -// packages/angular-meteor-data/modules/angular-meteor-camera.js // -// // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // -/*global // - angular, Package // - */ // - // -'use strict'; // 5 - // -var angularMeteorCamera = angular.module('angular-meteor.camera', ['angular-meteor.utils']); // 7 - // -// requires package 'mdg:camera' // -angularMeteorCamera.service('$meteorCamera', ['$q', '$meteorUtils', '$angularMeteorSettings', function ($q, $meteorUtils, $angularMeteorSettings) { - if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); - var pack = Package['mdg:camera']; // 15 - if (!pack) return; // 16 - // - var MeteorCamera = pack.MeteorCamera; // 18 - // - this.getPicture = function (options) { // 20 - if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); - // - options = options || {}; // 24 - var deferred = $q.defer(); // 25 - MeteorCamera.getPicture(options, $meteorUtils.fulfill(deferred)); // 26 - return deferred.promise; // 27 - }; // -}]); // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -}).call(this); - - - - - - -(function(){ - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// // -// packages/angular-meteor-data/modules/utils.js // -// // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // -angular.module('angular-meteor.utilities', []) // 1 - // -/* // - A utility service which is provided with general utility functions // - */ // -.service('$$utils', ['$rootScope', function ($rootScope) { // - var _this = this; // - // - // Checks if an object is a cursor // - this.isCursor = function (obj) { // 12 - return obj instanceof Meteor.Collection.Cursor; // 13 - }; // - // - // Cheecks if an object is a scope // - this.isScope = function (obj) { // 17 - return obj instanceof $rootScope.constructor; // 18 - }; // - // - // Checks if two objects are siblings // - this.areSiblings = function (obj1, obj2) { // 22 - return _.isObject(obj1) && _.isObject(obj2) && Object.getPrototypeOf(obj1) === Object.getPrototypeOf(obj2); // 23 - }; // - // - // Binds function into a scpecified context. If an object is provided, will bind every // - // value in the object which is a function. If a tap function is provided, it will be // - // called right after the function has been invoked. // - this.bind = function (fn, context, tap) { // 30 - tap = _.isFunction(tap) ? tap : angular.noop; // 31 - if (_.isFunction(fn)) return bindFn(fn, context, tap); // 32 - if (_.isObject(fn)) return bindObj(fn, context, tap); // 33 - return fn; // 34 - }; // - // - var bindFn = function (fn, context, tap) { // 37 - return function () { // 38 - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { // - args[_key] = arguments[_key]; // 38 - } // - // - var result = fn.apply(context, args); // 39 - tap.call(context, { result: result, args: args }); // 40 - return result; // 41 - }; // - }; // - // - var bindObj = function (obj, context, tap) { // 45 - return _.keys(obj).reduce(function (bound, k) { // 46 - bound[k] = _this.bind(obj[k], context, tap); // 47 - return bound; // 48 - }, {}); // - }; // -}]); // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -}).call(this); - - - - - - -(function(){ - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// // -// packages/angular-meteor-data/modules/mixer.js // -// // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // -angular.module('angular-meteor.mixer', []) // 1 - // -/* // - A service which lets us apply mixins into the `ChildScope` prototype. The flow is simple. Once // - we define a mixin, it will be stored in the `$Mixer`, and any time a `ChildScope` prototype is // - created it will be extended by the `$Mixer`. This concept is good because it keeps our code // - clean and simple, and easy to extend. So any time we would like to define a new behaviour to our // - scope, we will just use the `$Mixer` service. // - */ // -.service('$Mixer', function () { // - var _this = this; // - // - this._mixins = []; // 12 - // - // Adds a new mixin // - this.mixin = function (mixin) { // 15 - if (!_.isObject(mixin)) throw Error('argument 1 must be an object'); // 16 - // - _this._mixins = _.union(_this._mixins, [mixin]); // 19 - return _this; // 20 - }; // - // - // Removes a mixin. Useful mainly for test purposes // - this._mixout = function (mixin) { // 24 - _this._mixins = _.without(_this._mixins, mixin); // 25 - return _this; // 26 - }; // - // - // Invoke function mixins with the provided context and arguments // - this._construct = function (context) { // 30 - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { // - args[_key - 1] = arguments[_key]; // 30 - } // - // - _this._mixins.filter(_.isFunction).forEach(function (mixin) { // 31 - mixin.call.apply(mixin, [context].concat(args)); // 32 - }); // - // - return context; // 35 - }; // - // - // Extend prototype with the defined mixins // - this._extend = function (obj) { // 39 - var _ref; // - // - return (_ref = _).extend.apply(_ref, [obj].concat(_this._mixins)); // 40 - }; // -}); // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -}).call(this); - - - - - - -(function(){ - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// // -// packages/angular-meteor-data/modules/scope.js // -// // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // -angular.module('angular-meteor.scope', ['angular-meteor.mixer']).run(['$rootScope', '$Mixer', function ($rootScope, $Mixer) { - var Scope = $rootScope.constructor; // 11 - var $new = $rootScope.$new; // 12 - // - // Extends and constructs every newly created scope without affecting the root scope // - Scope.prototype.$new = function (isolate, parent) { // 15 - var firstChild = this === $rootScope && !this.$$ChildScope; // 16 - var scope = $new.call(this, isolate, parent); // 17 - // - // If the scope is isolated we would like to extend it aswell // - if (isolate) { // 20 - // The scope is the prototype of its upcomming child scopes, so the methods would // - // be accessable to them as well // - $Mixer._extend(scope); // 23 - } // - // Else, if this is the first child of the root scope we would like to apply the extensions // - // without affection the root scope // - else if (firstChild) { // - // Creating a middle layer where all the extensions are gonna be applied to // - scope.__proto__ = this.$$ChildScope.prototype = $Mixer._extend(Object.create(this)); // 29 - } // - // - return $Mixer._construct(scope); // 33 - }; // -}]); // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -}).call(this); - - - - - - -(function(){ - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// // -// packages/angular-meteor-data/modules/view-model.js // -// // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // -angular.module('angular-meteor.view-model', ['angular-meteor.utilities', 'angular-meteor.mixer', 'angular-meteor.core']) - // -/* // - A mixin which lets us bind a view model into a scope. Note that only a single view model can be bound, // - otherwise the scope might behave unexpectedly. Mainly used to define the controller as the view model, // - and very useful when wanting to use Angular's `controllerAs` syntax. // - */ // -.factory('$$ViewModel', ['$$utils', '$Mixer', function ($$utils, $Mixer) { // - function $$ViewModel() { // 18 - var vm = arguments.length <= 0 || arguments[0] === undefined ? this : arguments[0]; // - // - // Defines the view model on the scope. // - this.$$vm = vm; // 20 - } // - // - // Gets an object, wraps it with scope functions and returns it // - $$ViewModel.viewModel = function (vm) { // 24 - var _this = this; // - // - if (!_.isObject(vm)) throw Error('argument 1 must be an object'); // 25 - // - // Apply mixin functions // - $Mixer._mixins.forEach(function (mixin) { // 29 - // Reject methods which starts with double $ // - var keys = _.keys(mixin).filter(function (k) { // 31 - return k.match(/^(?!\$\$).*$/); // - }); // - var proto = _.pick(mixin, keys); // 32 - // Bind all the methods to the prototype // - var boundProto = $$utils.bind(proto, _this); // 34 - // Add the methods to the view model // - _.extend(vm, boundProto); // 36 - }); // - // - // Apply mixin constructors on the view model // - $Mixer._construct(this, vm); // 40 - return vm; // 41 - }; // - // - // Override $$Core.$bindToContext to be bound to view model instead of scope // - $$ViewModel.$bindToContext = function (fn) { // 45 - return $$utils.bind(fn, this.$$vm, this.$$throttledDigest.bind(this)); // 46 - }; // - // - return $$ViewModel; // 49 -}]) // - // -/* // - Illustrates the old API where a view model is created using $reactive service // - */ // -.service('$reactive', ['$$utils', function ($$utils) { // - var Reactive = (function () { // - function Reactive(vm) { // 61 - var _this2 = this; // - // - babelHelpers.classCallCheck(this, Reactive); // - // - if (!_.isObject(vm)) throw Error('argument 1 must be an object'); // 62 - // - _.defer(function () { // 65 - if (!_this2._attached) console.warn('view model was not attached to any scope'); // 66 - }); // - // - this._vm = vm; // 70 - } // - // - Reactive.prototype.attach = (function () { // 60 - function attach(scope) { // 73 - this._attached = true; // 74 - // - if (!$$utils.isScope(scope)) throw Error('argument 1 must be a scope'); // 76 - // - var viewModel = scope.viewModel(this._vm); // 79 - // - // Similar to the old/Meteor API // - viewModel.call = viewModel.callMethod; // 82 - viewModel.apply = viewModel.applyMethod; // 83 - // - return viewModel; // 85 - } // - // - return attach; // - })(); // - // - return Reactive; // - })(); // - // - return function (vm) { // 89 - return new Reactive(vm); // - }; // -}]); // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -}).call(this); - - - - - - -(function(){ - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// // -// packages/angular-meteor-data/modules/core.js // -// // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // -angular.module('angular-meteor.core', ['angular-meteor.utilities', 'angular-meteor.mixer']) // 1 - // -/* // - A mixin which provides us with core Meteor functions. // - */ // -.factory('$$Core', ['$q', '$$utils', function ($q, $$utils) { // - function $$Core() {} // 15 - // - // Calls Meteor.autorun() which will be digested after each run and automatically destroyed // - $$Core.autorun = function (fn) { // 18 - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; // - // - fn = this.$bindToContext(fn); // 19 - // - if (!_.isFunction(fn)) throw Error('argument 1 must be a function'); // 21 - if (!_.isObject(options)) throw Error('argument 2 must be an object'); // 23 - // - var computation = Tracker.autorun(fn, options); // 26 - this.$$autoStop(computation); // 27 - return computation; // 28 - }; // - // - // Calls Meteor.subscribe() which will be digested after each invokation and automatically destroyed // - $$Core.subscribe = function (name, fn, cb) { // 32 - fn = this.$bindToContext(fn || angular.noop); // 33 - cb = cb ? this.$bindToContext(cb) : angular.noop; // 34 - // - if (!_.isString(name)) throw Error('argument 1 must be a string'); // 36 - if (!_.isFunction(fn)) throw Error('argument 2 must be a function'); // 38 - if (!_.isFunction(cb) && !_.isObject(cb)) throw Error('argument 3 must be a function or an object'); // 40 - // - var result = {}; // 43 - // - var computation = this.autorun(function () { // 45 - var _Meteor; // - // - var args = fn(); // 46 - if (angular.isUndefined(args)) args = []; // 47 - // - if (!_.isArray(args)) throw Error("reactive function's return value must be an array"); // 49 - // - var subscription = (_Meteor = Meteor).subscribe.apply(_Meteor, [name].concat(args, [cb])); // 52 - result.ready = subscription.ready.bind(subscription); // 53 - result.subscriptionId = subscription.subscriptionId; // 54 - }); // - // - // Once the computation has been stopped, any subscriptions made inside will be stopped as well // - result.stop = computation.stop.bind(computation); // 58 - return result; // 59 - }; // - // - // Calls Meteor.call() wrapped by a digestion cycle // - $$Core.callMethod = function () { // 63 - var _Meteor2; // - // - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { // - args[_key] = arguments[_key]; // 63 - } // - // - var fn = args.pop(); // 64 - if (_.isFunction(fn)) fn = this.$bindToContext(fn); // 65 - return (_Meteor2 = Meteor).call.apply(_Meteor2, args.concat([fn])); // 66 - }; // - // - // Calls Meteor.apply() wrapped by a digestion cycle // - $$Core.applyMethod = function () { // 70 - var _Meteor3; // - // - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { // - args[_key2] = arguments[_key2]; // 70 - } // - // - var fn = args.pop(); // 71 - if (_.isFunction(fn)) fn = this.$bindToContext(fn); // 72 - return (_Meteor3 = Meteor).apply.apply(_Meteor3, args.concat([fn])); // 73 - }; // - // - $$Core.$$autoStop = function (stoppable) { // 76 - this.$on('$destroy', stoppable.stop.bind(stoppable)); // 77 - }; // - // - // Digests scope only if there is no phase at the moment // - $$Core.$$throttledDigest = function () { // 81 - var isDigestable = !this.$$destroyed && !this.$$phase && !this.$root.$$phase; // 82 - // - if (isDigestable) this.$digest(); // 87 - }; // - // - // Creates a promise only that the digestion cycle will be called at its fulfillment // - $$Core.$$defer = function () { // 91 - var deferred = $q.defer(); // 92 - // Once promise has been fulfilled, digest // - deferred.promise = deferred.promise['finally'](this.$$throttledDigest.bind(this)); // 94 - return deferred; // 95 - }; // - // - // Binds an object or a function to the scope to the view model and digest it once it is invoked // - $$Core.$bindToContext = function (fn) { // 99 - return $$utils.bind(fn, this, this.$$throttledDigest.bind(this)); // 100 - }; // - // - return $$Core; // 103 -}]); // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -}).call(this); - - - - - - -(function(){ - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// // -// packages/angular-meteor-data/modules/reactive.js // -// // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // -angular.module('angular-meteor.reactive', ['angular-meteor.utilities', 'angular-meteor.mixer', 'angular-meteor.core', 'angular-meteor.view-model']) - // -/* // - A mixin which enhance our reactive abilities by providing methods that are capable of updating // - our scope reactively. // - */ // -.factory('$$Reactive', ['$parse', '$$utils', '$angularMeteorSettings', function ($parse, $$utils, $angularMeteorSettings) { - function $$Reactive() { // 19 - var vm = arguments.length <= 0 || arguments[0] === undefined ? this : arguments[0]; // - // - // Helps us track changes made in the view model // - vm.$$dependencies = {}; // 21 - } // - // - // Gets an object containing functions and define their results as reactive properties. // - // Once a return value has been changed the property will be reset. // - $$Reactive.helpers = function () { // 26 - var _this = this; // - // - var props = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; // - // - if (!_.isObject(props)) throw Error('argument 1 must be an object'); // 27 - // - _.each(props, function (v, k, i) { // 30 - if (!_.isFunction(v)) throw Error('helper ' + (i + 1) + ' must be a function'); // 31 - // - if (!_this.$$vm.$$dependencies[k]) // 34 - // Registers a new dependency to the specified helper // - _this.$$vm.$$dependencies[k] = new Tracker.Dependency(); // 36 - // - _this.$$setFnHelper(k, v); // 38 - }); // - }; // - // - // Gets a model reactively // - $$Reactive.getReactively = function (k) { // 43 - var isDeep = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1]; // - // - if (!_.isBoolean(isDeep)) throw Error('argument 2 must be a boolean'); // 44 - // - return this.$$reactivateEntity(k, this.$watch, isDeep); // 47 - }; // - // - // Gets a collection reactively // - $$Reactive.getCollectionReactively = function (k) { // 51 - return this.$$reactivateEntity(k, this.$watchCollection); // 52 - }; // - // - // Gets an entity reactively, and once it has been changed the computation will be recomputed // - $$Reactive.$$reactivateEntity = function (k, watcher) { // 56 - if (!_.isString(k)) throw Error('argument 1 must be a string'); // 57 - // - if (!this.$$vm.$$dependencies[k]) { // 60 - this.$$vm.$$dependencies[k] = new Tracker.Dependency(); // 61 - // - for (var _len = arguments.length, watcherArgs = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - watcherArgs[_key - 2] = arguments[_key]; // 56 - } // - // - this.$$watchEntity.apply(this, [k, watcher].concat(watcherArgs)); // 62 - } // - // - this.$$vm.$$dependencies[k].depend(); // 65 - return $parse(k)(this.$$vm); // 66 - }; // - // - // Watches for changes in the view model, and if so will notify a change // - $$Reactive.$$watchEntity = function (k, watcher) { // 70 - var _this2 = this; // - // - // Gets a deep property from the view model // - var getVal = _.partial($parse(k), this.$$vm); // 72 - var initialVal = getVal(); // 73 - // - // Watches for changes in the view model // - // - for (var _len2 = arguments.length, watcherArgs = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { - watcherArgs[_key2 - 2] = arguments[_key2]; // 70 - } // - // - watcher.call.apply(watcher, [this, getVal, function (val, oldVal) { // 76 - var hasChanged = val !== initialVal || val !== oldVal; // 77 - // - // Notify if a change has been detected // - if (hasChanged) _this2.$$changed(k); // 82 - }].concat(watcherArgs)); // - }; // - // - // Invokes a function and sets the return value as a property // - $$Reactive.$$setFnHelper = function (k, fn) { // 87 - var _this3 = this; // - // - this.autorun(function (computation) { // 88 - // Invokes the reactive functon // - var model = fn.apply(_this3.$$vm); // 90 - // - // Ignore notifications made by the following handler // - Tracker.nonreactive(function () { // 93 - // If a cursor, observe its changes and update acoordingly // - if ($$utils.isCursor(model)) { // 95 - (function () { // - var observation = _this3.$$handleCursor(k, model); // 96 - // - computation.onInvalidate(function () { // 98 - observation.stop(); // 99 - _this3.$$vm[k].splice(0); // 100 - }); // - })(); // - } else { // - _this3.$$handleNonCursor(k, model); // 104 - } // - // - // Notify change and update the view model // - _this3.$$changed(k); // 108 - }); // - }); // - }; // - // - // Sets a value helper as a setter and a getter which will notify computations once used // - $$Reactive.$$setValHelper = function (k, v) { // 114 - var _this4 = this; // - // - var watch = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2]; // - // - // If set, reactives property // - if (watch) { // 116 - var isDeep = _.isObject(v); // 117 - this.getReactively(k, isDeep); // 118 - } // - // - Object.defineProperty(this.$$vm, k, { // 121 - configurable: true, // 122 - enumerable: true, // 123 - // - get: function () { // 125 - return v; // 126 - }, // - set: function (newVal) { // 128 - v = newVal; // 129 - _this4.$$changed(k); // 130 - } // - }); // - }; // - // - // Fetching a cursor and updates properties once the result set has been changed // - $$Reactive.$$handleCursor = function (k, cursor) { // 136 - var _this5 = this; // - // - // If not defined set it // - if (angular.isUndefined(this.$$vm[k])) { // 138 - this.$$setValHelper(k, cursor.fetch(), false); // 139 - } // - // If defined update it // - else { // - var diff = jsondiffpatch.diff(this.$$vm[k], cursor.fetch()); // 143 - jsondiffpatch.patch(this.$$vm[k], diff); // 144 - } // - // - // Observe changes made in the result set // - var observation = cursor.observe({ // 148 - addedAt: function (doc, atIndex) { // 149 - if (!observation) return; // 150 - _this5.$$vm[k].splice(atIndex, 0, doc); // 151 - _this5.$$changed(k); // 152 - }, // - changedAt: function (doc, oldDoc, atIndex) { // 154 - var diff = jsondiffpatch.diff(_this5.$$vm[k][atIndex], doc); // 155 - jsondiffpatch.patch(_this5.$$vm[k][atIndex], diff); // 156 - _this5.$$changed(k); // 157 - }, // - movedTo: function (doc, fromIndex, toIndex) { // 159 - _this5.$$vm[k].splice(fromIndex, 1); // 160 - _this5.$$vm[k].splice(toIndex, 0, doc); // 161 - _this5.$$changed(k); // 162 - }, // - removedAt: function (oldDoc, atIndex) { // 164 - _this5.$$vm[k].splice(atIndex, 1); // 165 - _this5.$$changed(k); // 166 - } // - }); // - // - return observation; // 170 - }; // - // - $$Reactive.$$handleNonCursor = function (k, data) { // 173 - var v = this.$$vm[k]; // 174 - // - if (angular.isDefined(v)) { // 176 - delete this.$$vm[k]; // 177 - v = null; // 178 - } // - // - if (angular.isUndefined(v)) { // 181 - this.$$setValHelper(k, data); // 182 - } // - // Update property if the new value is from the same type // - else if ($$utils.areSiblings(v, data)) { // - var diff = jsondiffpatch.diff(v, data); // 186 - jsondiffpatch.patch(v, diff); // 187 - this.$$changed(k); // 188 - } else { // - this.$$vm[k] = data; // 191 - } // - }; // - // - // Notifies dependency in view model // - $$Reactive.$$depend = function (k) { // 196 - this.$$vm.$$dependencies[k].depend(); // 197 - }; // - // - // Notifies change in view model // - $$Reactive.$$changed = function (k) { // 201 - this.$$throttledDigest(); // 202 - this.$$vm.$$dependencies[k].changed(); // 203 - }; // - // - return $$Reactive; // 206 -}]); // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -}).call(this); - - - - - - -(function(){ - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// // -// packages/angular-meteor-data/angular-meteor.js // -// // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // -angular.module('angular-meteor', [ // 1 -// new // -'angular-meteor.utilities', 'angular-meteor.mixer', 'angular-meteor.scope', 'angular-meteor.core', 'angular-meteor.view-model', 'angular-meteor.reactive', - // -// legacy // -'angular-meteor.ironrouter', 'angular-meteor.utils', 'angular-meteor.subscribe', 'angular-meteor.collection', 'angular-meteor.object', 'angular-meteor.user', 'angular-meteor.methods', 'angular-meteor.session', 'angular-meteor.camera']).constant('$angularMeteorSettings', { - suppressWarnings: false // 24 -}).run(['$Mixer', '$$Core', '$$ViewModel', '$$Reactive', function ($Mixer, $$Core, $$ViewModel, $$Reactive) { // - // Load all mixins // - $Mixer.mixin($$Core).mixin($$ViewModel).mixin($$Reactive); // 35 -}]) // - // -// legacy // -// Putting all services under $meteor service for syntactic sugar // -.service('$meteor', ['$meteorCollection', '$meteorCollectionFS', '$meteorObject', '$meteorMethods', '$meteorSession', '$meteorSubscribe', '$meteorUtils', '$meteorCamera', '$meteorUser', function ($meteorCollection, $meteorCollectionFS, $meteorObject, $meteorMethods, $meteorSession, $meteorSubscribe, $meteorUtils, $meteorCamera, $meteorUser) { - this.collection = $meteorCollection; // 45 - this.collectionFS = $meteorCollectionFS; // 46 - this.object = $meteorObject; // 47 - this.subscribe = $meteorSubscribe.subscribe; // 48 - this.call = $meteorMethods.call; // 49 - this.loginWithPassword = $meteorUser.loginWithPassword; // 50 - this.requireUser = $meteorUser.requireUser; // 51 - this.requireValidUser = $meteorUser.requireValidUser; // 52 - this.waitForUser = $meteorUser.waitForUser; // 53 - this.createUser = $meteorUser.createUser; // 54 - this.changePassword = $meteorUser.changePassword; // 55 - this.forgotPassword = $meteorUser.forgotPassword; // 56 - this.resetPassword = $meteorUser.resetPassword; // 57 - this.verifyEmail = $meteorUser.verifyEmail; // 58 - this.loginWithMeteorDeveloperAccount = $meteorUser.loginWithMeteorDeveloperAccount; // 59 - this.loginWithFacebook = $meteorUser.loginWithFacebook; // 60 - this.loginWithGithub = $meteorUser.loginWithGithub; // 61 - this.loginWithGoogle = $meteorUser.loginWithGoogle; // 62 - this.loginWithMeetup = $meteorUser.loginWithMeetup; // 63 - this.loginWithTwitter = $meteorUser.loginWithTwitter; // 64 - this.loginWithWeibo = $meteorUser.loginWithWeibo; // 65 - this.logout = $meteorUser.logout; // 66 - this.logoutOtherClients = $meteorUser.logoutOtherClients; // 67 - this.session = $meteorSession; // 68 - this.autorun = $meteorUtils.autorun; // 69 - this.getCollectionByName = $meteorUtils.getCollectionByName; // 70 - this.getPicture = $meteorCamera.getPicture; // 71 -}]); // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// // +// packages/angular-meteor-data/.npm/package/node_modules/angular-meteor/dist/angular-meteor.js // +// // +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // +/*! angular-meteor v1.3.7-beta.1 */ // 1 +/******/ (function(modules) { // webpackBootstrap // 2 +/******/ // The module cache // 3 +/******/ var installedModules = {}; // 4 + // 5 +/******/ // The require function // 6 +/******/ function __webpack_require__(moduleId) { // 7 + // 8 +/******/ // Check if module is in cache // 9 +/******/ if(installedModules[moduleId]) // 10 +/******/ return installedModules[moduleId].exports; // 11 + // 12 +/******/ // Create a new module (and put it into the cache) // 13 +/******/ var module = installedModules[moduleId] = { // 14 +/******/ exports: {}, // 15 +/******/ id: moduleId, // 16 +/******/ loaded: false // 17 +/******/ }; // 18 + // 19 +/******/ // Execute the module function // 20 +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); // 21 + // 22 +/******/ // Flag the module as loaded // 23 +/******/ module.loaded = true; // 24 + // 25 +/******/ // Return the exports of the module // 26 +/******/ return module.exports; // 27 +/******/ } // 28 + // 29 + // 30 +/******/ // expose the modules object (__webpack_modules__) // 31 +/******/ __webpack_require__.m = modules; // 32 + // 33 +/******/ // expose the module cache // 34 +/******/ __webpack_require__.c = installedModules; // 35 + // 36 +/******/ // __webpack_public_path__ // 37 +/******/ __webpack_require__.p = ""; // 38 + // 39 +/******/ // Load entry module and return exports // 40 +/******/ return __webpack_require__(0); // 41 +/******/ }) // 42 +/************************************************************************/ // 43 +/******/ ([ // 44 +/* 0 */ // 45 +/***/ function(module, exports, __webpack_require__) { // 46 + // 47 + 'use strict'; // 48 + // 49 + Object.defineProperty(exports, "__esModule", { // 50 + value: true // 51 + }); // 52 + exports.name = undefined; // 53 + // 54 + __webpack_require__(1); // 55 + // 56 + __webpack_require__(2); // 57 + // 58 + __webpack_require__(3); // 59 + // 60 + __webpack_require__(4); // 61 + // 62 + __webpack_require__(5); // 63 + // 64 + __webpack_require__(6); // 65 + // 66 + __webpack_require__(7); // 67 + // 68 + __webpack_require__(8); // 69 + // 70 + __webpack_require__(9); // 71 + // 72 + __webpack_require__(10); // 73 + // 74 + __webpack_require__(11); // 75 + // 76 + __webpack_require__(12); // 77 + // 78 + __webpack_require__(13); // 79 + // 80 + var _utils = __webpack_require__(14); // 81 + // 82 + var _mixer = __webpack_require__(15); // 83 + // 84 + var _scope = __webpack_require__(16); // 85 + // 86 + var _core = __webpack_require__(17); // 87 + // 88 + var _viewModel = __webpack_require__(18); // 89 + // 90 + var _reactive = __webpack_require__(19); // 91 + // 92 + var _templates = __webpack_require__(20); // 93 + // 94 + // legacy // 95 + // lib // 96 + var name = exports.name = 'angular-meteor'; // 97 + // 98 + // new // 99 + // 100 + // 101 + angular.module(name, [ // 102 + // new // 103 + _utils.name, _mixer.name, _scope.name, _core.name, _viewModel.name, _reactive.name, _templates.name, // 104 + // 105 + // legacy // 106 + 'angular-meteor.ironrouter', 'angular-meteor.utils', 'angular-meteor.subscribe', 'angular-meteor.collection', 'angular-meteor.object', 'angular-meteor.user', 'angular-meteor.methods', 'angular-meteor.session', 'angular-meteor.camera']).run([_mixer.Mixer, _core.Core, _viewModel.ViewModel, _reactive.Reactive, function ($Mixer, $$Core, $$ViewModel, $$Reactive) { + // Load all mixins // 108 + $Mixer.mixin($$Core).mixin($$ViewModel).mixin($$Reactive); // 109 + }]) // 110 + // 111 + // legacy // 112 + // Putting all services under $meteor service for syntactic sugar // 113 + .service('$meteor', ['$meteorCollection', '$meteorCollectionFS', '$meteorObject', '$meteorMethods', '$meteorSession', '$meteorSubscribe', '$meteorUtils', '$meteorCamera', '$meteorUser', function ($meteorCollection, $meteorCollectionFS, $meteorObject, $meteorMethods, $meteorSession, $meteorSubscribe, $meteorUtils, $meteorCamera, $meteorUser) { + var _this = this; // 115 + // 116 + this.collection = $meteorCollection; // 117 + this.collectionFS = $meteorCollectionFS; // 118 + this.object = $meteorObject; // 119 + this.subscribe = $meteorSubscribe.subscribe; // 120 + this.call = $meteorMethods.call; // 121 + this.session = $meteorSession; // 122 + this.autorun = $meteorUtils.autorun; // 123 + this.getCollectionByName = $meteorUtils.getCollectionByName; // 124 + this.getPicture = $meteorCamera.getPicture; // 125 + // 126 + // $meteorUser // 127 + ['loginWithPassword', 'requireUser', 'requireValidUser', 'waitForUser', 'createUser', 'changePassword', 'forgotPassword', 'resetPassword', 'verifyEmail', 'loginWithMeteorDeveloperAccount', 'loginWithFacebook', 'loginWithGithub', 'loginWithGoogle', 'loginWithMeetup', 'loginWithTwitter', 'loginWithWeibo', 'logout', 'logoutOtherClients'].forEach(function (method) { + _this[method] = $meteorUser[method]; // 129 + }); // 130 + }]); // 131 + // 132 +/***/ }, // 133 +/* 1 */ // 134 +/***/ function(module, exports) { // 135 + // 136 + /*global // 137 + angular, _ // 138 + */ // 139 + // 140 + 'use strict'; // 141 + // 142 + // https://github.com/DAB0mB/get-updates // 143 + // 144 + (function () { // 145 + var module = angular.module('getUpdates', []); // 146 + // 147 + var utils = function () { // 148 + var rip = function rip(obj, level) { // 149 + if (level < 1) return {}; // 150 + // 151 + return _.reduce(obj, function (clone, v, k) { // 152 + v = _.isObject(v) ? rip(v, --level) : v; // 153 + clone[k] = v; // 154 + return clone; // 155 + }, {}); // 156 + }; // 157 + // 158 + var toPaths = function toPaths(obj) { // 159 + var keys = getKeyPaths(obj); // 160 + var values = getDeepValues(obj); // 161 + return _.object(keys, values); // 162 + }; // 163 + // 164 + var getKeyPaths = function getKeyPaths(obj) { // 165 + var keys = _.keys(obj).map(function (k) { // 166 + var v = obj[k]; // 167 + if (!_.isObject(v) || _.isEmpty(v) || _.isArray(v)) return k; // 168 + // 169 + return getKeyPaths(v).map(function (subKey) { // 170 + return k + '.' + subKey; // 171 + }); // 172 + }); // 173 + // 174 + return _.flatten(keys); // 175 + }; // 176 + // 177 + var getDeepValues = function getDeepValues(obj, arr) { // 178 + arr = arr || []; // 179 + // 180 + _.values(obj).forEach(function (v) { // 181 + if (!_.isObject(v) || _.isEmpty(v) || _.isArray(v)) arr.push(v);else getDeepValues(v, arr); // 182 + }); // 183 + // 184 + return arr; // 185 + }; // 186 + // 187 + var flatten = function flatten(arr) { // 188 + return arr.reduce(function (flattened, v, i) { // 189 + if (_.isArray(v) && !_.isEmpty(v)) flattened.push.apply(flattened, flatten(v));else flattened.push(v); // 190 + // 191 + return flattened; // 192 + }, []); // 193 + }; // 194 + // 195 + var setFilled = function setFilled(obj, k, v) { // 196 + if (!_.isEmpty(v)) obj[k] = v; // 197 + }; // 198 + // 199 + var assert = function assert(result, msg) { // 200 + if (!result) throwErr(msg); // 201 + }; // 202 + // 203 + var throwErr = function throwErr(msg) { // 204 + throw Error('get-updates error - ' + msg); // 205 + }; // 206 + // 207 + return { // 208 + rip: rip, // 209 + toPaths: toPaths, // 210 + getKeyPaths: getKeyPaths, // 211 + getDeepValues: getDeepValues, // 212 + setFilled: setFilled, // 213 + assert: assert, // 214 + throwErr: throwErr // 215 + }; // 216 + }(); // 217 + // 218 + var getDifference = function () { // 219 + var getDifference = function getDifference(src, dst, isShallow) { // 220 + var level; // 221 + // 222 + if (isShallow > 1) level = isShallow;else if (isShallow) level = 1; // 223 + // 224 + if (level) { // 225 + src = utils.rip(src, level); // 226 + dst = utils.rip(dst, level); // 227 + } // 228 + // 229 + return compare(src, dst); // 230 + }; // 231 + // 232 + var compare = function compare(src, dst) { // 233 + var srcKeys = _.keys(src); // 234 + var dstKeys = _.keys(dst); // 235 + // 236 + var keys = _.chain([]).concat(srcKeys).concat(dstKeys).uniq().without('$$hashKey').value(); // 237 + // 238 + return keys.reduce(function (diff, k) { // 239 + var srcValue = src[k]; // 240 + var dstValue = dst[k]; // 241 + // 242 + if (_.isDate(srcValue) && _.isDate(dstValue)) { // 243 + if (srcValue.getTime() != dstValue.getTime()) diff[k] = dstValue; // 244 + } // 245 + // 246 + if (_.isObject(srcValue) && _.isObject(dstValue)) { // 247 + var valueDiff = getDifference(srcValue, dstValue); // 248 + utils.setFilled(diff, k, valueDiff); // 249 + } else if (srcValue !== dstValue) { // 250 + diff[k] = dstValue; // 251 + } // 252 + // 253 + return diff; // 254 + }, {}); // 255 + }; // 256 + // 257 + return getDifference; // 258 + }(); // 259 + // 260 + var getUpdates = function () { // 261 + var getUpdates = function getUpdates(src, dst, isShallow) { // 262 + utils.assert(_.isObject(src), 'first argument must be an object'); // 263 + utils.assert(_.isObject(dst), 'second argument must be an object'); // 264 + // 265 + var diff = getDifference(src, dst, isShallow); // 266 + var paths = utils.toPaths(diff); // 267 + // 268 + var set = createSet(paths); // 269 + var unset = createUnset(paths); // 270 + var pull = createPull(unset); // 271 + // 272 + var updates = {}; // 273 + utils.setFilled(updates, '$set', set); // 274 + utils.setFilled(updates, '$unset', unset); // 275 + utils.setFilled(updates, '$pull', pull); // 276 + // 277 + return updates; // 278 + }; // 279 + // 280 + var createSet = function createSet(paths) { // 281 + var undefinedKeys = getUndefinedKeys(paths); // 282 + return _.omit(paths, undefinedKeys); // 283 + }; // 284 + // 285 + var createUnset = function createUnset(paths) { // 286 + var undefinedKeys = getUndefinedKeys(paths); // 287 + var unset = _.pick(paths, undefinedKeys); // 288 + // 289 + return _.reduce(unset, function (result, v, k) { // 290 + result[k] = true; // 291 + return result; // 292 + }, {}); // 293 + }; // 294 + // 295 + var createPull = function createPull(unset) { // 296 + var arrKeyPaths = _.keys(unset).map(function (k) { // 297 + var split = k.match(/(.*)\.\d+$/); // 298 + return split && split[1]; // 299 + }); // 300 + // 301 + return _.compact(arrKeyPaths).reduce(function (pull, k) { // 302 + pull[k] = null; // 303 + return pull; // 304 + }, {}); // 305 + }; // 306 + // 307 + var getUndefinedKeys = function getUndefinedKeys(obj) { // 308 + return _.keys(obj).filter(function (k) { // 309 + var v = obj[k]; // 310 + return _.isUndefined(v); // 311 + }); // 312 + }; // 313 + // 314 + return getUpdates; // 315 + }(); // 316 + // 317 + module.value('getUpdates', getUpdates); // 318 + })(); // 319 + // 320 +/***/ }, // 321 +/* 2 */ // 322 +/***/ function(module, exports) { // 323 + // 324 + /*global // 325 + angular, _, Package // 326 + */ // 327 + // 328 + 'use strict'; // 329 + // 330 + var _module = angular.module('diffArray', ['getUpdates']); // 331 + // 332 + _module.factory('diffArray', ['getUpdates', function (getUpdates) { // 333 + var LocalCollection = Package.minimongo.LocalCollection; // 334 + var idStringify = LocalCollection._idStringify || Package['mongo-id'].MongoID.idStringify; // 335 + var idParse = LocalCollection._idParse || Package['mongo-id'].MongoID.idParse; // 336 + // 337 + // Calculates the differences between `lastSeqArray` and // 338 + // `seqArray` and calls appropriate functions from `callbacks`. // 339 + // Reuses Minimongo's diff algorithm implementation. // 340 + // XXX Should be replaced with the original diffArray function here: // 341 + // https://github.com/meteor/meteor/blob/devel/packages/observe-sequence/observe_sequence.js#L152 // 342 + // When it will become nested as well, tracking here: https://github.com/meteor/meteor/issues/3764 // 343 + function diffArray(lastSeqArray, seqArray, callbacks, preventNestedDiff) { // 344 + preventNestedDiff = !!preventNestedDiff; // 345 + // 346 + var diffFn = Package.minimongo.LocalCollection._diffQueryOrderedChanges || Package['diff-sequence'].DiffSequence.diffQueryOrderedChanges; + // 348 + var oldObjIds = []; // 349 + var newObjIds = []; // 350 + var posOld = {}; // maps from idStringify'd ids // 351 + var posNew = {}; // ditto // 352 + var posCur = {}; // 353 + var lengthCur = lastSeqArray.length; // 354 + // 355 + _.each(seqArray, function (doc, i) { // 356 + newObjIds.push({ _id: doc._id }); // 357 + posNew[idStringify(doc._id)] = i; // 358 + }); // 359 + // 360 + _.each(lastSeqArray, function (doc, i) { // 361 + oldObjIds.push({ _id: doc._id }); // 362 + posOld[idStringify(doc._id)] = i; // 363 + posCur[idStringify(doc._id)] = i; // 364 + }); // 365 + // 366 + // Arrays can contain arbitrary objects. We don't diff the // 367 + // objects. Instead we always fire 'changedAt' callback on every // 368 + // object. The consumer of `observe-sequence` should deal with // 369 + // it appropriately. // 370 + diffFn(oldObjIds, newObjIds, { // 371 + addedBefore: function addedBefore(id, doc, before) { // 372 + var position = before ? posCur[idStringify(before)] : lengthCur; // 373 + // 374 + _.each(posCur, function (pos, id) { // 375 + if (pos >= position) posCur[id]++; // 376 + }); // 377 + // 378 + lengthCur++; // 379 + posCur[idStringify(id)] = position; // 380 + // 381 + callbacks.addedAt(id, seqArray[posNew[idStringify(id)]], position, before); // 382 + }, // 383 + // 384 + movedBefore: function movedBefore(id, before) { // 385 + var prevPosition = posCur[idStringify(id)]; // 386 + var position = before ? posCur[idStringify(before)] : lengthCur - 1; // 387 + // 388 + _.each(posCur, function (pos, id) { // 389 + if (pos >= prevPosition && pos <= position) posCur[id]--;else if (pos <= prevPosition && pos >= position) posCur[id]++; + }); // 391 + // 392 + posCur[idStringify(id)] = position; // 393 + // 394 + callbacks.movedTo(id, seqArray[posNew[idStringify(id)]], prevPosition, position, before); // 395 + }, // 396 + removed: function removed(id) { // 397 + var prevPosition = posCur[idStringify(id)]; // 398 + // 399 + _.each(posCur, function (pos, id) { // 400 + if (pos >= prevPosition) posCur[id]--; // 401 + }); // 402 + // 403 + delete posCur[idStringify(id)]; // 404 + lengthCur--; // 405 + // 406 + callbacks.removedAt(id, lastSeqArray[posOld[idStringify(id)]], prevPosition); // 407 + } // 408 + }); // 409 + // 410 + _.each(posNew, function (pos, idString) { // 411 + if (!_.has(posOld, idString)) return; // 412 + // 413 + var id = idParse(idString); // 414 + var newItem = seqArray[pos] || {}; // 415 + var oldItem = lastSeqArray[posOld[idString]]; // 416 + var updates = getUpdates(oldItem, newItem, preventNestedDiff); // 417 + // 418 + if (!_.isEmpty(updates)) callbacks.changedAt(id, updates, pos, oldItem); // 419 + }); // 420 + } // 421 + // 422 + diffArray.shallow = function (lastSeqArray, seqArray, callbacks) { // 423 + return diffArray(lastSeqArray, seqArray, callbacks, true); // 424 + }; // 425 + // 426 + diffArray.deepCopyChanges = function (oldItem, newItem) { // 427 + var setDiff = getUpdates(oldItem, newItem).$set; // 428 + // 429 + _.each(setDiff, function (v, deepKey) { // 430 + setDeep(oldItem, deepKey, v); // 431 + }); // 432 + }; // 433 + // 434 + diffArray.deepCopyRemovals = function (oldItem, newItem) { // 435 + var unsetDiff = getUpdates(oldItem, newItem).$unset; // 436 + // 437 + _.each(unsetDiff, function (v, deepKey) { // 438 + unsetDeep(oldItem, deepKey); // 439 + }); // 440 + }; // 441 + // 442 + // Finds changes between two collections // 443 + diffArray.getChanges = function (newCollection, oldCollection, diffMethod) { // 444 + var changes = { added: [], removed: [], changed: [] }; // 445 + // 446 + diffMethod(oldCollection, newCollection, { // 447 + addedAt: function addedAt(id, item, index) { // 448 + changes.added.push({ item: item, index: index }); // 449 + }, // 450 + // 451 + removedAt: function removedAt(id, item, index) { // 452 + changes.removed.push({ item: item, index: index }); // 453 + }, // 454 + // 455 + changedAt: function changedAt(id, updates, index, oldItem) { // 456 + changes.changed.push({ selector: id, modifier: updates }); // 457 + }, // 458 + // 459 + movedTo: function movedTo(id, item, fromIndex, toIndex) { // 460 + // XXX do we need this? // 461 + } // 462 + }); // 463 + // 464 + return changes; // 465 + }; // 466 + // 467 + var setDeep = function setDeep(obj, deepKey, v) { // 468 + var split = deepKey.split('.'); // 469 + var initialKeys = _.initial(split); // 470 + var lastKey = _.last(split); // 471 + // 472 + initialKeys.reduce(function (subObj, k, i) { // 473 + var nextKey = split[i + 1]; // 474 + // 475 + if (isNumStr(nextKey)) { // 476 + if (subObj[k] === null) subObj[k] = []; // 477 + if (subObj[k].length == parseInt(nextKey)) subObj[k].push(null); // 478 + } else if (subObj[k] === null || !isHash(subObj[k])) { // 479 + subObj[k] = {}; // 480 + } // 481 + // 482 + return subObj[k]; // 483 + }, obj); // 484 + // 485 + var deepObj = getDeep(obj, initialKeys); // 486 + deepObj[lastKey] = v; // 487 + return v; // 488 + }; // 489 + // 490 + var unsetDeep = function unsetDeep(obj, deepKey) { // 491 + var split = deepKey.split('.'); // 492 + var initialKeys = _.initial(split); // 493 + var lastKey = _.last(split); // 494 + var deepObj = getDeep(obj, initialKeys); // 495 + // 496 + if (_.isArray(deepObj) && isNumStr(lastKey)) return !!deepObj.splice(lastKey, 1);else return delete deepObj[lastKey]; + }; // 498 + // 499 + var getDeep = function getDeep(obj, keys) { // 500 + return keys.reduce(function (subObj, k) { // 501 + return subObj[k]; // 502 + }, obj); // 503 + }; // 504 + // 505 + var isHash = function isHash(obj) { // 506 + return _.isObject(obj) && Object.getPrototypeOf(obj) === Object.prototype; // 507 + }; // 508 + // 509 + var isNumStr = function isNumStr(str) { // 510 + return str.match(/^\d+$/); // 511 + }; // 512 + // 513 + return diffArray; // 514 + }]); // 515 + // 516 +/***/ }, // 517 +/* 3 */ // 518 +/***/ function(module, exports) { // 519 + // 520 + 'use strict'; // 521 + // 522 + angular.module('angular-meteor.settings', []).constant('$angularMeteorSettings', { // 523 + suppressWarnings: false // 524 + }); // 525 + // 526 +/***/ }, // 527 +/* 4 */ // 528 +/***/ function(module, exports) { // 529 + // 530 + 'use strict'; // 531 + // 532 + angular.module('angular-meteor.ironrouter', []).run(['$compile', '$document', '$rootScope', function ($compile, $document, $rootScope) { + var Router = (Package['iron:router'] || {}).Router; // 534 + if (!Router) return; // 535 + // 536 + var isLoaded = false; // 537 + // 538 + // Recompile after iron:router builds page // 539 + Router.onAfterAction(function (req, res, next) { // 540 + Tracker.afterFlush(function () { // 541 + if (isLoaded) return; // 542 + $compile($document)($rootScope); // 543 + if (!$rootScope.$$phase) $rootScope.$apply(); // 544 + isLoaded = true; // 545 + }); // 546 + }); // 547 + }]); // 548 + // 549 +/***/ }, // 550 +/* 5 */ // 551 +/***/ function(module, exports) { // 552 + // 553 + /*global // 554 + angular, _, Tracker, EJSON, FS, Mongo // 555 + */ // 556 + // 557 + 'use strict'; // 558 + // 559 + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; + // 561 + var angularMeteorUtils = angular.module('angular-meteor.utils', ['angular-meteor.settings']); // 562 + // 563 + angularMeteorUtils.service('$meteorUtils', ['$q', '$timeout', '$angularMeteorSettings', function ($q, $timeout, $angularMeteorSettings) { + // 565 + var self = this; // 566 + // 567 + this.autorun = function (scope, fn) { // 568 + if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.utils.autorun] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.6/autorun. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); + // 570 + // wrapping around Deps.autorun // 571 + var comp = Tracker.autorun(function (c) { // 572 + fn(c); // 573 + // this is run immediately for the first call // 574 + // but after that, we need to $apply to start Angular digest // 575 + if (!c.firstRun) $timeout(angular.noop, 0); // 576 + }); // 577 + // 578 + // stop autorun when scope is destroyed // 579 + scope.$on('$destroy', function () { // 580 + comp.stop(); // 581 + }); // 582 + // 583 + // return autorun object so that it can be stopped manually // 584 + return comp; // 585 + }; // 586 + // 587 + // Borrowed from angularFire // 588 + // https://github.com/firebase/angularfire/blob/master/src/utils.js#L445-L454 // 589 + this.stripDollarPrefixedKeys = function (data) { // 590 + if (!_.isObject(data) || data instanceof Date || data instanceof File || EJSON.toJSONValue(data).$type === 'oid' || (typeof FS === 'undefined' ? 'undefined' : _typeof(FS)) === 'object' && data instanceof FS.File) return data; + // 592 + var out = _.isArray(data) ? [] : {}; // 593 + // 594 + _.each(data, function (v, k) { // 595 + if (typeof k !== 'string' || k.charAt(0) !== '$') out[k] = self.stripDollarPrefixedKeys(v); // 596 + }); // 597 + // 598 + return out; // 599 + }; // 600 + // 601 + // Returns a callback which fulfills promise // 602 + this.fulfill = function (deferred, boundError, boundResult) { // 603 + return function (err, result) { // 604 + if (err) deferred.reject(boundError == null ? err : boundError);else if (typeof boundResult == "function") deferred.resolve(boundResult == null ? result : boundResult(result));else deferred.resolve(boundResult == null ? result : boundResult); + }; // 606 + }; // 607 + // 608 + // creates a function which invokes method with the given arguments and returns a promise // 609 + this.promissor = function (obj, method) { // 610 + return function () { // 611 + var deferred = $q.defer(); // 612 + var fulfill = self.fulfill(deferred); // 613 + var args = _.toArray(arguments).concat(fulfill); // 614 + obj[method].apply(obj, args); // 615 + return deferred.promise; // 616 + }; // 617 + }; // 618 + // 619 + // creates a $q.all() promise and call digestion loop on fulfillment // 620 + this.promiseAll = function (promises) { // 621 + var allPromise = $q.all(promises); // 622 + // 623 + allPromise.finally(function () { // 624 + // calls digestion loop with no conflicts // 625 + $timeout(angular.noop); // 626 + }); // 627 + // 628 + return allPromise; // 629 + }; // 630 + // 631 + this.getCollectionByName = function (string) { // 632 + return Mongo.Collection.get(string); // 633 + }; // 634 + // 635 + this.findIndexById = function (collection, doc) { // 636 + var foundDoc = _.find(collection, function (colDoc) { // 637 + // EJSON.equals used to compare Mongo.ObjectIDs and Strings. // 638 + return EJSON.equals(colDoc._id, doc._id); // 639 + }); // 640 + // 641 + return _.indexOf(collection, foundDoc); // 642 + }; // 643 + }]); // 644 + // 645 + angularMeteorUtils.run(['$rootScope', '$meteorUtils', function ($rootScope, $meteorUtils) { // 646 + Object.getPrototypeOf($rootScope).$meteorAutorun = function (fn) { // 647 + return $meteorUtils.autorun(this, fn); // 648 + }; // 649 + }]); // 650 + // 651 +/***/ }, // 652 +/* 6 */ // 653 +/***/ function(module, exports) { // 654 + // 655 + /*global // 656 + angular, Meteor // 657 + */ // 658 + // 659 + 'use strict'; // 660 + // 661 + var angularMeteorSubscribe = angular.module('angular-meteor.subscribe', ['angular-meteor.settings']); // 662 + // 663 + angularMeteorSubscribe.service('$meteorSubscribe', ['$q', '$angularMeteorSettings', function ($q, $angularMeteorSettings) { + // 665 + var self = this; // 666 + // 667 + this._subscribe = function (scope, deferred, args) { // 668 + if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.subscribe] Please note that this module is deprecated since 1.3.0 and will be removed in 1.4.0! Replace it with the new syntax described here: http://www.angular-meteor.com/api/1.3.6/subscribe. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); + // 670 + var subscription = null; // 671 + var lastArg = args[args.length - 1]; // 672 + // 673 + // User supplied onStop callback // 674 + // save it for later use and remove // 675 + // from subscription arguments // 676 + if (angular.isObject(lastArg) && angular.isFunction(lastArg.onStop)) { // 677 + var _onStop = lastArg.onStop; // 678 + // 679 + args.pop(); // 680 + } // 681 + // 682 + args.push({ // 683 + onReady: function onReady() { // 684 + deferred.resolve(subscription); // 685 + }, // 686 + onStop: function onStop(err) { // 687 + if (!deferred.promise.$$state.status) { // 688 + if (err) deferred.reject(err);else deferred.reject(new Meteor.Error("Subscription Stopped", "Subscription stopped by a call to stop method. Either by the client or by the server.")); + } else if (_onStop) // 690 + // After promise was resolved or rejected // 691 + // call user supplied onStop callback. // 692 + _onStop.apply(this, Array.prototype.slice.call(arguments)); // 693 + } // 694 + }); // 695 + // 696 + subscription = Meteor.subscribe.apply(scope, args); // 697 + // 698 + return subscription; // 699 + }; // 700 + // 701 + this.subscribe = function () { // 702 + var deferred = $q.defer(); // 703 + var args = Array.prototype.slice.call(arguments); // 704 + var subscription = null; // 705 + // 706 + self._subscribe(this, deferred, args); // 707 + // 708 + return deferred.promise; // 709 + }; // 710 + }]); // 711 + // 712 + angularMeteorSubscribe.run(['$rootScope', '$q', '$meteorSubscribe', function ($rootScope, $q, $meteorSubscribe) { + Object.getPrototypeOf($rootScope).$meteorSubscribe = function () { // 714 + var deferred = $q.defer(); // 715 + var args = Array.prototype.slice.call(arguments); // 716 + // 717 + var subscription = $meteorSubscribe._subscribe(this, deferred, args); // 718 + // 719 + this.$on('$destroy', function () { // 720 + subscription.stop(); // 721 + }); // 722 + // 723 + return deferred.promise; // 724 + }; // 725 + }]); // 726 + // 727 +/***/ }, // 728 +/* 7 */ // 729 +/***/ function(module, exports) { // 730 + // 731 + /*global // 732 + angular, _, Tracker, check, Match, Mongo // 733 + */ // 734 + // 735 + 'use strict'; // 736 + // 737 + var angularMeteorCollection = angular.module('angular-meteor.collection', ['angular-meteor.stopper', 'angular-meteor.subscribe', 'angular-meteor.utils', 'diffArray', 'angular-meteor.settings']); + // 739 + // The reason angular meteor collection is a factory function and not something // 740 + // that inherit from array comes from here: // 741 + // http://perfectionkills.com/how-ecmascript-5-still-does-not-allow-to-subclass-an-array/ // 742 + // We went with the direct extensions approach. // 743 + angularMeteorCollection.factory('AngularMeteorCollection', ['$q', '$meteorSubscribe', '$meteorUtils', '$rootScope', '$timeout', 'diffArray', '$angularMeteorSettings', function ($q, $meteorSubscribe, $meteorUtils, $rootScope, $timeout, diffArray, $angularMeteorSettings) { + // 745 + function AngularMeteorCollection(curDefFunc, collection, diffArrayFunc, autoClientSave) { // 746 + if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.$meteorCollection] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorCollection. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); + // 748 + var data = []; // 749 + // Server backup data to evaluate what changes come from client // 750 + // after each server update. // 751 + data._serverBackup = []; // 752 + // Array differ function. // 753 + data._diffArrayFunc = diffArrayFunc; // 754 + // Handler of the cursor observer. // 755 + data._hObserve = null; // 756 + // On new cursor autorun handler // 757 + // (autorun for reactive variables). // 758 + data._hNewCurAutorun = null; // 759 + // On new data autorun handler // 760 + // (autorun for cursor.fetch). // 761 + data._hDataAutorun = null; // 762 + // 763 + if (angular.isDefined(collection)) { // 764 + data.$$collection = collection; // 765 + } else { // 766 + var cursor = curDefFunc(); // 767 + data.$$collection = $meteorUtils.getCollectionByName(cursor.collection.name); // 768 + } // 769 + // 770 + _.extend(data, AngularMeteorCollection); // 771 + data._startCurAutorun(curDefFunc, autoClientSave); // 772 + // 773 + return data; // 774 + } // 775 + // 776 + AngularMeteorCollection._startCurAutorun = function (curDefFunc, autoClientSave) { // 777 + var self = this; // 778 + // 779 + self._hNewCurAutorun = Tracker.autorun(function () { // 780 + // When the reactive func gets recomputated we need to stop any previous // 781 + // observeChanges. // 782 + Tracker.onInvalidate(function () { // 783 + self._stopCursor(); // 784 + }); // 785 + // 786 + if (autoClientSave) self._setAutoClientSave(); // 787 + self._updateCursor(curDefFunc(), autoClientSave); // 788 + }); // 789 + }; // 790 + // 791 + AngularMeteorCollection.subscribe = function () { // 792 + $meteorSubscribe.subscribe.apply(this, arguments); // 793 + return this; // 794 + }; // 795 + // 796 + AngularMeteorCollection.save = function (docs, useUnsetModifier) { // 797 + // save whole collection // 798 + if (!docs) docs = this; // 799 + // save single doc // 800 + docs = [].concat(docs); // 801 + // 802 + var promises = docs.map(function (doc) { // 803 + return this._upsertDoc(doc, useUnsetModifier); // 804 + }, this); // 805 + // 806 + return $meteorUtils.promiseAll(promises); // 807 + }; // 808 + // 809 + AngularMeteorCollection._upsertDoc = function (doc, useUnsetModifier) { // 810 + var deferred = $q.defer(); // 811 + var collection = this.$$collection; // 812 + var createFulfill = _.partial($meteorUtils.fulfill, deferred, null); // 813 + // 814 + // delete $$hashkey // 815 + doc = $meteorUtils.stripDollarPrefixedKeys(doc); // 816 + var docId = doc._id; // 817 + var isExist = collection.findOne(docId); // 818 + // 819 + // update // 820 + if (isExist) { // 821 + // Deletes _id property (from the copy) so that // 822 + // it can be $set using update. // 823 + delete doc._id; // 824 + var modifier = useUnsetModifier ? { $unset: doc } : { $set: doc }; // 825 + // NOTE: do not use #upsert() method, since it does not exist in some collections // 826 + collection.update(docId, modifier, createFulfill(function () { // 827 + return { _id: docId, action: 'updated' }; // 828 + })); // 829 + } // 830 + // insert // 831 + else { // 832 + collection.insert(doc, createFulfill(function (id) { // 833 + return { _id: id, action: 'inserted' }; // 834 + })); // 835 + } // 836 + // 837 + return deferred.promise; // 838 + }; // 839 + // 840 + // performs $pull operations parallely. // 841 + // used for handling splice operations returned from getUpdates() to prevent conflicts. // 842 + // see issue: https://github.com/Urigo/angular-meteor/issues/793 // 843 + AngularMeteorCollection._updateDiff = function (selector, update, callback) { // 844 + callback = callback || angular.noop; // 845 + var setters = _.omit(update, '$pull'); // 846 + var updates = [setters]; // 847 + // 848 + _.each(update.$pull, function (pull, prop) { // 849 + var puller = {}; // 850 + puller[prop] = pull; // 851 + updates.push({ $pull: puller }); // 852 + }); // 853 + // 854 + this._updateParallel(selector, updates, callback); // 855 + }; // 856 + // 857 + // performs each update operation parallely // 858 + AngularMeteorCollection._updateParallel = function (selector, updates, callback) { // 859 + var self = this; // 860 + var done = _.after(updates.length, callback); // 861 + // 862 + var next = function next(err, affectedDocsNum) { // 863 + if (err) return callback(err); // 864 + done(null, affectedDocsNum); // 865 + }; // 866 + // 867 + _.each(updates, function (update) { // 868 + self.$$collection.update(selector, update, next); // 869 + }); // 870 + }; // 871 + // 872 + AngularMeteorCollection.remove = function (keyOrDocs) { // 873 + var keys; // 874 + // 875 + // remove whole collection // 876 + if (!keyOrDocs) { // 877 + keys = _.pluck(this, '_id'); // 878 + } // 879 + // remove docs // 880 + else { // 881 + keyOrDocs = [].concat(keyOrDocs); // 882 + // 883 + keys = _.map(keyOrDocs, function (keyOrDoc) { // 884 + return keyOrDoc._id || keyOrDoc; // 885 + }); // 886 + } // 887 + // 888 + // Checks if all keys are correct. // 889 + check(keys, [Match.OneOf(String, Mongo.ObjectID)]); // 890 + // 891 + var promises = keys.map(function (key) { // 892 + return this._removeDoc(key); // 893 + }, this); // 894 + // 895 + return $meteorUtils.promiseAll(promises); // 896 + }; // 897 + // 898 + AngularMeteorCollection._removeDoc = function (id) { // 899 + var deferred = $q.defer(); // 900 + var collection = this.$$collection; // 901 + var fulfill = $meteorUtils.fulfill(deferred, null, { _id: id, action: 'removed' }); // 902 + collection.remove(id, fulfill); // 903 + return deferred.promise; // 904 + }; // 905 + // 906 + AngularMeteorCollection._updateCursor = function (cursor, autoClientSave) { // 907 + var self = this; // 908 + // XXX - consider adding an option for a non-orderd result for faster performance // 909 + if (self._hObserve) self._stopObserving(); // 910 + // 911 + self._hObserve = cursor.observe({ // 912 + addedAt: function addedAt(doc, atIndex) { // 913 + self.splice(atIndex, 0, doc); // 914 + self._serverBackup.splice(atIndex, 0, doc); // 915 + self._setServerUpdateMode(); // 916 + }, // 917 + // 918 + changedAt: function changedAt(doc, oldDoc, atIndex) { // 919 + diffArray.deepCopyChanges(self[atIndex], doc); // 920 + diffArray.deepCopyRemovals(self[atIndex], doc); // 921 + self._serverBackup[atIndex] = self[atIndex]; // 922 + self._setServerUpdateMode(); // 923 + }, // 924 + // 925 + movedTo: function movedTo(doc, fromIndex, toIndex) { // 926 + self.splice(fromIndex, 1); // 927 + self.splice(toIndex, 0, doc); // 928 + self._serverBackup.splice(fromIndex, 1); // 929 + self._serverBackup.splice(toIndex, 0, doc); // 930 + self._setServerUpdateMode(); // 931 + }, // 932 + // 933 + removedAt: function removedAt(oldDoc) { // 934 + var removedIndex = $meteorUtils.findIndexById(self, oldDoc); // 935 + // 936 + if (removedIndex != -1) { // 937 + self.splice(removedIndex, 1); // 938 + self._serverBackup.splice(removedIndex, 1); // 939 + self._setServerUpdateMode(); // 940 + } else { // 941 + // If it's been removed on client then it's already not in collection // 942 + // itself but still is in the _serverBackup. // 943 + removedIndex = $meteorUtils.findIndexById(self._serverBackup, oldDoc); // 944 + // 945 + if (removedIndex != -1) { // 946 + self._serverBackup.splice(removedIndex, 1); // 947 + } // 948 + } // 949 + } // 950 + }); // 951 + // 952 + self._hDataAutorun = Tracker.autorun(function () { // 953 + cursor.fetch(); // 954 + if (self._serverMode) self._unsetServerUpdateMode(autoClientSave); // 955 + }); // 956 + }; // 957 + // 958 + AngularMeteorCollection._stopObserving = function () { // 959 + this._hObserve.stop(); // 960 + this._hDataAutorun.stop(); // 961 + delete this._serverMode; // 962 + delete this._hUnsetTimeout; // 963 + }; // 964 + // 965 + AngularMeteorCollection._setServerUpdateMode = function (name) { // 966 + this._serverMode = true; // 967 + // To simplify server update logic, we don't follow // 968 + // updates from the client at the same time. // 969 + this._unsetAutoClientSave(); // 970 + }; // 971 + // 972 + // Here we use $timeout to combine multiple updates that go // 973 + // each one after another. // 974 + AngularMeteorCollection._unsetServerUpdateMode = function (autoClientSave) { // 975 + var self = this; // 976 + // 977 + if (self._hUnsetTimeout) { // 978 + $timeout.cancel(self._hUnsetTimeout); // 979 + self._hUnsetTimeout = null; // 980 + } // 981 + // 982 + self._hUnsetTimeout = $timeout(function () { // 983 + self._serverMode = false; // 984 + // Finds updates that was potentially done from the client side // 985 + // and saves them. // 986 + var changes = diffArray.getChanges(self, self._serverBackup, self._diffArrayFunc); // 987 + self._saveChanges(changes); // 988 + // After, continues following client updates. // 989 + if (autoClientSave) self._setAutoClientSave(); // 990 + }, 0); // 991 + }; // 992 + // 993 + AngularMeteorCollection.stop = function () { // 994 + this._stopCursor(); // 995 + this._hNewCurAutorun.stop(); // 996 + }; // 997 + // 998 + AngularMeteorCollection._stopCursor = function () { // 999 + this._unsetAutoClientSave(); // 1000 + // 1001 + if (this._hObserve) { // 1002 + this._hObserve.stop(); // 1003 + this._hDataAutorun.stop(); // 1004 + } // 1005 + // 1006 + this.splice(0); // 1007 + this._serverBackup.splice(0); // 1008 + }; // 1009 + // 1010 + AngularMeteorCollection._unsetAutoClientSave = function (name) { // 1011 + if (this._hRegAutoBind) { // 1012 + this._hRegAutoBind(); // 1013 + this._hRegAutoBind = null; // 1014 + } // 1015 + }; // 1016 + // 1017 + AngularMeteorCollection._setAutoClientSave = function () { // 1018 + var self = this; // 1019 + // 1020 + // Always unsets auto save to keep only one $watch handler. // 1021 + self._unsetAutoClientSave(); // 1022 + // 1023 + self._hRegAutoBind = $rootScope.$watch(function () { // 1024 + return self; // 1025 + }, function (nItems, oItems) { // 1026 + if (nItems === oItems) return; // 1027 + // 1028 + var changes = diffArray.getChanges(self, oItems, self._diffArrayFunc); // 1029 + self._unsetAutoClientSave(); // 1030 + self._saveChanges(changes); // 1031 + self._setAutoClientSave(); // 1032 + }, true); // 1033 + }; // 1034 + // 1035 + AngularMeteorCollection._saveChanges = function (changes) { // 1036 + var self = this; // 1037 + // 1038 + // Saves added documents // 1039 + // Using reversed iteration to prevent indexes from changing during splice // 1040 + var addedDocs = changes.added.reverse().map(function (descriptor) { // 1041 + self.splice(descriptor.index, 1); // 1042 + return descriptor.item; // 1043 + }); // 1044 + // 1045 + if (addedDocs.length) self.save(addedDocs); // 1046 + // 1047 + // Removes deleted documents // 1048 + var removedDocs = changes.removed.map(function (descriptor) { // 1049 + return descriptor.item; // 1050 + }); // 1051 + // 1052 + if (removedDocs.length) self.remove(removedDocs); // 1053 + // 1054 + // Updates changed documents // 1055 + changes.changed.forEach(function (descriptor) { // 1056 + self._updateDiff(descriptor.selector, descriptor.modifier); // 1057 + }); // 1058 + }; // 1059 + // 1060 + return AngularMeteorCollection; // 1061 + }]); // 1062 + // 1063 + angularMeteorCollection.factory('$meteorCollectionFS', ['$meteorCollection', 'diffArray', '$angularMeteorSettings', function ($meteorCollection, diffArray, $angularMeteorSettings) { + function $meteorCollectionFS(reactiveFunc, autoClientSave, collection) { // 1065 + // 1066 + if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.$meteorCollectionFS] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/files. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); + return new $meteorCollection(reactiveFunc, autoClientSave, collection, diffArray.shallow); // 1068 + } // 1069 + // 1070 + return $meteorCollectionFS; // 1071 + }]); // 1072 + // 1073 + angularMeteorCollection.factory('$meteorCollection', ['AngularMeteorCollection', '$rootScope', 'diffArray', function (AngularMeteorCollection, $rootScope, diffArray) { + function $meteorCollection(reactiveFunc, autoClientSave, collection, diffFn) { // 1075 + // Validate parameters // 1076 + if (!reactiveFunc) { // 1077 + throw new TypeError('The first argument of $meteorCollection is undefined.'); // 1078 + } // 1079 + // 1080 + if (!(angular.isFunction(reactiveFunc) || angular.isFunction(reactiveFunc.find))) { // 1081 + throw new TypeError('The first argument of $meteorCollection must be a function or ' + 'a have a find function property.'); + } // 1083 + // 1084 + if (!angular.isFunction(reactiveFunc)) { // 1085 + collection = angular.isDefined(collection) ? collection : reactiveFunc; // 1086 + reactiveFunc = _.bind(reactiveFunc.find, reactiveFunc); // 1087 + } // 1088 + // 1089 + // By default auto save - true. // 1090 + autoClientSave = angular.isDefined(autoClientSave) ? autoClientSave : true; // 1091 + diffFn = diffFn || diffArray; // 1092 + return new AngularMeteorCollection(reactiveFunc, collection, diffFn, autoClientSave); // 1093 + } // 1094 + // 1095 + return $meteorCollection; // 1096 + }]); // 1097 + // 1098 + angularMeteorCollection.run(['$rootScope', '$meteorCollection', '$meteorCollectionFS', '$meteorStopper', function ($rootScope, $meteorCollection, $meteorCollectionFS, $meteorStopper) { + var scopeProto = Object.getPrototypeOf($rootScope); // 1100 + scopeProto.$meteorCollection = $meteorStopper($meteorCollection); // 1101 + scopeProto.$meteorCollectionFS = $meteorStopper($meteorCollectionFS); // 1102 + }]); // 1103 + // 1104 +/***/ }, // 1105 +/* 8 */ // 1106 +/***/ function(module, exports) { // 1107 + // 1108 + /*global // 1109 + angular, _, Mongo // 1110 + */ // 1111 + // 1112 + 'use strict'; // 1113 + // 1114 + var angularMeteorObject = angular.module('angular-meteor.object', ['angular-meteor.utils', 'angular-meteor.subscribe', 'angular-meteor.collection', 'getUpdates', 'diffArray', 'angular-meteor.settings']); + // 1116 + angularMeteorObject.factory('AngularMeteorObject', ['$q', '$meteorSubscribe', '$meteorUtils', 'diffArray', 'getUpdates', 'AngularMeteorCollection', '$angularMeteorSettings', function ($q, $meteorSubscribe, $meteorUtils, diffArray, getUpdates, AngularMeteorCollection, $angularMeteorSettings) { + // 1118 + // A list of internals properties to not watch for, nor pass to the Document on update and etc. // 1119 + AngularMeteorObject.$$internalProps = ['$$collection', '$$options', '$$id', '$$hashkey', '$$internalProps', '$$scope', 'bind', 'save', 'reset', 'subscribe', 'stop', 'autorunComputation', 'unregisterAutoBind', 'unregisterAutoDestroy', 'getRawObject', '_auto', '_setAutos', '_eventEmitter', '_serverBackup', '_updateDiff', '_updateParallel', '_getId']; + // 1121 + function AngularMeteorObject(collection, selector, options) { // 1122 + if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.$meteorObject] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorObject. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); + // Make data not be an object so we can extend it to preserve // 1124 + // Collection Helpers and the like // 1125 + var helpers = collection._helpers; // 1126 + var data = _.isFunction(helpers) ? Object.create(helpers.prototype) : {}; // 1127 + var doc = collection.findOne(selector, options); // 1128 + var collectionExtension = _.pick(AngularMeteorCollection, '_updateParallel'); // 1129 + _.extend(data, doc); // 1130 + _.extend(data, AngularMeteorObject); // 1131 + _.extend(data, collectionExtension); // 1132 + // 1133 + // Omit options that may spoil document finding // 1134 + data.$$options = _.omit(options, 'skip', 'limit'); // 1135 + data.$$collection = collection; // 1136 + data.$$id = data._getId(selector); // 1137 + data._serverBackup = doc || {}; // 1138 + // 1139 + return data; // 1140 + } // 1141 + // 1142 + AngularMeteorObject.getRawObject = function () { // 1143 + return angular.copy(_.omit(this, this.$$internalProps)); // 1144 + }; // 1145 + // 1146 + AngularMeteorObject.subscribe = function () { // 1147 + $meteorSubscribe.subscribe.apply(this, arguments); // 1148 + return this; // 1149 + }; // 1150 + // 1151 + AngularMeteorObject.save = function (custom) { // 1152 + var deferred = $q.defer(); // 1153 + var collection = this.$$collection; // 1154 + var createFulfill = _.partial($meteorUtils.fulfill, deferred, null); // 1155 + var oldDoc = collection.findOne(this.$$id); // 1156 + var mods; // 1157 + // 1158 + // update // 1159 + if (oldDoc) { // 1160 + if (custom) mods = { $set: custom };else { // 1161 + mods = getUpdates(oldDoc, this.getRawObject()); // 1162 + // If there are no updates, there is nothing to do here, returning // 1163 + if (_.isEmpty(mods)) { // 1164 + return $q.when({ action: 'updated' }); // 1165 + } // 1166 + } // 1167 + // 1168 + // NOTE: do not use #upsert() method, since it does not exist in some collections // 1169 + this._updateDiff(mods, createFulfill({ action: 'updated' })); // 1170 + } // 1171 + // insert // 1172 + else { // 1173 + if (custom) mods = _.clone(custom);else mods = this.getRawObject(); // 1174 + // 1175 + mods._id = mods._id || this.$$id; // 1176 + collection.insert(mods, createFulfill({ action: 'inserted' })); // 1177 + } // 1178 + // 1179 + return deferred.promise; // 1180 + }; // 1181 + // 1182 + AngularMeteorObject._updateDiff = function (update, callback) { // 1183 + var selector = this.$$id; // 1184 + AngularMeteorCollection._updateDiff.call(this, selector, update, callback); // 1185 + }; // 1186 + // 1187 + AngularMeteorObject.reset = function (keepClientProps) { // 1188 + var self = this; // 1189 + var options = this.$$options; // 1190 + var id = this.$$id; // 1191 + var doc = this.$$collection.findOne(id, options); // 1192 + // 1193 + if (doc) { // 1194 + // extend SubObject // 1195 + var docKeys = _.keys(doc); // 1196 + var docExtension = _.pick(doc, docKeys); // 1197 + var clientProps; // 1198 + // 1199 + _.extend(self, docExtension); // 1200 + _.extend(self._serverBackup, docExtension); // 1201 + // 1202 + if (keepClientProps) { // 1203 + clientProps = _.intersection(_.keys(self), _.keys(self._serverBackup)); // 1204 + } else { // 1205 + clientProps = _.keys(self); // 1206 + } // 1207 + // 1208 + var serverProps = _.keys(doc); // 1209 + var removedKeys = _.difference(clientProps, serverProps, self.$$internalProps); // 1210 + // 1211 + removedKeys.forEach(function (prop) { // 1212 + delete self[prop]; // 1213 + delete self._serverBackup[prop]; // 1214 + }); // 1215 + } else { // 1216 + _.keys(this.getRawObject()).forEach(function (prop) { // 1217 + delete self[prop]; // 1218 + }); // 1219 + // 1220 + self._serverBackup = {}; // 1221 + } // 1222 + }; // 1223 + // 1224 + AngularMeteorObject.stop = function () { // 1225 + if (this.unregisterAutoDestroy) this.unregisterAutoDestroy(); // 1226 + // 1227 + if (this.unregisterAutoBind) this.unregisterAutoBind(); // 1228 + // 1229 + if (this.autorunComputation && this.autorunComputation.stop) this.autorunComputation.stop(); // 1230 + }; // 1231 + // 1232 + AngularMeteorObject._getId = function (selector) { // 1233 + var options = _.extend({}, this.$$options, { // 1234 + fields: { _id: 1 }, // 1235 + reactive: false, // 1236 + transform: null // 1237 + }); // 1238 + // 1239 + var doc = this.$$collection.findOne(selector, options); // 1240 + // 1241 + if (doc) return doc._id; // 1242 + if (selector instanceof Mongo.ObjectID) return selector; // 1243 + if (_.isString(selector)) return selector; // 1244 + return new Mongo.ObjectID(); // 1245 + }; // 1246 + // 1247 + return AngularMeteorObject; // 1248 + }]); // 1249 + // 1250 + angularMeteorObject.factory('$meteorObject', ['$rootScope', '$meteorUtils', 'getUpdates', 'AngularMeteorObject', function ($rootScope, $meteorUtils, getUpdates, AngularMeteorObject) { + function $meteorObject(collection, id, auto, options) { // 1252 + // Validate parameters // 1253 + if (!collection) { // 1254 + throw new TypeError("The first argument of $meteorObject is undefined."); // 1255 + } // 1256 + // 1257 + if (!angular.isFunction(collection.findOne)) { // 1258 + throw new TypeError("The first argument of $meteorObject must be a function or a have a findOne function property."); + } // 1260 + // 1261 + var data = new AngularMeteorObject(collection, id, options); // 1262 + // Making auto default true - http://stackoverflow.com/a/15464208/1426570 // 1263 + data._auto = auto !== false; // 1264 + _.extend(data, $meteorObject); // 1265 + data._setAutos(); // 1266 + return data; // 1267 + } // 1268 + // 1269 + $meteorObject._setAutos = function () { // 1270 + var self = this; // 1271 + // 1272 + this.autorunComputation = $meteorUtils.autorun($rootScope, function () { // 1273 + self.reset(true); // 1274 + }); // 1275 + // 1276 + // Deep watches the model and performs autobind // 1277 + this.unregisterAutoBind = this._auto && $rootScope.$watch(function () { // 1278 + return self.getRawObject(); // 1279 + }, function (item, oldItem) { // 1280 + if (item !== oldItem) self.save(); // 1281 + }, true); // 1282 + // 1283 + this.unregisterAutoDestroy = $rootScope.$on('$destroy', function () { // 1284 + if (self && self.stop) self.pop(); // 1285 + }); // 1286 + }; // 1287 + // 1288 + return $meteorObject; // 1289 + }]); // 1290 + // 1291 + angularMeteorObject.run(['$rootScope', '$meteorObject', '$meteorStopper', function ($rootScope, $meteorObject, $meteorStopper) { + var scopeProto = Object.getPrototypeOf($rootScope); // 1293 + scopeProto.$meteorObject = $meteorStopper($meteorObject); // 1294 + }]); // 1295 + // 1296 +/***/ }, // 1297 +/* 9 */ // 1298 +/***/ function(module, exports) { // 1299 + // 1300 + /*global // 1301 + angular, _, Package, Meteor // 1302 + */ // 1303 + // 1304 + 'use strict'; // 1305 + // 1306 + var angularMeteorUser = angular.module('angular-meteor.user', ['angular-meteor.utils', 'angular-meteor.core', 'angular-meteor.settings']); + // 1308 + // requires package 'accounts-password' // 1309 + angularMeteorUser.service('$meteorUser', ['$rootScope', '$meteorUtils', '$q', '$angularMeteorSettings', function ($rootScope, $meteorUtils, $q, $angularMeteorSettings) { + // 1311 + var pack = Package['accounts-base']; // 1312 + if (!pack) return; // 1313 + // 1314 + var self = this; // 1315 + var Accounts = pack.Accounts; // 1316 + // 1317 + this.waitForUser = function () { // 1318 + if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.waitForUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); + // 1320 + var deferred = $q.defer(); // 1321 + // 1322 + $meteorUtils.autorun($rootScope, function () { // 1323 + if (!Meteor.loggingIn()) deferred.resolve(Meteor.user()); // 1324 + }, true); // 1325 + // 1326 + return deferred.promise; // 1327 + }; // 1328 + // 1329 + this.requireUser = function () { // 1330 + if (!$angularMeteorSettings.suppressWarnings) { // 1331 + console.warn('[angular-meteor.requireUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); + } // 1333 + // 1334 + var deferred = $q.defer(); // 1335 + // 1336 + $meteorUtils.autorun($rootScope, function () { // 1337 + if (!Meteor.loggingIn()) { // 1338 + if (Meteor.user() === null) deferred.reject("AUTH_REQUIRED");else deferred.resolve(Meteor.user()); // 1339 + } // 1340 + }, true); // 1341 + // 1342 + return deferred.promise; // 1343 + }; // 1344 + // 1345 + this.requireValidUser = function (validatorFn) { // 1346 + if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.requireValidUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); + // 1348 + return self.requireUser(true).then(function (user) { // 1349 + var valid = validatorFn(user); // 1350 + // 1351 + if (valid === true) return user;else if (typeof valid === "string") return $q.reject(valid);else return $q.reject("FORBIDDEN"); + }); // 1353 + }; // 1354 + // 1355 + this.loginWithPassword = $meteorUtils.promissor(Meteor, 'loginWithPassword'); // 1356 + this.createUser = $meteorUtils.promissor(Accounts, 'createUser'); // 1357 + this.changePassword = $meteorUtils.promissor(Accounts, 'changePassword'); // 1358 + this.forgotPassword = $meteorUtils.promissor(Accounts, 'forgotPassword'); // 1359 + this.resetPassword = $meteorUtils.promissor(Accounts, 'resetPassword'); // 1360 + this.verifyEmail = $meteorUtils.promissor(Accounts, 'verifyEmail'); // 1361 + this.logout = $meteorUtils.promissor(Meteor, 'logout'); // 1362 + this.logoutOtherClients = $meteorUtils.promissor(Meteor, 'logoutOtherClients'); // 1363 + this.loginWithFacebook = $meteorUtils.promissor(Meteor, 'loginWithFacebook'); // 1364 + this.loginWithTwitter = $meteorUtils.promissor(Meteor, 'loginWithTwitter'); // 1365 + this.loginWithGoogle = $meteorUtils.promissor(Meteor, 'loginWithGoogle'); // 1366 + this.loginWithGithub = $meteorUtils.promissor(Meteor, 'loginWithGithub'); // 1367 + this.loginWithMeteorDeveloperAccount = $meteorUtils.promissor(Meteor, 'loginWithMeteorDeveloperAccount'); // 1368 + this.loginWithMeetup = $meteorUtils.promissor(Meteor, 'loginWithMeetup'); // 1369 + this.loginWithWeibo = $meteorUtils.promissor(Meteor, 'loginWithWeibo'); // 1370 + }]); // 1371 + // 1372 + angularMeteorUser.run(['$rootScope', '$angularMeteorSettings', '$$Core', function ($rootScope, $angularMeteorSettings, $$Core) { + // 1374 + var ScopeProto = Object.getPrototypeOf($rootScope); // 1375 + _.extend(ScopeProto, $$Core); // 1376 + // 1377 + $rootScope.autorun(function () { // 1378 + if (!Meteor.user) return; // 1379 + $rootScope.currentUser = Meteor.user(); // 1380 + $rootScope.loggingIn = Meteor.loggingIn(); // 1381 + }); // 1382 + }]); // 1383 + // 1384 +/***/ }, // 1385 +/* 10 */ // 1386 +/***/ function(module, exports) { // 1387 + // 1388 + /*global // 1389 + angular, _, Meteor // 1390 + */ // 1391 + // 1392 + 'use strict'; // 1393 + // 1394 + var angularMeteorMethods = angular.module('angular-meteor.methods', ['angular-meteor.utils', 'angular-meteor.settings']); + // 1396 + angularMeteorMethods.service('$meteorMethods', ['$q', '$meteorUtils', '$angularMeteorSettings', function ($q, $meteorUtils, $angularMeteorSettings) { + this.call = function () { // 1398 + if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.$meteor.call] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/methods. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); + // 1400 + var deferred = $q.defer(); // 1401 + var fulfill = $meteorUtils.fulfill(deferred); // 1402 + var args = _.toArray(arguments).concat(fulfill); // 1403 + Meteor.call.apply(this, args); // 1404 + return deferred.promise; // 1405 + }; // 1406 + }]); // 1407 + // 1408 +/***/ }, // 1409 +/* 11 */ // 1410 +/***/ function(module, exports) { // 1411 + // 1412 + /*global // 1413 + angular, Session // 1414 + */ // 1415 + // 1416 + 'use strict'; // 1417 + // 1418 + var angularMeteorSession = angular.module('angular-meteor.session', ['angular-meteor.utils', 'angular-meteor.settings']); + // 1420 + angularMeteorSession.factory('$meteorSession', ['$meteorUtils', '$parse', '$angularMeteorSettings', function ($meteorUtils, $parse, $angularMeteorSettings) { + return function (session) { // 1422 + // 1423 + return { // 1424 + // 1425 + bind: function bind(scope, model) { // 1426 + if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.session.bind] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://www.angular-meteor.com/api/1.3.0/session. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); + // 1428 + var getter = $parse(model); // 1429 + var setter = getter.assign; // 1430 + $meteorUtils.autorun(scope, function () { // 1431 + setter(scope, Session.get(session)); // 1432 + }); // 1433 + // 1434 + scope.$watch(model, function (newItem, oldItem) { // 1435 + Session.set(session, getter(scope)); // 1436 + }, true); // 1437 + } // 1438 + }; // 1439 + }; // 1440 + }]); // 1441 + // 1442 +/***/ }, // 1443 +/* 12 */ // 1444 +/***/ function(module, exports) { // 1445 + // 1446 + /*global // 1447 + angular, Package // 1448 + */ // 1449 + // 1450 + 'use strict'; // 1451 + // 1452 + var angularMeteorCamera = angular.module('angular-meteor.camera', ['angular-meteor.utils', 'angular-meteor.settings']); + // 1454 + // requires package 'mdg:camera' // 1455 + angularMeteorCamera.service('$meteorCamera', ['$q', '$meteorUtils', '$angularMeteorSettings', function ($q, $meteorUtils, $angularMeteorSettings) { + if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); + var pack = Package['mdg:camera']; // 1458 + if (!pack) return; // 1459 + // 1460 + var MeteorCamera = pack.MeteorCamera; // 1461 + // 1462 + this.getPicture = function (options) { // 1463 + if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); + // 1465 + options = options || {}; // 1466 + var deferred = $q.defer(); // 1467 + MeteorCamera.getPicture(options, $meteorUtils.fulfill(deferred)); // 1468 + return deferred.promise; // 1469 + }; // 1470 + }]); // 1471 + // 1472 +/***/ }, // 1473 +/* 13 */ // 1474 +/***/ function(module, exports) { // 1475 + // 1476 + /*global // 1477 + angular // 1478 + */ // 1479 + // 1480 + 'use strict'; // 1481 + // 1482 + var angularMeteorStopper = angular.module('angular-meteor.stopper', ['angular-meteor.subscribe']); // 1483 + // 1484 + angularMeteorStopper.factory('$meteorStopper', ['$q', '$meteorSubscribe', function ($q, $meteorSubscribe) { // 1485 + function $meteorStopper($meteorEntity) { // 1486 + return function () { // 1487 + var args = Array.prototype.slice.call(arguments); // 1488 + var meteorEntity = $meteorEntity.apply(this, args); // 1489 + // 1490 + angular.extend(meteorEntity, $meteorStopper); // 1491 + meteorEntity.$$scope = this; // 1492 + // 1493 + this.$on('$destroy', function () { // 1494 + meteorEntity.stop(); // 1495 + if (meteorEntity.subscription) meteorEntity.subscription.stop(); // 1496 + }); // 1497 + // 1498 + return meteorEntity; // 1499 + }; // 1500 + } // 1501 + // 1502 + $meteorStopper.subscribe = function () { // 1503 + var args = Array.prototype.slice.call(arguments); // 1504 + this.subscription = $meteorSubscribe._subscribe(this.$$scope, $q.defer(), args); // 1505 + return this; // 1506 + }; // 1507 + // 1508 + return $meteorStopper; // 1509 + }]); // 1510 + // 1511 +/***/ }, // 1512 +/* 14 */ // 1513 +/***/ function(module, exports) { // 1514 + // 1515 + 'use strict'; // 1516 + // 1517 + Object.defineProperty(exports, "__esModule", { // 1518 + value: true // 1519 + }); // 1520 + var name = exports.name = 'angular-meteor.utilities'; // 1521 + var utils = exports.utils = '$$utils'; // 1522 + // 1523 + angular.module(name, []) // 1524 + // 1525 + /* // 1526 + A utility service which is provided with general utility functions // 1527 + */ // 1528 + .service(utils, ['$rootScope', function ($rootScope) { // 1529 + var self = this; // 1530 + // 1531 + // Checks if an object is a cursor // 1532 + this.isCursor = function (obj) { // 1533 + return obj instanceof Meteor.Collection.Cursor; // 1534 + }; // 1535 + // 1536 + // Cheecks if an object is a scope // 1537 + this.isScope = function (obj) { // 1538 + return obj instanceof $rootScope.constructor; // 1539 + }; // 1540 + // 1541 + // Checks if two objects are siblings // 1542 + this.areSiblings = function (obj1, obj2) { // 1543 + return _.isObject(obj1) && _.isObject(obj2) && Object.getPrototypeOf(obj1) === Object.getPrototypeOf(obj2); // 1544 + }; // 1545 + // 1546 + // Binds function into a scpecified context. If an object is provided, will bind every // 1547 + // value in the object which is a function. If a tap function is provided, it will be // 1548 + // called right after the function has been invoked. // 1549 + this.bind = function (fn, context, tap) { // 1550 + tap = _.isFunction(tap) ? tap : angular.noop; // 1551 + if (_.isFunction(fn)) return bindFn(fn, context, tap); // 1552 + if (_.isObject(fn)) return bindObj(fn, context, tap); // 1553 + return fn; // 1554 + }; // 1555 + // 1556 + function bindFn(fn, context, tap) { // 1557 + return function () { // 1558 + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { // 1559 + args[_key] = arguments[_key]; // 1560 + } // 1561 + // 1562 + var result = fn.apply(context, args); // 1563 + tap.call(context, { // 1564 + result: result, // 1565 + args: args // 1566 + }); // 1567 + return result; // 1568 + }; // 1569 + } // 1570 + // 1571 + function bindObj(obj, context, tap) { // 1572 + return _.keys(obj).reduce(function (bound, k) { // 1573 + bound[k] = self.bind(obj[k], context, tap); // 1574 + return bound; // 1575 + }, {}); // 1576 + } // 1577 + }]); // 1578 + // 1579 +/***/ }, // 1580 +/* 15 */ // 1581 +/***/ function(module, exports) { // 1582 + // 1583 + 'use strict'; // 1584 + // 1585 + Object.defineProperty(exports, "__esModule", { // 1586 + value: true // 1587 + }); // 1588 + // 1589 + function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + // 1591 + var name = exports.name = 'angular-meteor.mixer'; // 1592 + var Mixer = exports.Mixer = '$Mixer'; // 1593 + // 1594 + angular.module(name, []) // 1595 + // 1596 + /* // 1597 + A service which lets us apply mixins into Scope.prototype. // 1598 + The flow is simple. Once we define a mixin, it will be stored in the `$Mixer`, // 1599 + and any time a `ChildScope` prototype is created // 1600 + it will be extended by the `$Mixer`. // 1601 + This concept is good because it keeps our code // 1602 + clean and simple, and easy to extend. // 1603 + So any time we would like to define a new behaviour to our scope, // 1604 + we will just use the `$Mixer` service. // 1605 + */ // 1606 + .service(Mixer, function () { // 1607 + var _this = this; // 1608 + // 1609 + this._mixins = []; // 1610 + // Apply mixins automatically on specified contexts // 1611 + this._autoExtend = []; // 1612 + this._autoConstruct = []; // 1613 + // 1614 + // Adds a new mixin // 1615 + this.mixin = function (mixin) { // 1616 + if (!_.isObject(mixin)) { // 1617 + throw Error('argument 1 must be an object'); // 1618 + } // 1619 + // 1620 + _this._mixins = _.union(_this._mixins, [mixin]); // 1621 + // Apply mixins to stored contexts // 1622 + _this._autoExtend.forEach(function (context) { // 1623 + return _this._extend(context); // 1624 + }); // 1625 + _this._autoConstruct.forEach(function (context) { // 1626 + return _this._construct(context); // 1627 + }); // 1628 + return _this; // 1629 + }; // 1630 + // 1631 + // Removes a mixin. Useful mainly for test purposes // 1632 + this._mixout = function (mixin) { // 1633 + _this._mixins = _.without(_this._mixins, mixin); // 1634 + return _this; // 1635 + }; // 1636 + // 1637 + // Invoke function mixins with the provided context and arguments // 1638 + this._construct = function (context) { // 1639 + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { // 1640 + args[_key - 1] = arguments[_key]; // 1641 + } // 1642 + // 1643 + _this._mixins.filter(_.isFunction).forEach(function (mixin) { // 1644 + mixin.call.apply(mixin, [context].concat(args)); // 1645 + }); // 1646 + // 1647 + return context; // 1648 + }; // 1649 + // 1650 + // Extend prototype with the defined mixins // 1651 + this._extend = function (obj) { // 1652 + var _ref; // 1653 + // 1654 + return (_ref = _).extend.apply(_ref, [obj].concat(_toConsumableArray(_this._mixins))); // 1655 + }; // 1656 + }); // 1657 + // 1658 +/***/ }, // 1659 +/* 16 */ // 1660 +/***/ function(module, exports, __webpack_require__) { // 1661 + // 1662 + 'use strict'; // 1663 + // 1664 + Object.defineProperty(exports, "__esModule", { // 1665 + value: true // 1666 + }); // 1667 + exports.name = undefined; // 1668 + // 1669 + var _mixer = __webpack_require__(15); // 1670 + // 1671 + var name = exports.name = 'angular-meteor.scope'; // 1672 + // 1673 + angular.module(name, [_mixer.name]).run(['$rootScope', _mixer.Mixer, function ($rootScope, $Mixer) { // 1674 + var Scope = $rootScope.constructor; // 1675 + var $new = $rootScope.$new; // 1676 + // 1677 + // Apply extensions whether a mixin in defined. // 1678 + // Note that this way mixins which are initialized later // 1679 + // can be applied on rootScope. // 1680 + $Mixer._autoExtend.push(Scope.prototype); // 1681 + $Mixer._autoConstruct.push($rootScope); // 1682 + // 1683 + Scope.prototype.$new = function () { // 1684 + var scope = $new.apply(this, arguments); // 1685 + // Apply constructors to newly created scopes // 1686 + return $Mixer._construct(scope); // 1687 + }; // 1688 + }]); // 1689 + // 1690 +/***/ }, // 1691 +/* 17 */ // 1692 +/***/ function(module, exports, __webpack_require__) { // 1693 + // 1694 + 'use strict'; // 1695 + // 1696 + Object.defineProperty(exports, "__esModule", { // 1697 + value: true // 1698 + }); // 1699 + exports.Core = exports.name = undefined; // 1700 + // 1701 + var _utils = __webpack_require__(14); // 1702 + // 1703 + var _mixer = __webpack_require__(15); // 1704 + // 1705 + function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + // 1707 + var name = exports.name = 'angular-meteor.core'; // 1708 + var Core = exports.Core = '$$Core'; // 1709 + // 1710 + angular.module(name, [_utils.name, _mixer.name]) // 1711 + // 1712 + /* // 1713 + A mixin which provides us with core Meteor functions. // 1714 + */ // 1715 + .factory(Core, ['$q', _utils.utils, function ($q, $$utils) { // 1716 + function $$Core() {} // 1717 + // 1718 + // Calls Meteor.autorun() which will be digested after each run and automatically destroyed // 1719 + $$Core.autorun = function (fn) { // 1720 + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; // 1721 + // 1722 + fn = this.$bindToContext(fn); // 1723 + // 1724 + if (!_.isFunction(fn)) { // 1725 + throw Error('argument 1 must be a function'); // 1726 + } // 1727 + if (!_.isObject(options)) { // 1728 + throw Error('argument 2 must be an object'); // 1729 + } // 1730 + // 1731 + var computation = Tracker.autorun(fn, options); // 1732 + this.$$autoStop(computation); // 1733 + return computation; // 1734 + }; // 1735 + // 1736 + // Calls Meteor.subscribe() which will be digested after each invokation // 1737 + // and automatically destroyed // 1738 + $$Core.subscribe = function (subName, fn, cb) { // 1739 + fn = this.$bindToContext(fn || angular.noop); // 1740 + cb = cb ? this.$bindToContext(cb) : angular.noop; // 1741 + // 1742 + if (!_.isString(subName)) { // 1743 + throw Error('argument 1 must be a string'); // 1744 + } // 1745 + if (!_.isFunction(fn)) { // 1746 + throw Error('argument 2 must be a function'); // 1747 + } // 1748 + if (!_.isFunction(cb) && !_.isObject(cb)) { // 1749 + throw Error('argument 3 must be a function or an object'); // 1750 + } // 1751 + // 1752 + var result = {}; // 1753 + // 1754 + var computation = this.autorun(function () { // 1755 + var _Meteor; // 1756 + // 1757 + var args = fn(); // 1758 + if (angular.isUndefined(args)) args = []; // 1759 + // 1760 + if (!_.isArray(args)) { // 1761 + throw Error('reactive function\'s return value must be an array'); // 1762 + } // 1763 + // 1764 + var subscription = (_Meteor = Meteor).subscribe.apply(_Meteor, [subName].concat(_toConsumableArray(args), [cb])); + result.ready = subscription.ready.bind(subscription); // 1766 + result.subscriptionId = subscription.subscriptionId; // 1767 + }); // 1768 + // 1769 + // Once the computation has been stopped, // 1770 + // any subscriptions made inside will be stopped as well // 1771 + result.stop = computation.stop.bind(computation); // 1772 + return result; // 1773 + }; // 1774 + // 1775 + // Calls Meteor.call() wrapped by a digestion cycle // 1776 + $$Core.callMethod = function () { // 1777 + var _Meteor2; // 1778 + // 1779 + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { // 1780 + args[_key] = arguments[_key]; // 1781 + } // 1782 + // 1783 + var fn = args.pop(); // 1784 + if (_.isFunction(fn)) fn = this.$bindToContext(fn); // 1785 + return (_Meteor2 = Meteor).call.apply(_Meteor2, args.concat([fn])); // 1786 + }; // 1787 + // 1788 + // Calls Meteor.apply() wrapped by a digestion cycle // 1789 + $$Core.applyMethod = function () { // 1790 + var _Meteor3; // 1791 + // 1792 + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { // 1793 + args[_key2] = arguments[_key2]; // 1794 + } // 1795 + // 1796 + var fn = args.pop(); // 1797 + if (_.isFunction(fn)) fn = this.$bindToContext(fn); // 1798 + return (_Meteor3 = Meteor).apply.apply(_Meteor3, args.concat([fn])); // 1799 + }; // 1800 + // 1801 + $$Core.$$autoStop = function (stoppable) { // 1802 + this.$on('$destroy', stoppable.stop.bind(stoppable)); // 1803 + }; // 1804 + // 1805 + // Digests scope only if there is no phase at the moment // 1806 + $$Core.$$throttledDigest = function () { // 1807 + var isDigestable = !this.$$destroyed && !this.$$phase && !this.$root.$$phase; // 1808 + // 1809 + if (isDigestable) this.$digest(); // 1810 + }; // 1811 + // 1812 + // Creates a promise only that the digestion cycle will be called at its fulfillment // 1813 + $$Core.$$defer = function () { // 1814 + var deferred = $q.defer(); // 1815 + // Once promise has been fulfilled, digest // 1816 + deferred.promise = deferred.promise.finally(this.$$throttledDigest.bind(this)); // 1817 + return deferred; // 1818 + }; // 1819 + // 1820 + // Binds an object or a function to the scope to the view model and digest it once it is invoked // 1821 + $$Core.$bindToContext = function (fn) { // 1822 + return $$utils.bind(fn, this, this.$$throttledDigest.bind(this)); // 1823 + }; // 1824 + // 1825 + return $$Core; // 1826 + }]); // 1827 + // 1828 +/***/ }, // 1829 +/* 18 */ // 1830 +/***/ function(module, exports, __webpack_require__) { // 1831 + // 1832 + 'use strict'; // 1833 + // 1834 + Object.defineProperty(exports, "__esModule", { // 1835 + value: true // 1836 + }); // 1837 + exports.reactive = exports.ViewModel = exports.name = undefined; // 1838 + // 1839 + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + // 1841 + var _utils = __webpack_require__(14); // 1842 + // 1843 + var _mixer = __webpack_require__(15); // 1844 + // 1845 + var _core = __webpack_require__(17); // 1846 + // 1847 + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + // 1849 + var name = exports.name = 'angular-meteor.view-model'; // 1850 + var ViewModel = exports.ViewModel = '$$ViewModel'; // 1851 + var reactive = exports.reactive = '$reactive'; // 1852 + // 1853 + angular.module(name, [_utils.name, _mixer.name, _core.name]) // 1854 + // 1855 + /* // 1856 + A mixin which lets us bind a view model into a scope. // 1857 + Note that only a single view model can be bound, // 1858 + otherwise the scope might behave unexpectedly. // 1859 + Mainly used to define the controller as the view model, // 1860 + and very useful when wanting to use Angular's `controllerAs` syntax. // 1861 + */ // 1862 + .factory(ViewModel, [_utils.utils, _mixer.Mixer, function ($$utils, $Mixer) { // 1863 + function $$ViewModel() { // 1864 + var vm = arguments.length <= 0 || arguments[0] === undefined ? this : arguments[0]; // 1865 + // 1866 + // Defines the view model on the scope. // 1867 + this.$$vm = vm; // 1868 + } // 1869 + // 1870 + // Gets an object, wraps it with scope functions and returns it // 1871 + $$ViewModel.viewModel = function (vm) { // 1872 + var _this = this; // 1873 + // 1874 + if (!_.isObject(vm)) { // 1875 + throw Error('argument 1 must be an object'); // 1876 + } // 1877 + // 1878 + // Apply mixin functions // 1879 + $Mixer._mixins.forEach(function (mixin) { // 1880 + // Reject methods which starts with double $ // 1881 + var keys = _.keys(mixin).filter(function (k) { // 1882 + return k.match(/^(?!\$\$).*$/); // 1883 + }); // 1884 + var proto = _.pick(mixin, keys); // 1885 + // Bind all the methods to the prototype // 1886 + var boundProto = $$utils.bind(proto, _this); // 1887 + // Add the methods to the view model // 1888 + _.extend(vm, boundProto); // 1889 + }); // 1890 + // 1891 + // Apply mixin constructors on the view model // 1892 + $Mixer._construct(this, vm); // 1893 + return vm; // 1894 + }; // 1895 + // 1896 + // Override $$Core.$bindToContext to be bound to view model instead of scope // 1897 + $$ViewModel.$bindToContext = function (fn) { // 1898 + return $$utils.bind(fn, this.$$vm, this.$$throttledDigest.bind(this)); // 1899 + }; // 1900 + // 1901 + return $$ViewModel; // 1902 + }]) // 1903 + // 1904 + /* // 1905 + Illustrates the old API where a view model is created using $reactive service // 1906 + */ // 1907 + .service(reactive, [_utils.utils, function ($$utils) { // 1908 + var Reactive = function () { // 1909 + function Reactive(vm) { // 1910 + var _this2 = this; // 1911 + // 1912 + _classCallCheck(this, Reactive); // 1913 + // 1914 + if (!_.isObject(vm)) { // 1915 + throw Error('argument 1 must be an object'); // 1916 + } // 1917 + // 1918 + _.defer(function () { // 1919 + if (!_this2._attached) { // 1920 + console.warn('view model was not attached to any scope'); // 1921 + } // 1922 + }); // 1923 + // 1924 + this._vm = vm; // 1925 + } // 1926 + // 1927 + _createClass(Reactive, [{ // 1928 + key: 'attach', // 1929 + value: function attach(scope) { // 1930 + this._attached = true; // 1931 + // 1932 + if (!$$utils.isScope(scope)) { // 1933 + throw Error('argument 1 must be a scope'); // 1934 + } // 1935 + // 1936 + var viewModel = scope.viewModel(this._vm); // 1937 + // 1938 + // Similar to the old/Meteor API // 1939 + viewModel.call = viewModel.callMethod; // 1940 + viewModel.apply = viewModel.applyMethod; // 1941 + // 1942 + return viewModel; // 1943 + } // 1944 + }]); // 1945 + // 1946 + return Reactive; // 1947 + }(); // 1948 + // 1949 + return function (vm) { // 1950 + return new Reactive(vm); // 1951 + }; // 1952 + }]); // 1953 + // 1954 +/***/ }, // 1955 +/* 19 */ // 1956 +/***/ function(module, exports, __webpack_require__) { // 1957 + // 1958 + 'use strict'; // 1959 + // 1960 + Object.defineProperty(exports, "__esModule", { // 1961 + value: true // 1962 + }); // 1963 + exports.Reactive = exports.name = undefined; // 1964 + // 1965 + var _utils = __webpack_require__(14); // 1966 + // 1967 + var _mixer = __webpack_require__(15); // 1968 + // 1969 + var _core = __webpack_require__(17); // 1970 + // 1971 + var _viewModel = __webpack_require__(18); // 1972 + // 1973 + var name = exports.name = 'angular-meteor.reactive'; // 1974 + var Reactive = exports.Reactive = '$$Reactive'; // 1975 + // 1976 + angular.module(name, [_utils.name, _mixer.name, _core.name, _viewModel.name]) // 1977 + // 1978 + /* // 1979 + A mixin which enhance our reactive abilities by providing methods // 1980 + that are capable of updating our scope reactively. // 1981 + */ // 1982 + .factory(Reactive, ['$parse', _utils.utils, function ($parse, $$utils) { // 1983 + function $$Reactive() { // 1984 + var vm = arguments.length <= 0 || arguments[0] === undefined ? this : arguments[0]; // 1985 + // 1986 + // Helps us track changes made in the view model // 1987 + vm.$$dependencies = {}; // 1988 + } // 1989 + // 1990 + // Gets an object containing functions and define their results as reactive properties. // 1991 + // Once a return value has been changed the property will be reset. // 1992 + $$Reactive.helpers = function () { // 1993 + var _this = this; // 1994 + // 1995 + var props = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; // 1996 + // 1997 + if (!_.isObject(props)) { // 1998 + throw Error('argument 1 must be an object'); // 1999 + } // 2000 + // 2001 + _.each(props, function (v, k, i) { // 2002 + if (!_.isFunction(v)) { // 2003 + throw Error('helper ' + (i + 1) + ' must be a function'); // 2004 + } // 2005 + // 2006 + if (!_this.$$vm.$$dependencies[k]) { // 2007 + // Registers a new dependency to the specified helper // 2008 + _this.$$vm.$$dependencies[k] = new Tracker.Dependency(); // 2009 + } // 2010 + // 2011 + _this.$$setFnHelper(k, v); // 2012 + }); // 2013 + }; // 2014 + // 2015 + // Gets a model reactively // 2016 + $$Reactive.getReactively = function (k) { // 2017 + var isDeep = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1]; // 2018 + // 2019 + if (!_.isBoolean(isDeep)) { // 2020 + throw Error('argument 2 must be a boolean'); // 2021 + } // 2022 + // 2023 + return this.$$reactivateEntity(k, this.$watch, isDeep); // 2024 + }; // 2025 + // 2026 + // Gets a collection reactively // 2027 + $$Reactive.getCollectionReactively = function (k) { // 2028 + return this.$$reactivateEntity(k, this.$watchCollection); // 2029 + }; // 2030 + // 2031 + // Gets an entity reactively, and once it has been changed the computation will be recomputed // 2032 + $$Reactive.$$reactivateEntity = function (k, watcher) { // 2033 + if (!_.isString(k)) { // 2034 + throw Error('argument 1 must be a string'); // 2035 + } // 2036 + // 2037 + if (!this.$$vm.$$dependencies[k]) { // 2038 + this.$$vm.$$dependencies[k] = new Tracker.Dependency(); // 2039 + // 2040 + for (var _len = arguments.length, watcherArgs = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + watcherArgs[_key - 2] = arguments[_key]; // 2042 + } // 2043 + // 2044 + this.$$watchEntity.apply(this, [k, watcher].concat(watcherArgs)); // 2045 + } // 2046 + // 2047 + this.$$vm.$$dependencies[k].depend(); // 2048 + return $parse(k)(this.$$vm); // 2049 + }; // 2050 + // 2051 + // Watches for changes in the view model, and if so will notify a change // 2052 + $$Reactive.$$watchEntity = function (k, watcher) { // 2053 + var _this2 = this; // 2054 + // 2055 + // Gets a deep property from the view model // 2056 + var getVal = _.partial($parse(k), this.$$vm); // 2057 + var initialVal = getVal(); // 2058 + // 2059 + // Watches for changes in the view model // 2060 + // 2061 + for (var _len2 = arguments.length, watcherArgs = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + watcherArgs[_key2 - 2] = arguments[_key2]; // 2063 + } // 2064 + // 2065 + watcher.call.apply(watcher, [this, getVal, function (val, oldVal) { // 2066 + var hasChanged = val !== initialVal || val !== oldVal; // 2067 + // 2068 + // Notify if a change has been detected // 2069 + if (hasChanged) _this2.$$changed(k); // 2070 + }].concat(watcherArgs)); // 2071 + }; // 2072 + // 2073 + // Invokes a function and sets the return value as a property // 2074 + $$Reactive.$$setFnHelper = function (k, fn) { // 2075 + var _this3 = this; // 2076 + // 2077 + this.autorun(function (computation) { // 2078 + // Invokes the reactive functon // 2079 + var model = fn.apply(_this3.$$vm); // 2080 + // 2081 + // Ignore notifications made by the following handler // 2082 + Tracker.nonreactive(function () { // 2083 + // If a cursor, observe its changes and update acoordingly // 2084 + if ($$utils.isCursor(model)) { // 2085 + (function () { // 2086 + var observation = _this3.$$handleCursor(k, model); // 2087 + // 2088 + computation.onInvalidate(function () { // 2089 + observation.stop(); // 2090 + _this3.$$vm[k].splice(0); // 2091 + }); // 2092 + })(); // 2093 + } else { // 2094 + _this3.$$handleNonCursor(k, model); // 2095 + } // 2096 + // 2097 + // Notify change and update the view model // 2098 + _this3.$$changed(k); // 2099 + }); // 2100 + }); // 2101 + }; // 2102 + // 2103 + // Sets a value helper as a setter and a getter which will notify computations once used // 2104 + $$Reactive.$$setValHelper = function (k, v) { // 2105 + var _this4 = this; // 2106 + // 2107 + var watch = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2]; // 2108 + // 2109 + // If set, reactives property // 2110 + if (watch) { // 2111 + var isDeep = _.isObject(v); // 2112 + this.getReactively(k, isDeep); // 2113 + } // 2114 + // 2115 + Object.defineProperty(this.$$vm, k, { // 2116 + configurable: true, // 2117 + enumerable: true, // 2118 + // 2119 + get: function get() { // 2120 + return v; // 2121 + }, // 2122 + set: function set(newVal) { // 2123 + v = newVal; // 2124 + _this4.$$changed(k); // 2125 + } // 2126 + }); // 2127 + }; // 2128 + // 2129 + // Fetching a cursor and updates properties once the result set has been changed // 2130 + $$Reactive.$$handleCursor = function (k, cursor) { // 2131 + var _this5 = this; // 2132 + // 2133 + // If not defined set it // 2134 + if (angular.isUndefined(this.$$vm[k])) { // 2135 + this.$$setValHelper(k, cursor.fetch(), false); // 2136 + } // 2137 + // If defined update it // 2138 + else { // 2139 + var diff = jsondiffpatch.diff(this.$$vm[k], cursor.fetch()); // 2140 + jsondiffpatch.patch(this.$$vm[k], diff); // 2141 + } // 2142 + // 2143 + // Observe changes made in the result set // 2144 + var observation = cursor.observe({ // 2145 + addedAt: function addedAt(doc, atIndex) { // 2146 + if (!observation) return; // 2147 + _this5.$$vm[k].splice(atIndex, 0, doc); // 2148 + _this5.$$changed(k); // 2149 + }, // 2150 + changedAt: function changedAt(doc, oldDoc, atIndex) { // 2151 + var diff = jsondiffpatch.diff(_this5.$$vm[k][atIndex], doc); // 2152 + jsondiffpatch.patch(_this5.$$vm[k][atIndex], diff); // 2153 + _this5.$$changed(k); // 2154 + }, // 2155 + movedTo: function movedTo(doc, fromIndex, toIndex) { // 2156 + _this5.$$vm[k].splice(fromIndex, 1); // 2157 + _this5.$$vm[k].splice(toIndex, 0, doc); // 2158 + _this5.$$changed(k); // 2159 + }, // 2160 + removedAt: function removedAt(oldDoc, atIndex) { // 2161 + _this5.$$vm[k].splice(atIndex, 1); // 2162 + _this5.$$changed(k); // 2163 + } // 2164 + }); // 2165 + // 2166 + return observation; // 2167 + }; // 2168 + // 2169 + $$Reactive.$$handleNonCursor = function (k, data) { // 2170 + var v = this.$$vm[k]; // 2171 + // 2172 + if (angular.isDefined(v)) { // 2173 + delete this.$$vm[k]; // 2174 + v = null; // 2175 + } // 2176 + // 2177 + if (angular.isUndefined(v)) { // 2178 + this.$$setValHelper(k, data); // 2179 + } // 2180 + // Update property if the new value is from the same type // 2181 + else if ($$utils.areSiblings(v, data)) { // 2182 + var diff = jsondiffpatch.diff(v, data); // 2183 + jsondiffpatch.patch(v, diff); // 2184 + this.$$changed(k); // 2185 + } else { // 2186 + this.$$vm[k] = data; // 2187 + } // 2188 + }; // 2189 + // 2190 + // Notifies dependency in view model // 2191 + $$Reactive.$$depend = function (k) { // 2192 + this.$$vm.$$dependencies[k].depend(); // 2193 + }; // 2194 + // 2195 + // Notifies change in view model // 2196 + $$Reactive.$$changed = function (k) { // 2197 + this.$$throttledDigest(); // 2198 + this.$$vm.$$dependencies[k].changed(); // 2199 + }; // 2200 + // 2201 + return $$Reactive; // 2202 + }]); // 2203 + // 2204 +/***/ }, // 2205 +/* 20 */ // 2206 +/***/ function(module, exports) { // 2207 + // 2208 + 'use strict'; // 2209 + // 2210 + Object.defineProperty(exports, "__esModule", { // 2211 + value: true // 2212 + }); // 2213 + var name = exports.name = 'angular-templates'; // 2214 + // 2215 + try { // 2216 + angular.module(name); // 2217 + } catch (e) { // 2218 + angular.module(name, []); // 2219 + } // 2220 + // 2221 +/***/ } // 2222 +/******/ ]); // 2223 +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// }).call(this); diff --git a/dist/angular-meteor.bundle.min.js b/dist/angular-meteor.bundle.min.js index d4dafba75..c89fcf8e0 100644 --- a/dist/angular-meteor.bundle.min.js +++ b/dist/angular-meteor.bundle.min.js @@ -2,6 +2,6 @@ module.exports=function(exec){try{return!!exec()}catch(e){return true}}},function(module,exports,__webpack_require__){var global=__webpack_require__(4),core=__webpack_require__(9),hide=__webpack_require__(10),$redef=__webpack_require__(12),PROTOTYPE="prototype";var ctx=function(fn,that){return function(){return fn.apply(that,arguments)}};var $def=function(type,name,source){var key,own,out,exp,isGlobal=type&$def.G,isProto=type&$def.P,target=isGlobal?global:type&$def.S?global[name]||(global[name]={}):(global[name]||{})[PROTOTYPE],exports=isGlobal?core:core[name]||(core[name]={});if(isGlobal)source=name;for(key in source){own=!(type&$def.F)&&target&&key in target;out=(own?target:source)[key];if(type&$def.B&&own)exp=ctx(out,global);else exp=isProto&&typeof out=="function"?ctx(Function.call,out):out;if(target&&!own)$redef(target,key,out);if(exports[key]!=out)hide(exports,key,exp);if(isProto)(exports[PROTOTYPE]||(exports[PROTOTYPE]={}))[key]=out}};global.core=core;$def.F=1;$def.G=2;$def.S=4;$def.P=8;$def.B=16;$def.W=32;module.exports=$def},function(module,exports){var core=module.exports={version:"1.2.1"};if(typeof __e=="number")__e=core},function(module,exports,__webpack_require__){var $=__webpack_require__(3),createDesc=__webpack_require__(11);module.exports=__webpack_require__(6)?function(object,key,value){return $.setDesc(object,key,createDesc(1,value))}:function(object,key,value){object[key]=value;return object}},function(module,exports){module.exports=function(bitmap,value){return{enumerable:!(bitmap&1),configurable:!(bitmap&2),writable:!(bitmap&4),value:value}}},function(module,exports,__webpack_require__){var global=__webpack_require__(4),hide=__webpack_require__(10),SRC=__webpack_require__(13)("src"),TO_STRING="toString",$toString=Function[TO_STRING],TPL=(""+$toString).split(TO_STRING);__webpack_require__(9).inspectSource=function(it){return $toString.call(it)};(module.exports=function(O,key,val,safe){if(typeof val=="function"){hide(val,SRC,O[key]?""+O[key]:TPL.join(String(key)));if(!("name"in val))val.name=key}if(O===global){O[key]=val}else{if(!safe)delete O[key];hide(O,key,val)}})(Function.prototype,TO_STRING,function toString(){return typeof this=="function"&&this[SRC]||$toString.call(this)})},function(module,exports){var id=0,px=Math.random();module.exports=function(key){return"Symbol(".concat(key===undefined?"":key,")_",(++id+px).toString(36))}},function(module,exports,__webpack_require__){var global=__webpack_require__(4),SHARED="__core-js_shared__",store=global[SHARED]||(global[SHARED]={});module.exports=function(key){return store[key]||(store[key]={})}},function(module,exports,__webpack_require__){var has=__webpack_require__(5),hide=__webpack_require__(10),TAG=__webpack_require__(16)("toStringTag");module.exports=function(it,tag,stat){if(it&&!has(it=stat?it:it.prototype,TAG))hide(it,TAG,tag)}},function(module,exports,__webpack_require__){var store=__webpack_require__(14)("wks"),Symbol=__webpack_require__(4).Symbol;module.exports=function(name){return store[name]||(store[name]=Symbol&&Symbol[name]||(Symbol||__webpack_require__(13))("Symbol."+name))}},function(module,exports,__webpack_require__){var $=__webpack_require__(3),toIObject=__webpack_require__(18);module.exports=function(object,el){var O=toIObject(object),keys=$.getKeys(O),length=keys.length,index=0,key;while(length>index)if(O[key=keys[index++]]===el)return key}},function(module,exports,__webpack_require__){var IObject=__webpack_require__(19),defined=__webpack_require__(21);module.exports=function(it){return IObject(defined(it))}},function(module,exports,__webpack_require__){var cof=__webpack_require__(20);module.exports=0 in Object("z")?Object:function(it){return cof(it)=="String"?it.split(""):Object(it)}},function(module,exports){var toString={}.toString;module.exports=function(it){return toString.call(it).slice(8,-1)}},function(module,exports){module.exports=function(it){if(it==undefined)throw TypeError("Can't call method on "+it);return it}},function(module,exports,__webpack_require__){var toString={}.toString,toIObject=__webpack_require__(18),getNames=__webpack_require__(3).getNames;var windowNames=typeof window=="object"&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];var getWindowNames=function(it){try{return getNames(it)}catch(e){return windowNames.slice()}};module.exports.get=function getOwnPropertyNames(it){if(windowNames&&toString.call(it)=="[object Window]")return getWindowNames(it);return getNames(toIObject(it))}},function(module,exports,__webpack_require__){var $=__webpack_require__(3);module.exports=function(it){var keys=$.getKeys(it),getSymbols=$.getSymbols;if(getSymbols){var symbols=getSymbols(it),isEnum=$.isEnum,i=0,key;while(symbols.length>i)if(isEnum.call(it,key=symbols[i++]))keys.push(key)}return keys}},function(module,exports,__webpack_require__){var cof=__webpack_require__(20);module.exports=Array.isArray||function(arg){return cof(arg)=="Array"}},function(module,exports){module.exports=function(it){return typeof it==="object"?it!==null:typeof it==="function"}},function(module,exports,__webpack_require__){var isObject=__webpack_require__(25);module.exports=function(it){if(!isObject(it))throw TypeError(it+" is not an object!");return it}},function(module,exports){module.exports=false},function(module,exports,__webpack_require__){var $def=__webpack_require__(8);$def($def.S+$def.F,"Object",{assign:__webpack_require__(29)})},function(module,exports,__webpack_require__){var toObject=__webpack_require__(30),IObject=__webpack_require__(19),enumKeys=__webpack_require__(23),has=__webpack_require__(5);module.exports=__webpack_require__(7)(function(){var a=Object.assign,A={},B={},S=Symbol(),K="abcdefghijklmnopqrst";A[S]=7;K.split("").forEach(function(k){B[k]=k});return a({},A)[S]!=7||Object.keys(a({},B)).join("")!=K})?function assign(target,source){var T=toObject(target),l=arguments.length,i=1;while(l>i){var S=IObject(arguments[i++]),keys=enumKeys(S),length=keys.length,j=0,key;while(length>j)if(has(S,key=keys[j++]))T[key]=S[key]}return T}:Object.assign},function(module,exports,__webpack_require__){var defined=__webpack_require__(21);module.exports=function(it){return Object(defined(it))}},function(module,exports,__webpack_require__){var $def=__webpack_require__(8);$def($def.S,"Object",{is:__webpack_require__(32)})},function(module,exports){module.exports=Object.is||function is(x,y){return x===y?x!==0||1/x===1/y:x!=x&&y!=y}},function(module,exports,__webpack_require__){var $def=__webpack_require__(8);$def($def.S,"Object",{setPrototypeOf:__webpack_require__(34).set})},function(module,exports,__webpack_require__){var getDesc=__webpack_require__(3).getDesc,isObject=__webpack_require__(25),anObject=__webpack_require__(26);var check=function(O,proto){anObject(O);if(!isObject(proto)&&proto!==null)throw TypeError(proto+": can't set as prototype!")};module.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(test,buggy,set){try{set=__webpack_require__(35)(Function.call,getDesc(Object.prototype,"__proto__").set,2);set(test,[]);buggy=!(test instanceof Array)}catch(e){buggy=true}return function setPrototypeOf(O,proto){check(O,proto);if(buggy)O.__proto__=proto;else set(O,proto);return O}}({},false):undefined),check:check}},function(module,exports,__webpack_require__){var aFunction=__webpack_require__(36);module.exports=function(fn,that,length){aFunction(fn);if(that===undefined)return fn;switch(length){case 1:return function(a){return fn.call(that,a)};case 2:return function(a,b){return fn.call(that,a,b)};case 3:return function(a,b,c){return fn.call(that,a,b,c)}}return function(){return fn.apply(that,arguments)}}},function(module,exports){module.exports=function(it){if(typeof it!="function")throw TypeError(it+" is not a function!");return it}},function(module,exports,__webpack_require__){"use strict";var classof=__webpack_require__(38),test={};test[__webpack_require__(16)("toStringTag")]="z";if(test+""!="[object z]"){__webpack_require__(12)(Object.prototype,"toString",function toString(){return"[object "+classof(this)+"]"},true)}},function(module,exports,__webpack_require__){var cof=__webpack_require__(20),TAG=__webpack_require__(16)("toStringTag"),ARG=cof(function(){return arguments}())=="Arguments";module.exports=function(it){var O,T,B;return it===undefined?"Undefined":it===null?"Null":typeof(T=(O=Object(it))[TAG])=="string"?T:ARG?cof(O):(B=cof(O))=="Object"&&typeof O.callee=="function"?"Arguments":B}},function(module,exports,__webpack_require__){var isObject=__webpack_require__(25);__webpack_require__(40)("freeze",function($freeze){return function freeze(it){return $freeze&&isObject(it)?$freeze(it):it}})},function(module,exports,__webpack_require__){module.exports=function(KEY,exec){var $def=__webpack_require__(8),fn=(__webpack_require__(9).Object||{})[KEY]||Object[KEY],exp={};exp[KEY]=exec(fn);$def($def.S+$def.F*__webpack_require__(7)(function(){fn(1)}),"Object",exp)}},function(module,exports,__webpack_require__){var isObject=__webpack_require__(25);__webpack_require__(40)("seal",function($seal){return function seal(it){return $seal&&isObject(it)?$seal(it):it}})},function(module,exports,__webpack_require__){var isObject=__webpack_require__(25);__webpack_require__(40)("preventExtensions",function($preventExtensions){return function preventExtensions(it){return $preventExtensions&&isObject(it)?$preventExtensions(it):it}})},function(module,exports,__webpack_require__){var isObject=__webpack_require__(25);__webpack_require__(40)("isFrozen",function($isFrozen){return function isFrozen(it){return isObject(it)?$isFrozen?$isFrozen(it):false:true}})},function(module,exports,__webpack_require__){var isObject=__webpack_require__(25);__webpack_require__(40)("isSealed",function($isSealed){return function isSealed(it){return isObject(it)?$isSealed?$isSealed(it):false:true}})},function(module,exports,__webpack_require__){var isObject=__webpack_require__(25);__webpack_require__(40)("isExtensible",function($isExtensible){return function isExtensible(it){return isObject(it)?$isExtensible?$isExtensible(it):true:false}})},function(module,exports,__webpack_require__){var toIObject=__webpack_require__(18);__webpack_require__(40)("getOwnPropertyDescriptor",function($getOwnPropertyDescriptor){return function getOwnPropertyDescriptor(it,key){return $getOwnPropertyDescriptor(toIObject(it),key)}})},function(module,exports,__webpack_require__){var toObject=__webpack_require__(30);__webpack_require__(40)("getPrototypeOf",function($getPrototypeOf){return function getPrototypeOf(it){return $getPrototypeOf(toObject(it))}})},function(module,exports,__webpack_require__){var toObject=__webpack_require__(30);__webpack_require__(40)("keys",function($keys){return function keys(it){return $keys(toObject(it))}})},function(module,exports,__webpack_require__){__webpack_require__(40)("getOwnPropertyNames",function(){return __webpack_require__(22).get})},function(module,exports,__webpack_require__){__webpack_require__(51);__webpack_require__(57);__webpack_require__(63);__webpack_require__(64);__webpack_require__(66);__webpack_require__(69);__webpack_require__(72);__webpack_require__(74);__webpack_require__(76);module.exports=__webpack_require__(9).Array},function(module,exports,__webpack_require__){"use strict";var $at=__webpack_require__(52)(true);__webpack_require__(54)(String,"String",function(iterated){this._t=String(iterated);this._i=0},function(){var O=this._t,index=this._i,point;if(index>=O.length)return{value:undefined,done:true};point=$at(O,index);this._i+=point.length;return{value:point,done:false}})},function(module,exports,__webpack_require__){var toInteger=__webpack_require__(53),defined=__webpack_require__(21);module.exports=function(TO_STRING){return function(that,pos){var s=String(defined(that)),i=toInteger(pos),l=s.length,a,b;if(i<0||i>=l)return TO_STRING?"":undefined;a=s.charCodeAt(i);return a<55296||a>56319||i+1===l||(b=s.charCodeAt(i+1))<56320||b>57343?TO_STRING?s.charAt(i):a:TO_STRING?s.slice(i,i+2):(a-55296<<10)+(b-56320)+65536}}},function(module,exports){var ceil=Math.ceil,floor=Math.floor;module.exports=function(it){return isNaN(it=+it)?0:(it>0?floor:ceil)(it)}},function(module,exports,__webpack_require__){"use strict";var LIBRARY=__webpack_require__(27),$def=__webpack_require__(8),$redef=__webpack_require__(12),hide=__webpack_require__(10),has=__webpack_require__(5),SYMBOL_ITERATOR=__webpack_require__(16)("iterator"),Iterators=__webpack_require__(55),BUGGY=!([].keys&&"next"in[].keys()),FF_ITERATOR="@@iterator",KEYS="keys",VALUES="values";var returnThis=function(){return this};module.exports=function(Base,NAME,Constructor,next,DEFAULT,IS_SET,FORCE){__webpack_require__(56)(Constructor,NAME,next);var createMethod=function(kind){switch(kind){case KEYS:return function keys(){return new Constructor(this,kind)};case VALUES:return function values(){return new Constructor(this,kind)}}return function entries(){return new Constructor(this,kind)}};var TAG=NAME+" Iterator",proto=Base.prototype,_native=proto[SYMBOL_ITERATOR]||proto[FF_ITERATOR]||DEFAULT&&proto[DEFAULT],_default=_native||createMethod(DEFAULT),methods,key;if(_native){var IteratorPrototype=__webpack_require__(3).getProto(_default.call(new Base));__webpack_require__(15)(IteratorPrototype,TAG,true);if(!LIBRARY&&has(proto,FF_ITERATOR))hide(IteratorPrototype,SYMBOL_ITERATOR,returnThis)}if(!LIBRARY||FORCE)hide(proto,SYMBOL_ITERATOR,_default);Iterators[NAME]=_default;Iterators[TAG]=returnThis;if(DEFAULT){methods={keys:IS_SET?_default:createMethod(KEYS),values:DEFAULT==VALUES?_default:createMethod(VALUES),entries:DEFAULT!=VALUES?_default:createMethod("entries")};if(FORCE)for(key in methods){if(!(key in proto))$redef(proto,key,methods[key])}else $def($def.P+$def.F*BUGGY,NAME,methods)}}},function(module,exports){module.exports={}},function(module,exports,__webpack_require__){"use strict";var $=__webpack_require__(3),IteratorPrototype={};__webpack_require__(10)(IteratorPrototype,__webpack_require__(16)("iterator"),function(){return this});module.exports=function(Constructor,NAME,next){Constructor.prototype=$.create(IteratorPrototype,{next:__webpack_require__(11)(1,next)});__webpack_require__(15)(Constructor,NAME+" Iterator")}},function(module,exports,__webpack_require__){"use strict";var ctx=__webpack_require__(35),$def=__webpack_require__(8),toObject=__webpack_require__(30),call=__webpack_require__(58),isArrayIter=__webpack_require__(59),toLength=__webpack_require__(60),getIterFn=__webpack_require__(61);$def($def.S+$def.F*!__webpack_require__(62)(function(iter){Array.from(iter)}),"Array",{from:function from(arrayLike){var O=toObject(arrayLike),C=typeof this=="function"?this:Array,mapfn=arguments[1],mapping=mapfn!==undefined,index=0,iterFn=getIterFn(O),length,result,step,iterator;if(mapping)mapfn=ctx(mapfn,arguments[2],2);if(iterFn!=undefined&&!(C==Array&&isArrayIter(iterFn))){for(iterator=iterFn.call(O),result=new C;!(step=iterator.next()).done;index++){result[index]=mapping?call(iterator,mapfn,[step.value,index],true):step.value}}else{length=toLength(O.length);for(result=new C(length);length>index;index++){result[index]=mapping?mapfn(O[index],index):O[index]}}result.length=index;return result}})},function(module,exports,__webpack_require__){var anObject=__webpack_require__(26);module.exports=function(iterator,fn,value,entries){try{return entries?fn(anObject(value)[0],value[1]):fn(value)}catch(e){var ret=iterator["return"];if(ret!==undefined)anObject(ret.call(iterator));throw e}}},function(module,exports,__webpack_require__){var Iterators=__webpack_require__(55),ITERATOR=__webpack_require__(16)("iterator");module.exports=function(it){return(Iterators.Array||Array.prototype[ITERATOR])===it}},function(module,exports,__webpack_require__){var toInteger=__webpack_require__(53),min=Math.min;module.exports=function(it){return it>0?min(toInteger(it),9007199254740991):0}},function(module,exports,__webpack_require__){var classof=__webpack_require__(38),ITERATOR=__webpack_require__(16)("iterator"),Iterators=__webpack_require__(55);module.exports=__webpack_require__(9).getIteratorMethod=function(it){if(it!=undefined)return it[ITERATOR]||it["@@iterator"]||Iterators[classof(it)]}},function(module,exports,__webpack_require__){var SYMBOL_ITERATOR=__webpack_require__(16)("iterator"),SAFE_CLOSING=false;try{var riter=[7][SYMBOL_ITERATOR]();riter["return"]=function(){SAFE_CLOSING=true};Array.from(riter,function(){throw 2})}catch(e){}module.exports=function(exec){if(!SAFE_CLOSING)return false;var safe=false;try{var arr=[7],iter=arr[SYMBOL_ITERATOR]();iter.next=function(){safe=true};arr[SYMBOL_ITERATOR]=function(){return iter};exec(arr)}catch(e){}return safe}},function(module,exports,__webpack_require__){"use strict";var $def=__webpack_require__(8);$def($def.S+$def.F*__webpack_require__(7)(function(){function F(){}return!(Array.of.call(F)instanceof F)}),"Array",{of:function of(){var index=0,length=arguments.length,result=new(typeof this=="function"?this:Array)(length);while(length>index)result[index]=arguments[index++];result.length=length;return result}})},function(module,exports,__webpack_require__){__webpack_require__(65)(Array)},function(module,exports,__webpack_require__){"use strict";var $=__webpack_require__(3),SPECIES=__webpack_require__(16)("species");module.exports=function(C){if(__webpack_require__(6)&&!(SPECIES in C))$.setDesc(C,SPECIES,{configurable:true,get:function(){return this}})}},function(module,exports,__webpack_require__){"use strict";var setUnscope=__webpack_require__(67),step=__webpack_require__(68),Iterators=__webpack_require__(55),toIObject=__webpack_require__(18);__webpack_require__(54)(Array,"Array",function(iterated,kind){this._t=toIObject(iterated);this._i=0;this._k=kind},function(){var O=this._t,kind=this._k,index=this._i++;if(!O||index>=O.length){this._t=undefined;return step(1)}if(kind=="keys")return step(0,index);if(kind=="values")return step(0,O[index]);return step(0,[index,O[index]])},"values");Iterators.Arguments=Iterators.Array;setUnscope("keys");setUnscope("values");setUnscope("entries")},function(module,exports,__webpack_require__){var UNSCOPABLES=__webpack_require__(16)("unscopables");if([][UNSCOPABLES]==undefined)__webpack_require__(10)(Array.prototype,UNSCOPABLES,{});module.exports=function(key){[][UNSCOPABLES][key]=true}},function(module,exports){module.exports=function(done,value){return{value:value,done:!!done}}},function(module,exports,__webpack_require__){"use strict";var $def=__webpack_require__(8);$def($def.P,"Array",{copyWithin:__webpack_require__(70)});__webpack_require__(67)("copyWithin")},function(module,exports,__webpack_require__){"use strict";var toObject=__webpack_require__(30),toIndex=__webpack_require__(71),toLength=__webpack_require__(60);module.exports=[].copyWithin||function copyWithin(target,start){var O=toObject(this),len=toLength(O.length),to=toIndex(target,len),from=toIndex(start,len),end=arguments[2],count=Math.min((end===undefined?len:toIndex(end,len))-from,len-to),inc=1;if(from0){if(from in O)O[to]=O[from];else delete O[to];to+=inc;from+=inc}return O}},function(module,exports,__webpack_require__){var toInteger=__webpack_require__(53),max=Math.max,min=Math.min;module.exports=function(index,length){index=toInteger(index);return index<0?max(index+length,0):min(index,length)}},function(module,exports,__webpack_require__){var $def=__webpack_require__(8);$def($def.P,"Array",{fill:__webpack_require__(73)});__webpack_require__(67)("fill")},function(module,exports,__webpack_require__){"use strict";var toObject=__webpack_require__(30),toIndex=__webpack_require__(71),toLength=__webpack_require__(60);module.exports=[].fill||function fill(value){var O=toObject(this,true),length=toLength(O.length),index=toIndex(arguments[1],length),end=arguments[2],endPos=end===undefined?length:toIndex(end,length);while(endPos>index)O[index++]=value;return O}},function(module,exports,__webpack_require__){"use strict";var KEY="find",$def=__webpack_require__(8),forced=true,$find=__webpack_require__(75)(5);if(KEY in[])Array(1)[KEY](function(){forced=false});$def($def.P+$def.F*forced,"Array",{find:function find(callbackfn){return $find(this,callbackfn,arguments[1])}});__webpack_require__(67)(KEY)},function(module,exports,__webpack_require__){var ctx=__webpack_require__(35),isObject=__webpack_require__(25),IObject=__webpack_require__(19),toObject=__webpack_require__(30),toLength=__webpack_require__(60),isArray=__webpack_require__(24),SPECIES=__webpack_require__(16)("species");var ASC=function(original,length){var C;if(isArray(original)&&isObject(C=original.constructor)){C=C[SPECIES];if(C===null)C=undefined}return new(C===undefined?Array:C)(length)};module.exports=function(TYPE){var IS_MAP=TYPE==1,IS_FILTER=TYPE==2,IS_SOME=TYPE==3,IS_EVERY=TYPE==4,IS_FIND_INDEX=TYPE==6,NO_HOLES=TYPE==5||IS_FIND_INDEX;return function($this,callbackfn,that){var O=toObject($this),self=IObject(O),f=ctx(callbackfn,that,3),length=toLength(self.length),index=0,result=IS_MAP?ASC($this,length):IS_FILTER?ASC($this,0):undefined,val,res;for(;length>index;index++)if(NO_HOLES||index in self){val=self[index];res=f(val,index,O);if(TYPE){if(IS_MAP)result[index]=res;else if(res)switch(TYPE){case 3:return true;case 5:return val;case 6:return index;case 2:result.push(val)}else if(IS_EVERY)return false}}return IS_FIND_INDEX?-1:IS_SOME||IS_EVERY?IS_EVERY:result}}},function(module,exports,__webpack_require__){"use strict";var KEY="findIndex",$def=__webpack_require__(8),forced=true,$find=__webpack_require__(75)(6);if(KEY in[])Array(1)[KEY](function(){forced=false});$def($def.P+$def.F*forced,"Array",{findIndex:function findIndex(callbackfn){return $find(this,callbackfn,arguments[1])}});__webpack_require__(67)(KEY)},function(module,exports,__webpack_require__){__webpack_require__(78);__webpack_require__(79);__webpack_require__(80);__webpack_require__(51);__webpack_require__(82);__webpack_require__(83);__webpack_require__(87);__webpack_require__(88);__webpack_require__(90);__webpack_require__(91);__webpack_require__(93);__webpack_require__(94);__webpack_require__(95);module.exports=__webpack_require__(9).String},function(module,exports,__webpack_require__){var $def=__webpack_require__(8),toIndex=__webpack_require__(71),fromCharCode=String.fromCharCode,$fromCodePoint=String.fromCodePoint;$def($def.S+$def.F*(!!$fromCodePoint&&$fromCodePoint.length!=1),"String",{fromCodePoint:function fromCodePoint(x){var res=[],len=arguments.length,i=0,code;while(len>i){code=+arguments[i++];if(toIndex(code,1114111)!==code)throw RangeError(code+" is not a valid code point");res.push(code<65536?fromCharCode(code):fromCharCode(((code-=65536)>>10)+55296,code%1024+56320))}return res.join("")}})},function(module,exports,__webpack_require__){var $def=__webpack_require__(8),toIObject=__webpack_require__(18),toLength=__webpack_require__(60);$def($def.S,"String",{raw:function raw(callSite){var tpl=toIObject(callSite.raw),len=toLength(tpl.length),sln=arguments.length,res=[],i=0;while(len>i){res.push(String(tpl[i++]));if(i0;(n>>>=1)&&(str+=str))if(n&1)res+=str;return res}},function(module,exports,__webpack_require__){"use strict";var $def=__webpack_require__(8),toLength=__webpack_require__(60),context=__webpack_require__(84),STARTS_WITH="startsWith",$startsWith=""[STARTS_WITH];$def($def.P+$def.F*__webpack_require__(86)(STARTS_WITH),"String",{startsWith:function startsWith(searchString){var that=context(this,searchString,STARTS_WITH),index=toLength(Math.min(arguments[1],that.length)),search=String(searchString);return $startsWith?$startsWith.call(that,search,index):that.slice(index,index+search.length)===search}})},function(module,exports,__webpack_require__){__webpack_require__(92)("match",1,function(defined,MATCH){return function match(regexp){"use strict";var O=defined(this),fn=regexp==undefined?undefined:regexp[MATCH];return fn!==undefined?fn.call(regexp,O):new RegExp(regexp)[MATCH](String(O))}})},function(module,exports,__webpack_require__){"use strict";module.exports=function(KEY,length,exec){var defined=__webpack_require__(21),SYMBOL=__webpack_require__(16)(KEY),original=""[KEY];if(__webpack_require__(7)(function(){var O={};O[SYMBOL]=function(){return 7};return""[KEY](O)!=7})){__webpack_require__(12)(String.prototype,KEY,exec(defined,SYMBOL,original));__webpack_require__(10)(RegExp.prototype,SYMBOL,length==2?function(string,arg){return original.call(string,this,arg)}:function(string){return original.call(string,this)})}}},function(module,exports,__webpack_require__){__webpack_require__(92)("replace",2,function(defined,REPLACE,$replace){return function replace(searchValue,replaceValue){"use strict";var O=defined(this),fn=searchValue==undefined?undefined:searchValue[REPLACE];return fn!==undefined?fn.call(searchValue,O,replaceValue):$replace.call(String(O),searchValue,replaceValue)}})},function(module,exports,__webpack_require__){__webpack_require__(92)("search",1,function(defined,SEARCH){return function search(regexp){"use strict";var O=defined(this),fn=regexp==undefined?undefined:regexp[SEARCH];return fn!==undefined?fn.call(regexp,O):new RegExp(regexp)[SEARCH](String(O))}})},function(module,exports,__webpack_require__){__webpack_require__(92)("split",2,function(defined,SPLIT,$split){return function split(separator,limit){"use strict";var O=defined(this),fn=separator==undefined?undefined:separator[SPLIT];return fn!==undefined?fn.call(separator,O,limit):$split.call(String(O),separator,limit)}})},function(module,exports,__webpack_require__){__webpack_require__(97);__webpack_require__(98);module.exports=__webpack_require__(9).Function},function(module,exports,__webpack_require__){var setDesc=__webpack_require__(3).setDesc,createDesc=__webpack_require__(11),has=__webpack_require__(5),FProto=Function.prototype,nameRE=/^\s*function ([^ (]*)/,NAME="name";NAME in FProto||__webpack_require__(6)&&setDesc(FProto,NAME,{configurable:true,get:function(){var match=(""+this).match(nameRE),name=match?match[1]:"";has(this,NAME)||setDesc(this,NAME,createDesc(5,name));return name}})},function(module,exports,__webpack_require__){"use strict";var $=__webpack_require__(3),isObject=__webpack_require__(25),HAS_INSTANCE=__webpack_require__(16)("hasInstance"),FunctionProto=Function.prototype;if(!(HAS_INSTANCE in FunctionProto))$.setDesc(FunctionProto,HAS_INSTANCE,{value:function(O){if(typeof this!="function"||!isObject(O))return false;if(!isObject(this.prototype))return O instanceof this;while(O=$.getProto(O))if(this.prototype===O)return true;return false}})},function(module,exports,__webpack_require__){__webpack_require__(2);module.exports=__webpack_require__(9).Symbol},function(module,exports,__webpack_require__){__webpack_require__(37);__webpack_require__(51);__webpack_require__(101);__webpack_require__(102);module.exports=__webpack_require__(9).Map},function(module,exports,__webpack_require__){__webpack_require__(66);var global=__webpack_require__(4),hide=__webpack_require__(10),Iterators=__webpack_require__(55),ITERATOR=__webpack_require__(16)("iterator"),NL=global.NodeList,HTC=global.HTMLCollection,NLProto=NL&&NL.prototype,HTCProto=HTC&&HTC.prototype,ArrayValues=Iterators.NodeList=Iterators.HTMLCollection=Iterators.Array;if(NL&&!(ITERATOR in NLProto))hide(NLProto,ITERATOR,ArrayValues);if(HTC&&!(ITERATOR in HTCProto))hide(HTCProto,ITERATOR,ArrayValues)},function(module,exports,__webpack_require__){"use strict";var strong=__webpack_require__(103);__webpack_require__(107)("Map",function(get){return function Map(){return get(this,arguments[0])}},{get:function get(key){var entry=strong.getEntry(this,key);return entry&&entry.v},set:function set(key,value){return strong.def(this,key===0?0:key,value)}},strong,true)},function(module,exports,__webpack_require__){"use strict";var $=__webpack_require__(3),hide=__webpack_require__(10),ctx=__webpack_require__(35),species=__webpack_require__(65),strictNew=__webpack_require__(104),defined=__webpack_require__(21),forOf=__webpack_require__(105),step=__webpack_require__(68),ID=__webpack_require__(13)("id"),$has=__webpack_require__(5),isObject=__webpack_require__(25),isExtensible=Object.isExtensible||isObject,SUPPORT_DESC=__webpack_require__(6),SIZE=SUPPORT_DESC?"_s":"size",id=0;var fastKey=function(it,create){if(!isObject(it))return typeof it=="symbol"?it:(typeof it=="string"?"S":"P")+it;if(!$has(it,ID)){if(!isExtensible(it))return"F";if(!create)return"E";hide(it,ID,++id)}return"O"+it[ID]};var getEntry=function(that,key){var index=fastKey(key),entry;if(index!=="F")return that._i[index];for(entry=that._f;entry;entry=entry.n){if(entry.k==key)return entry}};module.exports={getConstructor:function(wrapper,NAME,IS_MAP,ADDER){var C=wrapper(function(that,iterable){strictNew(that,C,NAME);that._i=$.create(null);that._f=undefined;that._l=undefined;that[SIZE]=0;if(iterable!=undefined)forOf(iterable,IS_MAP,that[ADDER],that); });__webpack_require__(106)(C.prototype,{clear:function clear(){for(var that=this,data=that._i,entry=that._f;entry;entry=entry.n){entry.r=true;if(entry.p)entry.p=entry.p.n=undefined;delete data[entry.i]}that._f=that._l=undefined;that[SIZE]=0},"delete":function(key){var that=this,entry=getEntry(that,key);if(entry){var next=entry.n,prev=entry.p;delete that._i[entry.i];entry.r=true;if(prev)prev.n=next;if(next)next.p=prev;if(that._f==entry)that._f=next;if(that._l==entry)that._l=prev;that[SIZE]--}return!!entry},forEach:function forEach(callbackfn){var f=ctx(callbackfn,arguments[1],3),entry;while(entry=entry?entry.n:this._f){f(entry.v,entry.k,this);while(entry&&entry.r)entry=entry.p}},has:function has(key){return!!getEntry(this,key)}});if(SUPPORT_DESC)$.setDesc(C.prototype,"size",{get:function(){return defined(this[SIZE])}});return C},def:function(that,key,value){var entry=getEntry(that,key),prev,index;if(entry){entry.v=value}else{that._l=entry={i:index=fastKey(key,true),k:key,v:value,p:prev=that._l,n:undefined,r:false};if(!that._f)that._f=entry;if(prev)prev.n=entry;that[SIZE]++;if(index!=="F")that._i[index]=entry}return that},getEntry:getEntry,setStrong:function(C,NAME,IS_MAP){__webpack_require__(54)(C,NAME,function(iterated,kind){this._t=iterated;this._k=kind;this._l=undefined},function(){var that=this,kind=that._k,entry=that._l;while(entry&&entry.r)entry=entry.p;if(!that._t||!(that._l=entry=entry?entry.n:that._t._f)){that._t=undefined;return step(1)}if(kind=="keys")return step(0,entry.k);if(kind=="values")return step(0,entry.v);return step(0,[entry.k,entry.v])},IS_MAP?"entries":"values",!IS_MAP,true);species(C);species(__webpack_require__(9)[NAME])}}},function(module,exports){module.exports=function(it,Constructor,name){if(!(it instanceof Constructor))throw TypeError(name+": use the 'new' operator!");return it}},function(module,exports,__webpack_require__){var ctx=__webpack_require__(35),call=__webpack_require__(58),isArrayIter=__webpack_require__(59),anObject=__webpack_require__(26),toLength=__webpack_require__(60),getIterFn=__webpack_require__(61);module.exports=function(iterable,entries,fn,that){var iterFn=getIterFn(iterable),f=ctx(fn,that,entries?2:1),index=0,length,step,iterator;if(typeof iterFn!="function")throw TypeError(iterable+" is not iterable!");if(isArrayIter(iterFn))for(length=toLength(iterable.length);length>index;index++){entries?f(anObject(step=iterable[index])[0],step[1]):f(iterable[index])}else for(iterator=iterFn.call(iterable);!(step=iterator.next()).done;){call(iterator,f,step.value,entries)}}},function(module,exports,__webpack_require__){var $redef=__webpack_require__(12);module.exports=function(target,src){for(var key in src)$redef(target,key,src[key]);return target}},function(module,exports,__webpack_require__){"use strict";var global=__webpack_require__(4),$def=__webpack_require__(8),forOf=__webpack_require__(105),strictNew=__webpack_require__(104);module.exports=function(NAME,wrapper,methods,common,IS_MAP,IS_WEAK){var Base=global[NAME],C=Base,ADDER=IS_MAP?"set":"add",proto=C&&C.prototype,O={};var fixMethod=function(KEY){var fn=proto[KEY];__webpack_require__(12)(proto,KEY,KEY=="delete"?function(a){return fn.call(this,a===0?0:a)}:KEY=="has"?function has(a){return fn.call(this,a===0?0:a)}:KEY=="get"?function get(a){return fn.call(this,a===0?0:a)}:KEY=="add"?function add(a){fn.call(this,a===0?0:a);return this}:function set(a,b){fn.call(this,a===0?0:a,b);return this})};if(typeof C!="function"||!(IS_WEAK||proto.forEach&&!__webpack_require__(7)(function(){(new C).entries().next()}))){C=common.getConstructor(wrapper,NAME,IS_MAP,ADDER);__webpack_require__(106)(C.prototype,methods)}else{var inst=new C,chain=inst[ADDER](IS_WEAK?{}:-0,1),buggyZero;if(!__webpack_require__(62)(function(iter){new C(iter)})){C=wrapper(function(target,iterable){strictNew(target,C,NAME);var that=new Base;if(iterable!=undefined)forOf(iterable,IS_MAP,that[ADDER],that);return that});C.prototype=proto;proto.constructor=C}IS_WEAK||inst.forEach(function(val,key){buggyZero=1/key===-Infinity});if(buggyZero){fixMethod("delete");fixMethod("has");IS_MAP&&fixMethod("get")}if(buggyZero||chain!==inst)fixMethod(ADDER);if(IS_WEAK&&proto.clear)delete proto.clear}__webpack_require__(15)(C,NAME);O[NAME]=C;$def($def.G+$def.W+$def.F*(C!=Base),O);if(!IS_WEAK)common.setStrong(C,NAME,IS_MAP);return C}},function(module,exports,__webpack_require__){__webpack_require__(37);__webpack_require__(51);__webpack_require__(101);__webpack_require__(109);module.exports=__webpack_require__(9).Set},function(module,exports,__webpack_require__){"use strict";var strong=__webpack_require__(103);__webpack_require__(107)("Set",function(get){return function Set(){return get(this,arguments[0])}},{add:function add(value){return strong.def(this,value=value===0?0:value,value)}},strong)}]);if(typeof Package==="undefined")Package={};Package["ecmascript-runtime"]={Symbol:Symbol,Map:Map,Set:Set}})();(function(){var Meteor=Package.meteor.Meteor;var Promise;(function(){(function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={exports:{},id:moduleId,loaded:false};modules[moduleId].call(module.exports,module,module.exports,__webpack_require__);module.loaded=true;return module.exports}__webpack_require__.m=modules;__webpack_require__.c=installedModules;__webpack_require__.p="";return __webpack_require__(0)})([function(module,exports,__webpack_require__){var MeteorPromise=__webpack_require__(1);var es6PromiseThen=MeteorPromise.prototype.then;MeteorPromise.prototype.then=function(onResolved,onRejected){if(typeof Meteor==="object"&&typeof Meteor.bindEnvironment==="function"){return es6PromiseThen.call(this,onResolved&&Meteor.bindEnvironment(onResolved,raise),onRejected&&Meteor.bindEnvironment(onRejected,raise))}return es6PromiseThen.call(this,onResolved,onRejected)};function raise(exception){throw exception}Promise=MeteorPromise},function(module,exports,__webpack_require__){(function(global){var hasOwn=Object.prototype.hasOwnProperty;var g=typeof global==="object"?global:typeof window==="object"?window:typeof self==="object"?self:this;var GlobalPromise=g.Promise;var NpmPromise=__webpack_require__(2);function copyMethods(target,source){Object.keys(source).forEach(function(key){var value=source[key];if(typeof value==="function"&&!hasOwn.call(target,key)){target[key]=value}})}if(typeof GlobalPromise==="function"){copyMethods(GlobalPromise,NpmPromise);copyMethods(GlobalPromise.prototype,NpmPromise.prototype);module.exports=GlobalPromise}else{module.exports=NpmPromise}}).call(exports,function(){return this}())},function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__(3)},function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__(4);__webpack_require__(6);__webpack_require__(7);__webpack_require__(8);__webpack_require__(9)},function(module,exports,__webpack_require__){"use strict";var asap=__webpack_require__(5);function noop(){}var LAST_ERROR=null;var IS_ERROR={};function getThen(obj){try{return obj.then}catch(ex){LAST_ERROR=ex;return IS_ERROR}}function tryCallOne(fn,a){try{return fn(a)}catch(ex){LAST_ERROR=ex;return IS_ERROR}}function tryCallTwo(fn,a,b){try{fn(a,b)}catch(ex){LAST_ERROR=ex;return IS_ERROR}}module.exports=Promise;function Promise(fn){if(typeof this!=="object"){throw new TypeError("Promises must be constructed via new")}if(typeof fn!=="function"){throw new TypeError("not a function")}this._37=0;this._12=null;this._59=[];if(fn===noop)return;doResolve(fn,this)}Promise._99=noop;Promise.prototype.then=function(onFulfilled,onRejected){if(this.constructor!==Promise){return safeThen(this,onFulfilled,onRejected)}var res=new Promise(noop);handle(this,new Handler(onFulfilled,onRejected,res));return res};function safeThen(self,onFulfilled,onRejected){return new self.constructor(function(resolve,reject){var res=new Promise(noop);res.then(resolve,reject);handle(self,new Handler(onFulfilled,onRejected,res))})}function handle(self,deferred){while(self._37===3){self=self._12}if(self._37===0){self._59.push(deferred);return}asap(function(){var cb=self._37===1?deferred.onFulfilled:deferred.onRejected;if(cb===null){if(self._37===1){resolve(deferred.promise,self._12)}else{reject(deferred.promise,self._12)}return}var ret=tryCallOne(cb,self._12);if(ret===IS_ERROR){reject(deferred.promise,LAST_ERROR)}else{resolve(deferred.promise,ret)}})}function resolve(self,newValue){if(newValue===self){return reject(self,new TypeError("A promise cannot be resolved with itself."))}if(newValue&&(typeof newValue==="object"||typeof newValue==="function")){var then=getThen(newValue);if(then===IS_ERROR){return reject(self,LAST_ERROR)}if(then===self.then&&newValue instanceof Promise){self._37=3;self._12=newValue;finale(self);return}else if(typeof then==="function"){doResolve(then.bind(newValue),self);return}}self._37=1;self._12=newValue;finale(self)}function reject(self,newValue){self._37=2;self._12=newValue;finale(self)}function finale(self){for(var i=0;icapacity){for(var scan=0,newLength=queue.length-index;scan0?argumentCount:0);return new Promise(function(resolve,reject){args.push(function(err,res){if(err)reject(err);else resolve(res)});var res=fn.apply(self,args);if(res&&(typeof res==="object"||typeof res==="function")&&typeof res.then==="function"){resolve(res)}})}};Promise.nodeify=function(fn){return function(){var args=Array.prototype.slice.call(arguments);var callback=typeof args[args.length-1]==="function"?args.pop():null;var ctx=this;try{return fn.apply(this,arguments).nodeify(callback,ctx)}catch(ex){if(callback===null||typeof callback=="undefined"){return new Promise(function(resolve,reject){reject(ex)})}else{asap(function(){callback.call(ctx,ex)})}}}};Promise.prototype.nodeify=function(callback,ctx){if(typeof callback!="function")return this;this.then(function(value){asap(function(){callback.call(ctx,null,value)})},function(err){asap(function(){callback.call(ctx,err)})})}},function(module,exports,__webpack_require__){"use strict";var rawAsap=__webpack_require__(5);var freeTasks=[];var pendingErrors=[];var requestErrorThrow=rawAsap.makeRequestCallFromTimer(throwFirstError);function throwFirstError(){if(pendingErrors.length){throw pendingErrors.shift()}}module.exports=asap;function asap(task){var rawTask;if(freeTasks.length){rawTask=freeTasks.pop()}else{rawTask=new RawTask}rawTask.task=task;rawAsap(rawTask)}function RawTask(){this.task=null}RawTask.prototype.call=function(){try{this.task.call()}catch(error){if(asap.onerror){asap.onerror(error)}else{pendingErrors.push(error);requestErrorThrow()}}finally{this.task=null;freeTasks[freeTasks.length]=this}}}])}).call(this);if(typeof Package==="undefined")Package={};Package.promise={Promise:Promise}})();(function(){var Meteor=Package.meteor.Meteor;var _=Package.underscore._;var Tracker=Package.tracker.Tracker;var Deps=Package.tracker.Deps;var EJSON=Package.ejson.EJSON;var ECMAScript=Package.ecmascript.ECMAScript;var babelHelpers=Package["babel-runtime"].babelHelpers;var Symbol=Package["ecmascript-runtime"].Symbol;var Map=Package["ecmascript-runtime"].Map;var Set=Package["ecmascript-runtime"].Set;var Promise=Package.promise.Promise;var ReactiveDict;(function(){var stringify=function(value){if(value===undefined)return"undefined";return EJSON.stringify(value)};var parse=function(serialized){if(serialized===undefined||serialized==="undefined")return undefined;return EJSON.parse(serialized)};var changed=function(v){v&&v.changed()};ReactiveDict=function(dictName){if(dictName){if(typeof dictName==="string"){ReactiveDict._registerDictForMigrate(dictName,this);this.keys=ReactiveDict._loadMigratedDict(dictName)||{};this.name=dictName}else if(typeof dictName==="object"){this.keys=dictName}else{throw new Error("Invalid ReactiveDict argument: "+dictName)}}else{this.keys={}}this.allDeps=new Tracker.Dependency;this.keyDeps={};this.keyValueDeps={}};_.extend(ReactiveDict.prototype,{set:function(keyOrObject,value){var self=this;if(typeof keyOrObject==="object"&&value===undefined){self._setObject(keyOrObject);return}var key=keyOrObject;value=stringify(value);var keyExisted=_.has(self.keys,key);var oldSerializedValue=keyExisted?self.keys[key]:"undefined";var isNewValue=value!==oldSerializedValue;self.keys[key]=value;if(isNewValue||!keyExisted){self.allDeps.changed()}if(isNewValue){changed(self.keyDeps[key]);if(self.keyValueDeps[key]){changed(self.keyValueDeps[key][oldSerializedValue]);changed(self.keyValueDeps[key][value])}}},setDefault:function(key,value){var self=this;if(!_.has(self.keys,key)){self.set(key,value)}},get:function(key){var self=this;self._ensureKey(key);self.keyDeps[key].depend();return parse(self.keys[key])},equals:function(key,value){var self=this;var ObjectID=null;if(Package.mongo){ObjectID=Package.mongo.Mongo.ObjectID}if(typeof value!=="string"&&typeof value!=="number"&&typeof value!=="boolean"&&typeof value!=="undefined"&&!(value instanceof Date)&&!(ObjectID&&value instanceof ObjectID)&&value!==null){throw new Error("ReactiveDict.equals: value must be scalar")}var serializedValue=stringify(value);if(Tracker.active){self._ensureKey(key);if(!_.has(self.keyValueDeps[key],serializedValue))self.keyValueDeps[key][serializedValue]=new Tracker.Dependency;var isNew=self.keyValueDeps[key][serializedValue].depend();if(isNew){Tracker.onInvalidate(function(){if(!self.keyValueDeps[key][serializedValue].hasDependents())delete self.keyValueDeps[key][serializedValue]})}}var oldValue=undefined;if(_.has(self.keys,key))oldValue=parse(self.keys[key]);return EJSON.equals(oldValue,value)},all:function(){this.allDeps.depend();var ret={};_.each(this.keys,function(value,key){ret[key]=parse(value)});return ret},clear:function(){var self=this;var oldKeys=self.keys;self.keys={};self.allDeps.changed();_.each(oldKeys,function(value,key){changed(self.keyDeps[key]);changed(self.keyValueDeps[key][value]);changed(self.keyValueDeps[key]["undefined"])})},"delete":function(key){var self=this;var didRemove=false;if(_.has(self.keys,key)){var oldValue=self.keys[key];delete self.keys[key];changed(self.keyDeps[key]);if(self.keyValueDeps[key]){changed(self.keyValueDeps[key][oldValue]);changed(self.keyValueDeps[key]["undefined"])}self.allDeps.changed();didRemove=true}return didRemove},_setObject:function(object){var self=this;_.each(object,function(value,key){self.set(key,value)})},_ensureKey:function(key){var self=this;if(!(key in self.keyDeps)){self.keyDeps[key]=new Tracker.Dependency;self.keyValueDeps[key]={}}},_getMigrationData:function(){return this.keys}})}).call(this);(function(){ReactiveDict._migratedDictData={};ReactiveDict._dictsToMigrate={};ReactiveDict._loadMigratedDict=function(dictName){if(_.has(ReactiveDict._migratedDictData,dictName))return ReactiveDict._migratedDictData[dictName];return null};ReactiveDict._registerDictForMigrate=function(dictName,dict){if(_.has(ReactiveDict._dictsToMigrate,dictName))throw new Error("Duplicate ReactiveDict name: "+dictName);ReactiveDict._dictsToMigrate[dictName]=dict};if(Meteor.isClient&&Package.reload){var migrationData=Package.reload.Reload._migrationData("reactive-dict");if(migrationData&&migrationData.dicts)ReactiveDict._migratedDictData=migrationData.dicts;Package.reload.Reload._onMigrate("reactive-dict",function(){var dictsToMigrate=ReactiveDict._dictsToMigrate;var dataToMigrate={};for(var dictName in babelHelpers.sanitizeForInObject(dictsToMigrate))dataToMigrate[dictName]=dictsToMigrate[dictName]._getMigrationData();return[true,{dicts:dataToMigrate}]})}}).call(this);if(typeof Package==="undefined")Package={};Package["reactive-dict"]={ReactiveDict:ReactiveDict}})();(function(){var Meteor=Package.meteor.Meteor;var _=Package.underscore._;var ReactiveDict=Package["reactive-dict"].ReactiveDict;var EJSON=Package.ejson.EJSON;var Session;(function(){Session=new ReactiveDict("session")}).call(this);if(typeof Package==="undefined")Package={};Package.session={Session:Session}})();(function(){var Meteor=Package.meteor.Meteor;var Tracker=Package.tracker.Tracker;var Deps=Package.tracker.Deps;var ReactiveVar;(function(){ReactiveVar=function(initialValue,equalsFunc){if(!(this instanceof ReactiveVar))return new ReactiveVar(initialValue,equalsFunc);this.curValue=initialValue;this.equalsFunc=equalsFunc;this.dep=new Tracker.Dependency};ReactiveVar._isEqual=function(oldValue,newValue){var a=oldValue,b=newValue;if(a!==b)return false;else return!a||typeof a==="number"||typeof a==="boolean"||typeof a==="string"};ReactiveVar.prototype.get=function(){if(Tracker.active)this.dep.depend();return this.curValue};ReactiveVar.prototype.set=function(newValue){var oldValue=this.curValue;if((this.equalsFunc||ReactiveVar._isEqual)(oldValue,newValue))return;this.curValue=newValue;this.dep.changed()};ReactiveVar.prototype.toString=function(){return"ReactiveVar{"+this.get()+"}"};ReactiveVar.prototype._numListeners=function(){var count=0;for(var id in this.dep._dependentsById)count++;return count}}).call(this);if(typeof Package==="undefined")Package={};Package["reactive-var"]={ReactiveVar:ReactiveVar}})();(function(){var Meteor=Package.meteor.Meteor;var Mongo=Package.mongo.Mongo;var Tracker=Package.tracker.Tracker;var Deps=Package.tracker.Deps;var LocalCollection=Package.minimongo.LocalCollection;var Minimongo=Package.minimongo.Minimongo;var CollectionExtensions;(function(){(function(){CollectionExtensions={};CollectionExtensions._extensions=[];Meteor.addCollectionExtension=function(customFunction){if(typeof customFunction!=="function"){throw new Meteor.Error("collection-extension-wrong-argument","You must pass a function into Meteor.addCollectionExtension().")}CollectionExtensions._extensions.push(customFunction);if(typeof Meteor.users!=="undefined"){customFunction.apply(Meteor.users,["users"])}};Meteor.addCollectionPrototype=function(name,customFunction){if(typeof name!=="string"){throw new Meteor.Error("collection-extension-wrong-argument","You must pass a string as the first argument into Meteor.addCollectionPrototype().")}if(typeof customFunction!=="function"){throw new Meteor.Error("collection-extension-wrong-argument","You must pass a function as the second argument into Meteor.addCollectionPrototype().")}(typeof Mongo!=="undefined"?Mongo.Collection:Meteor.Collection).prototype[name]=customFunction};CollectionExtensions._reassignCollectionPrototype=function(instance,constr){var hasSetPrototypeOf=typeof Object.setPrototypeOf==="function";if(!constr)constr=typeof Mongo!=="undefined"?Mongo.Collection:Meteor.Collection;if(hasSetPrototypeOf){Object.setPrototypeOf(instance,constr.prototype)}else if(instance.__proto__){instance.__proto__=constr.prototype}};CollectionExtensions._wrapCollection=function(ns,as){if(!as._CollectionPrototype)as._CollectionPrototype=new as.Collection(null);var constructor=as.Collection;var proto=as._CollectionPrototype;ns.Collection=function(){var ret=constructor.apply(this,arguments);CollectionExtensions._processCollectionExtensions(this,arguments);return ret};ns.Collection.prototype=proto;ns.Collection.prototype.constructor=ns.Collection;for(var prop in constructor){if(constructor.hasOwnProperty(prop)){ns.Collection[prop]=constructor[prop]}}};CollectionExtensions._processCollectionExtensions=function(self,args){var args=args?[].slice.call(args,0):undefined;var extensions=CollectionExtensions._extensions;for(var i=0,len=extensions.length;itext2.length?text1:text2;var shorttext=text1.length>text2.length?text2:text1;var i=longtext.indexOf(shorttext);if(i!=-1){diffs=[[DIFF_INSERT,longtext.substring(0,i)],[DIFF_EQUAL,shorttext],[DIFF_INSERT,longtext.substring(i+shorttext.length)]];if(text1.length>text2.length){diffs[0][0]=diffs[2][0]=DIFF_DELETE}return diffs}if(shorttext.length==1){return[[DIFF_DELETE,text1],[DIFF_INSERT,text2]]}longtext=shorttext=null;var hm=this.diff_halfMatch_(text1,text2);if(hm){var text1_a=hm[0];var text1_b=hm[1];var text2_a=hm[2];var text2_b=hm[3];var mid_common=hm[4];var diffs_a=this.diff_main(text1_a,text2_a,checklines,deadline);var diffs_b=this.diff_main(text1_b,text2_b,checklines,deadline);return diffs_a.concat([[DIFF_EQUAL,mid_common]],diffs_b)}if(checklines&&text1.length>100&&text2.length>100){return this.diff_lineMode_(text1,text2,deadline)}return this.diff_bisect_(text1,text2,deadline)};diff_match_patch.prototype.diff_lineMode_=function(text1,text2,deadline){var a=this.diff_linesToChars_(text1,text2);text1=a[0];text2=a[1];var linearray=a[2];var diffs=this.diff_bisect_(text1,text2,deadline);this.diff_charsToLines_(diffs,linearray);this.diff_cleanupSemantic(diffs);diffs.push([DIFF_EQUAL,""]);var pointer=0;var count_delete=0;var count_insert=0;var text_delete="";var text_insert="";while(pointer=1&&count_insert>=1){var a=this.diff_main(text_delete,text_insert,false,deadline);diffs.splice(pointer-count_delete-count_insert,count_delete+count_insert);pointer=pointer-count_delete-count_insert;for(var j=a.length-1;j>=0;j--){diffs.splice(pointer,0,a[j])}pointer=pointer+a.length}count_insert=0;count_delete=0;text_delete="";text_insert="";break}pointer++}diffs.pop();return diffs};diff_match_patch.prototype.diff_bisect_=function(text1,text2,deadline){var text1_length=text1.length;var text2_length=text2.length;var max_d=Math.ceil((text1_length+text2_length)/2);var v_offset=max_d;var v_length=2*max_d;var v1=new Array(v_length);var v2=new Array(v_length);for(var x=0;xdeadline){break}for(var k1=-d+k1start;k1<=d-k1end;k1+=2){var k1_offset=v_offset+k1;var x1;if(k1==-d||k1!=d&&v1[k1_offset-1]text1_length){k1end+=2}else if(y1>text2_length){k1start+=2}else if(front){var k2_offset=v_offset+delta-k1;if(k2_offset>=0&&k2_offset=x2){return this.diff_bisectSplit_(text1,text2,x1,y1,deadline)}}}}for(var k2=-d+k2start;k2<=d-k2end;k2+=2){var k2_offset=v_offset+k2;var x2;if(k2==-d||k2!=d&&v2[k2_offset-1]text1_length){k2end+=2}else if(y2>text2_length){k2start+=2}else if(!front){var k1_offset=v_offset+delta-k2;if(k1_offset>=0&&k1_offset=x2){return this.diff_bisectSplit_(text1,text2,x1,y1,deadline)}}}}}return[[DIFF_DELETE,text1],[DIFF_INSERT,text2]]};diff_match_patch.prototype.diff_bisectSplit_=function(text1,text2,x,y,deadline){var text1a=text1.substring(0,x); var text2a=text2.substring(0,y);var text1b=text1.substring(x);var text2b=text2.substring(y);var diffs=this.diff_main(text1a,text2a,false,deadline);var diffsb=this.diff_main(text1b,text2b,false,deadline);return diffs.concat(diffsb)};diff_match_patch.prototype.diff_linesToChars_=function(text1,text2){var lineArray=[];var lineHash={};lineArray[0]="";function diff_linesToCharsMunge_(text){var chars="";var lineStart=0;var lineEnd=-1;var lineArrayLength=lineArray.length;while(lineEndtext2_length){text1=text1.substring(text1_length-text2_length)}else if(text1_lengthtext2.length?text1:text2;var shorttext=text1.length>text2.length?text2:text1;if(longtext.length<4||shorttext.length*2=longtext.length){return[best_longtext_a,best_longtext_b,best_shorttext_a,best_shorttext_b,best_common]}else{return null}}var hm1=diff_halfMatchI_(longtext,shorttext,Math.ceil(longtext.length/4));var hm2=diff_halfMatchI_(longtext,shorttext,Math.ceil(longtext.length/2));var hm;if(!hm1&&!hm2){return null}else if(!hm2){hm=hm1}else if(!hm1){hm=hm2}else{hm=hm1[4].length>hm2[4].length?hm1:hm2}var text1_a,text1_b,text2_a,text2_b;if(text1.length>text2.length){text1_a=hm[0];text1_b=hm[1];text2_a=hm[2];text2_b=hm[3]}else{text2_a=hm[0];text2_b=hm[1];text1_a=hm[2];text1_b=hm[3]}var mid_common=hm[4];return[text1_a,text1_b,text2_a,text2_b,mid_common]};diff_match_patch.prototype.diff_cleanupSemantic=function(diffs){var changes=false;var equalities=[];var equalitiesLength=0;var lastequality=null;var pointer=0;var length_insertions1=0;var length_deletions1=0;var length_insertions2=0;var length_deletions2=0;while(pointer0?equalities[equalitiesLength-1]:-1;length_insertions1=0;length_deletions1=0;length_insertions2=0;length_deletions2=0;lastequality=null;changes=true}}pointer++}if(changes){this.diff_cleanupMerge(diffs)}this.diff_cleanupSemanticLossless(diffs);pointer=1;while(pointer=deletion.length/2||overlap_length>=insertion.length/2){diffs.splice(pointer,0,[DIFF_EQUAL,insertion.substring(0,overlap_length)]);diffs[pointer-1][1]=deletion.substring(0,deletion.length-overlap_length);diffs[pointer+1][1]=insertion.substring(overlap_length);pointer++}pointer++}pointer++}};diff_match_patch.prototype.diff_cleanupSemanticLossless=function(diffs){var punctuation=/[^a-zA-Z0-9]/;var whitespace=/\s/;var linebreak=/[\r\n]/;var blanklineEnd=/\n\r?\n$/;var blanklineStart=/^\r?\n\r?\n/;function diff_cleanupSemanticScore_(one,two){if(!one||!two){return 5}var score=0;if(one.charAt(one.length-1).match(punctuation)||two.charAt(0).match(punctuation)){score++;if(one.charAt(one.length-1).match(whitespace)||two.charAt(0).match(whitespace)){score++;if(one.charAt(one.length-1).match(linebreak)||two.charAt(0).match(linebreak)){score++;if(one.match(blanklineEnd)||two.match(blanklineStart)){score++}}}}return score}var pointer=1;while(pointer=bestScore){bestScore=score;bestEquality1=equality1;bestEdit=edit;bestEquality2=equality2}}if(diffs[pointer-1][1]!=bestEquality1){if(bestEquality1){diffs[pointer-1][1]=bestEquality1}else{diffs.splice(pointer-1,1);pointer--}diffs[pointer][1]=bestEdit;if(bestEquality2){diffs[pointer+1][1]=bestEquality2}else{diffs.splice(pointer+1,1);pointer--}}}pointer++}};diff_match_patch.prototype.diff_cleanupEfficiency=function(diffs){var changes=false;var equalities=[];var equalitiesLength=0;var lastequality="";var pointer=0;var pre_ins=false;var pre_del=false;var post_ins=false;var post_del=false;while(pointer0?equalities[equalitiesLength-1]:-1;post_ins=post_del=false}changes=true}}pointer++}if(changes){this.diff_cleanupMerge(diffs)}};diff_match_patch.prototype.diff_cleanupMerge=function(diffs){diffs.push([DIFF_EQUAL,""]);var pointer=0;var count_delete=0;var count_insert=0;var text_delete="";var text_insert="";var commonlength;while(pointer1){if(count_delete!==0&&count_insert!==0){commonlength=this.diff_commonPrefix(text_insert,text_delete);if(commonlength!==0){if(pointer-count_delete-count_insert>0&&diffs[pointer-count_delete-count_insert-1][0]==DIFF_EQUAL){diffs[pointer-count_delete-count_insert-1][1]+=text_insert.substring(0,commonlength)}else{diffs.splice(0,0,[DIFF_EQUAL,text_insert.substring(0,commonlength)]);pointer++}text_insert=text_insert.substring(commonlength);text_delete=text_delete.substring(commonlength)}commonlength=this.diff_commonSuffix(text_insert,text_delete);if(commonlength!==0){diffs[pointer][1]=text_insert.substring(text_insert.length-commonlength)+diffs[pointer][1];text_insert=text_insert.substring(0,text_insert.length-commonlength);text_delete=text_delete.substring(0,text_delete.length-commonlength)}}if(count_delete===0){diffs.splice(pointer-count_delete-count_insert,count_delete+count_insert,[DIFF_INSERT,text_insert])}else if(count_insert===0){diffs.splice(pointer-count_delete-count_insert,count_delete+count_insert,[DIFF_DELETE,text_delete])}else{diffs.splice(pointer-count_delete-count_insert,count_delete+count_insert,[DIFF_DELETE,text_delete],[DIFF_INSERT,text_insert])}pointer=pointer-count_delete-count_insert+(count_delete?1:0)+(count_insert?1:0)+1}else if(pointer!==0&&diffs[pointer-1][0]==DIFF_EQUAL){diffs[pointer-1][1]+=diffs[pointer][1];diffs.splice(pointer,1)}else{pointer++}count_insert=0;count_delete=0;text_delete="";text_insert="";break}}if(diffs[diffs.length-1][1]===""){diffs.pop()}var changes=false;pointer=1;while(pointerloc){break}last_chars1=chars1;last_chars2=chars2}if(diffs.length!=x&&diffs[x][0]===DIFF_DELETE){return last_chars2}return last_chars2+(loc-last_chars1)};diff_match_patch.prototype.diff_prettyHtml=function(diffs){var html=[];var i=0;var pattern_amp=/&/g;var pattern_lt=//g;var pattern_para=/\n/g;for(var x=0;x");switch(op){case DIFF_INSERT:html[x]=''+text+"";break;case DIFF_DELETE:html[x]=''+text+"";break;case DIFF_EQUAL:html[x]=""+text+"";break}if(op!==DIFF_DELETE){i+=data.length}}return html.join("")};diff_match_patch.prototype.diff_text1=function(diffs){var text=[];for(var x=0;xthis.Match_MaxBits){throw new Error("Pattern too long for this browser.")}var s=this.match_alphabet_(pattern);var dmp=this;function match_bitapScore_(e,x){var accuracy=e/pattern.length;var proximity=Math.abs(loc-x);if(!dmp.Match_Distance){return proximity?1:accuracy}return accuracy+proximity/dmp.Match_Distance}var score_threshold=this.Match_Threshold;var best_loc=text.indexOf(pattern,loc);if(best_loc!=-1){score_threshold=Math.min(match_bitapScore_(0,best_loc),score_threshold);best_loc=text.lastIndexOf(pattern,loc+pattern.length);if(best_loc!=-1){score_threshold=Math.min(match_bitapScore_(0,best_loc),score_threshold)}}var matchmask=1<=start;j--){var charMatch=s[text.charAt(j-1)];if(d===0){rd[j]=(rd[j+1]<<1|1)&charMatch}else{rd[j]=(rd[j+1]<<1|1)&charMatch|((last_rd[j+1]|last_rd[j])<<1|1)|last_rd[j+1]}if(rd[j]&matchmask){var score=match_bitapScore_(d,j-1);if(score<=score_threshold){score_threshold=score;best_loc=j-1;if(best_loc>loc){start=Math.max(1,2*loc-best_loc)}else{break}}}}if(match_bitapScore_(d+1,loc)>score_threshold){break}last_rd=rd}return best_loc};diff_match_patch.prototype.match_alphabet_=function(pattern){var s={};for(var i=0;i2){this.diff_cleanupSemantic(diffs);this.diff_cleanupEfficiency(diffs)}}else if(a&&typeof a=="object"&&typeof opt_b=="undefined"&&typeof opt_c=="undefined"){diffs=a;text1=this.diff_text1(diffs)}else if(typeof a=="string"&&opt_b&&typeof opt_b=="object"&&typeof opt_c=="undefined"){text1=a;diffs=opt_b}else if(typeof a=="string"&&typeof opt_b=="string"&&opt_c&&typeof opt_c=="object"){text1=a;diffs=opt_c}else{throw new Error("Unknown call format to patch_make.")}if(diffs.length===0){return[]}var patches=[];var patch=new diff_match_patch.patch_obj;var patchDiffLength=0;var char_count1=0;var char_count2=0;var prepatch_text=text1;var postpatch_text=text1;for(var x=0;x=2*this.Patch_Margin){if(patchDiffLength){this.patch_addContext_(patch,prepatch_text);patches.push(patch);patch=new diff_match_patch.patch_obj;patchDiffLength=0;prepatch_text=postpatch_text;char_count1=char_count2}}break}if(diff_type!==DIFF_INSERT){char_count1+=diff_text.length}if(diff_type!==DIFF_DELETE){char_count2+=diff_text.length}}if(patchDiffLength){this.patch_addContext_(patch,prepatch_text);patches.push(patch)}return patches};diff_match_patch.prototype.patch_deepCopy=function(patches){var patchesCopy=[];for(var x=0;xthis.Match_MaxBits){start_loc=this.match_main(text,text1.substring(0,this.Match_MaxBits),expected_loc);if(start_loc!=-1){end_loc=this.match_main(text,text1.substring(text1.length-this.Match_MaxBits),expected_loc+text1.length-this.Match_MaxBits);if(end_loc==-1||start_loc>=end_loc){start_loc=-1}}}else{start_loc=this.match_main(text,text1,expected_loc)}if(start_loc==-1){results[x]=false;delta-=patches[x].length2-patches[x].length1}else{results[x]=true;delta=start_loc-expected_loc;var text2;if(end_loc==-1){text2=text.substring(start_loc,start_loc+text1.length)}else{text2=text.substring(start_loc,end_loc+this.Match_MaxBits)}if(text1==text2){text=text.substring(0,start_loc)+this.diff_text2(patches[x].diffs)+text.substring(start_loc+text1.length)}else{var diffs=this.diff_main(text1,text2,false);if(text1.length>this.Match_MaxBits&&this.diff_levenshtein(diffs)/text1.length>this.Patch_DeleteThreshold){results[x]=false}else{this.diff_cleanupSemanticLossless(diffs);var index1=0;var index2;for(var y=0;ydiffs[0][1].length){var extraLength=paddingLength-diffs[0][1].length;diffs[0][1]=nullPadding.substring(diffs[0][1].length)+diffs[0][1];patch.start1-=extraLength;patch.start2-=extraLength;patch.length1+=extraLength;patch.length2+=extraLength}patch=patches[patches.length-1];diffs=patch.diffs;if(diffs.length==0||diffs[diffs.length-1][0]!=DIFF_EQUAL){diffs.push([DIFF_EQUAL,nullPadding]);patch.length1+=paddingLength;patch.length2+=paddingLength}else if(paddingLength>diffs[diffs.length-1][1].length){var extraLength=paddingLength-diffs[diffs.length-1][1].length;diffs[diffs.length-1][1]+=nullPadding.substring(0,extraLength);patch.length1+=extraLength;patch.length2+=extraLength}return nullPadding};diff_match_patch.prototype.patch_splitMax=function(patches){var patch_size=this.Match_MaxBits;for(var x=0;xpatch_size){var bigpatch=patches[x];patches.splice(x--,1);var start1=bigpatch.start1;var start2=bigpatch.start2;var precontext="";while(bigpatch.diffs.length!==0){var patch=new diff_match_patch.patch_obj;var empty=true;patch.start1=start1-precontext.length;patch.start2=start2-precontext.length;if(precontext!==""){patch.length1=patch.length2=precontext.length;patch.diffs.push([DIFF_EQUAL,precontext])}while(bigpatch.diffs.length!==0&&patch.length12*patch_size){patch.length1+=diff_text.length;start1+=diff_text.length;empty=false;patch.diffs.push([diff_type,diff_text]);bigpatch.diffs.shift()}else{diff_text=diff_text.substring(0,patch_size-patch.length1-this.Patch_Margin);patch.length1+=diff_text.length;start1+=diff_text.length;if(diff_type===DIFF_EQUAL){patch.length2+=diff_text.length;start2+=diff_text.length}else{empty=false}patch.diffs.push([diff_type,diff_text]);if(diff_text==bigpatch.diffs[0][1]){bigpatch.diffs.shift()}else{bigpatch.diffs[0][1]=bigpatch.diffs[0][1].substring(diff_text.length)}}}precontext=this.diff_text2(patch.diffs);precontext=precontext.substring(precontext.length-this.Patch_Margin);var postcontext=this.diff_text1(bigpatch.diffs).substring(0,this.Patch_Margin);if(postcontext!==""){patch.length1+=postcontext.length;patch.length2+=postcontext.length;if(patch.diffs.length!==0&&patch.diffs[patch.diffs.length-1][0]===DIFF_EQUAL){patch.diffs[patch.diffs.length-1][1]+=postcontext}else{patch.diffs.push([DIFF_EQUAL,postcontext])}}if(!empty){patches.splice(++x,0,patch)}}}}};diff_match_patch.prototype.patch_toText=function(patches){var text=[];for(var x=0;x0&&len2>0&&!matchContext.objectHash&&typeof matchContext.matchByPosition!=="boolean"){matchContext.matchByPosition=!arraysHaveMatchByRef(array1,array2,len1,len2)}while(commonHead0){for(var removeItemIndex1=0;removeItemIndex1=0;index--){index1=toRemove[index];var indexDiff=delta["_"+index1];var removedValue=array.splice(index1,1)[0];if(indexDiff[2]===ARRAY_MOVE){toInsert.push({index:indexDiff[1],value:removedValue})}}toInsert=toInsert.sort(compare.numericallyBy("index"));var toInsertLength=toInsert.length;for(index=0;index0){for(index=0;indexreverseIndex){reverseIndex++}else if(moveFromIndex>=reverseIndex&&moveToIndexmatrix[index1-1][index2]){return backtrack(matrix,array1,array2,index1,index2-1,context)}else{return backtrack(matrix,array1,array2,index1-1,index2,context)}};var get=function(array1,array2,match,context){context=context||{};var matrix=lengthMatrix(array1,array2,match||defaultMatch,context);var result=backtrack(matrix,array1,array2,array1.length,array2.length,context);if(typeof array1==="string"&&typeof array2==="string"){result.sequence=result.sequence.join("")}return result};exports.get=get},{}],13:[function(require,module,exports){var DiffContext=require("../contexts/diff").DiffContext;var PatchContext=require("../contexts/patch").PatchContext;var ReverseContext=require("../contexts/reverse").ReverseContext;var collectChildrenDiffFilter=function collectChildrenDiffFilter(context){if(!context||!context.children){return}var length=context.children.length;var child;var result=context.result;for(var index=0;index=position)posCur[id]++});lengthCur++;posCur[idStringify(id)]=position;callbacks.addedAt(id,seqArray[posNew[idStringify(id)]],position,before)},movedBefore:function(id,before){var prevPosition=posCur[idStringify(id)];var position=before?posCur[idStringify(before)]:lengthCur-1;_.each(posCur,function(pos,id){if(pos>=prevPosition&&pos<=position)posCur[id]--;else if(pos<=prevPosition&&pos>=position)posCur[id]++});posCur[idStringify(id)]=position;callbacks.movedTo(id,seqArray[posNew[idStringify(id)]],prevPosition,position,before)},removed:function(id){var prevPosition=posCur[idStringify(id)];_.each(posCur,function(pos,id){if(pos>=prevPosition)posCur[id]--});delete posCur[idStringify(id)];lengthCur--;callbacks.removedAt(id,lastSeqArray[posOld[idStringify(id)]],prevPosition)}});_.each(posNew,function(pos,idString){if(!_.has(posOld,idString))return;var id=idParse(idString);var newItem=seqArray[pos]||{};var oldItem=lastSeqArray[posOld[idString]];var updates=getUpdates(oldItem,newItem,preventNestedDiff);if(!_.isEmpty(updates))callbacks.changedAt(id,updates,pos,oldItem)})}diffArray.shallow=function(lastSeqArray,seqArray,callbacks){return diffArray(lastSeqArray,seqArray,callbacks,true)};diffArray.deepCopyChanges=function(oldItem,newItem){var setDiff=getUpdates(oldItem,newItem).$set;_.each(setDiff,function(v,deepKey){setDeep(oldItem,deepKey,v)})};diffArray.deepCopyRemovals=function(oldItem,newItem){var unsetDiff=getUpdates(oldItem,newItem).$unset;_.each(unsetDiff,function(v,deepKey){unsetDeep(oldItem,deepKey)})};diffArray.getChanges=function(newCollection,oldCollection,diffMethod){var changes={added:[],removed:[],changed:[]};diffMethod(oldCollection,newCollection,{addedAt:function(id,item,index){changes.added.push({item:item,index:index})},removedAt:function(id,item,index){changes.removed.push({item:item,index:index})},changedAt:function(id,updates,index,oldItem){changes.changed.push({selector:id,modifier:updates})},movedTo:function(id,item,fromIndex,toIndex){}});return changes};var setDeep=function(obj,deepKey,v){var split=deepKey.split(".");var initialKeys=_.initial(split);var lastKey=_.last(split);initialKeys.reduce(function(subObj,k,i){var nextKey=split[i+1];if(isNumStr(nextKey)){if(subObj[k]===null)subObj[k]=[];if(subObj[k].length==parseInt(nextKey))subObj[k].push(null)}else if(subObj[k]===null||!isHash(subObj[k])){subObj[k]={}}return subObj[k]},obj);var deepObj=getDeep(obj,initialKeys);deepObj[lastKey]=v;return v};var unsetDeep=function(obj,deepKey){var split=deepKey.split(".");var initialKeys=_.initial(split);var lastKey=_.last(split);var deepObj=getDeep(obj,initialKeys);if(_.isArray(deepObj)&&isNumStr(lastKey))return!!deepObj.splice(lastKey,1);else return delete deepObj[lastKey]};var getDeep=function(obj,keys){return keys.reduce(function(subObj,k){return subObj[k]},obj)};var isHash=function(obj){return _.isObject(obj)&&Object.getPrototypeOf(obj)===Object.prototype};var isNumStr=function(str){return str.match(/^\d+$/)};return diffArray}])}).call(this);(function(){"use strict";(function(){var module=angular.module("getUpdates",[]);var utils=function(){var rip=function(obj,level){if(level<1)return{};return _.reduce(obj,function(clone,v,k){v=_.isObject(v)?rip(v,--level):v;clone[k]=v;return clone},{})};var toPaths=function(obj){var keys=getKeyPaths(obj);var values=getDeepValues(obj);return _.object(keys,values)};var getKeyPaths=function(obj){var keys=_.keys(obj).map(function(k){var v=obj[k];if(!_.isObject(v)||_.isEmpty(v)||_.isArray(v))return k;return getKeyPaths(v).map(function(subKey){return k+"."+subKey})});return _.flatten(keys)};var getDeepValues=function(obj,arr){arr=arr||[];_.values(obj).forEach(function(v){if(!_.isObject(v)||_.isEmpty(v)||_.isArray(v))arr.push(v);else getDeepValues(v,arr)});return arr};var flatten=function(arr){return arr.reduce(function(flattened,v,i){if(_.isArray(v)&&!_.isEmpty(v))flattened.push.apply(flattened,flatten(v));else flattened.push(v);return flattened},[])};var setFilled=function(obj,k,v){if(!_.isEmpty(v))obj[k]=v};var assert=function(result,msg){if(!result)throwErr(msg)};var throwErr=function(msg){throw Error("get-updates error - "+msg)};return{rip:rip,toPaths:toPaths,getKeyPaths:getKeyPaths,getDeepValues:getDeepValues,setFilled:setFilled,assert:assert,throwErr:throwErr}}();var getDifference=function(){var getDifference=function(src,dst,isShallow){var level;if(isShallow>1)level=isShallow;else if(isShallow)level=1;if(level){src=utils.rip(src,level);dst=utils.rip(dst,level)}return compare(src,dst)};var compare=function(src,dst){var srcKeys=_.keys(src);var dstKeys=_.keys(dst);var keys=_.chain([]).concat(srcKeys).concat(dstKeys).uniq().without("$$hashKey").value();return keys.reduce(function(diff,k){var srcValue=src[k];var dstValue=dst[k];if(_.isDate(srcValue)&&_.isDate(dstValue)){if(srcValue.getTime()!=dstValue.getTime())diff[k]=dstValue}if(_.isObject(srcValue)&&_.isObject(dstValue)){var valueDiff=getDifference(srcValue,dstValue); -utils.setFilled(diff,k,valueDiff)}else if(srcValue!==dstValue){diff[k]=dstValue}return diff},{})};return getDifference}();var getUpdates=function(){var getUpdates=function(src,dst,isShallow){utils.assert(_.isObject(src),"first argument must be an object");utils.assert(_.isObject(dst),"second argument must be an object");var diff=getDifference(src,dst,isShallow);var paths=utils.toPaths(diff);var set=createSet(paths);var unset=createUnset(paths);var pull=createPull(unset);var updates={};utils.setFilled(updates,"$set",set);utils.setFilled(updates,"$unset",unset);utils.setFilled(updates,"$pull",pull);return updates};var createSet=function(paths){var undefinedKeys=getUndefinedKeys(paths);return _.omit(paths,undefinedKeys)};var createUnset=function(paths){var undefinedKeys=getUndefinedKeys(paths);var unset=_.pick(paths,undefinedKeys);return _.reduce(unset,function(result,v,k){result[k]=true;return result},{})};var createPull=function(unset){var arrKeyPaths=_.keys(unset).map(function(k){var split=k.match(/(.*)\.\d+$/);return split&&split[1]});return _.compact(arrKeyPaths).reduce(function(pull,k){pull[k]=null;return pull},{})};var getUndefinedKeys=function(obj){return _.keys(obj).filter(function(k){var v=obj[k];return _.isUndefined(v)})};return getUpdates}();module.value("getUpdates",getUpdates)})()}).call(this);(function(){"use strict";var angularMeteorSubscribe=angular.module("angular-meteor.subscribe",[]);angularMeteorSubscribe.service("$meteorSubscribe",["$q","$angularMeteorSettings",function($q,$angularMeteorSettings){var self=this;this._subscribe=function(scope,deferred,args){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.subscribe] Please note that this module is deprecated since 1.3.0 and will be removed in 1.4.0! Replace it with the new syntax described here: http://www.angular-meteor.com/api/1.3.6/subscribe. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var subscription=null;var lastArg=args[args.length-1];if(angular.isObject(lastArg)&&angular.isFunction(lastArg.onStop)){var onStop=lastArg.onStop;args.pop()}args.push({onReady:function(){deferred.resolve(subscription)},onStop:function(err){if(!deferred.promise.$$state.status){if(err)deferred.reject(err);else deferred.reject(new Meteor.Error("Subscription Stopped","Subscription stopped by a call to stop method. Either by the client or by the server."))}else if(onStop)onStop.apply(this,Array.prototype.slice.call(arguments))}});subscription=Meteor.subscribe.apply(scope,args);return subscription};this.subscribe=function(){var deferred=$q.defer();var args=Array.prototype.slice.call(arguments);var subscription=null;self._subscribe(this,deferred,args);return deferred.promise}}]);angularMeteorSubscribe.run(["$rootScope","$q","$meteorSubscribe",function($rootScope,$q,$meteorSubscribe){Object.getPrototypeOf($rootScope).$meteorSubscribe=function(){var deferred=$q.defer();var args=Array.prototype.slice.call(arguments);var subscription=$meteorSubscribe._subscribe(this,deferred,args);this.$on("$destroy",function(){subscription.stop()});return deferred.promise}}])}).call(this);(function(){"use strict";var angularMeteorStopper=angular.module("angular-meteor.stopper",["angular-meteor.subscribe"]);angularMeteorStopper.factory("$meteorStopper",["$q","$meteorSubscribe",function($q,$meteorSubscribe){function $meteorStopper($meteorEntity){return function(){var args=Array.prototype.slice.call(arguments);var meteorEntity=$meteorEntity.apply(this,args);angular.extend(meteorEntity,$meteorStopper);meteorEntity.$$scope=this;this.$on("$destroy",function(){meteorEntity.stop();if(meteorEntity.subscription)meteorEntity.subscription.stop()});return meteorEntity}}$meteorStopper.subscribe=function(){var args=Array.prototype.slice.call(arguments);this.subscription=$meteorSubscribe._subscribe(this.$$scope,$q.defer(),args);return this};return $meteorStopper}])}).call(this);(function(){"use strict";var angularMeteorCollection=angular.module("angular-meteor.collection",["angular-meteor.stopper","angular-meteor.subscribe","angular-meteor.utils","diffArray"]);angularMeteorCollection.factory("AngularMeteorCollection",["$q","$meteorSubscribe","$meteorUtils","$rootScope","$timeout","diffArray","$angularMeteorSettings",function($q,$meteorSubscribe,$meteorUtils,$rootScope,$timeout,diffArray,$angularMeteorSettings){function AngularMeteorCollection(curDefFunc,collection,diffArrayFunc,autoClientSave){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.$meteorCollection] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorCollection. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var data=[];data._serverBackup=[];data._diffArrayFunc=diffArrayFunc;data._hObserve=null;data._hNewCurAutorun=null;data._hDataAutorun=null;if(angular.isDefined(collection)){data.$$collection=collection}else{var cursor=curDefFunc();data.$$collection=$meteorUtils.getCollectionByName(cursor.collection.name)}_.extend(data,AngularMeteorCollection);data._startCurAutorun(curDefFunc,autoClientSave);return data}AngularMeteorCollection._startCurAutorun=function(curDefFunc,autoClientSave){var self=this;self._hNewCurAutorun=Tracker.autorun(function(){Tracker.onInvalidate(function(){self._stopCursor()});if(autoClientSave)self._setAutoClientSave();self._updateCursor(curDefFunc(),autoClientSave)})};AngularMeteorCollection.subscribe=function(){$meteorSubscribe.subscribe.apply(this,arguments);return this};AngularMeteorCollection.save=function(docs,useUnsetModifier){if(!docs)docs=this;docs=[].concat(docs);var promises=docs.map(function(doc){return this._upsertDoc(doc,useUnsetModifier)},this);return $meteorUtils.promiseAll(promises)};AngularMeteorCollection._upsertDoc=function(doc,useUnsetModifier){var deferred=$q.defer();var collection=this.$$collection;var createFulfill=_.partial($meteorUtils.fulfill,deferred,null);doc=$meteorUtils.stripDollarPrefixedKeys(doc);var docId=doc._id;var isExist=collection.findOne(docId);if(isExist){delete doc._id;var modifier=useUnsetModifier?{$unset:doc}:{$set:doc};collection.update(docId,modifier,createFulfill(function(){return{_id:docId,action:"updated"}}))}else{collection.insert(doc,createFulfill(function(id){return{_id:id,action:"inserted"}}))}return deferred.promise};AngularMeteorCollection._updateDiff=function(selector,update,callback){callback=callback||angular.noop;var setters=_.omit(update,"$pull");var updates=[setters];_.each(update.$pull,function(pull,prop){var puller={};puller[prop]=pull;updates.push({$pull:puller})});this._updateParallel(selector,updates,callback)};AngularMeteorCollection._updateParallel=function(selector,updates,callback){var self=this;var done=_.after(updates.length,callback);var next=function(err,affectedDocsNum){if(err)return callback(err);done(null,affectedDocsNum)};_.each(updates,function(update){self.$$collection.update(selector,update,next)})};AngularMeteorCollection.remove=function(keyOrDocs){var keys;if(!keyOrDocs){keys=_.pluck(this,"_id")}else{keyOrDocs=[].concat(keyOrDocs);keys=_.map(keyOrDocs,function(keyOrDoc){return keyOrDoc._id||keyOrDoc})}check(keys,[Match.OneOf(String,Mongo.ObjectID)]);var promises=keys.map(function(key){return this._removeDoc(key)},this);return $meteorUtils.promiseAll(promises)};AngularMeteorCollection._removeDoc=function(id){var deferred=$q.defer();var collection=this.$$collection;var fulfill=$meteorUtils.fulfill(deferred,null,{_id:id,action:"removed"});collection.remove(id,fulfill);return deferred.promise};AngularMeteorCollection._updateCursor=function(cursor,autoClientSave){var self=this;if(self._hObserve)self._stopObserving();self._hObserve=cursor.observe({addedAt:function(doc,atIndex){self.splice(atIndex,0,doc);self._serverBackup.splice(atIndex,0,doc);self._setServerUpdateMode()},changedAt:function(doc,oldDoc,atIndex){diffArray.deepCopyChanges(self[atIndex],doc);diffArray.deepCopyRemovals(self[atIndex],doc);self._serverBackup[atIndex]=self[atIndex];self._setServerUpdateMode()},movedTo:function(doc,fromIndex,toIndex){self.splice(fromIndex,1);self.splice(toIndex,0,doc);self._serverBackup.splice(fromIndex,1);self._serverBackup.splice(toIndex,0,doc);self._setServerUpdateMode()},removedAt:function(oldDoc){var removedIndex=$meteorUtils.findIndexById(self,oldDoc);if(removedIndex!=-1){self.splice(removedIndex,1);self._serverBackup.splice(removedIndex,1);self._setServerUpdateMode()}else{removedIndex=$meteorUtils.findIndexById(self._serverBackup,oldDoc);if(removedIndex!=-1){self._serverBackup.splice(removedIndex,1)}}}});self._hDataAutorun=Tracker.autorun(function(){cursor.fetch();if(self._serverMode)self._unsetServerUpdateMode(autoClientSave)})};AngularMeteorCollection._stopObserving=function(){this._hObserve.stop();this._hDataAutorun.stop();delete this._serverMode;delete this._hUnsetTimeout};AngularMeteorCollection._setServerUpdateMode=function(name){this._serverMode=true;this._unsetAutoClientSave()};AngularMeteorCollection._unsetServerUpdateMode=function(autoClientSave){var self=this;if(self._hUnsetTimeout){$timeout.cancel(self._hUnsetTimeout);self._hUnsetTimeout=null}self._hUnsetTimeout=$timeout(function(){self._serverMode=false;var changes=diffArray.getChanges(self,self._serverBackup,self._diffArrayFunc);self._saveChanges(changes);if(autoClientSave)self._setAutoClientSave()},0)};AngularMeteorCollection.stop=function(){this._stopCursor();this._hNewCurAutorun.stop()};AngularMeteorCollection._stopCursor=function(){this._unsetAutoClientSave();if(this._hObserve){this._hObserve.stop();this._hDataAutorun.stop()}this.splice(0);this._serverBackup.splice(0)};AngularMeteorCollection._unsetAutoClientSave=function(name){if(this._hRegAutoBind){this._hRegAutoBind();this._hRegAutoBind=null}};AngularMeteorCollection._setAutoClientSave=function(){var self=this;self._unsetAutoClientSave();self._hRegAutoBind=$rootScope.$watch(function(){return self},function(nItems,oItems){if(nItems===oItems)return;var changes=diffArray.getChanges(self,oItems,self._diffArrayFunc);self._unsetAutoClientSave();self._saveChanges(changes);self._setAutoClientSave()},true)};AngularMeteorCollection._saveChanges=function(changes){var self=this;var addedDocs=changes.added.reverse().map(function(descriptor){self.splice(descriptor.index,1);return descriptor.item});if(addedDocs.length)self.save(addedDocs);var removedDocs=changes.removed.map(function(descriptor){return descriptor.item});if(removedDocs.length)self.remove(removedDocs);changes.changed.forEach(function(descriptor){self._updateDiff(descriptor.selector,descriptor.modifier)})};return AngularMeteorCollection}]);angularMeteorCollection.factory("$meteorCollectionFS",["$meteorCollection","diffArray","$angularMeteorSettings",function($meteorCollection,diffArray,$angularMeteorSettings){function $meteorCollectionFS(reactiveFunc,autoClientSave,collection){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.$meteorCollectionFS] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/files. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");return new $meteorCollection(reactiveFunc,autoClientSave,collection,diffArray.shallow)}return $meteorCollectionFS}]);angularMeteorCollection.factory("$meteorCollection",["AngularMeteorCollection","$rootScope","diffArray",function(AngularMeteorCollection,$rootScope,diffArray){function $meteorCollection(reactiveFunc,autoClientSave,collection,diffFn){if(!reactiveFunc){throw new TypeError("The first argument of $meteorCollection is undefined.")}if(!(angular.isFunction(reactiveFunc)||angular.isFunction(reactiveFunc.find))){throw new TypeError("The first argument of $meteorCollection must be a function or "+"a have a find function property.")}if(!angular.isFunction(reactiveFunc)){collection=angular.isDefined(collection)?collection:reactiveFunc;reactiveFunc=_.bind(reactiveFunc.find,reactiveFunc)}autoClientSave=angular.isDefined(autoClientSave)?autoClientSave:true;diffFn=diffFn||diffArray;return new AngularMeteorCollection(reactiveFunc,collection,diffFn,autoClientSave)}return $meteorCollection}]);angularMeteorCollection.run(["$rootScope","$meteorCollection","$meteorCollectionFS","$meteorStopper",function($rootScope,$meteorCollection,$meteorCollectionFS,$meteorStopper){var scopeProto=Object.getPrototypeOf($rootScope);scopeProto.$meteorCollection=$meteorStopper($meteorCollection);scopeProto.$meteorCollectionFS=$meteorStopper($meteorCollectionFS)}])}).call(this);(function(){"use strict";var angularMeteorObject=angular.module("angular-meteor.object",["angular-meteor.utils","angular-meteor.subscribe","angular-meteor.collection","getUpdates","diffArray"]);angularMeteorObject.factory("AngularMeteorObject",["$q","$meteorSubscribe","$meteorUtils","diffArray","getUpdates","AngularMeteorCollection","$angularMeteorSettings",function($q,$meteorSubscribe,$meteorUtils,diffArray,getUpdates,AngularMeteorCollection,$angularMeteorSettings){AngularMeteorObject.$$internalProps=["$$collection","$$options","$$id","$$hashkey","$$internalProps","$$scope","bind","save","reset","subscribe","stop","autorunComputation","unregisterAutoBind","unregisterAutoDestroy","getRawObject","_auto","_setAutos","_eventEmitter","_serverBackup","_updateDiff","_updateParallel","_getId"];function AngularMeteorObject(collection,selector,options){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.$meteorObject] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorObject. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var helpers=collection._helpers;var data=_.isFunction(helpers)?Object.create(helpers.prototype):{};var doc=collection.findOne(selector,options);var collectionExtension=_.pick(AngularMeteorCollection,"_updateParallel");_.extend(data,doc);_.extend(data,AngularMeteorObject);_.extend(data,collectionExtension);data.$$options=_.omit(options,"skip","limit");data.$$collection=collection;data.$$id=data._getId(selector);data._serverBackup=doc||{};return data}AngularMeteorObject.getRawObject=function(){return angular.copy(_.omit(this,this.$$internalProps))};AngularMeteorObject.subscribe=function(){$meteorSubscribe.subscribe.apply(this,arguments);return this};AngularMeteorObject.save=function(custom){var deferred=$q.defer();var collection=this.$$collection;var createFulfill=_.partial($meteorUtils.fulfill,deferred,null);var oldDoc=collection.findOne(this.$$id);var mods;if(oldDoc){if(custom)mods={$set:custom};else{mods=getUpdates(oldDoc,this.getRawObject());if(_.isEmpty(mods)){return $q.when({action:"updated"})}}this._updateDiff(mods,createFulfill({action:"updated"}))}else{if(custom)mods=_.clone(custom);else mods=this.getRawObject();mods._id=mods._id||this.$$id;collection.insert(mods,createFulfill({action:"inserted"}))}return deferred.promise};AngularMeteorObject._updateDiff=function(update,callback){var selector=this.$$id;AngularMeteorCollection._updateDiff.call(this,selector,update,callback)};AngularMeteorObject.reset=function(keepClientProps){var self=this;var options=this.$$options;var id=this.$$id;var doc=this.$$collection.findOne(id,options);if(doc){var docKeys=_.keys(doc);var docExtension=_.pick(doc,docKeys);var clientProps;_.extend(self,docExtension);_.extend(self._serverBackup,docExtension);if(keepClientProps){clientProps=_.intersection(_.keys(self),_.keys(self._serverBackup))}else{clientProps=_.keys(self)}var serverProps=_.keys(doc);var removedKeys=_.difference(clientProps,serverProps,self.$$internalProps);removedKeys.forEach(function(prop){delete self[prop];delete self._serverBackup[prop]})}else{_.keys(this.getRawObject()).forEach(function(prop){delete self[prop]});self._serverBackup={}}};AngularMeteorObject.stop=function(){if(this.unregisterAutoDestroy)this.unregisterAutoDestroy();if(this.unregisterAutoBind)this.unregisterAutoBind();if(this.autorunComputation&&this.autorunComputation.stop)this.autorunComputation.stop()};AngularMeteorObject._getId=function(selector){var options=_.extend({},this.$$options,{fields:{_id:1},reactive:false,transform:null});var doc=this.$$collection.findOne(selector,options);if(doc)return doc._id;if(selector instanceof Mongo.ObjectID)return selector;if(_.isString(selector))return selector;return new Mongo.ObjectID};return AngularMeteorObject}]);angularMeteorObject.factory("$meteorObject",["$rootScope","$meteorUtils","getUpdates","AngularMeteorObject",function($rootScope,$meteorUtils,getUpdates,AngularMeteorObject){function $meteorObject(collection,id,auto,options){if(!collection){throw new TypeError("The first argument of $meteorObject is undefined.")}if(!angular.isFunction(collection.findOne)){throw new TypeError("The first argument of $meteorObject must be a function or a have a findOne function property.")}var data=new AngularMeteorObject(collection,id,options);data._auto=auto!==false;_.extend(data,$meteorObject);data._setAutos();return data}$meteorObject._setAutos=function(){var self=this;this.autorunComputation=$meteorUtils.autorun($rootScope,function(){self.reset(true)});this.unregisterAutoBind=this._auto&&$rootScope.$watch(function(){return self.getRawObject()},function(item,oldItem){if(item!==oldItem)self.save()},true);this.unregisterAutoDestroy=$rootScope.$on("$destroy",function(){if(self&&self.stop)self.pop()})};return $meteorObject}]);angularMeteorObject.run(["$rootScope","$meteorObject","$meteorStopper",function($rootScope,$meteorObject,$meteorStopper){var scopeProto=Object.getPrototypeOf($rootScope);scopeProto.$meteorObject=$meteorStopper($meteorObject)}])}).call(this);(function(){angular.module("angular-meteor.ironrouter",[]).run(["$compile","$document","$rootScope",function($compile,$document,$rootScope){var Router=(Package["iron:router"]||{}).Router;if(!Router)return;var isLoaded=false;Router.onAfterAction(function(req,res,next){Tracker.afterFlush(function(){if(isLoaded)return;$compile($document)($rootScope);if(!$rootScope.$$phase)$rootScope.$apply();isLoaded=true})})}])}).call(this);(function(){"use strict";var angularMeteorUser=angular.module("angular-meteor.user",["angular-meteor.utils","angular-meteor.core"]);angularMeteorUser.service("$meteorUser",["$rootScope","$meteorUtils","$q","$angularMeteorSettings",function($rootScope,$meteorUtils,$q,$angularMeteorSettings){var pack=Package["accounts-base"];if(!pack)return;var self=this;var Accounts=pack.Accounts;this.waitForUser=function(){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.waitForUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var deferred=$q.defer();$meteorUtils.autorun($rootScope,function(){if(!Meteor.loggingIn())deferred.resolve(Meteor.user())},true);return deferred.promise};this.requireUser=function(){if(!$angularMeteorSettings.suppressWarnings){console.warn("[angular-meteor.requireUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings")}var deferred=$q.defer();$meteorUtils.autorun($rootScope,function(){if(!Meteor.loggingIn()){if(Meteor.user()===null)deferred.reject("AUTH_REQUIRED");else deferred.resolve(Meteor.user())}},true);return deferred.promise};this.requireValidUser=function(validatorFn){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.requireValidUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");return self.requireUser(true).then(function(user){var valid=validatorFn(user);if(valid===true)return user;else if(typeof valid==="string")return $q.reject(valid);else return $q.reject("FORBIDDEN")})};this.loginWithPassword=$meteorUtils.promissor(Meteor,"loginWithPassword");this.createUser=$meteorUtils.promissor(Accounts,"createUser");this.changePassword=$meteorUtils.promissor(Accounts,"changePassword");this.forgotPassword=$meteorUtils.promissor(Accounts,"forgotPassword");this.resetPassword=$meteorUtils.promissor(Accounts,"resetPassword");this.verifyEmail=$meteorUtils.promissor(Accounts,"verifyEmail");this.logout=$meteorUtils.promissor(Meteor,"logout");this.logoutOtherClients=$meteorUtils.promissor(Meteor,"logoutOtherClients");this.loginWithFacebook=$meteorUtils.promissor(Meteor,"loginWithFacebook");this.loginWithTwitter=$meteorUtils.promissor(Meteor,"loginWithTwitter");this.loginWithGoogle=$meteorUtils.promissor(Meteor,"loginWithGoogle");this.loginWithGithub=$meteorUtils.promissor(Meteor,"loginWithGithub");this.loginWithMeteorDeveloperAccount=$meteorUtils.promissor(Meteor,"loginWithMeteorDeveloperAccount");this.loginWithMeetup=$meteorUtils.promissor(Meteor,"loginWithMeetup");this.loginWithWeibo=$meteorUtils.promissor(Meteor,"loginWithWeibo")}]);angularMeteorUser.run(["$rootScope","$angularMeteorSettings","$$Core",function($rootScope,$angularMeteorSettings,$$Core){var ScopeProto=Object.getPrototypeOf($rootScope);_.extend(ScopeProto,$$Core);$rootScope.autorun(function(){if(!Meteor.user)return;$rootScope.currentUser=Meteor.user();$rootScope.loggingIn=Meteor.loggingIn()})}])}).call(this);(function(){"use strict";var angularMeteorMethods=angular.module("angular-meteor.methods",["angular-meteor.utils"]);angularMeteorMethods.service("$meteorMethods",["$q","$meteorUtils","$angularMeteorSettings",function($q,$meteorUtils,$angularMeteorSettings){this.call=function(){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.$meteor.call] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/methods. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var deferred=$q.defer();var fulfill=$meteorUtils.fulfill(deferred);var args=_.toArray(arguments).concat(fulfill);Meteor.call.apply(this,args);return deferred.promise}}])}).call(this);(function(){"use strict";var angularMeteorSession=angular.module("angular-meteor.session",["angular-meteor.utils"]);angularMeteorSession.factory("$meteorSession",["$meteorUtils","$parse","$angularMeteorSettings",function($meteorUtils,$parse,$angularMeteorSettings){return function(session){return{bind:function(scope,model){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.session.bind] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://www.angular-meteor.com/api/1.3.0/session. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var getter=$parse(model);var setter=getter.assign;$meteorUtils.autorun(scope,function(){setter(scope,Session.get(session))});scope.$watch(model,function(newItem,oldItem){Session.set(session,getter(scope))},true)}}}}])}).call(this);(function(){"use strict";var angularMeteorUtils=angular.module("angular-meteor.utils",[]);angularMeteorUtils.service("$meteorUtils",["$q","$timeout","$angularMeteorSettings",function($q,$timeout,$angularMeteorSettings){var self=this;this.autorun=function(scope,fn){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.utils.autorun] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.6/autorun. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var comp=Tracker.autorun(function(c){fn(c);if(!c.firstRun)$timeout(angular.noop,0)});scope.$on("$destroy",function(){comp.stop()});return comp};this.stripDollarPrefixedKeys=function(data){if(!_.isObject(data)||data instanceof Date||data instanceof File||EJSON.toJSONValue(data).$type==="oid"||typeof FS==="object"&&data instanceof FS.File)return data;var out=_.isArray(data)?[]:{};_.each(data,function(v,k){if(typeof k!=="string"||k.charAt(0)!=="$")out[k]=self.stripDollarPrefixedKeys(v)});return out};this.fulfill=function(deferred,boundError,boundResult){return function(err,result){if(err)deferred.reject(boundError===null?err:boundError);else if(typeof boundResult=="function")deferred.resolve(boundResult===null?result:boundResult(result));else deferred.resolve(boundResult===null?result:boundResult)}};this.promissor=function(obj,method){return function(){var deferred=$q.defer();var fulfill=self.fulfill(deferred);var args=_.toArray(arguments).concat(fulfill);obj[method].apply(obj,args);return deferred.promise}};this.promiseAll=function(promises){var allPromise=$q.all(promises);allPromise["finally"](function(){$timeout(angular.noop)});return allPromise};this.getCollectionByName=function(string){return Mongo.Collection.get(string)};this.findIndexById=function(collection,doc){var foundDoc=_.find(collection,function(colDoc){return EJSON.equals(colDoc._id,doc._id)});return _.indexOf(collection,foundDoc)}}]);angularMeteorUtils.run(["$rootScope","$meteorUtils",function($rootScope,$meteorUtils){Object.getPrototypeOf($rootScope).$meteorAutorun=function(fn){return $meteorUtils.autorun(this,fn)}}])}).call(this);(function(){"use strict";var angularMeteorCamera=angular.module("angular-meteor.camera",["angular-meteor.utils"]);angularMeteorCamera.service("$meteorCamera",["$q","$meteorUtils","$angularMeteorSettings",function($q,$meteorUtils,$angularMeteorSettings){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var pack=Package["mdg:camera"];if(!pack)return;var MeteorCamera=pack.MeteorCamera;this.getPicture=function(options){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");options=options||{};var deferred=$q.defer();MeteorCamera.getPicture(options,$meteorUtils.fulfill(deferred));return deferred.promise}}])}).call(this);(function(){angular.module("angular-meteor.utilities",[]).service("$$utils",["$rootScope",function($rootScope){var _this=this;this.isCursor=function(obj){return obj instanceof Meteor.Collection.Cursor};this.isScope=function(obj){return obj instanceof $rootScope.constructor};this.areSiblings=function(obj1,obj2){return _.isObject(obj1)&&_.isObject(obj2)&&Object.getPrototypeOf(obj1)===Object.getPrototypeOf(obj2)};this.bind=function(fn,context,tap){tap=_.isFunction(tap)?tap:angular.noop;if(_.isFunction(fn))return bindFn(fn,context,tap);if(_.isObject(fn))return bindObj(fn,context,tap);return fn};var bindFn=function(fn,context,tap){return function(){for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}var result=fn.apply(context,args);tap.call(context,{result:result,args:args});return result}};var bindObj=function(obj,context,tap){return _.keys(obj).reduce(function(bound,k){bound[k]=_this.bind(obj[k],context,tap);return bound},{})}}])}).call(this);(function(){angular.module("angular-meteor.mixer",[]).service("$Mixer",function(){var _this=this;this._mixins=[];this.mixin=function(mixin){if(!_.isObject(mixin))throw Error("argument 1 must be an object");_this._mixins=_.union(_this._mixins,[mixin]);return _this};this._mixout=function(mixin){_this._mixins=_.without(_this._mixins,mixin);return _this};this._construct=function(context){for(var _len=arguments.length,args=Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key]}_this._mixins.filter(_.isFunction).forEach(function(mixin){mixin.call.apply(mixin,[context].concat(args))});return context};this._extend=function(obj){var _ref;return(_ref=_).extend.apply(_ref,[obj].concat(_this._mixins))}})}).call(this);(function(){angular.module("angular-meteor.scope",["angular-meteor.mixer"]).run(["$rootScope","$Mixer",function($rootScope,$Mixer){var Scope=$rootScope.constructor;var $new=$rootScope.$new;Scope.prototype.$new=function(isolate,parent){var firstChild=this===$rootScope&&!this.$$ChildScope;var scope=$new.call(this,isolate,parent);if(isolate){$Mixer._extend(scope)}else if(firstChild){scope.__proto__=this.$$ChildScope.prototype=$Mixer._extend(Object.create(this))}return $Mixer._construct(scope)}}])}).call(this);(function(){angular.module("angular-meteor.view-model",["angular-meteor.utilities","angular-meteor.mixer","angular-meteor.core"]).factory("$$ViewModel",["$$utils","$Mixer",function($$utils,$Mixer){function $$ViewModel(){var vm=arguments.length<=0||arguments[0]===undefined?this:arguments[0];this.$$vm=vm}$$ViewModel.viewModel=function(vm){var _this=this;if(!_.isObject(vm))throw Error("argument 1 must be an object");$Mixer._mixins.forEach(function(mixin){var keys=_.keys(mixin).filter(function(k){return k.match(/^(?!\$\$).*$/)});var proto=_.pick(mixin,keys);var boundProto=$$utils.bind(proto,_this);_.extend(vm,boundProto)});$Mixer._construct(this,vm);return vm};$$ViewModel.$bindToContext=function(fn){return $$utils.bind(fn,this.$$vm,this.$$throttledDigest.bind(this))};return $$ViewModel}]).service("$reactive",["$$utils",function($$utils){var Reactive=function(){function Reactive(vm){var _this2=this;babelHelpers.classCallCheck(this,Reactive);if(!_.isObject(vm))throw Error("argument 1 must be an object");_.defer(function(){if(!_this2._attached)console.warn("view model was not attached to any scope")});this._vm=vm}Reactive.prototype.attach=function(){function attach(scope){this._attached=true;if(!$$utils.isScope(scope))throw Error("argument 1 must be a scope");var viewModel=scope.viewModel(this._vm);viewModel.call=viewModel.callMethod;viewModel.apply=viewModel.applyMethod;return viewModel}return attach}();return Reactive}();return function(vm){return new Reactive(vm)}}])}).call(this);(function(){angular.module("angular-meteor.core",["angular-meteor.utilities","angular-meteor.mixer"]).factory("$$Core",["$q","$$utils",function($q,$$utils){function $$Core(){}$$Core.autorun=function(fn){var options=arguments.length<=1||arguments[1]===undefined?{}:arguments[1];fn=this.$bindToContext(fn);if(!_.isFunction(fn))throw Error("argument 1 must be a function");if(!_.isObject(options))throw Error("argument 2 must be an object");var computation=Tracker.autorun(fn,options);this.$$autoStop(computation);return computation};$$Core.subscribe=function(name,fn,cb){fn=this.$bindToContext(fn||angular.noop);cb=cb?this.$bindToContext(cb):angular.noop;if(!_.isString(name))throw Error("argument 1 must be a string");if(!_.isFunction(fn))throw Error("argument 2 must be a function");if(!_.isFunction(cb)&&!_.isObject(cb))throw Error("argument 3 must be a function or an object");var result={};var computation=this.autorun(function(){var _Meteor;var args=fn();if(angular.isUndefined(args))args=[];if(!_.isArray(args))throw Error("reactive function's return value must be an array");var subscription=(_Meteor=Meteor).subscribe.apply(_Meteor,[name].concat(args,[cb]));result.ready=subscription.ready.bind(subscription);result.subscriptionId=subscription.subscriptionId});result.stop=computation.stop.bind(computation);return result};$$Core.callMethod=function(){ -var _Meteor2;for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}var fn=args.pop();if(_.isFunction(fn))fn=this.$bindToContext(fn);return(_Meteor2=Meteor).call.apply(_Meteor2,args.concat([fn]))};$$Core.applyMethod=function(){var _Meteor3;for(var _len2=arguments.length,args=Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2]}var fn=args.pop();if(_.isFunction(fn))fn=this.$bindToContext(fn);return(_Meteor3=Meteor).apply.apply(_Meteor3,args.concat([fn]))};$$Core.$$autoStop=function(stoppable){this.$on("$destroy",stoppable.stop.bind(stoppable))};$$Core.$$throttledDigest=function(){var isDigestable=!this.$$destroyed&&!this.$$phase&&!this.$root.$$phase;if(isDigestable)this.$digest()};$$Core.$$defer=function(){var deferred=$q.defer();deferred.promise=deferred.promise["finally"](this.$$throttledDigest.bind(this));return deferred};$$Core.$bindToContext=function(fn){return $$utils.bind(fn,this,this.$$throttledDigest.bind(this))};return $$Core}])}).call(this);(function(){angular.module("angular-meteor.reactive",["angular-meteor.utilities","angular-meteor.mixer","angular-meteor.core","angular-meteor.view-model"]).factory("$$Reactive",["$parse","$$utils","$angularMeteorSettings",function($parse,$$utils,$angularMeteorSettings){function $$Reactive(){var vm=arguments.length<=0||arguments[0]===undefined?this:arguments[0];vm.$$dependencies={}}$$Reactive.helpers=function(){var _this=this;var props=arguments.length<=0||arguments[0]===undefined?{}:arguments[0];if(!_.isObject(props))throw Error("argument 1 must be an object");_.each(props,function(v,k,i){if(!_.isFunction(v))throw Error("helper "+(i+1)+" must be a function");if(!_this.$$vm.$$dependencies[k])_this.$$vm.$$dependencies[k]=new Tracker.Dependency;_this.$$setFnHelper(k,v)})};$$Reactive.getReactively=function(k){var isDeep=arguments.length<=1||arguments[1]===undefined?false:arguments[1];if(!_.isBoolean(isDeep))throw Error("argument 2 must be a boolean");return this.$$reactivateEntity(k,this.$watch,isDeep)};$$Reactive.getCollectionReactively=function(k){return this.$$reactivateEntity(k,this.$watchCollection)};$$Reactive.$$reactivateEntity=function(k,watcher){if(!_.isString(k))throw Error("argument 1 must be a string");if(!this.$$vm.$$dependencies[k]){this.$$vm.$$dependencies[k]=new Tracker.Dependency;for(var _len=arguments.length,watcherArgs=Array(_len>2?_len-2:0),_key=2;_key<_len;_key++){watcherArgs[_key-2]=arguments[_key]}this.$$watchEntity.apply(this,[k,watcher].concat(watcherArgs))}this.$$vm.$$dependencies[k].depend();return $parse(k)(this.$$vm)};$$Reactive.$$watchEntity=function(k,watcher){var _this2=this;var getVal=_.partial($parse(k),this.$$vm);var initialVal=getVal();for(var _len2=arguments.length,watcherArgs=Array(_len2>2?_len2-2:0),_key2=2;_key2<_len2;_key2++){watcherArgs[_key2-2]=arguments[_key2]}watcher.call.apply(watcher,[this,getVal,function(val,oldVal){var hasChanged=val!==initialVal||val!==oldVal;if(hasChanged)_this2.$$changed(k)}].concat(watcherArgs))};$$Reactive.$$setFnHelper=function(k,fn){var _this3=this;this.autorun(function(computation){var model=fn.apply(_this3.$$vm);Tracker.nonreactive(function(){if($$utils.isCursor(model)){(function(){var observation=_this3.$$handleCursor(k,model);computation.onInvalidate(function(){observation.stop();_this3.$$vm[k].splice(0)})})()}else{_this3.$$handleNonCursor(k,model)}_this3.$$changed(k)})})};$$Reactive.$$setValHelper=function(k,v){var _this4=this;var watch=arguments.length<=2||arguments[2]===undefined?true:arguments[2];if(watch){var isDeep=_.isObject(v);this.getReactively(k,isDeep)}Object.defineProperty(this.$$vm,k,{configurable:true,enumerable:true,get:function(){return v},set:function(newVal){v=newVal;_this4.$$changed(k)}})};$$Reactive.$$handleCursor=function(k,cursor){var _this5=this;if(angular.isUndefined(this.$$vm[k])){this.$$setValHelper(k,cursor.fetch(),false)}else{var diff=jsondiffpatch.diff(this.$$vm[k],cursor.fetch());jsondiffpatch.patch(this.$$vm[k],diff)}var observation=cursor.observe({addedAt:function(doc,atIndex){if(!observation)return;_this5.$$vm[k].splice(atIndex,0,doc);_this5.$$changed(k)},changedAt:function(doc,oldDoc,atIndex){var diff=jsondiffpatch.diff(_this5.$$vm[k][atIndex],doc);jsondiffpatch.patch(_this5.$$vm[k][atIndex],diff);_this5.$$changed(k)},movedTo:function(doc,fromIndex,toIndex){_this5.$$vm[k].splice(fromIndex,1);_this5.$$vm[k].splice(toIndex,0,doc);_this5.$$changed(k)},removedAt:function(oldDoc,atIndex){_this5.$$vm[k].splice(atIndex,1);_this5.$$changed(k)}});return observation};$$Reactive.$$handleNonCursor=function(k,data){var v=this.$$vm[k];if(angular.isDefined(v)){delete this.$$vm[k];v=null}if(angular.isUndefined(v)){this.$$setValHelper(k,data)}else if($$utils.areSiblings(v,data)){var diff=jsondiffpatch.diff(v,data);jsondiffpatch.patch(v,diff);this.$$changed(k)}else{this.$$vm[k]=data}};$$Reactive.$$depend=function(k){this.$$vm.$$dependencies[k].depend()};$$Reactive.$$changed=function(k){this.$$throttledDigest();this.$$vm.$$dependencies[k].changed()};return $$Reactive}])}).call(this);(function(){angular.module("angular-meteor",["angular-meteor.utilities","angular-meteor.mixer","angular-meteor.scope","angular-meteor.core","angular-meteor.view-model","angular-meteor.reactive","angular-meteor.ironrouter","angular-meteor.utils","angular-meteor.subscribe","angular-meteor.collection","angular-meteor.object","angular-meteor.user","angular-meteor.methods","angular-meteor.session","angular-meteor.camera"]).constant("$angularMeteorSettings",{suppressWarnings:false}).run(["$Mixer","$$Core","$$ViewModel","$$Reactive",function($Mixer,$$Core,$$ViewModel,$$Reactive){$Mixer.mixin($$Core).mixin($$ViewModel).mixin($$Reactive)}]).service("$meteor",["$meteorCollection","$meteorCollectionFS","$meteorObject","$meteorMethods","$meteorSession","$meteorSubscribe","$meteorUtils","$meteorCamera","$meteorUser",function($meteorCollection,$meteorCollectionFS,$meteorObject,$meteorMethods,$meteorSession,$meteorSubscribe,$meteorUtils,$meteorCamera,$meteorUser){this.collection=$meteorCollection;this.collectionFS=$meteorCollectionFS;this.object=$meteorObject;this.subscribe=$meteorSubscribe.subscribe;this.call=$meteorMethods.call;this.loginWithPassword=$meteorUser.loginWithPassword;this.requireUser=$meteorUser.requireUser;this.requireValidUser=$meteorUser.requireValidUser;this.waitForUser=$meteorUser.waitForUser;this.createUser=$meteorUser.createUser;this.changePassword=$meteorUser.changePassword;this.forgotPassword=$meteorUser.forgotPassword;this.resetPassword=$meteorUser.resetPassword;this.verifyEmail=$meteorUser.verifyEmail;this.loginWithMeteorDeveloperAccount=$meteorUser.loginWithMeteorDeveloperAccount;this.loginWithFacebook=$meteorUser.loginWithFacebook;this.loginWithGithub=$meteorUser.loginWithGithub;this.loginWithGoogle=$meteorUser.loginWithGoogle;this.loginWithMeetup=$meteorUser.loginWithMeetup;this.loginWithTwitter=$meteorUser.loginWithTwitter;this.loginWithWeibo=$meteorUser.loginWithWeibo;this.logout=$meteorUser.logout;this.logoutOtherClients=$meteorUser.logoutOtherClients;this.session=$meteorSession;this.autorun=$meteorUtils.autorun;this.getCollectionByName=$meteorUtils.getCollectionByName;this.getPicture=$meteorCamera.getPicture}])}).call(this);if(typeof Package==="undefined")Package={};Package["angular-meteor-data"]={}})(); \ No newline at end of file +return this.processor.process(new PatchContext(left,delta))};DiffPatcher.prototype.reverse=function(delta){return this.processor.process(new ReverseContext(delta))};DiffPatcher.prototype.unpatch=function(right,delta){return this.patch(right,this.reverse(delta))};exports.DiffPatcher=DiffPatcher},{"./contexts/diff":4,"./contexts/patch":5,"./contexts/reverse":6,"./filters/arrays":10,"./filters/dates":11,"./filters/nested":13,"./filters/texts":14,"./filters/trivial":15,"./pipe":17,"./processor":18}],9:[function(require,module,exports){exports.isBrowser=typeof window!=="undefined"},{}],10:[function(require,module,exports){var DiffContext=require("../contexts/diff").DiffContext;var PatchContext=require("../contexts/patch").PatchContext;var ReverseContext=require("../contexts/reverse").ReverseContext;var lcs=require("./lcs");var ARRAY_MOVE=3;var isArray=typeof Array.isArray==="function"?Array.isArray:function(a){return a instanceof Array};var arrayIndexOf=typeof Array.prototype.indexOf==="function"?function(array,item){return array.indexOf(item)}:function(array,item){var length=array.length;for(var i=0;i0&&len2>0&&!matchContext.objectHash&&typeof matchContext.matchByPosition!=="boolean"){matchContext.matchByPosition=!arraysHaveMatchByRef(array1,array2,len1,len2)}while(commonHead0){for(var removeItemIndex1=0;removeItemIndex1=0;index--){index1=toRemove[index];var indexDiff=delta["_"+index1];var removedValue=array.splice(index1,1)[0];if(indexDiff[2]===ARRAY_MOVE){toInsert.push({index:indexDiff[1],value:removedValue})}}toInsert=toInsert.sort(compare.numericallyBy("index"));var toInsertLength=toInsert.length;for(index=0;index0){for(index=0;indexreverseIndex){reverseIndex++}else if(moveFromIndex>=reverseIndex&&moveToIndexmatrix[index1-1][index2]){return backtrack(matrix,array1,array2,index1,index2-1,context)}else{return backtrack(matrix,array1,array2,index1-1,index2,context)}};var get=function(array1,array2,match,context){context=context||{};var matrix=lengthMatrix(array1,array2,match||defaultMatch,context);var result=backtrack(matrix,array1,array2,array1.length,array2.length,context);if(typeof array1==="string"&&typeof array2==="string"){result.sequence=result.sequence.join("")}return result};exports.get=get},{}],13:[function(require,module,exports){var DiffContext=require("../contexts/diff").DiffContext;var PatchContext=require("../contexts/patch").PatchContext;var ReverseContext=require("../contexts/reverse").ReverseContext;var collectChildrenDiffFilter=function collectChildrenDiffFilter(context){if(!context||!context.children){return}var length=context.children.length;var child;var result=context.result;for(var index=0;index1)level=isShallow;else if(isShallow)level=1;if(level){src=utils.rip(src,level);dst=utils.rip(dst,level)}return compare(src,dst)};var compare=function compare(src,dst){var srcKeys=_.keys(src);var dstKeys=_.keys(dst);var keys=_.chain([]).concat(srcKeys).concat(dstKeys).uniq().without("$$hashKey").value();return keys.reduce(function(diff,k){var srcValue=src[k];var dstValue=dst[k];if(_.isDate(srcValue)&&_.isDate(dstValue)){if(srcValue.getTime()!=dstValue.getTime())diff[k]=dstValue}if(_.isObject(srcValue)&&_.isObject(dstValue)){var valueDiff=getDifference(srcValue,dstValue);utils.setFilled(diff,k,valueDiff)}else if(srcValue!==dstValue){diff[k]=dstValue}return diff},{})};return getDifference}();var getUpdates=function(){var getUpdates=function getUpdates(src,dst,isShallow){utils.assert(_.isObject(src),"first argument must be an object");utils.assert(_.isObject(dst),"second argument must be an object");var diff=getDifference(src,dst,isShallow);var paths=utils.toPaths(diff);var set=createSet(paths);var unset=createUnset(paths);var pull=createPull(unset);var updates={};utils.setFilled(updates,"$set",set);utils.setFilled(updates,"$unset",unset);utils.setFilled(updates,"$pull",pull);return updates};var createSet=function createSet(paths){var undefinedKeys=getUndefinedKeys(paths);return _.omit(paths,undefinedKeys)};var createUnset=function createUnset(paths){var undefinedKeys=getUndefinedKeys(paths);var unset=_.pick(paths,undefinedKeys);return _.reduce(unset,function(result,v,k){result[k]=true;return result},{})};var createPull=function createPull(unset){var arrKeyPaths=_.keys(unset).map(function(k){var split=k.match(/(.*)\.\d+$/);return split&&split[1]});return _.compact(arrKeyPaths).reduce(function(pull,k){pull[k]=null;return pull; +},{})};var getUndefinedKeys=function getUndefinedKeys(obj){return _.keys(obj).filter(function(k){var v=obj[k];return _.isUndefined(v)})};return getUpdates}();module.value("getUpdates",getUpdates)})()},function(module,exports){"use strict";var _module=angular.module("diffArray",["getUpdates"]);_module.factory("diffArray",["getUpdates",function(getUpdates){var LocalCollection=Package.minimongo.LocalCollection;var idStringify=LocalCollection._idStringify||Package["mongo-id"].MongoID.idStringify;var idParse=LocalCollection._idParse||Package["mongo-id"].MongoID.idParse;function diffArray(lastSeqArray,seqArray,callbacks,preventNestedDiff){preventNestedDiff=!!preventNestedDiff;var diffFn=Package.minimongo.LocalCollection._diffQueryOrderedChanges||Package["diff-sequence"].DiffSequence.diffQueryOrderedChanges;var oldObjIds=[];var newObjIds=[];var posOld={};var posNew={};var posCur={};var lengthCur=lastSeqArray.length;_.each(seqArray,function(doc,i){newObjIds.push({_id:doc._id});posNew[idStringify(doc._id)]=i});_.each(lastSeqArray,function(doc,i){oldObjIds.push({_id:doc._id});posOld[idStringify(doc._id)]=i;posCur[idStringify(doc._id)]=i});diffFn(oldObjIds,newObjIds,{addedBefore:function addedBefore(id,doc,before){var position=before?posCur[idStringify(before)]:lengthCur;_.each(posCur,function(pos,id){if(pos>=position)posCur[id]++});lengthCur++;posCur[idStringify(id)]=position;callbacks.addedAt(id,seqArray[posNew[idStringify(id)]],position,before)},movedBefore:function movedBefore(id,before){var prevPosition=posCur[idStringify(id)];var position=before?posCur[idStringify(before)]:lengthCur-1;_.each(posCur,function(pos,id){if(pos>=prevPosition&&pos<=position)posCur[id]--;else if(pos<=prevPosition&&pos>=position)posCur[id]++});posCur[idStringify(id)]=position;callbacks.movedTo(id,seqArray[posNew[idStringify(id)]],prevPosition,position,before)},removed:function removed(id){var prevPosition=posCur[idStringify(id)];_.each(posCur,function(pos,id){if(pos>=prevPosition)posCur[id]--});delete posCur[idStringify(id)];lengthCur--;callbacks.removedAt(id,lastSeqArray[posOld[idStringify(id)]],prevPosition)}});_.each(posNew,function(pos,idString){if(!_.has(posOld,idString))return;var id=idParse(idString);var newItem=seqArray[pos]||{};var oldItem=lastSeqArray[posOld[idString]];var updates=getUpdates(oldItem,newItem,preventNestedDiff);if(!_.isEmpty(updates))callbacks.changedAt(id,updates,pos,oldItem)})}diffArray.shallow=function(lastSeqArray,seqArray,callbacks){return diffArray(lastSeqArray,seqArray,callbacks,true)};diffArray.deepCopyChanges=function(oldItem,newItem){var setDiff=getUpdates(oldItem,newItem).$set;_.each(setDiff,function(v,deepKey){setDeep(oldItem,deepKey,v)})};diffArray.deepCopyRemovals=function(oldItem,newItem){var unsetDiff=getUpdates(oldItem,newItem).$unset;_.each(unsetDiff,function(v,deepKey){unsetDeep(oldItem,deepKey)})};diffArray.getChanges=function(newCollection,oldCollection,diffMethod){var changes={added:[],removed:[],changed:[]};diffMethod(oldCollection,newCollection,{addedAt:function addedAt(id,item,index){changes.added.push({item:item,index:index})},removedAt:function removedAt(id,item,index){changes.removed.push({item:item,index:index})},changedAt:function changedAt(id,updates,index,oldItem){changes.changed.push({selector:id,modifier:updates})},movedTo:function movedTo(id,item,fromIndex,toIndex){}});return changes};var setDeep=function setDeep(obj,deepKey,v){var split=deepKey.split(".");var initialKeys=_.initial(split);var lastKey=_.last(split);initialKeys.reduce(function(subObj,k,i){var nextKey=split[i+1];if(isNumStr(nextKey)){if(subObj[k]===null)subObj[k]=[];if(subObj[k].length==parseInt(nextKey))subObj[k].push(null)}else if(subObj[k]===null||!isHash(subObj[k])){subObj[k]={}}return subObj[k]},obj);var deepObj=getDeep(obj,initialKeys);deepObj[lastKey]=v;return v};var unsetDeep=function unsetDeep(obj,deepKey){var split=deepKey.split(".");var initialKeys=_.initial(split);var lastKey=_.last(split);var deepObj=getDeep(obj,initialKeys);if(_.isArray(deepObj)&&isNumStr(lastKey))return!!deepObj.splice(lastKey,1);else return delete deepObj[lastKey]};var getDeep=function getDeep(obj,keys){return keys.reduce(function(subObj,k){return subObj[k]},obj)};var isHash=function isHash(obj){return _.isObject(obj)&&Object.getPrototypeOf(obj)===Object.prototype};var isNumStr=function isNumStr(str){return str.match(/^\d+$/)};return diffArray}])},function(module,exports){"use strict";angular.module("angular-meteor.settings",[]).constant("$angularMeteorSettings",{suppressWarnings:false})},function(module,exports){"use strict";angular.module("angular-meteor.ironrouter",[]).run(["$compile","$document","$rootScope",function($compile,$document,$rootScope){var Router=(Package["iron:router"]||{}).Router;if(!Router)return;var isLoaded=false;Router.onAfterAction(function(req,res,next){Tracker.afterFlush(function(){if(isLoaded)return;$compile($document)($rootScope);if(!$rootScope.$$phase)$rootScope.$apply();isLoaded=true})})}])},function(module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};var angularMeteorUtils=angular.module("angular-meteor.utils",["angular-meteor.settings"]);angularMeteorUtils.service("$meteorUtils",["$q","$timeout","$angularMeteorSettings",function($q,$timeout,$angularMeteorSettings){var self=this;this.autorun=function(scope,fn){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.utils.autorun] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.6/autorun. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var comp=Tracker.autorun(function(c){fn(c);if(!c.firstRun)$timeout(angular.noop,0)});scope.$on("$destroy",function(){comp.stop()});return comp};this.stripDollarPrefixedKeys=function(data){if(!_.isObject(data)||data instanceof Date||data instanceof File||EJSON.toJSONValue(data).$type==="oid"||(typeof FS==="undefined"?"undefined":_typeof(FS))==="object"&&data instanceof FS.File)return data;var out=_.isArray(data)?[]:{};_.each(data,function(v,k){if(typeof k!=="string"||k.charAt(0)!=="$")out[k]=self.stripDollarPrefixedKeys(v)});return out};this.fulfill=function(deferred,boundError,boundResult){return function(err,result){if(err)deferred.reject(boundError==null?err:boundError);else if(typeof boundResult=="function")deferred.resolve(boundResult==null?result:boundResult(result));else deferred.resolve(boundResult==null?result:boundResult)}};this.promissor=function(obj,method){return function(){var deferred=$q.defer();var fulfill=self.fulfill(deferred);var args=_.toArray(arguments).concat(fulfill);obj[method].apply(obj,args);return deferred.promise}};this.promiseAll=function(promises){var allPromise=$q.all(promises);allPromise.finally(function(){$timeout(angular.noop)});return allPromise};this.getCollectionByName=function(string){return Mongo.Collection.get(string)};this.findIndexById=function(collection,doc){var foundDoc=_.find(collection,function(colDoc){return EJSON.equals(colDoc._id,doc._id)});return _.indexOf(collection,foundDoc)}}]);angularMeteorUtils.run(["$rootScope","$meteorUtils",function($rootScope,$meteorUtils){Object.getPrototypeOf($rootScope).$meteorAutorun=function(fn){return $meteorUtils.autorun(this,fn)}}])},function(module,exports){"use strict";var angularMeteorSubscribe=angular.module("angular-meteor.subscribe",["angular-meteor.settings"]);angularMeteorSubscribe.service("$meteorSubscribe",["$q","$angularMeteorSettings",function($q,$angularMeteorSettings){var self=this;this._subscribe=function(scope,deferred,args){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.subscribe] Please note that this module is deprecated since 1.3.0 and will be removed in 1.4.0! Replace it with the new syntax described here: http://www.angular-meteor.com/api/1.3.6/subscribe. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var subscription=null;var lastArg=args[args.length-1];if(angular.isObject(lastArg)&&angular.isFunction(lastArg.onStop)){var _onStop=lastArg.onStop;args.pop()}args.push({onReady:function onReady(){deferred.resolve(subscription)},onStop:function onStop(err){if(!deferred.promise.$$state.status){if(err)deferred.reject(err);else deferred.reject(new Meteor.Error("Subscription Stopped","Subscription stopped by a call to stop method. Either by the client or by the server."))}else if(_onStop)_onStop.apply(this,Array.prototype.slice.call(arguments))}});subscription=Meteor.subscribe.apply(scope,args);return subscription};this.subscribe=function(){var deferred=$q.defer();var args=Array.prototype.slice.call(arguments);var subscription=null;self._subscribe(this,deferred,args);return deferred.promise}}]);angularMeteorSubscribe.run(["$rootScope","$q","$meteorSubscribe",function($rootScope,$q,$meteorSubscribe){Object.getPrototypeOf($rootScope).$meteorSubscribe=function(){var deferred=$q.defer();var args=Array.prototype.slice.call(arguments);var subscription=$meteorSubscribe._subscribe(this,deferred,args);this.$on("$destroy",function(){subscription.stop()});return deferred.promise}}])},function(module,exports){"use strict";var angularMeteorCollection=angular.module("angular-meteor.collection",["angular-meteor.stopper","angular-meteor.subscribe","angular-meteor.utils","diffArray","angular-meteor.settings"]);angularMeteorCollection.factory("AngularMeteorCollection",["$q","$meteorSubscribe","$meteorUtils","$rootScope","$timeout","diffArray","$angularMeteorSettings",function($q,$meteorSubscribe,$meteorUtils,$rootScope,$timeout,diffArray,$angularMeteorSettings){function AngularMeteorCollection(curDefFunc,collection,diffArrayFunc,autoClientSave){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.$meteorCollection] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorCollection. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var data=[];data._serverBackup=[];data._diffArrayFunc=diffArrayFunc;data._hObserve=null;data._hNewCurAutorun=null;data._hDataAutorun=null;if(angular.isDefined(collection)){data.$$collection=collection}else{var cursor=curDefFunc();data.$$collection=$meteorUtils.getCollectionByName(cursor.collection.name)}_.extend(data,AngularMeteorCollection);data._startCurAutorun(curDefFunc,autoClientSave);return data}AngularMeteorCollection._startCurAutorun=function(curDefFunc,autoClientSave){var self=this;self._hNewCurAutorun=Tracker.autorun(function(){Tracker.onInvalidate(function(){self._stopCursor()});if(autoClientSave)self._setAutoClientSave();self._updateCursor(curDefFunc(),autoClientSave)})};AngularMeteorCollection.subscribe=function(){$meteorSubscribe.subscribe.apply(this,arguments);return this};AngularMeteorCollection.save=function(docs,useUnsetModifier){if(!docs)docs=this;docs=[].concat(docs);var promises=docs.map(function(doc){return this._upsertDoc(doc,useUnsetModifier)},this);return $meteorUtils.promiseAll(promises)};AngularMeteorCollection._upsertDoc=function(doc,useUnsetModifier){var deferred=$q.defer();var collection=this.$$collection;var createFulfill=_.partial($meteorUtils.fulfill,deferred,null);doc=$meteorUtils.stripDollarPrefixedKeys(doc);var docId=doc._id;var isExist=collection.findOne(docId);if(isExist){delete doc._id;var modifier=useUnsetModifier?{$unset:doc}:{$set:doc};collection.update(docId,modifier,createFulfill(function(){return{_id:docId,action:"updated"}}))}else{collection.insert(doc,createFulfill(function(id){return{_id:id,action:"inserted"}}))}return deferred.promise};AngularMeteorCollection._updateDiff=function(selector,update,callback){callback=callback||angular.noop;var setters=_.omit(update,"$pull");var updates=[setters];_.each(update.$pull,function(pull,prop){var puller={};puller[prop]=pull;updates.push({$pull:puller})});this._updateParallel(selector,updates,callback)};AngularMeteorCollection._updateParallel=function(selector,updates,callback){var self=this;var done=_.after(updates.length,callback);var next=function next(err,affectedDocsNum){if(err)return callback(err);done(null,affectedDocsNum)};_.each(updates,function(update){self.$$collection.update(selector,update,next)})};AngularMeteorCollection.remove=function(keyOrDocs){var keys;if(!keyOrDocs){keys=_.pluck(this,"_id")}else{keyOrDocs=[].concat(keyOrDocs);keys=_.map(keyOrDocs,function(keyOrDoc){return keyOrDoc._id||keyOrDoc})}check(keys,[Match.OneOf(String,Mongo.ObjectID)]);var promises=keys.map(function(key){return this._removeDoc(key)},this);return $meteorUtils.promiseAll(promises)};AngularMeteorCollection._removeDoc=function(id){var deferred=$q.defer();var collection=this.$$collection;var fulfill=$meteorUtils.fulfill(deferred,null,{_id:id,action:"removed"});collection.remove(id,fulfill);return deferred.promise};AngularMeteorCollection._updateCursor=function(cursor,autoClientSave){var self=this;if(self._hObserve)self._stopObserving();self._hObserve=cursor.observe({addedAt:function addedAt(doc,atIndex){self.splice(atIndex,0,doc);self._serverBackup.splice(atIndex,0,doc);self._setServerUpdateMode()},changedAt:function changedAt(doc,oldDoc,atIndex){diffArray.deepCopyChanges(self[atIndex],doc);diffArray.deepCopyRemovals(self[atIndex],doc);self._serverBackup[atIndex]=self[atIndex];self._setServerUpdateMode()},movedTo:function movedTo(doc,fromIndex,toIndex){self.splice(fromIndex,1);self.splice(toIndex,0,doc);self._serverBackup.splice(fromIndex,1);self._serverBackup.splice(toIndex,0,doc);self._setServerUpdateMode()},removedAt:function removedAt(oldDoc){var removedIndex=$meteorUtils.findIndexById(self,oldDoc);if(removedIndex!=-1){self.splice(removedIndex,1);self._serverBackup.splice(removedIndex,1);self._setServerUpdateMode()}else{removedIndex=$meteorUtils.findIndexById(self._serverBackup,oldDoc);if(removedIndex!=-1){self._serverBackup.splice(removedIndex,1)}}}});self._hDataAutorun=Tracker.autorun(function(){cursor.fetch();if(self._serverMode)self._unsetServerUpdateMode(autoClientSave)})};AngularMeteorCollection._stopObserving=function(){this._hObserve.stop();this._hDataAutorun.stop();delete this._serverMode;delete this._hUnsetTimeout};AngularMeteorCollection._setServerUpdateMode=function(name){this._serverMode=true;this._unsetAutoClientSave()};AngularMeteorCollection._unsetServerUpdateMode=function(autoClientSave){var self=this;if(self._hUnsetTimeout){$timeout.cancel(self._hUnsetTimeout);self._hUnsetTimeout=null}self._hUnsetTimeout=$timeout(function(){self._serverMode=false;var changes=diffArray.getChanges(self,self._serverBackup,self._diffArrayFunc);self._saveChanges(changes);if(autoClientSave)self._setAutoClientSave()},0)};AngularMeteorCollection.stop=function(){this._stopCursor();this._hNewCurAutorun.stop()};AngularMeteorCollection._stopCursor=function(){this._unsetAutoClientSave();if(this._hObserve){this._hObserve.stop();this._hDataAutorun.stop()}this.splice(0);this._serverBackup.splice(0)};AngularMeteorCollection._unsetAutoClientSave=function(name){if(this._hRegAutoBind){this._hRegAutoBind();this._hRegAutoBind=null}};AngularMeteorCollection._setAutoClientSave=function(){var self=this;self._unsetAutoClientSave();self._hRegAutoBind=$rootScope.$watch(function(){return self},function(nItems,oItems){if(nItems===oItems)return;var changes=diffArray.getChanges(self,oItems,self._diffArrayFunc);self._unsetAutoClientSave();self._saveChanges(changes);self._setAutoClientSave()},true)};AngularMeteorCollection._saveChanges=function(changes){var self=this;var addedDocs=changes.added.reverse().map(function(descriptor){self.splice(descriptor.index,1);return descriptor.item});if(addedDocs.length)self.save(addedDocs);var removedDocs=changes.removed.map(function(descriptor){return descriptor.item});if(removedDocs.length)self.remove(removedDocs);changes.changed.forEach(function(descriptor){self._updateDiff(descriptor.selector,descriptor.modifier)})};return AngularMeteorCollection}]);angularMeteorCollection.factory("$meteorCollectionFS",["$meteorCollection","diffArray","$angularMeteorSettings",function($meteorCollection,diffArray,$angularMeteorSettings){function $meteorCollectionFS(reactiveFunc,autoClientSave,collection){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.$meteorCollectionFS] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/files. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");return new $meteorCollection(reactiveFunc,autoClientSave,collection,diffArray.shallow)}return $meteorCollectionFS}]);angularMeteorCollection.factory("$meteorCollection",["AngularMeteorCollection","$rootScope","diffArray",function(AngularMeteorCollection,$rootScope,diffArray){function $meteorCollection(reactiveFunc,autoClientSave,collection,diffFn){if(!reactiveFunc){throw new TypeError("The first argument of $meteorCollection is undefined.")}if(!(angular.isFunction(reactiveFunc)||angular.isFunction(reactiveFunc.find))){throw new TypeError("The first argument of $meteorCollection must be a function or "+"a have a find function property.")}if(!angular.isFunction(reactiveFunc)){collection=angular.isDefined(collection)?collection:reactiveFunc;reactiveFunc=_.bind(reactiveFunc.find,reactiveFunc)}autoClientSave=angular.isDefined(autoClientSave)?autoClientSave:true;diffFn=diffFn||diffArray;return new AngularMeteorCollection(reactiveFunc,collection,diffFn,autoClientSave)}return $meteorCollection}]);angularMeteorCollection.run(["$rootScope","$meteorCollection","$meteorCollectionFS","$meteorStopper",function($rootScope,$meteorCollection,$meteorCollectionFS,$meteorStopper){var scopeProto=Object.getPrototypeOf($rootScope);scopeProto.$meteorCollection=$meteorStopper($meteorCollection);scopeProto.$meteorCollectionFS=$meteorStopper($meteorCollectionFS)}])},function(module,exports){"use strict";var angularMeteorObject=angular.module("angular-meteor.object",["angular-meteor.utils","angular-meteor.subscribe","angular-meteor.collection","getUpdates","diffArray","angular-meteor.settings"]);angularMeteorObject.factory("AngularMeteorObject",["$q","$meteorSubscribe","$meteorUtils","diffArray","getUpdates","AngularMeteorCollection","$angularMeteorSettings",function($q,$meteorSubscribe,$meteorUtils,diffArray,getUpdates,AngularMeteorCollection,$angularMeteorSettings){AngularMeteorObject.$$internalProps=["$$collection","$$options","$$id","$$hashkey","$$internalProps","$$scope","bind","save","reset","subscribe","stop","autorunComputation","unregisterAutoBind","unregisterAutoDestroy","getRawObject","_auto","_setAutos","_eventEmitter","_serverBackup","_updateDiff","_updateParallel","_getId"];function AngularMeteorObject(collection,selector,options){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.$meteorObject] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorObject. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var helpers=collection._helpers;var data=_.isFunction(helpers)?Object.create(helpers.prototype):{};var doc=collection.findOne(selector,options);var collectionExtension=_.pick(AngularMeteorCollection,"_updateParallel");_.extend(data,doc);_.extend(data,AngularMeteorObject);_.extend(data,collectionExtension);data.$$options=_.omit(options,"skip","limit");data.$$collection=collection;data.$$id=data._getId(selector);data._serverBackup=doc||{};return data}AngularMeteorObject.getRawObject=function(){return angular.copy(_.omit(this,this.$$internalProps))};AngularMeteorObject.subscribe=function(){$meteorSubscribe.subscribe.apply(this,arguments);return this};AngularMeteorObject.save=function(custom){var deferred=$q.defer();var collection=this.$$collection;var createFulfill=_.partial($meteorUtils.fulfill,deferred,null);var oldDoc=collection.findOne(this.$$id);var mods;if(oldDoc){if(custom)mods={$set:custom};else{mods=getUpdates(oldDoc,this.getRawObject());if(_.isEmpty(mods)){return $q.when({action:"updated"})}}this._updateDiff(mods,createFulfill({action:"updated"}))}else{if(custom)mods=_.clone(custom);else mods=this.getRawObject();mods._id=mods._id||this.$$id;collection.insert(mods,createFulfill({action:"inserted"}))}return deferred.promise};AngularMeteorObject._updateDiff=function(update,callback){var selector=this.$$id;AngularMeteorCollection._updateDiff.call(this,selector,update,callback)};AngularMeteorObject.reset=function(keepClientProps){var self=this;var options=this.$$options;var id=this.$$id;var doc=this.$$collection.findOne(id,options);if(doc){var docKeys=_.keys(doc);var docExtension=_.pick(doc,docKeys);var clientProps;_.extend(self,docExtension);_.extend(self._serverBackup,docExtension);if(keepClientProps){clientProps=_.intersection(_.keys(self),_.keys(self._serverBackup))}else{clientProps=_.keys(self)}var serverProps=_.keys(doc);var removedKeys=_.difference(clientProps,serverProps,self.$$internalProps);removedKeys.forEach(function(prop){delete self[prop];delete self._serverBackup[prop]})}else{_.keys(this.getRawObject()).forEach(function(prop){delete self[prop]});self._serverBackup={}}};AngularMeteorObject.stop=function(){if(this.unregisterAutoDestroy)this.unregisterAutoDestroy();if(this.unregisterAutoBind)this.unregisterAutoBind();if(this.autorunComputation&&this.autorunComputation.stop)this.autorunComputation.stop()};AngularMeteorObject._getId=function(selector){var options=_.extend({},this.$$options,{fields:{_id:1},reactive:false,transform:null});var doc=this.$$collection.findOne(selector,options);if(doc)return doc._id;if(selector instanceof Mongo.ObjectID)return selector;if(_.isString(selector))return selector;return new Mongo.ObjectID};return AngularMeteorObject}]);angularMeteorObject.factory("$meteorObject",["$rootScope","$meteorUtils","getUpdates","AngularMeteorObject",function($rootScope,$meteorUtils,getUpdates,AngularMeteorObject){function $meteorObject(collection,id,auto,options){if(!collection){throw new TypeError("The first argument of $meteorObject is undefined.")}if(!angular.isFunction(collection.findOne)){throw new TypeError("The first argument of $meteorObject must be a function or a have a findOne function property.")}var data=new AngularMeteorObject(collection,id,options);data._auto=auto!==false;_.extend(data,$meteorObject);data._setAutos();return data}$meteorObject._setAutos=function(){var self=this;this.autorunComputation=$meteorUtils.autorun($rootScope,function(){self.reset(true)});this.unregisterAutoBind=this._auto&&$rootScope.$watch(function(){return self.getRawObject()},function(item,oldItem){if(item!==oldItem)self.save()},true);this.unregisterAutoDestroy=$rootScope.$on("$destroy",function(){if(self&&self.stop)self.pop()})};return $meteorObject}]);angularMeteorObject.run(["$rootScope","$meteorObject","$meteorStopper",function($rootScope,$meteorObject,$meteorStopper){var scopeProto=Object.getPrototypeOf($rootScope);scopeProto.$meteorObject=$meteorStopper($meteorObject)}])},function(module,exports){"use strict";var angularMeteorUser=angular.module("angular-meteor.user",["angular-meteor.utils","angular-meteor.core","angular-meteor.settings"]);angularMeteorUser.service("$meteorUser",["$rootScope","$meteorUtils","$q","$angularMeteorSettings",function($rootScope,$meteorUtils,$q,$angularMeteorSettings){var pack=Package["accounts-base"];if(!pack)return;var self=this;var Accounts=pack.Accounts;this.waitForUser=function(){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.waitForUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var deferred=$q.defer();$meteorUtils.autorun($rootScope,function(){if(!Meteor.loggingIn())deferred.resolve(Meteor.user())},true);return deferred.promise};this.requireUser=function(){if(!$angularMeteorSettings.suppressWarnings){console.warn("[angular-meteor.requireUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings")}var deferred=$q.defer();$meteorUtils.autorun($rootScope,function(){if(!Meteor.loggingIn()){if(Meteor.user()===null)deferred.reject("AUTH_REQUIRED");else deferred.resolve(Meteor.user())}},true);return deferred.promise};this.requireValidUser=function(validatorFn){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.requireValidUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");return self.requireUser(true).then(function(user){var valid=validatorFn(user);if(valid===true)return user;else if(typeof valid==="string")return $q.reject(valid);else return $q.reject("FORBIDDEN")})};this.loginWithPassword=$meteorUtils.promissor(Meteor,"loginWithPassword");this.createUser=$meteorUtils.promissor(Accounts,"createUser");this.changePassword=$meteorUtils.promissor(Accounts,"changePassword");this.forgotPassword=$meteorUtils.promissor(Accounts,"forgotPassword");this.resetPassword=$meteorUtils.promissor(Accounts,"resetPassword");this.verifyEmail=$meteorUtils.promissor(Accounts,"verifyEmail");this.logout=$meteorUtils.promissor(Meteor,"logout");this.logoutOtherClients=$meteorUtils.promissor(Meteor,"logoutOtherClients");this.loginWithFacebook=$meteorUtils.promissor(Meteor,"loginWithFacebook");this.loginWithTwitter=$meteorUtils.promissor(Meteor,"loginWithTwitter");this.loginWithGoogle=$meteorUtils.promissor(Meteor,"loginWithGoogle");this.loginWithGithub=$meteorUtils.promissor(Meteor,"loginWithGithub");this.loginWithMeteorDeveloperAccount=$meteorUtils.promissor(Meteor,"loginWithMeteorDeveloperAccount");this.loginWithMeetup=$meteorUtils.promissor(Meteor,"loginWithMeetup");this.loginWithWeibo=$meteorUtils.promissor(Meteor,"loginWithWeibo")}]);angularMeteorUser.run(["$rootScope","$angularMeteorSettings","$$Core",function($rootScope,$angularMeteorSettings,$$Core){var ScopeProto=Object.getPrototypeOf($rootScope);_.extend(ScopeProto,$$Core);$rootScope.autorun(function(){if(!Meteor.user)return;$rootScope.currentUser=Meteor.user();$rootScope.loggingIn=Meteor.loggingIn()})}])},function(module,exports){"use strict";var angularMeteorMethods=angular.module("angular-meteor.methods",["angular-meteor.utils","angular-meteor.settings"]);angularMeteorMethods.service("$meteorMethods",["$q","$meteorUtils","$angularMeteorSettings",function($q,$meteorUtils,$angularMeteorSettings){this.call=function(){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.$meteor.call] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/methods. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var deferred=$q.defer();var fulfill=$meteorUtils.fulfill(deferred);var args=_.toArray(arguments).concat(fulfill);Meteor.call.apply(this,args);return deferred.promise}}])},function(module,exports){"use strict";var angularMeteorSession=angular.module("angular-meteor.session",["angular-meteor.utils","angular-meteor.settings"]);angularMeteorSession.factory("$meteorSession",["$meteorUtils","$parse","$angularMeteorSettings",function($meteorUtils,$parse,$angularMeteorSettings){return function(session){return{bind:function bind(scope,model){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.session.bind] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://www.angular-meteor.com/api/1.3.0/session. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var getter=$parse(model);var setter=getter.assign;$meteorUtils.autorun(scope,function(){setter(scope,Session.get(session))});scope.$watch(model,function(newItem,oldItem){Session.set(session,getter(scope))},true)}}}}])},function(module,exports){"use strict";var angularMeteorCamera=angular.module("angular-meteor.camera",["angular-meteor.utils","angular-meteor.settings"]);angularMeteorCamera.service("$meteorCamera",["$q","$meteorUtils","$angularMeteorSettings",function($q,$meteorUtils,$angularMeteorSettings){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var pack=Package["mdg:camera"];if(!pack)return;var MeteorCamera=pack.MeteorCamera;this.getPicture=function(options){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");options=options||{};var deferred=$q.defer();MeteorCamera.getPicture(options,$meteorUtils.fulfill(deferred));return deferred.promise}}])},function(module,exports){"use strict";var angularMeteorStopper=angular.module("angular-meteor.stopper",["angular-meteor.subscribe"]);angularMeteorStopper.factory("$meteorStopper",["$q","$meteorSubscribe",function($q,$meteorSubscribe){function $meteorStopper($meteorEntity){return function(){var args=Array.prototype.slice.call(arguments);var meteorEntity=$meteorEntity.apply(this,args);angular.extend(meteorEntity,$meteorStopper);meteorEntity.$$scope=this;this.$on("$destroy",function(){meteorEntity.stop();if(meteorEntity.subscription)meteorEntity.subscription.stop()});return meteorEntity}}$meteorStopper.subscribe=function(){var args=Array.prototype.slice.call(arguments);this.subscription=$meteorSubscribe._subscribe(this.$$scope,$q.defer(),args);return this};return $meteorStopper}])},function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var name=exports.name="angular-meteor.utilities";var utils=exports.utils="$$utils";angular.module(name,[]).service(utils,["$rootScope",function($rootScope){var self=this;this.isCursor=function(obj){return obj instanceof Meteor.Collection.Cursor};this.isScope=function(obj){return obj instanceof $rootScope.constructor};this.areSiblings=function(obj1,obj2){return _.isObject(obj1)&&_.isObject(obj2)&&Object.getPrototypeOf(obj1)===Object.getPrototypeOf(obj2)};this.bind=function(fn,context,tap){tap=_.isFunction(tap)?tap:angular.noop;if(_.isFunction(fn))return bindFn(fn,context,tap);if(_.isObject(fn))return bindObj(fn,context,tap);return fn};function bindFn(fn,context,tap){return function(){for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}var result=fn.apply(context,args);tap.call(context,{result:result,args:args});return result}}function bindObj(obj,context,tap){return _.keys(obj).reduce(function(bound,k){bound[k]=self.bind(obj[k],context,tap);return bound},{})}}])},function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key]}_this._mixins.filter(_.isFunction).forEach(function(mixin){mixin.call.apply(mixin,[context].concat(args))});return context};this._extend=function(obj){var _ref;return(_ref=_).extend.apply(_ref,[obj].concat(_toConsumableArray(_this._mixins)))}})},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.name=undefined;var _mixer=__webpack_require__(15);var name=exports.name="angular-meteor.scope";angular.module(name,[_mixer.name]).run(["$rootScope",_mixer.Mixer,function($rootScope,$Mixer){var Scope=$rootScope.constructor;var $new=$rootScope.$new;$Mixer._autoExtend.push(Scope.prototype);$Mixer._autoConstruct.push($rootScope);Scope.prototype.$new=function(){var scope=$new.apply(this,arguments);return $Mixer._construct(scope)}}])},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.Core=exports.name=undefined;var _utils=__webpack_require__(14);var _mixer=__webpack_require__(15);function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i2?_len-2:0),_key=2;_key<_len;_key++){watcherArgs[_key-2]=arguments[_key]}this.$$watchEntity.apply(this,[k,watcher].concat(watcherArgs))}this.$$vm.$$dependencies[k].depend();return $parse(k)(this.$$vm)};$$Reactive.$$watchEntity=function(k,watcher){var _this2=this;var getVal=_.partial($parse(k),this.$$vm);var initialVal=getVal();for(var _len2=arguments.length,watcherArgs=Array(_len2>2?_len2-2:0),_key2=2;_key2<_len2;_key2++){watcherArgs[_key2-2]=arguments[_key2]}watcher.call.apply(watcher,[this,getVal,function(val,oldVal){var hasChanged=val!==initialVal||val!==oldVal;if(hasChanged)_this2.$$changed(k)}].concat(watcherArgs))};$$Reactive.$$setFnHelper=function(k,fn){var _this3=this;this.autorun(function(computation){var model=fn.apply(_this3.$$vm);Tracker.nonreactive(function(){if($$utils.isCursor(model)){(function(){var observation=_this3.$$handleCursor(k,model);computation.onInvalidate(function(){observation.stop();_this3.$$vm[k].splice(0)})})()}else{_this3.$$handleNonCursor(k,model)}_this3.$$changed(k)})})};$$Reactive.$$setValHelper=function(k,v){var _this4=this;var watch=arguments.length<=2||arguments[2]===undefined?true:arguments[2];if(watch){var isDeep=_.isObject(v);this.getReactively(k,isDeep)}Object.defineProperty(this.$$vm,k,{configurable:true,enumerable:true,get:function get(){return v},set:function set(newVal){v=newVal;_this4.$$changed(k)}})};$$Reactive.$$handleCursor=function(k,cursor){var _this5=this;if(angular.isUndefined(this.$$vm[k])){this.$$setValHelper(k,cursor.fetch(),false)}else{var diff=jsondiffpatch.diff(this.$$vm[k],cursor.fetch());jsondiffpatch.patch(this.$$vm[k],diff)}var observation=cursor.observe({addedAt:function addedAt(doc,atIndex){if(!observation)return;_this5.$$vm[k].splice(atIndex,0,doc);_this5.$$changed(k)},changedAt:function changedAt(doc,oldDoc,atIndex){var diff=jsondiffpatch.diff(_this5.$$vm[k][atIndex],doc);jsondiffpatch.patch(_this5.$$vm[k][atIndex],diff);_this5.$$changed(k)},movedTo:function movedTo(doc,fromIndex,toIndex){_this5.$$vm[k].splice(fromIndex,1);_this5.$$vm[k].splice(toIndex,0,doc);_this5.$$changed(k)},removedAt:function removedAt(oldDoc,atIndex){_this5.$$vm[k].splice(atIndex,1);_this5.$$changed(k)}});return observation};$$Reactive.$$handleNonCursor=function(k,data){var v=this.$$vm[k];if(angular.isDefined(v)){delete this.$$vm[k];v=null}if(angular.isUndefined(v)){this.$$setValHelper(k,data)}else if($$utils.areSiblings(v,data)){var diff=jsondiffpatch.diff(v,data);jsondiffpatch.patch(v,diff);this.$$changed(k)}else{this.$$vm[k]=data}};$$Reactive.$$depend=function(k){this.$$vm.$$dependencies[k].depend()};$$Reactive.$$changed=function(k){this.$$throttledDigest();this.$$vm.$$dependencies[k].changed()};return $$Reactive}])},function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var name=exports.name="angular-templates";try{angular.module(name)}catch(e){angular.module(name,[])}}])}).call(this);if(typeof Package==="undefined")Package={};Package["angular-meteor-data"]={}})(); \ No newline at end of file diff --git a/dist/angular-meteor.min.js b/dist/angular-meteor.min.js index 55e99acc7..d5ba317e6 100644 --- a/dist/angular-meteor.min.js +++ b/dist/angular-meteor.min.js @@ -1,4 +1,4 @@ /*! angular-meteor v1.3.7-beta.1 */ -!function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(1),r(2),r(3),r(4),r(5),r(6),r(7),r(8),r(9),r(10),r(11),r(12);var n=r(13),o=r(14),i=r(15),a=r(16),s=r(17),u=r(18),c="angular-meteor";t["default"]=c,angular.module(c,[n.module,o.module,i.module,a.module,s.module,u.module,"angular-meteor.ironrouter","angular-meteor.utils","angular-meteor.subscribe","angular-meteor.collection","angular-meteor.object","angular-meteor.user","angular-meteor.methods","angular-meteor.session","angular-meteor.camera"]).constant("$angularMeteorSettings",{suppressWarnings:!1}).run([o.Mixer,a.Core,s.ViewModel,u.Reactive,function(e,t,r,n){e.mixin(t).mixin(r).mixin(n)}]).service("$meteor",["$meteorCollection","$meteorCollectionFS","$meteorObject","$meteorMethods","$meteorSession","$meteorSubscribe","$meteorUtils","$meteorCamera","$meteorUser",function(e,t,r,n,o,i,a,s,u){var c=this;this.collection=e,this.collectionFS=t,this.object=r,this.subscribe=i.subscribe,this.call=n.call,this.session=o,this.autorun=a.autorun,this.getCollectionByName=a.getCollectionByName,this.getPicture=s.getPicture,["loginWithPassword","requireUser","requireValidUser","waitForUser","createUser","changePassword","forgotPassword","resetPassword","verifyEmail","loginWithMeteorDeveloperAccount","loginWithFacebook","loginWithGithub","loginWithGoogle","loginWithMeetup","loginWithTwitter","loginWithWeibo","logout","logoutOtherClients"].forEach(function(e){c[e]=u[e]})}])},function(e,t){"use strict";!function(){var e=angular.module("getUpdates",[]),t=function(){var e=function s(e,t){return 1>t?{}:_.reduce(e,function(e,r,n){return r=_.isObject(r)?s(r,--t):r,e[n]=r,e},{})},t=function(e){var t=r(e),o=n(e);return _.object(t,o)},r=function u(e){var t=_.keys(e).map(function(t){var r=e[t];return!_.isObject(r)||_.isEmpty(r)||_.isArray(r)?t:u(r).map(function(e){return t+"."+e})});return _.flatten(t)},n=function c(e,t){return t=t||[],_.values(e).forEach(function(e){!_.isObject(e)||_.isEmpty(e)||_.isArray(e)?t.push(e):c(e,t)}),t},o=function(e,t,r){_.isEmpty(r)||(e[t]=r)},i=function(e,t){e||a(t)},a=function(e){throw Error("get-updates error - "+e)};return{rip:e,toPaths:t,getKeyPaths:r,getDeepValues:n,setFilled:o,assert:i,throwErr:a}}(),r=function(){var e=function(e,n,o){var i;return o>1?i=o:o&&(i=1),i&&(e=t.rip(e,i),n=t.rip(n,i)),r(e,n)},r=function(r,n){var o=_.keys(r),i=_.keys(n),a=_.chain([]).concat(o).concat(i).uniq().without("$$hashKey").value();return a.reduce(function(o,i){var a=r[i],s=n[i];if(_.isDate(a)&&_.isDate(s)&&a.getTime()!=s.getTime()&&(o[i]=s),_.isObject(a)&&_.isObject(s)){var u=e(a,s);t.setFilled(o,i,u)}else a!==s&&(o[i]=s);return o},{})};return e}(),n=function(){var e=function(e,a,s){t.assert(_.isObject(e),"first argument must be an object"),t.assert(_.isObject(a),"second argument must be an object");var u=r(e,a,s),c=t.toPaths(u),l=n(c),f=o(c),d=i(f),h={};return t.setFilled(h,"$set",l),t.setFilled(h,"$unset",f),t.setFilled(h,"$pull",d),h},n=function(e){var t=a(e);return _.omit(e,t)},o=function(e){var t=a(e),r=_.pick(e,t);return _.reduce(r,function(e,t,r){return e[r]=!0,e},{})},i=function(e){var t=_.keys(e).map(function(e){var t=e.match(/(.*)\.\d+$/);return t&&t[1]});return _.compact(t).reduce(function(e,t){return e[t]=null,e},{})},a=function(e){return _.keys(e).filter(function(t){var r=e[t];return _.isUndefined(r)})};return e}();e.value("getUpdates",n)}()},function(e,t){"use strict";var r=angular.module("diffArray",["getUpdates"]);r.factory("diffArray",["getUpdates",function(e){function t(t,r,i,a){a=!!a;var s=Package.minimongo.LocalCollection._diffQueryOrderedChanges||Package["diff-sequence"].DiffSequence.diffQueryOrderedChanges,u=[],c=[],l={},f={},d={},h=t.length;_.each(r,function(e,t){c.push({_id:e._id}),f[n(e._id)]=t}),_.each(t,function(e,t){u.push({_id:e._id}),l[n(e._id)]=t,d[n(e._id)]=t}),s(u,c,{addedBefore:function(e,t,o){var a=o?d[n(o)]:h;_.each(d,function(e,t){e>=a&&d[t]++}),h++,d[n(e)]=a,i.addedAt(e,r[f[n(e)]],a,o)},movedBefore:function(e,t){var o=d[n(e)],a=t?d[n(t)]:h-1;_.each(d,function(e,t){e>=o&&a>=e?d[t]--:o>=e&&e>=a&&d[t]++}),d[n(e)]=a,i.movedTo(e,r[f[n(e)]],o,a,t)},removed:function(e){var r=d[n(e)];_.each(d,function(e,t){e>=r&&d[t]--}),delete d[n(e)],h--,i.removedAt(e,t[l[n(e)]],r)}}),_.each(f,function(n,s){if(_.has(l,s)){var u=o(s),c=r[n]||{},f=t[l[s]],d=e(f,c,a);_.isEmpty(d)||i.changedAt(u,d,n,f)}})}var r=Package.minimongo.LocalCollection,n=r._idStringify||Package["mongo-id"].MongoID.idStringify,o=r._idParse||Package["mongo-id"].MongoID.idParse;t.shallow=function(e,r,n){return t(e,r,n,!0)},t.deepCopyChanges=function(t,r){var n=e(t,r).$set;_.each(n,function(e,r){i(t,r,e)})},t.deepCopyRemovals=function(t,r){var n=e(t,r).$unset;_.each(n,function(e,r){a(t,r)})},t.getChanges=function(e,t,r){var n={added:[],removed:[],changed:[]};return r(t,e,{addedAt:function(e,t,r){n.added.push({item:t,index:r})},removedAt:function(e,t,r){n.removed.push({item:t,index:r})},changedAt:function(e,t,r,o){n.changed.push({selector:e,modifier:t})},movedTo:function(e,t,r,n){}}),n};var i=function(e,t,r){var n=t.split("."),o=_.initial(n),i=_.last(n);o.reduce(function(e,t,r){var o=n[r+1];return c(o)?(null===e[t]&&(e[t]=[]),e[t].length==parseInt(o)&&e[t].push(null)):null!==e[t]&&u(e[t])||(e[t]={}),e[t]},e);var a=s(e,o);return a[i]=r,r},a=function(e,t){var r=t.split("."),n=_.initial(r),o=_.last(r),i=s(e,n);return _.isArray(i)&&c(o)?!!i.splice(o,1):delete i[o]},s=function(e,t){return t.reduce(function(e,t){return e[t]},e)},u=function(e){return _.isObject(e)&&Object.getPrototypeOf(e)===Object.prototype},c=function(e){return e.match(/^\d+$/)};return t}])},function(e,t){"use strict";angular.module("angular-meteor.ironrouter",[]).run(["$compile","$document","$rootScope",function(e,t,r){var n=(Package["iron:router"]||{}).Router;if(n){var o=!1;n.onAfterAction(function(n,i,a){Tracker.afterFlush(function(){o||(e(t)(r),r.$$phase||r.$apply(),o=!0)})})}}])},function(e,t){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},n=angular.module("angular-meteor.utils",[]);n.service("$meteorUtils",["$q","$timeout","$angularMeteorSettings",function(e,t,n){var o=this;this.autorun=function(e,r){n.suppressWarnings||console.warn("[angular-meteor.utils.autorun] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.6/autorun. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var o=Tracker.autorun(function(e){r(e),e.firstRun||t(angular.noop,0)});return e.$on("$destroy",function(){o.stop()}),o},this.stripDollarPrefixedKeys=function(e){if(!_.isObject(e)||e instanceof Date||e instanceof File||"oid"===EJSON.toJSONValue(e).$type||"object"===("undefined"==typeof FS?"undefined":r(FS))&&e instanceof FS.File)return e;var t=_.isArray(e)?[]:{};return _.each(e,function(e,r){("string"!=typeof r||"$"!==r.charAt(0))&&(t[r]=o.stripDollarPrefixedKeys(e))}),t},this.fulfill=function(e,t,r){return function(n,o){n?e.reject(null===t?n:t):"function"==typeof r?e.resolve(null===r?o:r(o)):e.resolve(null===r?o:r)}},this.promissor=function(t,r){return function(){var n=e.defer(),i=o.fulfill(n),a=_.toArray(arguments).concat(i);return t[r].apply(t,a),n.promise}},this.promiseAll=function(r){var n=e.all(r);return n["finally"](function(){t(angular.noop)}),n},this.getCollectionByName=function(e){return Mongo.Collection.get(e)},this.findIndexById=function(e,t){var r=_.find(e,function(e){return EJSON.equals(e._id,t._id)});return _.indexOf(e,r)}}]),n.run(["$rootScope","$meteorUtils",function(e,t){Object.getPrototypeOf(e).$meteorAutorun=function(e){return t.autorun(this,e)}}])},function(e,t){"use strict";var r=angular.module("angular-meteor.subscribe",[]);r.service("$meteorSubscribe",["$q","$angularMeteorSettings",function(e,t){var r=this;this._subscribe=function(e,r,n){t.suppressWarnings||console.warn("[angular-meteor.subscribe] Please note that this module is deprecated since 1.3.0 and will be removed in 1.4.0! Replace it with the new syntax described here: http://www.angular-meteor.com/api/1.3.6/subscribe. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var o=null,i=n[n.length-1];if(angular.isObject(i)&&angular.isFunction(i.onStop)){var a=i.onStop;n.pop()}return n.push({onReady:function(){r.resolve(o)},onStop:function(e){r.promise.$$state.status?a&&a.apply(this,Array.prototype.slice.call(arguments)):e?r.reject(e):r.reject(new Meteor.Error("Subscription Stopped","Subscription stopped by a call to stop method. Either by the client or by the server."))}}),o=Meteor.subscribe.apply(e,n)},this.subscribe=function(){var t=e.defer(),n=Array.prototype.slice.call(arguments);return r._subscribe(this,t,n),t.promise}}]),r.run(["$rootScope","$q","$meteorSubscribe",function(e,t,r){Object.getPrototypeOf(e).$meteorSubscribe=function(){var e=t.defer(),n=Array.prototype.slice.call(arguments),o=r._subscribe(this,e,n);return this.$on("$destroy",function(){o.stop()}),e.promise}}])},function(e,t){"use strict";var r=angular.module("angular-meteor.collection",["angular-meteor.stopper","angular-meteor.subscribe","angular-meteor.utils","diffArray"]);r.factory("AngularMeteorCollection",["$q","$meteorSubscribe","$meteorUtils","$rootScope","$timeout","diffArray","$angularMeteorSettings",function(e,t,r,n,o,i,a){function s(e,t,n,o){a.suppressWarnings||console.warn("[angular-meteor.$meteorCollection] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorCollection. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var i=[];if(i._serverBackup=[],i._diffArrayFunc=n,i._hObserve=null,i._hNewCurAutorun=null,i._hDataAutorun=null,angular.isDefined(t))i.$$collection=t;else{var u=e();i.$$collection=r.getCollectionByName(u.collection.name)}return _.extend(i,s),i._startCurAutorun(e,o),i}return s._startCurAutorun=function(e,t){var r=this;r._hNewCurAutorun=Tracker.autorun(function(){Tracker.onInvalidate(function(){r._stopCursor()}),t&&r._setAutoClientSave(),r._updateCursor(e(),t)})},s.subscribe=function(){return t.subscribe.apply(this,arguments),this},s.save=function(e,t){e||(e=this),e=[].concat(e);var n=e.map(function(e){return this._upsertDoc(e,t)},this);return r.promiseAll(n)},s._upsertDoc=function(t,n){var o=e.defer(),i=this.$$collection,a=_.partial(r.fulfill,o,null);t=r.stripDollarPrefixedKeys(t);var s=t._id,u=i.findOne(s);if(u){delete t._id;var c=n?{$unset:t}:{$set:t};i.update(s,c,a(function(){return{_id:s,action:"updated"}}))}else i.insert(t,a(function(e){return{_id:e,action:"inserted"}}));return o.promise},s._updateDiff=function(e,t,r){r=r||angular.noop;var n=_.omit(t,"$pull"),o=[n];_.each(t.$pull,function(e,t){var r={};r[t]=e,o.push({$pull:r})}),this._updateParallel(e,o,r)},s._updateParallel=function(e,t,r){var n=this,o=_.after(t.length,r),i=function(e,t){return e?r(e):void o(null,t)};_.each(t,function(t){n.$$collection.update(e,t,i)})},s.remove=function(e){var t;e?(e=[].concat(e),t=_.map(e,function(e){return e._id||e})):t=_.pluck(this,"_id"),check(t,[Match.OneOf(String,Mongo.ObjectID)]);var n=t.map(function(e){return this._removeDoc(e)},this);return r.promiseAll(n)},s._removeDoc=function(t){var n=e.defer(),o=this.$$collection,i=r.fulfill(n,null,{_id:t,action:"removed"});return o.remove(t,i),n.promise},s._updateCursor=function(e,t){var n=this;n._hObserve&&n._stopObserving(),n._hObserve=e.observe({addedAt:function(e,t){n.splice(t,0,e),n._serverBackup.splice(t,0,e),n._setServerUpdateMode()},changedAt:function(e,t,r){i.deepCopyChanges(n[r],e),i.deepCopyRemovals(n[r],e),n._serverBackup[r]=n[r],n._setServerUpdateMode()},movedTo:function(e,t,r){n.splice(t,1),n.splice(r,0,e),n._serverBackup.splice(t,1),n._serverBackup.splice(r,0,e),n._setServerUpdateMode()},removedAt:function(e){var t=r.findIndexById(n,e);-1!=t?(n.splice(t,1),n._serverBackup.splice(t,1),n._setServerUpdateMode()):(t=r.findIndexById(n._serverBackup,e),-1!=t&&n._serverBackup.splice(t,1))}}),n._hDataAutorun=Tracker.autorun(function(){e.fetch(),n._serverMode&&n._unsetServerUpdateMode(t)})},s._stopObserving=function(){this._hObserve.stop(),this._hDataAutorun.stop(),delete this._serverMode,delete this._hUnsetTimeout},s._setServerUpdateMode=function(e){this._serverMode=!0,this._unsetAutoClientSave()},s._unsetServerUpdateMode=function(e){var t=this;t._hUnsetTimeout&&(o.cancel(t._hUnsetTimeout),t._hUnsetTimeout=null),t._hUnsetTimeout=o(function(){t._serverMode=!1;var r=i.getChanges(t,t._serverBackup,t._diffArrayFunc);t._saveChanges(r),e&&t._setAutoClientSave()},0)},s.stop=function(){this._stopCursor(),this._hNewCurAutorun.stop()},s._stopCursor=function(){this._unsetAutoClientSave(),this._hObserve&&(this._hObserve.stop(),this._hDataAutorun.stop()),this.splice(0),this._serverBackup.splice(0)},s._unsetAutoClientSave=function(e){this._hRegAutoBind&&(this._hRegAutoBind(),this._hRegAutoBind=null)},s._setAutoClientSave=function(){var e=this;e._unsetAutoClientSave(),e._hRegAutoBind=n.$watch(function(){return e},function(t,r){if(t!==r){var n=i.getChanges(e,r,e._diffArrayFunc);e._unsetAutoClientSave(),e._saveChanges(n),e._setAutoClientSave()}},!0)},s._saveChanges=function(e){var t=this,r=e.added.reverse().map(function(e){return t.splice(e.index,1),e.item});r.length&&t.save(r);var n=e.removed.map(function(e){return e.item});n.length&&t.remove(n),e.changed.forEach(function(e){t._updateDiff(e.selector,e.modifier)})},s}]),r.factory("$meteorCollectionFS",["$meteorCollection","diffArray","$angularMeteorSettings",function(e,t,r){function n(n,o,i){return r.suppressWarnings||console.warn("[angular-meteor.$meteorCollectionFS] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/files. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings"),new e(n,o,i,t.shallow)}return n}]),r.factory("$meteorCollection",["AngularMeteorCollection","$rootScope","diffArray",function(e,t,r){function n(t,n,o,i){if(!t)throw new TypeError("The first argument of $meteorCollection is undefined.");if(!angular.isFunction(t)&&!angular.isFunction(t.find))throw new TypeError("The first argument of $meteorCollection must be a function or a have a find function property.");return angular.isFunction(t)||(o=angular.isDefined(o)?o:t,t=_.bind(t.find,t)),n=angular.isDefined(n)?n:!0,i=i||r,new e(t,o,i,n)}return n}]),r.run(["$rootScope","$meteorCollection","$meteorCollectionFS","$meteorStopper",function(e,t,r,n){var o=Object.getPrototypeOf(e);o.$meteorCollection=n(t),o.$meteorCollectionFS=n(r)}])},function(e,t){"use strict";var r=angular.module("angular-meteor.object",["angular-meteor.utils","angular-meteor.subscribe","angular-meteor.collection","getUpdates","diffArray"]);r.factory("AngularMeteorObject",["$q","$meteorSubscribe","$meteorUtils","diffArray","getUpdates","AngularMeteorCollection","$angularMeteorSettings",function(e,t,r,n,o,i,a){function s(e,t,r){a.suppressWarnings||console.warn("[angular-meteor.$meteorObject] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorObject. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var n=e._helpers,o=_.isFunction(n)?Object.create(n.prototype):{},u=e.findOne(t,r),c=_.pick(i,"_updateParallel");return _.extend(o,u),_.extend(o,s),_.extend(o,c),o.$$options=_.omit(r,"skip","limit"),o.$$collection=e,o.$$id=o._getId(t),o._serverBackup=u||{},o}return s.$$internalProps=["$$collection","$$options","$$id","$$hashkey","$$internalProps","$$scope","bind","save","reset","subscribe","stop","autorunComputation","unregisterAutoBind","unregisterAutoDestroy","getRawObject","_auto","_setAutos","_eventEmitter","_serverBackup","_updateDiff","_updateParallel","_getId"],s.getRawObject=function(){return angular.copy(_.omit(this,this.$$internalProps))},s.subscribe=function(){return t.subscribe.apply(this,arguments),this},s.save=function(t){var n,i=e.defer(),a=this.$$collection,s=_.partial(r.fulfill,i,null),u=a.findOne(this.$$id);if(u){if(t)n={$set:t};else if(n=o(u,this.getRawObject()),_.isEmpty(n))return e.when({action:"updated"});this._updateDiff(n,s({action:"updated"}))}else n=t?_.clone(t):this.getRawObject(),n._id=n._id||this.$$id,a.insert(n,s({action:"inserted"}));return i.promise},s._updateDiff=function(e,t){var r=this.$$id;i._updateDiff.call(this,r,e,t)},s.reset=function(e){var t=this,r=this.$$options,n=this.$$id,o=this.$$collection.findOne(n,r);if(o){var i,a=_.keys(o),s=_.pick(o,a);_.extend(t,s),_.extend(t._serverBackup,s),i=e?_.intersection(_.keys(t),_.keys(t._serverBackup)):_.keys(t);var u=_.keys(o),c=_.difference(i,u,t.$$internalProps);c.forEach(function(e){delete t[e],delete t._serverBackup[e]})}else _.keys(this.getRawObject()).forEach(function(e){delete t[e]}),t._serverBackup={}},s.stop=function(){this.unregisterAutoDestroy&&this.unregisterAutoDestroy(),this.unregisterAutoBind&&this.unregisterAutoBind(),this.autorunComputation&&this.autorunComputation.stop&&this.autorunComputation.stop()},s._getId=function(e){var t=_.extend({},this.$$options,{fields:{_id:1},reactive:!1,transform:null}),r=this.$$collection.findOne(e,t);return r?r._id:e instanceof Mongo.ObjectID?e:_.isString(e)?e:new Mongo.ObjectID},s}]),r.factory("$meteorObject",["$rootScope","$meteorUtils","getUpdates","AngularMeteorObject",function(e,t,r,n){function o(e,t,r,i){if(!e)throw new TypeError("The first argument of $meteorObject is undefined.");if(!angular.isFunction(e.findOne))throw new TypeError("The first argument of $meteorObject must be a function or a have a findOne function property.");var a=new n(e,t,i);return a._auto=r!==!1,_.extend(a,o),a._setAutos(),a}return o._setAutos=function(){var r=this;this.autorunComputation=t.autorun(e,function(){r.reset(!0)}),this.unregisterAutoBind=this._auto&&e.$watch(function(){return r.getRawObject()},function(e,t){e!==t&&r.save()},!0),this.unregisterAutoDestroy=e.$on("$destroy",function(){r&&r.stop&&r.pop()})},o}]),r.run(["$rootScope","$meteorObject","$meteorStopper",function(e,t,r){var n=Object.getPrototypeOf(e);n.$meteorObject=r(t)}])},function(e,t){"use strict";var r=angular.module("angular-meteor.user",["angular-meteor.utils","angular-meteor.core"]);r.service("$meteorUser",["$rootScope","$meteorUtils","$q","$angularMeteorSettings",function(e,t,r,n){var o=Package["accounts-base"];if(o){var i=this,a=o.Accounts;this.waitForUser=function(){n.suppressWarnings||console.warn("[angular-meteor.waitForUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var o=r.defer();return t.autorun(e,function(){Meteor.loggingIn()||o.resolve(Meteor.user())},!0),o.promise},this.requireUser=function(){n.suppressWarnings||console.warn("[angular-meteor.requireUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var o=r.defer();return t.autorun(e,function(){Meteor.loggingIn()||(null===Meteor.user()?o.reject("AUTH_REQUIRED"):o.resolve(Meteor.user()))},!0),o.promise},this.requireValidUser=function(e){return n.suppressWarnings||console.warn("[angular-meteor.requireValidUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings"),i.requireUser(!0).then(function(t){var n=e(t);return n===!0?t:"string"==typeof n?r.reject(n):r.reject("FORBIDDEN")})},this.loginWithPassword=t.promissor(Meteor,"loginWithPassword"),this.createUser=t.promissor(a,"createUser"),this.changePassword=t.promissor(a,"changePassword"),this.forgotPassword=t.promissor(a,"forgotPassword"),this.resetPassword=t.promissor(a,"resetPassword"),this.verifyEmail=t.promissor(a,"verifyEmail"),this.logout=t.promissor(Meteor,"logout"),this.logoutOtherClients=t.promissor(Meteor,"logoutOtherClients"),this.loginWithFacebook=t.promissor(Meteor,"loginWithFacebook"),this.loginWithTwitter=t.promissor(Meteor,"loginWithTwitter"),this.loginWithGoogle=t.promissor(Meteor,"loginWithGoogle"),this.loginWithGithub=t.promissor(Meteor,"loginWithGithub"),this.loginWithMeteorDeveloperAccount=t.promissor(Meteor,"loginWithMeteorDeveloperAccount"),this.loginWithMeetup=t.promissor(Meteor,"loginWithMeetup"),this.loginWithWeibo=t.promissor(Meteor,"loginWithWeibo")}}]),r.run(["$rootScope","$angularMeteorSettings","$$Core",function(e,t,r){var n=Object.getPrototypeOf(e);_.extend(n,r),e.autorun(function(){Meteor.user&&(e.currentUser=Meteor.user(),e.loggingIn=Meteor.loggingIn())})}])},function(e,t){"use strict";var r=angular.module("angular-meteor.methods",["angular-meteor.utils"]);r.service("$meteorMethods",["$q","$meteorUtils","$angularMeteorSettings",function(e,t,r){this.call=function(){r.suppressWarnings||console.warn("[angular-meteor.$meteor.call] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/methods. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var n=e.defer(),o=t.fulfill(n),i=_.toArray(arguments).concat(o);return Meteor.call.apply(this,i),n.promise}}])},function(e,t){"use strict";var r=angular.module("angular-meteor.session",["angular-meteor.utils"]);r.factory("$meteorSession",["$meteorUtils","$parse","$angularMeteorSettings",function(e,t,r){return function(n){return{bind:function(o,i){r.suppressWarnings||console.warn("[angular-meteor.session.bind] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://www.angular-meteor.com/api/1.3.0/session. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var a=t(i),s=a.assign;e.autorun(o,function(){s(o,Session.get(n))}),o.$watch(i,function(e,t){Session.set(n,a(o))},!0)}}}}])},function(e,t){"use strict";var r=angular.module("angular-meteor.camera",["angular-meteor.utils"]);r.service("$meteorCamera",["$q","$meteorUtils","$angularMeteorSettings",function(e,t,r){r.suppressWarnings||console.warn("[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var n=Package["mdg:camera"];if(n){var o=n.MeteorCamera;this.getPicture=function(n){r.suppressWarnings||console.warn("[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings"),n=n||{};var i=e.defer();return o.getPicture(n,t.fulfill(i)),i.promise}}}])},function(e,t){"use strict";var r=angular.module("angular-meteor.stopper",["angular-meteor.subscribe"]);r.factory("$meteorStopper",["$q","$meteorSubscribe",function(e,t){function r(e){return function(){var t=Array.prototype.slice.call(arguments),n=e.apply(this,t);return angular.extend(n,r),n.$$scope=this,this.$on("$destroy",function(){n.stop(),n.subscription&&n.subscription.stop()}),n}}return r.subscribe=function(){var r=Array.prototype.slice.call(arguments);return this.subscription=t._subscribe(this.$$scope,e.defer(),r),this},r}])},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="angular-meteor.utilities";t.module=r;var n=t.utils="$$utils";angular.module(r,[]).service(n,["$rootScope",function(e){var t=this;this.isCursor=function(e){return e instanceof Meteor.Collection.Cursor},this.isScope=function(t){return t instanceof e.constructor},this.areSiblings=function(e,t){return _.isObject(e)&&_.isObject(t)&&Object.getPrototypeOf(e)===Object.getPrototypeOf(t)},this.bind=function(e,t,o){return o=_.isFunction(o)?o:angular.noop,_.isFunction(e)?r(e,t,o):_.isObject(e)?n(e,t,o):e};var r=function(e,t,r){return function(){for(var n=arguments.length,o=Array(n),i=0;n>i;i++)o[i]=arguments[i];var a=e.apply(t,o);return r.call(t,{result:a,args:o}),a}},n=function(e,r,n){return _.keys(e).reduce(function(o,i){return o[i]=t.bind(e[i],r,n),o},{})}}])},function(e,t){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t1?r-1:0),o=1;r>o;o++)n[o-1]=arguments[o];return e._mixins.filter(_.isFunction).forEach(function(e){e.call.apply(e,[t].concat(n))}),t},this._extend=function(t){var n;return(n=_).extend.apply(n,[t].concat(r(e._mixins)))}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.module=void 0;var n=r(14),o="angular-meteor.scope";t.module=o,angular.module(o,[n.module]).run(["$rootScope",n.Mixer,function(e,t){var r=e.constructor,n=e.$new;r.prototype.$new=function(r,o){var i=this===e&&!this.$$ChildScope,a=n.call(this,r,o);return r?t._extend(a):i&&(a.__proto__=this.$$ChildScope.prototype=t._extend(Object.create(this))),t._construct(a)}}])},function(e,t,r){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);tn;n++)r[n]=arguments[n];var o=r.pop();return _.isFunction(o)&&(o=this.$bindToContext(o)),(e=Meteor).call.apply(e,r.concat([o]))},r.applyMethod=function(){for(var e,t=arguments.length,r=Array(t),n=0;t>n;n++)r[n]=arguments[n];var o=r.pop();return _.isFunction(o)&&(o=this.$bindToContext(o)),(e=Meteor).apply.apply(e,r.concat([o]))},r.$$autoStop=function(e){this.$on("$destroy",e.stop.bind(e))},r.$$throttledDigest=function(){var e=!this.$$destroyed&&!this.$$phase&&!this.$root.$$phase;e&&this.$digest()},r.$$defer=function(){var t=e.defer();return t.promise=t.promise["finally"](this.$$throttledDigest.bind(this)),t},r.$bindToContext=function(e){return t.bind(e,this,this.$$throttledDigest.bind(this))},r}])},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.reactive=t.ViewModel=t.module=void 0;var o=function(){function e(e,t){for(var r=0;r2?n-2:0),i=2;n>i;i++)o[i-2]=arguments[i];this.$$watchEntity.apply(this,[t,r].concat(o))}return this.$$vm.$$dependencies[t].depend(),e(t)(this.$$vm)},n.$$watchEntity=function(t,r){for(var n=this,o=_.partial(e(t),this.$$vm),i=o(),a=arguments.length,s=Array(a>2?a-2:0),u=2;a>u;u++)s[u-2]=arguments[u];r.call.apply(r,[this,o,function(e,r){var o=e!==i||e!==r;o&&n.$$changed(t)}].concat(s))},n.$$setFnHelper=function(e,r){var n=this;this.autorun(function(o){var i=r.apply(n.$$vm);Tracker.nonreactive(function(){t.isCursor(i)?!function(){var t=n.$$handleCursor(e,i);o.onInvalidate(function(){t.stop(),n.$$vm[e].splice(0); -})}():n.$$handleNonCursor(e,i),n.$$changed(e)})})},n.$$setValHelper=function(e,t){var r=this,n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];if(n){var o=_.isObject(t);this.getReactively(e,o)}Object.defineProperty(this.$$vm,e,{configurable:!0,enumerable:!0,get:function(){return t},set:function(n){t=n,r.$$changed(e)}})},n.$$handleCursor=function(e,t){var r=this;if(angular.isUndefined(this.$$vm[e]))this.$$setValHelper(e,t.fetch(),!1);else{var n=jsondiffpatch.diff(this.$$vm[e],t.fetch());jsondiffpatch.patch(this.$$vm[e],n)}var o=t.observe({addedAt:function(t,n){o&&(r.$$vm[e].splice(n,0,t),r.$$changed(e))},changedAt:function(t,n,o){var i=jsondiffpatch.diff(r.$$vm[e][o],t);jsondiffpatch.patch(r.$$vm[e][o],i),r.$$changed(e)},movedTo:function(t,n,o){r.$$vm[e].splice(n,1),r.$$vm[e].splice(o,0,t),r.$$changed(e)},removedAt:function(t,n){r.$$vm[e].splice(n,1),r.$$changed(e)}});return o},n.$$handleNonCursor=function(e,r){var n=this.$$vm[e];if(angular.isDefined(n)&&(delete this.$$vm[e],n=null),angular.isUndefined(n))this.$$setValHelper(e,r);else if(t.areSiblings(n,r)){var o=jsondiffpatch.diff(n,r);jsondiffpatch.patch(n,o),this.$$changed(e)}else this.$$vm[e]=r},n.$$depend=function(e){this.$$vm.$$dependencies[e].depend()},n.$$changed=function(e){this.$$throttledDigest(),this.$$vm.$$dependencies[e].changed()},n}])}]); +!function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.name=void 0,r(1),r(2),r(3),r(4),r(5),r(6),r(7),r(8),r(9),r(10),r(11),r(12),r(13);var n=r(14),o=r(15),i=r(16),a=r(17),s=r(18),u=r(19),c=r(20),l=t.name="angular-meteor";angular.module(l,[n.name,o.name,i.name,a.name,s.name,u.name,c.name,"angular-meteor.ironrouter","angular-meteor.utils","angular-meteor.subscribe","angular-meteor.collection","angular-meteor.object","angular-meteor.user","angular-meteor.methods","angular-meteor.session","angular-meteor.camera"]).run([o.Mixer,a.Core,s.ViewModel,u.Reactive,function(e,t,r,n){e.mixin(t).mixin(r).mixin(n)}]).service("$meteor",["$meteorCollection","$meteorCollectionFS","$meteorObject","$meteorMethods","$meteorSession","$meteorSubscribe","$meteorUtils","$meteorCamera","$meteorUser",function(e,t,r,n,o,i,a,s,u){var c=this;this.collection=e,this.collectionFS=t,this.object=r,this.subscribe=i.subscribe,this.call=n.call,this.session=o,this.autorun=a.autorun,this.getCollectionByName=a.getCollectionByName,this.getPicture=s.getPicture,["loginWithPassword","requireUser","requireValidUser","waitForUser","createUser","changePassword","forgotPassword","resetPassword","verifyEmail","loginWithMeteorDeveloperAccount","loginWithFacebook","loginWithGithub","loginWithGoogle","loginWithMeetup","loginWithTwitter","loginWithWeibo","logout","logoutOtherClients"].forEach(function(e){c[e]=u[e]})}])},function(e,t){"use strict";!function(){var e=angular.module("getUpdates",[]),t=function(){var e=function s(e,t){return 1>t?{}:_.reduce(e,function(e,r,n){return r=_.isObject(r)?s(r,--t):r,e[n]=r,e},{})},t=function(e){var t=r(e),o=n(e);return _.object(t,o)},r=function u(e){var t=_.keys(e).map(function(t){var r=e[t];return!_.isObject(r)||_.isEmpty(r)||_.isArray(r)?t:u(r).map(function(e){return t+"."+e})});return _.flatten(t)},n=function c(e,t){return t=t||[],_.values(e).forEach(function(e){!_.isObject(e)||_.isEmpty(e)||_.isArray(e)?t.push(e):c(e,t)}),t},o=function(e,t,r){_.isEmpty(r)||(e[t]=r)},i=function(e,t){e||a(t)},a=function(e){throw Error("get-updates error - "+e)};return{rip:e,toPaths:t,getKeyPaths:r,getDeepValues:n,setFilled:o,assert:i,throwErr:a}}(),r=function(){var e=function(e,n,o){var i;return o>1?i=o:o&&(i=1),i&&(e=t.rip(e,i),n=t.rip(n,i)),r(e,n)},r=function(r,n){var o=_.keys(r),i=_.keys(n),a=_.chain([]).concat(o).concat(i).uniq().without("$$hashKey").value();return a.reduce(function(o,i){var a=r[i],s=n[i];if(_.isDate(a)&&_.isDate(s)&&a.getTime()!=s.getTime()&&(o[i]=s),_.isObject(a)&&_.isObject(s)){var u=e(a,s);t.setFilled(o,i,u)}else a!==s&&(o[i]=s);return o},{})};return e}(),n=function(){var e=function(e,a,s){t.assert(_.isObject(e),"first argument must be an object"),t.assert(_.isObject(a),"second argument must be an object");var u=r(e,a,s),c=t.toPaths(u),l=n(c),f=o(c),d=i(f),h={};return t.setFilled(h,"$set",l),t.setFilled(h,"$unset",f),t.setFilled(h,"$pull",d),h},n=function(e){var t=a(e);return _.omit(e,t)},o=function(e){var t=a(e),r=_.pick(e,t);return _.reduce(r,function(e,t,r){return e[r]=!0,e},{})},i=function(e){var t=_.keys(e).map(function(e){var t=e.match(/(.*)\.\d+$/);return t&&t[1]});return _.compact(t).reduce(function(e,t){return e[t]=null,e},{})},a=function(e){return _.keys(e).filter(function(t){var r=e[t];return _.isUndefined(r)})};return e}();e.value("getUpdates",n)}()},function(e,t){"use strict";var r=angular.module("diffArray",["getUpdates"]);r.factory("diffArray",["getUpdates",function(e){function t(t,r,i,a){a=!!a;var s=Package.minimongo.LocalCollection._diffQueryOrderedChanges||Package["diff-sequence"].DiffSequence.diffQueryOrderedChanges,u=[],c=[],l={},f={},d={},h=t.length;_.each(r,function(e,t){c.push({_id:e._id}),f[n(e._id)]=t}),_.each(t,function(e,t){u.push({_id:e._id}),l[n(e._id)]=t,d[n(e._id)]=t}),s(u,c,{addedBefore:function(e,t,o){var a=o?d[n(o)]:h;_.each(d,function(e,t){e>=a&&d[t]++}),h++,d[n(e)]=a,i.addedAt(e,r[f[n(e)]],a,o)},movedBefore:function(e,t){var o=d[n(e)],a=t?d[n(t)]:h-1;_.each(d,function(e,t){e>=o&&a>=e?d[t]--:o>=e&&e>=a&&d[t]++}),d[n(e)]=a,i.movedTo(e,r[f[n(e)]],o,a,t)},removed:function(e){var r=d[n(e)];_.each(d,function(e,t){e>=r&&d[t]--}),delete d[n(e)],h--,i.removedAt(e,t[l[n(e)]],r)}}),_.each(f,function(n,s){if(_.has(l,s)){var u=o(s),c=r[n]||{},f=t[l[s]],d=e(f,c,a);_.isEmpty(d)||i.changedAt(u,d,n,f)}})}var r=Package.minimongo.LocalCollection,n=r._idStringify||Package["mongo-id"].MongoID.idStringify,o=r._idParse||Package["mongo-id"].MongoID.idParse;t.shallow=function(e,r,n){return t(e,r,n,!0)},t.deepCopyChanges=function(t,r){var n=e(t,r).$set;_.each(n,function(e,r){i(t,r,e)})},t.deepCopyRemovals=function(t,r){var n=e(t,r).$unset;_.each(n,function(e,r){a(t,r)})},t.getChanges=function(e,t,r){var n={added:[],removed:[],changed:[]};return r(t,e,{addedAt:function(e,t,r){n.added.push({item:t,index:r})},removedAt:function(e,t,r){n.removed.push({item:t,index:r})},changedAt:function(e,t,r,o){n.changed.push({selector:e,modifier:t})},movedTo:function(e,t,r,n){}}),n};var i=function(e,t,r){var n=t.split("."),o=_.initial(n),i=_.last(n);o.reduce(function(e,t,r){var o=n[r+1];return c(o)?(null===e[t]&&(e[t]=[]),e[t].length==parseInt(o)&&e[t].push(null)):null!==e[t]&&u(e[t])||(e[t]={}),e[t]},e);var a=s(e,o);return a[i]=r,r},a=function(e,t){var r=t.split("."),n=_.initial(r),o=_.last(r),i=s(e,n);return _.isArray(i)&&c(o)?!!i.splice(o,1):delete i[o]},s=function(e,t){return t.reduce(function(e,t){return e[t]},e)},u=function(e){return _.isObject(e)&&Object.getPrototypeOf(e)===Object.prototype},c=function(e){return e.match(/^\d+$/)};return t}])},function(e,t){"use strict";angular.module("angular-meteor.settings",[]).constant("$angularMeteorSettings",{suppressWarnings:!1})},function(e,t){"use strict";angular.module("angular-meteor.ironrouter",[]).run(["$compile","$document","$rootScope",function(e,t,r){var n=(Package["iron:router"]||{}).Router;if(n){var o=!1;n.onAfterAction(function(n,i,a){Tracker.afterFlush(function(){o||(e(t)(r),r.$$phase||r.$apply(),o=!0)})})}}])},function(e,t){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},n=angular.module("angular-meteor.utils",["angular-meteor.settings"]);n.service("$meteorUtils",["$q","$timeout","$angularMeteorSettings",function(e,t,n){var o=this;this.autorun=function(e,r){n.suppressWarnings||console.warn("[angular-meteor.utils.autorun] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.6/autorun. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var o=Tracker.autorun(function(e){r(e),e.firstRun||t(angular.noop,0)});return e.$on("$destroy",function(){o.stop()}),o},this.stripDollarPrefixedKeys=function(e){if(!_.isObject(e)||e instanceof Date||e instanceof File||"oid"===EJSON.toJSONValue(e).$type||"object"===("undefined"==typeof FS?"undefined":r(FS))&&e instanceof FS.File)return e;var t=_.isArray(e)?[]:{};return _.each(e,function(e,r){("string"!=typeof r||"$"!==r.charAt(0))&&(t[r]=o.stripDollarPrefixedKeys(e))}),t},this.fulfill=function(e,t,r){return function(n,o){n?e.reject(null==t?n:t):"function"==typeof r?e.resolve(null==r?o:r(o)):e.resolve(null==r?o:r)}},this.promissor=function(t,r){return function(){var n=e.defer(),i=o.fulfill(n),a=_.toArray(arguments).concat(i);return t[r].apply(t,a),n.promise}},this.promiseAll=function(r){var n=e.all(r);return n["finally"](function(){t(angular.noop)}),n},this.getCollectionByName=function(e){return Mongo.Collection.get(e)},this.findIndexById=function(e,t){var r=_.find(e,function(e){return EJSON.equals(e._id,t._id)});return _.indexOf(e,r)}}]),n.run(["$rootScope","$meteorUtils",function(e,t){Object.getPrototypeOf(e).$meteorAutorun=function(e){return t.autorun(this,e)}}])},function(e,t){"use strict";var r=angular.module("angular-meteor.subscribe",["angular-meteor.settings"]);r.service("$meteorSubscribe",["$q","$angularMeteorSettings",function(e,t){var r=this;this._subscribe=function(e,r,n){t.suppressWarnings||console.warn("[angular-meteor.subscribe] Please note that this module is deprecated since 1.3.0 and will be removed in 1.4.0! Replace it with the new syntax described here: http://www.angular-meteor.com/api/1.3.6/subscribe. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var o=null,i=n[n.length-1];if(angular.isObject(i)&&angular.isFunction(i.onStop)){var a=i.onStop;n.pop()}return n.push({onReady:function(){r.resolve(o)},onStop:function(e){r.promise.$$state.status?a&&a.apply(this,Array.prototype.slice.call(arguments)):e?r.reject(e):r.reject(new Meteor.Error("Subscription Stopped","Subscription stopped by a call to stop method. Either by the client or by the server."))}}),o=Meteor.subscribe.apply(e,n)},this.subscribe=function(){var t=e.defer(),n=Array.prototype.slice.call(arguments);return r._subscribe(this,t,n),t.promise}}]),r.run(["$rootScope","$q","$meteorSubscribe",function(e,t,r){Object.getPrototypeOf(e).$meteorSubscribe=function(){var e=t.defer(),n=Array.prototype.slice.call(arguments),o=r._subscribe(this,e,n);return this.$on("$destroy",function(){o.stop()}),e.promise}}])},function(e,t){"use strict";var r=angular.module("angular-meteor.collection",["angular-meteor.stopper","angular-meteor.subscribe","angular-meteor.utils","diffArray","angular-meteor.settings"]);r.factory("AngularMeteorCollection",["$q","$meteorSubscribe","$meteorUtils","$rootScope","$timeout","diffArray","$angularMeteorSettings",function(e,t,r,n,o,i,a){function s(e,t,n,o){a.suppressWarnings||console.warn("[angular-meteor.$meteorCollection] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorCollection. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var i=[];if(i._serverBackup=[],i._diffArrayFunc=n,i._hObserve=null,i._hNewCurAutorun=null,i._hDataAutorun=null,angular.isDefined(t))i.$$collection=t;else{var u=e();i.$$collection=r.getCollectionByName(u.collection.name)}return _.extend(i,s),i._startCurAutorun(e,o),i}return s._startCurAutorun=function(e,t){var r=this;r._hNewCurAutorun=Tracker.autorun(function(){Tracker.onInvalidate(function(){r._stopCursor()}),t&&r._setAutoClientSave(),r._updateCursor(e(),t)})},s.subscribe=function(){return t.subscribe.apply(this,arguments),this},s.save=function(e,t){e||(e=this),e=[].concat(e);var n=e.map(function(e){return this._upsertDoc(e,t)},this);return r.promiseAll(n)},s._upsertDoc=function(t,n){var o=e.defer(),i=this.$$collection,a=_.partial(r.fulfill,o,null);t=r.stripDollarPrefixedKeys(t);var s=t._id,u=i.findOne(s);if(u){delete t._id;var c=n?{$unset:t}:{$set:t};i.update(s,c,a(function(){return{_id:s,action:"updated"}}))}else i.insert(t,a(function(e){return{_id:e,action:"inserted"}}));return o.promise},s._updateDiff=function(e,t,r){r=r||angular.noop;var n=_.omit(t,"$pull"),o=[n];_.each(t.$pull,function(e,t){var r={};r[t]=e,o.push({$pull:r})}),this._updateParallel(e,o,r)},s._updateParallel=function(e,t,r){var n=this,o=_.after(t.length,r),i=function(e,t){return e?r(e):void o(null,t)};_.each(t,function(t){n.$$collection.update(e,t,i)})},s.remove=function(e){var t;e?(e=[].concat(e),t=_.map(e,function(e){return e._id||e})):t=_.pluck(this,"_id"),check(t,[Match.OneOf(String,Mongo.ObjectID)]);var n=t.map(function(e){return this._removeDoc(e)},this);return r.promiseAll(n)},s._removeDoc=function(t){var n=e.defer(),o=this.$$collection,i=r.fulfill(n,null,{_id:t,action:"removed"});return o.remove(t,i),n.promise},s._updateCursor=function(e,t){var n=this;n._hObserve&&n._stopObserving(),n._hObserve=e.observe({addedAt:function(e,t){n.splice(t,0,e),n._serverBackup.splice(t,0,e),n._setServerUpdateMode()},changedAt:function(e,t,r){i.deepCopyChanges(n[r],e),i.deepCopyRemovals(n[r],e),n._serverBackup[r]=n[r],n._setServerUpdateMode()},movedTo:function(e,t,r){n.splice(t,1),n.splice(r,0,e),n._serverBackup.splice(t,1),n._serverBackup.splice(r,0,e),n._setServerUpdateMode()},removedAt:function(e){var t=r.findIndexById(n,e);-1!=t?(n.splice(t,1),n._serverBackup.splice(t,1),n._setServerUpdateMode()):(t=r.findIndexById(n._serverBackup,e),-1!=t&&n._serverBackup.splice(t,1))}}),n._hDataAutorun=Tracker.autorun(function(){e.fetch(),n._serverMode&&n._unsetServerUpdateMode(t)})},s._stopObserving=function(){this._hObserve.stop(),this._hDataAutorun.stop(),delete this._serverMode,delete this._hUnsetTimeout},s._setServerUpdateMode=function(e){this._serverMode=!0,this._unsetAutoClientSave()},s._unsetServerUpdateMode=function(e){var t=this;t._hUnsetTimeout&&(o.cancel(t._hUnsetTimeout),t._hUnsetTimeout=null),t._hUnsetTimeout=o(function(){t._serverMode=!1;var r=i.getChanges(t,t._serverBackup,t._diffArrayFunc);t._saveChanges(r),e&&t._setAutoClientSave()},0)},s.stop=function(){this._stopCursor(),this._hNewCurAutorun.stop()},s._stopCursor=function(){this._unsetAutoClientSave(),this._hObserve&&(this._hObserve.stop(),this._hDataAutorun.stop()),this.splice(0),this._serverBackup.splice(0)},s._unsetAutoClientSave=function(e){this._hRegAutoBind&&(this._hRegAutoBind(),this._hRegAutoBind=null)},s._setAutoClientSave=function(){var e=this;e._unsetAutoClientSave(),e._hRegAutoBind=n.$watch(function(){return e},function(t,r){if(t!==r){var n=i.getChanges(e,r,e._diffArrayFunc);e._unsetAutoClientSave(),e._saveChanges(n),e._setAutoClientSave()}},!0)},s._saveChanges=function(e){var t=this,r=e.added.reverse().map(function(e){return t.splice(e.index,1),e.item});r.length&&t.save(r);var n=e.removed.map(function(e){return e.item});n.length&&t.remove(n),e.changed.forEach(function(e){t._updateDiff(e.selector,e.modifier)})},s}]),r.factory("$meteorCollectionFS",["$meteorCollection","diffArray","$angularMeteorSettings",function(e,t,r){function n(n,o,i){return r.suppressWarnings||console.warn("[angular-meteor.$meteorCollectionFS] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/files. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings"),new e(n,o,i,t.shallow)}return n}]),r.factory("$meteorCollection",["AngularMeteorCollection","$rootScope","diffArray",function(e,t,r){function n(t,n,o,i){if(!t)throw new TypeError("The first argument of $meteorCollection is undefined.");if(!angular.isFunction(t)&&!angular.isFunction(t.find))throw new TypeError("The first argument of $meteorCollection must be a function or a have a find function property.");return angular.isFunction(t)||(o=angular.isDefined(o)?o:t,t=_.bind(t.find,t)),n=angular.isDefined(n)?n:!0,i=i||r,new e(t,o,i,n)}return n}]),r.run(["$rootScope","$meteorCollection","$meteorCollectionFS","$meteorStopper",function(e,t,r,n){var o=Object.getPrototypeOf(e);o.$meteorCollection=n(t),o.$meteorCollectionFS=n(r)}])},function(e,t){"use strict";var r=angular.module("angular-meteor.object",["angular-meteor.utils","angular-meteor.subscribe","angular-meteor.collection","getUpdates","diffArray","angular-meteor.settings"]);r.factory("AngularMeteorObject",["$q","$meteorSubscribe","$meteorUtils","diffArray","getUpdates","AngularMeteorCollection","$angularMeteorSettings",function(e,t,r,n,o,i,a){function s(e,t,r){a.suppressWarnings||console.warn("[angular-meteor.$meteorObject] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorObject. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var n=e._helpers,o=_.isFunction(n)?Object.create(n.prototype):{},u=e.findOne(t,r),c=_.pick(i,"_updateParallel");return _.extend(o,u),_.extend(o,s),_.extend(o,c),o.$$options=_.omit(r,"skip","limit"),o.$$collection=e,o.$$id=o._getId(t),o._serverBackup=u||{},o}return s.$$internalProps=["$$collection","$$options","$$id","$$hashkey","$$internalProps","$$scope","bind","save","reset","subscribe","stop","autorunComputation","unregisterAutoBind","unregisterAutoDestroy","getRawObject","_auto","_setAutos","_eventEmitter","_serverBackup","_updateDiff","_updateParallel","_getId"],s.getRawObject=function(){return angular.copy(_.omit(this,this.$$internalProps))},s.subscribe=function(){return t.subscribe.apply(this,arguments),this},s.save=function(t){var n,i=e.defer(),a=this.$$collection,s=_.partial(r.fulfill,i,null),u=a.findOne(this.$$id);if(u){if(t)n={$set:t};else if(n=o(u,this.getRawObject()),_.isEmpty(n))return e.when({action:"updated"});this._updateDiff(n,s({action:"updated"}))}else n=t?_.clone(t):this.getRawObject(),n._id=n._id||this.$$id,a.insert(n,s({action:"inserted"}));return i.promise},s._updateDiff=function(e,t){var r=this.$$id;i._updateDiff.call(this,r,e,t)},s.reset=function(e){var t=this,r=this.$$options,n=this.$$id,o=this.$$collection.findOne(n,r);if(o){var i,a=_.keys(o),s=_.pick(o,a);_.extend(t,s),_.extend(t._serverBackup,s),i=e?_.intersection(_.keys(t),_.keys(t._serverBackup)):_.keys(t);var u=_.keys(o),c=_.difference(i,u,t.$$internalProps);c.forEach(function(e){delete t[e],delete t._serverBackup[e]})}else _.keys(this.getRawObject()).forEach(function(e){delete t[e]}),t._serverBackup={}},s.stop=function(){this.unregisterAutoDestroy&&this.unregisterAutoDestroy(),this.unregisterAutoBind&&this.unregisterAutoBind(),this.autorunComputation&&this.autorunComputation.stop&&this.autorunComputation.stop()},s._getId=function(e){var t=_.extend({},this.$$options,{fields:{_id:1},reactive:!1,transform:null}),r=this.$$collection.findOne(e,t);return r?r._id:e instanceof Mongo.ObjectID?e:_.isString(e)?e:new Mongo.ObjectID},s}]),r.factory("$meteorObject",["$rootScope","$meteorUtils","getUpdates","AngularMeteorObject",function(e,t,r,n){function o(e,t,r,i){if(!e)throw new TypeError("The first argument of $meteorObject is undefined.");if(!angular.isFunction(e.findOne))throw new TypeError("The first argument of $meteorObject must be a function or a have a findOne function property.");var a=new n(e,t,i);return a._auto=r!==!1,_.extend(a,o),a._setAutos(),a}return o._setAutos=function(){var r=this;this.autorunComputation=t.autorun(e,function(){r.reset(!0)}),this.unregisterAutoBind=this._auto&&e.$watch(function(){return r.getRawObject()},function(e,t){e!==t&&r.save()},!0),this.unregisterAutoDestroy=e.$on("$destroy",function(){r&&r.stop&&r.pop()})},o}]),r.run(["$rootScope","$meteorObject","$meteorStopper",function(e,t,r){var n=Object.getPrototypeOf(e);n.$meteorObject=r(t)}])},function(e,t){"use strict";var r=angular.module("angular-meteor.user",["angular-meteor.utils","angular-meteor.core","angular-meteor.settings"]);r.service("$meteorUser",["$rootScope","$meteorUtils","$q","$angularMeteorSettings",function(e,t,r,n){var o=Package["accounts-base"];if(o){var i=this,a=o.Accounts;this.waitForUser=function(){n.suppressWarnings||console.warn("[angular-meteor.waitForUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var o=r.defer();return t.autorun(e,function(){Meteor.loggingIn()||o.resolve(Meteor.user())},!0),o.promise},this.requireUser=function(){n.suppressWarnings||console.warn("[angular-meteor.requireUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var o=r.defer();return t.autorun(e,function(){Meteor.loggingIn()||(null===Meteor.user()?o.reject("AUTH_REQUIRED"):o.resolve(Meteor.user()))},!0),o.promise},this.requireValidUser=function(e){return n.suppressWarnings||console.warn("[angular-meteor.requireValidUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings"),i.requireUser(!0).then(function(t){var n=e(t);return n===!0?t:"string"==typeof n?r.reject(n):r.reject("FORBIDDEN")})},this.loginWithPassword=t.promissor(Meteor,"loginWithPassword"),this.createUser=t.promissor(a,"createUser"),this.changePassword=t.promissor(a,"changePassword"),this.forgotPassword=t.promissor(a,"forgotPassword"),this.resetPassword=t.promissor(a,"resetPassword"),this.verifyEmail=t.promissor(a,"verifyEmail"),this.logout=t.promissor(Meteor,"logout"),this.logoutOtherClients=t.promissor(Meteor,"logoutOtherClients"),this.loginWithFacebook=t.promissor(Meteor,"loginWithFacebook"),this.loginWithTwitter=t.promissor(Meteor,"loginWithTwitter"),this.loginWithGoogle=t.promissor(Meteor,"loginWithGoogle"),this.loginWithGithub=t.promissor(Meteor,"loginWithGithub"),this.loginWithMeteorDeveloperAccount=t.promissor(Meteor,"loginWithMeteorDeveloperAccount"),this.loginWithMeetup=t.promissor(Meteor,"loginWithMeetup"),this.loginWithWeibo=t.promissor(Meteor,"loginWithWeibo")}}]),r.run(["$rootScope","$angularMeteorSettings","$$Core",function(e,t,r){var n=Object.getPrototypeOf(e);_.extend(n,r),e.autorun(function(){Meteor.user&&(e.currentUser=Meteor.user(),e.loggingIn=Meteor.loggingIn())})}])},function(e,t){"use strict";var r=angular.module("angular-meteor.methods",["angular-meteor.utils","angular-meteor.settings"]);r.service("$meteorMethods",["$q","$meteorUtils","$angularMeteorSettings",function(e,t,r){this.call=function(){r.suppressWarnings||console.warn("[angular-meteor.$meteor.call] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/methods. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var n=e.defer(),o=t.fulfill(n),i=_.toArray(arguments).concat(o);return Meteor.call.apply(this,i),n.promise}}])},function(e,t){"use strict";var r=angular.module("angular-meteor.session",["angular-meteor.utils","angular-meteor.settings"]);r.factory("$meteorSession",["$meteorUtils","$parse","$angularMeteorSettings",function(e,t,r){return function(n){return{bind:function(o,i){r.suppressWarnings||console.warn("[angular-meteor.session.bind] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://www.angular-meteor.com/api/1.3.0/session. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var a=t(i),s=a.assign;e.autorun(o,function(){s(o,Session.get(n))}),o.$watch(i,function(e,t){Session.set(n,a(o))},!0)}}}}])},function(e,t){"use strict";var r=angular.module("angular-meteor.camera",["angular-meteor.utils","angular-meteor.settings"]);r.service("$meteorCamera",["$q","$meteorUtils","$angularMeteorSettings",function(e,t,r){r.suppressWarnings||console.warn("[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var n=Package["mdg:camera"];if(n){var o=n.MeteorCamera;this.getPicture=function(n){r.suppressWarnings||console.warn("[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings"),n=n||{};var i=e.defer();return o.getPicture(n,t.fulfill(i)),i.promise}}}])},function(e,t){"use strict";var r=angular.module("angular-meteor.stopper",["angular-meteor.subscribe"]);r.factory("$meteorStopper",["$q","$meteorSubscribe",function(e,t){function r(e){return function(){var t=Array.prototype.slice.call(arguments),n=e.apply(this,t);return angular.extend(n,r),n.$$scope=this,this.$on("$destroy",function(){n.stop(),n.subscription&&n.subscription.stop()}),n}}return r.subscribe=function(){var r=Array.prototype.slice.call(arguments);return this.subscription=t._subscribe(this.$$scope,e.defer(),r),this},r}])},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=t.name="angular-meteor.utilities",n=t.utils="$$utils";angular.module(r,[]).service(n,["$rootScope",function(e){function t(e,t,r){return function(){for(var n=arguments.length,o=Array(n),i=0;n>i;i++)o[i]=arguments[i];var a=e.apply(t,o);return r.call(t,{result:a,args:o}),a}}function r(e,t,r){return _.keys(e).reduce(function(o,i){return o[i]=n.bind(e[i],t,r),o},{})}var n=this;this.isCursor=function(e){return e instanceof Meteor.Collection.Cursor},this.isScope=function(t){return t instanceof e.constructor},this.areSiblings=function(e,t){return _.isObject(e)&&_.isObject(t)&&Object.getPrototypeOf(e)===Object.getPrototypeOf(t)},this.bind=function(e,n,o){return o=_.isFunction(o)?o:angular.noop,_.isFunction(e)?t(e,n,o):_.isObject(e)?r(e,n,o):e}}])},function(e,t){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t1?r-1:0),o=1;r>o;o++)n[o-1]=arguments[o];return e._mixins.filter(_.isFunction).forEach(function(e){e.call.apply(e,[t].concat(n))}),t},this._extend=function(t){var n;return(n=_).extend.apply(n,[t].concat(r(e._mixins)))}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.name=void 0;var n=r(15),o=t.name="angular-meteor.scope";angular.module(o,[n.name]).run(["$rootScope",n.Mixer,function(e,t){var r=e.constructor,n=e.$new;t._autoExtend.push(r.prototype),t._autoConstruct.push(e),r.prototype.$new=function(){var e=n.apply(this,arguments);return t._construct(e)}}])},function(e,t,r){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);tn;n++)r[n]=arguments[n];var o=r.pop();return _.isFunction(o)&&(o=this.$bindToContext(o)),(e=Meteor).call.apply(e,r.concat([o]))},r.applyMethod=function(){for(var e,t=arguments.length,r=Array(t),n=0;t>n;n++)r[n]=arguments[n];var o=r.pop();return _.isFunction(o)&&(o=this.$bindToContext(o)),(e=Meteor).apply.apply(e,r.concat([o]))},r.$$autoStop=function(e){this.$on("$destroy",e.stop.bind(e))},r.$$throttledDigest=function(){var e=!this.$$destroyed&&!this.$$phase&&!this.$root.$$phase;e&&this.$digest()},r.$$defer=function(){var t=e.defer();return t.promise=t.promise["finally"](this.$$throttledDigest.bind(this)),t},r.$bindToContext=function(e){return t.bind(e,this,this.$$throttledDigest.bind(this))},r}])},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.reactive=t.ViewModel=t.name=void 0;var o=function(){function e(e,t){for(var r=0;r2?n-2:0),i=2;n>i;i++)o[i-2]=arguments[i];this.$$watchEntity.apply(this,[t,r].concat(o))}return this.$$vm.$$dependencies[t].depend(),e(t)(this.$$vm)},r.$$watchEntity=function(t,r){for(var n=this,o=_.partial(e(t),this.$$vm),i=o(),a=arguments.length,s=Array(a>2?a-2:0),u=2;a>u;u++)s[u-2]=arguments[u];r.call.apply(r,[this,o,function(e,r){ +var o=e!==i||e!==r;o&&n.$$changed(t)}].concat(s))},r.$$setFnHelper=function(e,r){var n=this;this.autorun(function(o){var i=r.apply(n.$$vm);Tracker.nonreactive(function(){t.isCursor(i)?!function(){var t=n.$$handleCursor(e,i);o.onInvalidate(function(){t.stop(),n.$$vm[e].splice(0)})}():n.$$handleNonCursor(e,i),n.$$changed(e)})})},r.$$setValHelper=function(e,t){var r=this,n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];if(n){var o=_.isObject(t);this.getReactively(e,o)}Object.defineProperty(this.$$vm,e,{configurable:!0,enumerable:!0,get:function(){return t},set:function(n){t=n,r.$$changed(e)}})},r.$$handleCursor=function(e,t){var r=this;if(angular.isUndefined(this.$$vm[e]))this.$$setValHelper(e,t.fetch(),!1);else{var n=jsondiffpatch.diff(this.$$vm[e],t.fetch());jsondiffpatch.patch(this.$$vm[e],n)}var o=t.observe({addedAt:function(t,n){o&&(r.$$vm[e].splice(n,0,t),r.$$changed(e))},changedAt:function(t,n,o){var i=jsondiffpatch.diff(r.$$vm[e][o],t);jsondiffpatch.patch(r.$$vm[e][o],i),r.$$changed(e)},movedTo:function(t,n,o){r.$$vm[e].splice(n,1),r.$$vm[e].splice(o,0,t),r.$$changed(e)},removedAt:function(t,n){r.$$vm[e].splice(n,1),r.$$changed(e)}});return o},r.$$handleNonCursor=function(e,r){var n=this.$$vm[e];if(angular.isDefined(n)&&(delete this.$$vm[e],n=null),angular.isUndefined(n))this.$$setValHelper(e,r);else if(t.areSiblings(n,r)){var o=jsondiffpatch.diff(n,r);jsondiffpatch.patch(n,o),this.$$changed(e)}else this.$$vm[e]=r},r.$$depend=function(e){this.$$vm.$$dependencies[e].depend()},r.$$changed=function(e){this.$$throttledDigest(),this.$$vm.$$dependencies[e].changed()},r}])},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=t.name="angular-templates";try{angular.module(r)}catch(n){angular.module(r,[])}}]); //# sourceMappingURL=angular-meteor.min.js.map \ No newline at end of file diff --git a/dist/angular-meteor.min.js.map b/dist/angular-meteor.min.js.map index 7cfae1a49..92f74ec7e 100644 --- a/dist/angular-meteor.min.js.map +++ b/dist/angular-meteor.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///dist/angular-meteor.min.js","webpack:///webpack/bootstrap 39a73188e98df3db7f81","webpack:///./src/angular-meteor.js","webpack:///./src/lib/get-updates.js","webpack:///./src/lib/diff-array.js","webpack:///./src/modules/angular-meteor-ironrouter.js","webpack:///./src/modules/angular-meteor-utils.js","webpack:///./src/modules/angular-meteor-subscribe.js","webpack:///./src/modules/angular-meteor-collection.js","webpack:///./src/modules/angular-meteor-object.js","webpack:///./src/modules/angular-meteor-user.js","webpack:///./src/modules/angular-meteor-methods.js","webpack:///./src/modules/angular-meteor-session.js","webpack:///./src/modules/angular-meteor-camera.js","webpack:///./src/modules/angular-meteor-stopper.js","webpack:///./src/modules/utils.js","webpack:///./src/modules/mixer.js","webpack:///./src/modules/scope.js","webpack:///./src/modules/core.js","webpack:///./src/modules/view-model.js","webpack:///./src/modules/reactive.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","id","loaded","call","m","c","p","Object","defineProperty","value","_utils","_mixer","_scope","_core","_viewModel","_reactive","_module","angular","constant","suppressWarnings","run","Mixer","Core","ViewModel","Reactive","$Mixer","$$Core","$$ViewModel","$$Reactive","mixin","service","$meteorCollection","$meteorCollectionFS","$meteorObject","$meteorMethods","$meteorSession","$meteorSubscribe","$meteorUtils","$meteorCamera","$meteorUser","_this","this","collection","collectionFS","object","subscribe","session","autorun","getCollectionByName","getPicture","forEach","method","utils","rip","obj","level","_","reduce","clone","v","k","isObject","toPaths","keys","getKeyPaths","values","getDeepValues","map","isEmpty","isArray","subKey","flatten","arr","push","setFilled","assert","result","msg","throwErr","Error","getDifference","src","dst","isShallow","compare","srcKeys","dstKeys","chain","concat","uniq","without","diff","srcValue","dstValue","isDate","getTime","valueDiff","getUpdates","paths","set","createSet","unset","createUnset","pull","createPull","updates","undefinedKeys","getUndefinedKeys","omit","pick","arrKeyPaths","split","match","compact","filter","isUndefined","factory","diffArray","lastSeqArray","seqArray","callbacks","preventNestedDiff","diffFn","Package","minimongo","LocalCollection","_diffQueryOrderedChanges","DiffSequence","diffQueryOrderedChanges","oldObjIds","newObjIds","posOld","posNew","posCur","lengthCur","length","each","doc","i","_id","idStringify","addedBefore","before","position","pos","addedAt","movedBefore","prevPosition","movedTo","removed","removedAt","idString","has","idParse","newItem","oldItem","changedAt","_idStringify","MongoID","_idParse","shallow","deepCopyChanges","setDiff","$set","deepKey","setDeep","deepCopyRemovals","unsetDiff","$unset","unsetDeep","getChanges","newCollection","oldCollection","diffMethod","changes","added","changed","item","index","selector","modifier","fromIndex","toIndex","initialKeys","initial","lastKey","last","subObj","nextKey","isNumStr","parseInt","isHash","deepObj","getDeep","splice","getPrototypeOf","prototype","str","$compile","$document","$rootScope","Router","isLoaded","onAfterAction","req","res","next","Tracker","afterFlush","$$phase","$apply","_typeof","Symbol","iterator","constructor","angularMeteorUtils","$q","$timeout","$angularMeteorSettings","self","scope","fn","console","warn","comp","firstRun","noop","$on","stop","stripDollarPrefixedKeys","data","Date","File","EJSON","toJSONValue","$type","FS","out","charAt","fulfill","deferred","boundError","boundResult","err","reject","resolve","promissor","defer","args","toArray","arguments","apply","promise","promiseAll","promises","allPromise","all","string","Mongo","Collection","get","findIndexById","foundDoc","find","colDoc","equals","indexOf","$meteorAutorun","angularMeteorSubscribe","_subscribe","subscription","lastArg","isFunction","onStop","_onStop","pop","onReady","$$state","status","Array","slice","Meteor","angularMeteorCollection","AngularMeteorCollection","curDefFunc","diffArrayFunc","autoClientSave","_serverBackup","_diffArrayFunc","_hObserve","_hNewCurAutorun","_hDataAutorun","isDefined","$$collection","cursor","name","extend","_startCurAutorun","onInvalidate","_stopCursor","_setAutoClientSave","_updateCursor","save","docs","useUnsetModifier","_upsertDoc","createFulfill","partial","docId","isExist","findOne","update","action","insert","_updateDiff","callback","setters","$pull","prop","puller","_updateParallel","done","after","affectedDocsNum","remove","keyOrDocs","keyOrDoc","pluck","check","Match","OneOf","String","ObjectID","key","_removeDoc","_stopObserving","observe","atIndex","_setServerUpdateMode","oldDoc","removedIndex","fetch","_serverMode","_unsetServerUpdateMode","_hUnsetTimeout","_unsetAutoClientSave","cancel","_saveChanges","_hRegAutoBind","$watch","nItems","oItems","addedDocs","reverse","descriptor","removedDocs","reactiveFunc","TypeError","bind","$meteorStopper","scopeProto","angularMeteorObject","AngularMeteorObject","options","helpers","_helpers","create","collectionExtension","$$options","$$id","_getId","$$internalProps","getRawObject","copy","custom","mods","when","reset","keepClientProps","clientProps","docKeys","docExtension","intersection","serverProps","removedKeys","difference","unregisterAutoDestroy","unregisterAutoBind","autorunComputation","fields","reactive","transform","isString","auto","_auto","_setAutos","angularMeteorUser","pack","Accounts","waitForUser","loggingIn","user","requireUser","requireValidUser","validatorFn","then","valid","loginWithPassword","createUser","changePassword","forgotPassword","resetPassword","verifyEmail","logout","logoutOtherClients","loginWithFacebook","loginWithTwitter","loginWithGoogle","loginWithGithub","loginWithMeteorDeveloperAccount","loginWithMeetup","loginWithWeibo","ScopeProto","currentUser","angularMeteorMethods","angularMeteorSession","$parse","model","getter","setter","assign","Session","angularMeteorCamera","MeteorCamera","angularMeteorStopper","$meteorEntity","meteorEntity","$$scope","isCursor","Cursor","isScope","areSiblings","obj1","obj2","context","tap","bindFn","bindObj","_len","_key","bound","_toConsumableArray","arr2","from","_mixins","union","_mixout","_construct","_extend","_ref","undefined","Scope","$new","isolate","parent","firstChild","$$ChildScope","__proto__","$$utils","$bindToContext","computation","$$autoStop","cb","_Meteor","ready","subscriptionId","callMethod","_Meteor2","applyMethod","_Meteor3","_len2","_key2","stoppable","$$throttledDigest","isDigestable","$$destroyed","$root","$digest","$$defer","_classCallCheck","instance","Constructor","_createClass","defineProperties","target","props","enumerable","configurable","writable","protoProps","staticProps","vm","$$vm","viewModel","proto","boundProto","_this2","_attached","_vm","$$dependencies","Dependency","$$setFnHelper","getReactively","isDeep","isBoolean","$$reactivateEntity","getCollectionReactively","$watchCollection","watcher","watcherArgs","$$watchEntity","depend","getVal","initialVal","val","oldVal","hasChanged","$$changed","_this3","nonreactive","observation","$$handleCursor","$$handleNonCursor","$$setValHelper","_this4","watch","newVal","_this5","jsondiffpatch","patch","$$depend"],"mappings":";CACS,SAAUA,GCGnB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAE,WACAE,GAAAJ,EACAK,QAAA,EAUA,OANAP,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,GAGAI,EAAAE,QAAA,EAGAF,EAAAD,QAvBA,GAAAD,KAqCA,OATAF,GAAAQ,EAAAT,EAGAC,EAAAS,EAAAP,EAGAF,EAAAU,EAAA,GAGAV,EAAA,KDOM,SAASI,EAAQD,EAASH,GAE/B,YAEAW,QAAOC,eAAeT,EAAS,cAC7BU,OAAO,IAGTb,EAAoB,GAEpBA,EAAoB,GAEpBA,EAAoB,GAEpBA,EAAoB,GAEpBA,EAAoB,GAEpBA,EAAoB,GAEpBA,EAAoB,GAEpBA,EAAoB,GAEpBA,EAAoB,GAEpBA,EAAoB,IAEpBA,EAAoB,IAEpBA,EAAoB,GAEpB,IAAIc,GAASd,EAAoB,IAE7Be,EAASf,EAAoB,IAE7BgB,EAAShB,EAAoB,IAE7BiB,EAAQjB,EAAoB,IAE5BkB,EAAalB,EAAoB,IAEjCmB,EAAYnB,EAAoB,IEhE/BoB,EAAS,gBFyEdjB,cExEciB,EAEfC,QAAQjB,OAAOgB,GF2EdN,EAAOV,OAAQW,EAAOX,OAAQY,EAAOZ,OAAQa,EAAMb,OAAQc,EAAWd,OAAQe,EAAUf,OEjEvF,4BACA,uBACA,2BACA,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AI,MAGF1C,QAAQkG,YAAYxD,GACtBlB,KAAK4e,eAAezd,EAAG0K,OAGpB,IAAI8O,EAAQ3B,YAAY9X,EAAG2K,GAAO,CACrC,GAAM3I,GAAO+b,cAAc/b,KAAKhC,EAAG2K,EACnCoT,eAAcC,MAAMhe,EAAGgC,GACvBlD,KAAKse,UAAUnd,OAEfnB,MAAK6c,KAAK1b,GAAK0K,GAhL6B1M,EAqLrCggB,SAAW,SAAShe,GAC7BnB,KAAK6c,KAAKO,eAAejc,GAAG6c,UAtLkB7e,EA0LrCmf,UAAY,SAASnd,GAC9BnB,KAAK0b,oBACL1b,KAAK6c,KAAKO,eAAejc,GAAGoH,WAGvBpJ","file":"dist/angular-meteor.min.js","sourcesContent":["/*! angular-meteor v1.3.7-beta.1 */\n/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\t__webpack_require__(1);\n\t\n\t__webpack_require__(2);\n\t\n\t__webpack_require__(3);\n\t\n\t__webpack_require__(4);\n\t\n\t__webpack_require__(5);\n\t\n\t__webpack_require__(6);\n\t\n\t__webpack_require__(7);\n\t\n\t__webpack_require__(8);\n\t\n\t__webpack_require__(9);\n\t\n\t__webpack_require__(10);\n\t\n\t__webpack_require__(11);\n\t\n\t__webpack_require__(12);\n\t\n\tvar _utils = __webpack_require__(13);\n\t\n\tvar _mixer = __webpack_require__(14);\n\t\n\tvar _scope = __webpack_require__(15);\n\t\n\tvar _core = __webpack_require__(16);\n\t\n\tvar _viewModel = __webpack_require__(17);\n\t\n\tvar _reactive = __webpack_require__(18);\n\t\n\t// new\n\t\n\t// legacy\n\t// lib\n\t\n\t\n\tvar _module = 'angular-meteor';\n\texports.default = _module;\n\t\n\t\n\tangular.module(_module, [\n\t// new\n\t_utils.module, _mixer.module, _scope.module, _core.module, _viewModel.module, _reactive.module,\n\t\n\t// legacy\n\t'angular-meteor.ironrouter', 'angular-meteor.utils', 'angular-meteor.subscribe', 'angular-meteor.collection', 'angular-meteor.object', 'angular-meteor.user', 'angular-meteor.methods', 'angular-meteor.session', 'angular-meteor.camera']).constant('$angularMeteorSettings', {\n\t suppressWarnings: false\n\t}).run([_mixer.Mixer, _core.Core, _viewModel.ViewModel, _reactive.Reactive, function ($Mixer, $$Core, $$ViewModel, $$Reactive) {\n\t // Load all mixins\n\t $Mixer.mixin($$Core).mixin($$ViewModel).mixin($$Reactive);\n\t}])\n\t\n\t// legacy\n\t// Putting all services under $meteor service for syntactic sugar\n\t.service('$meteor', ['$meteorCollection', '$meteorCollectionFS', '$meteorObject', '$meteorMethods', '$meteorSession', '$meteorSubscribe', '$meteorUtils', '$meteorCamera', '$meteorUser', function ($meteorCollection, $meteorCollectionFS, $meteorObject, $meteorMethods, $meteorSession, $meteorSubscribe, $meteorUtils, $meteorCamera, $meteorUser) {\n\t var _this = this;\n\t\n\t this.collection = $meteorCollection;\n\t this.collectionFS = $meteorCollectionFS;\n\t this.object = $meteorObject;\n\t this.subscribe = $meteorSubscribe.subscribe;\n\t this.call = $meteorMethods.call;\n\t this.session = $meteorSession;\n\t this.autorun = $meteorUtils.autorun;\n\t this.getCollectionByName = $meteorUtils.getCollectionByName;\n\t this.getPicture = $meteorCamera.getPicture;\n\t\n\t // $meteorUser\n\t ['loginWithPassword', 'requireUser', 'requireValidUser', 'waitForUser', 'createUser', 'changePassword', 'forgotPassword', 'resetPassword', 'verifyEmail', 'loginWithMeteorDeveloperAccount', 'loginWithFacebook', 'loginWithGithub', 'loginWithGoogle', 'loginWithMeetup', 'loginWithTwitter', 'loginWithWeibo', 'logout', 'logoutOtherClients'].forEach(function (method) {\n\t _this[method] = $meteorUser[method];\n\t });\n\t}]);\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\t/*global\r\n\t angular, _\r\n\t */\n\t\n\t'use strict';\n\t\n\t// https://github.com/DAB0mB/get-updates\n\t\n\t(function () {\n\t var module = angular.module('getUpdates', []);\n\t\n\t var utils = function () {\n\t var rip = function rip(obj, level) {\n\t if (level < 1) return {};\n\t\n\t return _.reduce(obj, function (clone, v, k) {\n\t v = _.isObject(v) ? rip(v, --level) : v;\n\t clone[k] = v;\n\t return clone;\n\t }, {});\n\t };\n\t\n\t var toPaths = function toPaths(obj) {\n\t var keys = getKeyPaths(obj);\n\t var values = getDeepValues(obj);\n\t return _.object(keys, values);\n\t };\n\t\n\t var getKeyPaths = function getKeyPaths(obj) {\n\t var keys = _.keys(obj).map(function (k) {\n\t var v = obj[k];\n\t if (!_.isObject(v) || _.isEmpty(v) || _.isArray(v)) return k;\n\t\n\t return getKeyPaths(v).map(function (subKey) {\n\t return k + '.' + subKey;\n\t });\n\t });\n\t\n\t return _.flatten(keys);\n\t };\n\t\n\t var getDeepValues = function getDeepValues(obj, arr) {\n\t arr = arr || [];\n\t\n\t _.values(obj).forEach(function (v) {\n\t if (!_.isObject(v) || _.isEmpty(v) || _.isArray(v)) arr.push(v);else getDeepValues(v, arr);\n\t });\n\t\n\t return arr;\n\t };\n\t\n\t var flatten = function flatten(arr) {\n\t return arr.reduce(function (flattened, v, i) {\n\t if (_.isArray(v) && !_.isEmpty(v)) flattened.push.apply(flattened, flatten(v));else flattened.push(v);\n\t\n\t return flattened;\n\t }, []);\n\t };\n\t\n\t var setFilled = function setFilled(obj, k, v) {\n\t if (!_.isEmpty(v)) obj[k] = v;\n\t };\n\t\n\t var assert = function assert(result, msg) {\n\t if (!result) throwErr(msg);\n\t };\n\t\n\t var throwErr = function throwErr(msg) {\n\t throw Error('get-updates error - ' + msg);\n\t };\n\t\n\t return {\n\t rip: rip,\n\t toPaths: toPaths,\n\t getKeyPaths: getKeyPaths,\n\t getDeepValues: getDeepValues,\n\t setFilled: setFilled,\n\t assert: assert,\n\t throwErr: throwErr\n\t };\n\t }();\n\t\n\t var getDifference = function () {\n\t var getDifference = function getDifference(src, dst, isShallow) {\n\t var level;\n\t\n\t if (isShallow > 1) level = isShallow;else if (isShallow) level = 1;\n\t\n\t if (level) {\n\t src = utils.rip(src, level);\n\t dst = utils.rip(dst, level);\n\t }\n\t\n\t return compare(src, dst);\n\t };\n\t\n\t var compare = function compare(src, dst) {\n\t var srcKeys = _.keys(src);\n\t var dstKeys = _.keys(dst);\n\t\n\t var keys = _.chain([]).concat(srcKeys).concat(dstKeys).uniq().without('$$hashKey').value();\n\t\n\t return keys.reduce(function (diff, k) {\n\t var srcValue = src[k];\n\t var dstValue = dst[k];\n\t\n\t if (_.isDate(srcValue) && _.isDate(dstValue)) {\n\t if (srcValue.getTime() != dstValue.getTime()) diff[k] = dstValue;\n\t }\n\t\n\t if (_.isObject(srcValue) && _.isObject(dstValue)) {\n\t var valueDiff = getDifference(srcValue, dstValue);\n\t utils.setFilled(diff, k, valueDiff);\n\t } else if (srcValue !== dstValue) {\n\t diff[k] = dstValue;\n\t }\n\t\n\t return diff;\n\t }, {});\n\t };\n\t\n\t return getDifference;\n\t }();\n\t\n\t var getUpdates = function () {\n\t var getUpdates = function getUpdates(src, dst, isShallow) {\n\t utils.assert(_.isObject(src), 'first argument must be an object');\n\t utils.assert(_.isObject(dst), 'second argument must be an object');\n\t\n\t var diff = getDifference(src, dst, isShallow);\n\t var paths = utils.toPaths(diff);\n\t\n\t var set = createSet(paths);\n\t var unset = createUnset(paths);\n\t var pull = createPull(unset);\n\t\n\t var updates = {};\n\t utils.setFilled(updates, '$set', set);\n\t utils.setFilled(updates, '$unset', unset);\n\t utils.setFilled(updates, '$pull', pull);\n\t\n\t return updates;\n\t };\n\t\n\t var createSet = function createSet(paths) {\n\t var undefinedKeys = getUndefinedKeys(paths);\n\t return _.omit(paths, undefinedKeys);\n\t };\n\t\n\t var createUnset = function createUnset(paths) {\n\t var undefinedKeys = getUndefinedKeys(paths);\n\t var unset = _.pick(paths, undefinedKeys);\n\t\n\t return _.reduce(unset, function (result, v, k) {\n\t result[k] = true;\n\t return result;\n\t }, {});\n\t };\n\t\n\t var createPull = function createPull(unset) {\n\t var arrKeyPaths = _.keys(unset).map(function (k) {\n\t var split = k.match(/(.*)\\.\\d+$/);\n\t return split && split[1];\n\t });\n\t\n\t return _.compact(arrKeyPaths).reduce(function (pull, k) {\n\t pull[k] = null;\n\t return pull;\n\t }, {});\n\t };\n\t\n\t var getUndefinedKeys = function getUndefinedKeys(obj) {\n\t return _.keys(obj).filter(function (k) {\n\t var v = obj[k];\n\t return _.isUndefined(v);\n\t });\n\t };\n\t\n\t return getUpdates;\n\t }();\n\t\n\t module.value('getUpdates', getUpdates);\n\t})();\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\t/*global\r\n\t angular, _, Package\r\n\t */\n\t\n\t'use strict';\n\t\n\tvar _module = angular.module('diffArray', ['getUpdates']);\n\t\n\t_module.factory('diffArray', ['getUpdates', function (getUpdates) {\n\t var LocalCollection = Package.minimongo.LocalCollection;\n\t var idStringify = LocalCollection._idStringify || Package['mongo-id'].MongoID.idStringify;\n\t var idParse = LocalCollection._idParse || Package['mongo-id'].MongoID.idParse;\n\t\n\t // Calculates the differences between `lastSeqArray` and\n\t // `seqArray` and calls appropriate functions from `callbacks`.\n\t // Reuses Minimongo's diff algorithm implementation.\n\t // XXX Should be replaced with the original diffArray function here:\n\t // https://github.com/meteor/meteor/blob/devel/packages/observe-sequence/observe_sequence.js#L152\n\t // When it will become nested as well, tracking here: https://github.com/meteor/meteor/issues/3764\n\t function diffArray(lastSeqArray, seqArray, callbacks, preventNestedDiff) {\n\t preventNestedDiff = !!preventNestedDiff;\n\t\n\t var diffFn = Package.minimongo.LocalCollection._diffQueryOrderedChanges || Package['diff-sequence'].DiffSequence.diffQueryOrderedChanges;\n\t\n\t var oldObjIds = [];\n\t var newObjIds = [];\n\t var posOld = {}; // maps from idStringify'd ids\n\t var posNew = {}; // ditto\n\t var posCur = {};\n\t var lengthCur = lastSeqArray.length;\n\t\n\t _.each(seqArray, function (doc, i) {\n\t newObjIds.push({ _id: doc._id });\n\t posNew[idStringify(doc._id)] = i;\n\t });\n\t\n\t _.each(lastSeqArray, function (doc, i) {\n\t oldObjIds.push({ _id: doc._id });\n\t posOld[idStringify(doc._id)] = i;\n\t posCur[idStringify(doc._id)] = i;\n\t });\n\t\n\t // Arrays can contain arbitrary objects. We don't diff the\n\t // objects. Instead we always fire 'changedAt' callback on every\n\t // object. The consumer of `observe-sequence` should deal with\n\t // it appropriately.\n\t diffFn(oldObjIds, newObjIds, {\n\t addedBefore: function addedBefore(id, doc, before) {\n\t var position = before ? posCur[idStringify(before)] : lengthCur;\n\t\n\t _.each(posCur, function (pos, id) {\n\t if (pos >= position) posCur[id]++;\n\t });\n\t\n\t lengthCur++;\n\t posCur[idStringify(id)] = position;\n\t\n\t callbacks.addedAt(id, seqArray[posNew[idStringify(id)]], position, before);\n\t },\n\t\n\t movedBefore: function movedBefore(id, before) {\n\t var prevPosition = posCur[idStringify(id)];\n\t var position = before ? posCur[idStringify(before)] : lengthCur - 1;\n\t\n\t _.each(posCur, function (pos, id) {\n\t if (pos >= prevPosition && pos <= position) posCur[id]--;else if (pos <= prevPosition && pos >= position) posCur[id]++;\n\t });\n\t\n\t posCur[idStringify(id)] = position;\n\t\n\t callbacks.movedTo(id, seqArray[posNew[idStringify(id)]], prevPosition, position, before);\n\t },\n\t removed: function removed(id) {\n\t var prevPosition = posCur[idStringify(id)];\n\t\n\t _.each(posCur, function (pos, id) {\n\t if (pos >= prevPosition) posCur[id]--;\n\t });\n\t\n\t delete posCur[idStringify(id)];\n\t lengthCur--;\n\t\n\t callbacks.removedAt(id, lastSeqArray[posOld[idStringify(id)]], prevPosition);\n\t }\n\t });\n\t\n\t _.each(posNew, function (pos, idString) {\n\t if (!_.has(posOld, idString)) return;\n\t\n\t var id = idParse(idString);\n\t var newItem = seqArray[pos] || {};\n\t var oldItem = lastSeqArray[posOld[idString]];\n\t var updates = getUpdates(oldItem, newItem, preventNestedDiff);\n\t\n\t if (!_.isEmpty(updates)) callbacks.changedAt(id, updates, pos, oldItem);\n\t });\n\t }\n\t\n\t diffArray.shallow = function (lastSeqArray, seqArray, callbacks) {\n\t return diffArray(lastSeqArray, seqArray, callbacks, true);\n\t };\n\t\n\t diffArray.deepCopyChanges = function (oldItem, newItem) {\n\t var setDiff = getUpdates(oldItem, newItem).$set;\n\t\n\t _.each(setDiff, function (v, deepKey) {\n\t setDeep(oldItem, deepKey, v);\n\t });\n\t };\n\t\n\t diffArray.deepCopyRemovals = function (oldItem, newItem) {\n\t var unsetDiff = getUpdates(oldItem, newItem).$unset;\n\t\n\t _.each(unsetDiff, function (v, deepKey) {\n\t unsetDeep(oldItem, deepKey);\n\t });\n\t };\n\t\n\t // Finds changes between two collections\n\t diffArray.getChanges = function (newCollection, oldCollection, diffMethod) {\n\t var changes = { added: [], removed: [], changed: [] };\n\t\n\t diffMethod(oldCollection, newCollection, {\n\t addedAt: function addedAt(id, item, index) {\n\t changes.added.push({ item: item, index: index });\n\t },\n\t\n\t removedAt: function removedAt(id, item, index) {\n\t changes.removed.push({ item: item, index: index });\n\t },\n\t\n\t changedAt: function changedAt(id, updates, index, oldItem) {\n\t changes.changed.push({ selector: id, modifier: updates });\n\t },\n\t\n\t movedTo: function movedTo(id, item, fromIndex, toIndex) {\n\t // XXX do we need this?\n\t }\n\t });\n\t\n\t return changes;\n\t };\n\t\n\t var setDeep = function setDeep(obj, deepKey, v) {\n\t var split = deepKey.split('.');\n\t var initialKeys = _.initial(split);\n\t var lastKey = _.last(split);\n\t\n\t initialKeys.reduce(function (subObj, k, i) {\n\t var nextKey = split[i + 1];\n\t\n\t if (isNumStr(nextKey)) {\n\t if (subObj[k] === null) subObj[k] = [];\n\t if (subObj[k].length == parseInt(nextKey)) subObj[k].push(null);\n\t } else if (subObj[k] === null || !isHash(subObj[k])) {\n\t subObj[k] = {};\n\t }\n\t\n\t return subObj[k];\n\t }, obj);\n\t\n\t var deepObj = getDeep(obj, initialKeys);\n\t deepObj[lastKey] = v;\n\t return v;\n\t };\n\t\n\t var unsetDeep = function unsetDeep(obj, deepKey) {\n\t var split = deepKey.split('.');\n\t var initialKeys = _.initial(split);\n\t var lastKey = _.last(split);\n\t var deepObj = getDeep(obj, initialKeys);\n\t\n\t if (_.isArray(deepObj) && isNumStr(lastKey)) return !!deepObj.splice(lastKey, 1);else return delete deepObj[lastKey];\n\t };\n\t\n\t var getDeep = function getDeep(obj, keys) {\n\t return keys.reduce(function (subObj, k) {\n\t return subObj[k];\n\t }, obj);\n\t };\n\t\n\t var isHash = function isHash(obj) {\n\t return _.isObject(obj) && Object.getPrototypeOf(obj) === Object.prototype;\n\t };\n\t\n\t var isNumStr = function isNumStr(str) {\n\t return str.match(/^\\d+$/);\n\t };\n\t\n\t return diffArray;\n\t}]);\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tangular.module('angular-meteor.ironrouter', []).run(['$compile', '$document', '$rootScope', function ($compile, $document, $rootScope) {\n\t var Router = (Package['iron:router'] || {}).Router;\n\t if (!Router) return;\n\t\n\t var isLoaded = false;\n\t\n\t // Recompile after iron:router builds page\n\t Router.onAfterAction(function (req, res, next) {\n\t Tracker.afterFlush(function () {\n\t if (isLoaded) return;\n\t $compile($document)($rootScope);\n\t if (!$rootScope.$$phase) $rootScope.$apply();\n\t isLoaded = true;\n\t });\n\t });\n\t}]);\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\t/*global\r\n\t angular, _, Tracker, EJSON, FS, Mongo\r\n\t */\n\t\n\t'use strict';\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\t\n\tvar angularMeteorUtils = angular.module('angular-meteor.utils', []);\n\t\n\tangularMeteorUtils.service('$meteorUtils', ['$q', '$timeout', '$angularMeteorSettings', function ($q, $timeout, $angularMeteorSettings) {\n\t\n\t var self = this;\n\t\n\t this.autorun = function (scope, fn) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.utils.autorun] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.6/autorun. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t // wrapping around Deps.autorun\n\t var comp = Tracker.autorun(function (c) {\n\t fn(c);\n\t // this is run immediately for the first call\n\t // but after that, we need to $apply to start Angular digest\n\t if (!c.firstRun) $timeout(angular.noop, 0);\n\t });\n\t\n\t // stop autorun when scope is destroyed\n\t scope.$on('$destroy', function () {\n\t comp.stop();\n\t });\n\t\n\t // return autorun object so that it can be stopped manually\n\t return comp;\n\t };\n\t\n\t // Borrowed from angularFire\n\t // https://github.com/firebase/angularfire/blob/master/src/utils.js#L445-L454\n\t this.stripDollarPrefixedKeys = function (data) {\n\t if (!_.isObject(data) || data instanceof Date || data instanceof File || EJSON.toJSONValue(data).$type === 'oid' || (typeof FS === 'undefined' ? 'undefined' : _typeof(FS)) === 'object' && data instanceof FS.File) return data;\n\t\n\t var out = _.isArray(data) ? [] : {};\n\t\n\t _.each(data, function (v, k) {\n\t if (typeof k !== 'string' || k.charAt(0) !== '$') out[k] = self.stripDollarPrefixedKeys(v);\n\t });\n\t\n\t return out;\n\t };\n\t\n\t // Returns a callback which fulfills promise\n\t this.fulfill = function (deferred, boundError, boundResult) {\n\t return function (err, result) {\n\t if (err) deferred.reject(boundError === null ? err : boundError);else if (typeof boundResult == \"function\") deferred.resolve(boundResult === null ? result : boundResult(result));else deferred.resolve(boundResult === null ? result : boundResult);\n\t };\n\t };\n\t\n\t // creates a function which invokes method with the given arguments and returns a promise\n\t this.promissor = function (obj, method) {\n\t return function () {\n\t var deferred = $q.defer();\n\t var fulfill = self.fulfill(deferred);\n\t var args = _.toArray(arguments).concat(fulfill);\n\t obj[method].apply(obj, args);\n\t return deferred.promise;\n\t };\n\t };\n\t\n\t // creates a $q.all() promise and call digestion loop on fulfillment\n\t this.promiseAll = function (promises) {\n\t var allPromise = $q.all(promises);\n\t\n\t allPromise.finally(function () {\n\t // calls digestion loop with no conflicts\n\t $timeout(angular.noop);\n\t });\n\t\n\t return allPromise;\n\t };\n\t\n\t this.getCollectionByName = function (string) {\n\t return Mongo.Collection.get(string);\n\t };\n\t\n\t this.findIndexById = function (collection, doc) {\n\t var foundDoc = _.find(collection, function (colDoc) {\n\t // EJSON.equals used to compare Mongo.ObjectIDs and Strings.\n\t return EJSON.equals(colDoc._id, doc._id);\n\t });\n\t\n\t return _.indexOf(collection, foundDoc);\n\t };\n\t}]);\n\t\n\tangularMeteorUtils.run(['$rootScope', '$meteorUtils', function ($rootScope, $meteorUtils) {\n\t Object.getPrototypeOf($rootScope).$meteorAutorun = function (fn) {\n\t return $meteorUtils.autorun(this, fn);\n\t };\n\t}]);\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\t/*global\r\n\t angular, Meteor\r\n\t */\n\t\n\t'use strict';\n\t\n\tvar angularMeteorSubscribe = angular.module('angular-meteor.subscribe', []);\n\t\n\tangularMeteorSubscribe.service('$meteorSubscribe', ['$q', '$angularMeteorSettings', function ($q, $angularMeteorSettings) {\n\t\n\t var self = this;\n\t\n\t this._subscribe = function (scope, deferred, args) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.subscribe] Please note that this module is deprecated since 1.3.0 and will be removed in 1.4.0! Replace it with the new syntax described here: http://www.angular-meteor.com/api/1.3.6/subscribe. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t var subscription = null;\n\t var lastArg = args[args.length - 1];\n\t\n\t // User supplied onStop callback\n\t // save it for later use and remove\n\t // from subscription arguments\n\t if (angular.isObject(lastArg) && angular.isFunction(lastArg.onStop)) {\n\t var _onStop = lastArg.onStop;\n\t\n\t args.pop();\n\t }\n\t\n\t args.push({\n\t onReady: function onReady() {\n\t deferred.resolve(subscription);\n\t },\n\t onStop: function onStop(err) {\n\t if (!deferred.promise.$$state.status) {\n\t if (err) deferred.reject(err);else deferred.reject(new Meteor.Error(\"Subscription Stopped\", \"Subscription stopped by a call to stop method. Either by the client or by the server.\"));\n\t } else if (_onStop)\n\t // After promise was resolved or rejected\n\t // call user supplied onStop callback.\n\t _onStop.apply(this, Array.prototype.slice.call(arguments));\n\t }\n\t });\n\t\n\t subscription = Meteor.subscribe.apply(scope, args);\n\t\n\t return subscription;\n\t };\n\t\n\t this.subscribe = function () {\n\t var deferred = $q.defer();\n\t var args = Array.prototype.slice.call(arguments);\n\t var subscription = null;\n\t\n\t self._subscribe(this, deferred, args);\n\t\n\t return deferred.promise;\n\t };\n\t}]);\n\t\n\tangularMeteorSubscribe.run(['$rootScope', '$q', '$meteorSubscribe', function ($rootScope, $q, $meteorSubscribe) {\n\t Object.getPrototypeOf($rootScope).$meteorSubscribe = function () {\n\t var deferred = $q.defer();\n\t var args = Array.prototype.slice.call(arguments);\n\t\n\t var subscription = $meteorSubscribe._subscribe(this, deferred, args);\n\t\n\t this.$on('$destroy', function () {\n\t subscription.stop();\n\t });\n\t\n\t return deferred.promise;\n\t };\n\t}]);\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\t/*global\r\n\t angular, _, Tracker, check, Match, Mongo\r\n\t */\n\t\n\t'use strict';\n\t\n\tvar angularMeteorCollection = angular.module('angular-meteor.collection', ['angular-meteor.stopper', 'angular-meteor.subscribe', 'angular-meteor.utils', 'diffArray']);\n\t\n\t// The reason angular meteor collection is a factory function and not something\n\t// that inherit from array comes from here:\n\t// http://perfectionkills.com/how-ecmascript-5-still-does-not-allow-to-subclass-an-array/\n\t// We went with the direct extensions approach.\n\tangularMeteorCollection.factory('AngularMeteorCollection', ['$q', '$meteorSubscribe', '$meteorUtils', '$rootScope', '$timeout', 'diffArray', '$angularMeteorSettings', function ($q, $meteorSubscribe, $meteorUtils, $rootScope, $timeout, diffArray, $angularMeteorSettings) {\n\t\n\t function AngularMeteorCollection(curDefFunc, collection, diffArrayFunc, autoClientSave) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.$meteorCollection] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorCollection. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t var data = [];\n\t // Server backup data to evaluate what changes come from client\n\t // after each server update.\n\t data._serverBackup = [];\n\t // Array differ function.\n\t data._diffArrayFunc = diffArrayFunc;\n\t // Handler of the cursor observer.\n\t data._hObserve = null;\n\t // On new cursor autorun handler\n\t // (autorun for reactive variables).\n\t data._hNewCurAutorun = null;\n\t // On new data autorun handler\n\t // (autorun for cursor.fetch).\n\t data._hDataAutorun = null;\n\t\n\t if (angular.isDefined(collection)) {\n\t data.$$collection = collection;\n\t } else {\n\t var cursor = curDefFunc();\n\t data.$$collection = $meteorUtils.getCollectionByName(cursor.collection.name);\n\t }\n\t\n\t _.extend(data, AngularMeteorCollection);\n\t data._startCurAutorun(curDefFunc, autoClientSave);\n\t\n\t return data;\n\t }\n\t\n\t AngularMeteorCollection._startCurAutorun = function (curDefFunc, autoClientSave) {\n\t var self = this;\n\t\n\t self._hNewCurAutorun = Tracker.autorun(function () {\n\t // When the reactive func gets recomputated we need to stop any previous\n\t // observeChanges.\n\t Tracker.onInvalidate(function () {\n\t self._stopCursor();\n\t });\n\t\n\t if (autoClientSave) self._setAutoClientSave();\n\t self._updateCursor(curDefFunc(), autoClientSave);\n\t });\n\t };\n\t\n\t AngularMeteorCollection.subscribe = function () {\n\t $meteorSubscribe.subscribe.apply(this, arguments);\n\t return this;\n\t };\n\t\n\t AngularMeteorCollection.save = function (docs, useUnsetModifier) {\n\t // save whole collection\n\t if (!docs) docs = this;\n\t // save single doc\n\t docs = [].concat(docs);\n\t\n\t var promises = docs.map(function (doc) {\n\t return this._upsertDoc(doc, useUnsetModifier);\n\t }, this);\n\t\n\t return $meteorUtils.promiseAll(promises);\n\t };\n\t\n\t AngularMeteorCollection._upsertDoc = function (doc, useUnsetModifier) {\n\t var deferred = $q.defer();\n\t var collection = this.$$collection;\n\t var createFulfill = _.partial($meteorUtils.fulfill, deferred, null);\n\t\n\t // delete $$hashkey\n\t doc = $meteorUtils.stripDollarPrefixedKeys(doc);\n\t var docId = doc._id;\n\t var isExist = collection.findOne(docId);\n\t\n\t // update\n\t if (isExist) {\n\t // Deletes _id property (from the copy) so that\n\t // it can be $set using update.\n\t delete doc._id;\n\t var modifier = useUnsetModifier ? { $unset: doc } : { $set: doc };\n\t // NOTE: do not use #upsert() method, since it does not exist in some collections\n\t collection.update(docId, modifier, createFulfill(function () {\n\t return { _id: docId, action: 'updated' };\n\t }));\n\t }\n\t // insert\n\t else {\n\t collection.insert(doc, createFulfill(function (id) {\n\t return { _id: id, action: 'inserted' };\n\t }));\n\t }\n\t\n\t return deferred.promise;\n\t };\n\t\n\t // performs $pull operations parallely.\n\t // used for handling splice operations returned from getUpdates() to prevent conflicts.\n\t // see issue: https://github.com/Urigo/angular-meteor/issues/793\n\t AngularMeteorCollection._updateDiff = function (selector, update, callback) {\n\t callback = callback || angular.noop;\n\t var setters = _.omit(update, '$pull');\n\t var updates = [setters];\n\t\n\t _.each(update.$pull, function (pull, prop) {\n\t var puller = {};\n\t puller[prop] = pull;\n\t updates.push({ $pull: puller });\n\t });\n\t\n\t this._updateParallel(selector, updates, callback);\n\t };\n\t\n\t // performs each update operation parallely\n\t AngularMeteorCollection._updateParallel = function (selector, updates, callback) {\n\t var self = this;\n\t var done = _.after(updates.length, callback);\n\t\n\t var next = function next(err, affectedDocsNum) {\n\t if (err) return callback(err);\n\t done(null, affectedDocsNum);\n\t };\n\t\n\t _.each(updates, function (update) {\n\t self.$$collection.update(selector, update, next);\n\t });\n\t };\n\t\n\t AngularMeteorCollection.remove = function (keyOrDocs) {\n\t var keys;\n\t\n\t // remove whole collection\n\t if (!keyOrDocs) {\n\t keys = _.pluck(this, '_id');\n\t }\n\t // remove docs\n\t else {\n\t keyOrDocs = [].concat(keyOrDocs);\n\t\n\t keys = _.map(keyOrDocs, function (keyOrDoc) {\n\t return keyOrDoc._id || keyOrDoc;\n\t });\n\t }\n\t\n\t // Checks if all keys are correct.\n\t check(keys, [Match.OneOf(String, Mongo.ObjectID)]);\n\t\n\t var promises = keys.map(function (key) {\n\t return this._removeDoc(key);\n\t }, this);\n\t\n\t return $meteorUtils.promiseAll(promises);\n\t };\n\t\n\t AngularMeteorCollection._removeDoc = function (id) {\n\t var deferred = $q.defer();\n\t var collection = this.$$collection;\n\t var fulfill = $meteorUtils.fulfill(deferred, null, { _id: id, action: 'removed' });\n\t collection.remove(id, fulfill);\n\t return deferred.promise;\n\t };\n\t\n\t AngularMeteorCollection._updateCursor = function (cursor, autoClientSave) {\n\t var self = this;\n\t // XXX - consider adding an option for a non-orderd result for faster performance\n\t if (self._hObserve) self._stopObserving();\n\t\n\t self._hObserve = cursor.observe({\n\t addedAt: function addedAt(doc, atIndex) {\n\t self.splice(atIndex, 0, doc);\n\t self._serverBackup.splice(atIndex, 0, doc);\n\t self._setServerUpdateMode();\n\t },\n\t\n\t changedAt: function changedAt(doc, oldDoc, atIndex) {\n\t diffArray.deepCopyChanges(self[atIndex], doc);\n\t diffArray.deepCopyRemovals(self[atIndex], doc);\n\t self._serverBackup[atIndex] = self[atIndex];\n\t self._setServerUpdateMode();\n\t },\n\t\n\t movedTo: function movedTo(doc, fromIndex, toIndex) {\n\t self.splice(fromIndex, 1);\n\t self.splice(toIndex, 0, doc);\n\t self._serverBackup.splice(fromIndex, 1);\n\t self._serverBackup.splice(toIndex, 0, doc);\n\t self._setServerUpdateMode();\n\t },\n\t\n\t removedAt: function removedAt(oldDoc) {\n\t var removedIndex = $meteorUtils.findIndexById(self, oldDoc);\n\t\n\t if (removedIndex != -1) {\n\t self.splice(removedIndex, 1);\n\t self._serverBackup.splice(removedIndex, 1);\n\t self._setServerUpdateMode();\n\t } else {\n\t // If it's been removed on client then it's already not in collection\n\t // itself but still is in the _serverBackup.\n\t removedIndex = $meteorUtils.findIndexById(self._serverBackup, oldDoc);\n\t\n\t if (removedIndex != -1) {\n\t self._serverBackup.splice(removedIndex, 1);\n\t }\n\t }\n\t }\n\t });\n\t\n\t self._hDataAutorun = Tracker.autorun(function () {\n\t cursor.fetch();\n\t if (self._serverMode) self._unsetServerUpdateMode(autoClientSave);\n\t });\n\t };\n\t\n\t AngularMeteorCollection._stopObserving = function () {\n\t this._hObserve.stop();\n\t this._hDataAutorun.stop();\n\t delete this._serverMode;\n\t delete this._hUnsetTimeout;\n\t };\n\t\n\t AngularMeteorCollection._setServerUpdateMode = function (name) {\n\t this._serverMode = true;\n\t // To simplify server update logic, we don't follow\n\t // updates from the client at the same time.\n\t this._unsetAutoClientSave();\n\t };\n\t\n\t // Here we use $timeout to combine multiple updates that go\n\t // each one after another.\n\t AngularMeteorCollection._unsetServerUpdateMode = function (autoClientSave) {\n\t var self = this;\n\t\n\t if (self._hUnsetTimeout) {\n\t $timeout.cancel(self._hUnsetTimeout);\n\t self._hUnsetTimeout = null;\n\t }\n\t\n\t self._hUnsetTimeout = $timeout(function () {\n\t self._serverMode = false;\n\t // Finds updates that was potentially done from the client side\n\t // and saves them.\n\t var changes = diffArray.getChanges(self, self._serverBackup, self._diffArrayFunc);\n\t self._saveChanges(changes);\n\t // After, continues following client updates.\n\t if (autoClientSave) self._setAutoClientSave();\n\t }, 0);\n\t };\n\t\n\t AngularMeteorCollection.stop = function () {\n\t this._stopCursor();\n\t this._hNewCurAutorun.stop();\n\t };\n\t\n\t AngularMeteorCollection._stopCursor = function () {\n\t this._unsetAutoClientSave();\n\t\n\t if (this._hObserve) {\n\t this._hObserve.stop();\n\t this._hDataAutorun.stop();\n\t }\n\t\n\t this.splice(0);\n\t this._serverBackup.splice(0);\n\t };\n\t\n\t AngularMeteorCollection._unsetAutoClientSave = function (name) {\n\t if (this._hRegAutoBind) {\n\t this._hRegAutoBind();\n\t this._hRegAutoBind = null;\n\t }\n\t };\n\t\n\t AngularMeteorCollection._setAutoClientSave = function () {\n\t var self = this;\n\t\n\t // Always unsets auto save to keep only one $watch handler.\n\t self._unsetAutoClientSave();\n\t\n\t self._hRegAutoBind = $rootScope.$watch(function () {\n\t return self;\n\t }, function (nItems, oItems) {\n\t if (nItems === oItems) return;\n\t\n\t var changes = diffArray.getChanges(self, oItems, self._diffArrayFunc);\n\t self._unsetAutoClientSave();\n\t self._saveChanges(changes);\n\t self._setAutoClientSave();\n\t }, true);\n\t };\n\t\n\t AngularMeteorCollection._saveChanges = function (changes) {\n\t var self = this;\n\t\n\t // Saves added documents\n\t // Using reversed iteration to prevent indexes from changing during splice\n\t var addedDocs = changes.added.reverse().map(function (descriptor) {\n\t self.splice(descriptor.index, 1);\n\t return descriptor.item;\n\t });\n\t\n\t if (addedDocs.length) self.save(addedDocs);\n\t\n\t // Removes deleted documents\n\t var removedDocs = changes.removed.map(function (descriptor) {\n\t return descriptor.item;\n\t });\n\t\n\t if (removedDocs.length) self.remove(removedDocs);\n\t\n\t // Updates changed documents\n\t changes.changed.forEach(function (descriptor) {\n\t self._updateDiff(descriptor.selector, descriptor.modifier);\n\t });\n\t };\n\t\n\t return AngularMeteorCollection;\n\t}]);\n\t\n\tangularMeteorCollection.factory('$meteorCollectionFS', ['$meteorCollection', 'diffArray', '$angularMeteorSettings', function ($meteorCollection, diffArray, $angularMeteorSettings) {\n\t function $meteorCollectionFS(reactiveFunc, autoClientSave, collection) {\n\t\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.$meteorCollectionFS] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/files. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t return new $meteorCollection(reactiveFunc, autoClientSave, collection, diffArray.shallow);\n\t }\n\t\n\t return $meteorCollectionFS;\n\t}]);\n\t\n\tangularMeteorCollection.factory('$meteorCollection', ['AngularMeteorCollection', '$rootScope', 'diffArray', function (AngularMeteorCollection, $rootScope, diffArray) {\n\t function $meteorCollection(reactiveFunc, autoClientSave, collection, diffFn) {\n\t // Validate parameters\n\t if (!reactiveFunc) {\n\t throw new TypeError('The first argument of $meteorCollection is undefined.');\n\t }\n\t\n\t if (!(angular.isFunction(reactiveFunc) || angular.isFunction(reactiveFunc.find))) {\n\t throw new TypeError('The first argument of $meteorCollection must be a function or ' + 'a have a find function property.');\n\t }\n\t\n\t if (!angular.isFunction(reactiveFunc)) {\n\t collection = angular.isDefined(collection) ? collection : reactiveFunc;\n\t reactiveFunc = _.bind(reactiveFunc.find, reactiveFunc);\n\t }\n\t\n\t // By default auto save - true.\n\t autoClientSave = angular.isDefined(autoClientSave) ? autoClientSave : true;\n\t diffFn = diffFn || diffArray;\n\t return new AngularMeteorCollection(reactiveFunc, collection, diffFn, autoClientSave);\n\t }\n\t\n\t return $meteorCollection;\n\t}]);\n\t\n\tangularMeteorCollection.run(['$rootScope', '$meteorCollection', '$meteorCollectionFS', '$meteorStopper', function ($rootScope, $meteorCollection, $meteorCollectionFS, $meteorStopper) {\n\t var scopeProto = Object.getPrototypeOf($rootScope);\n\t scopeProto.$meteorCollection = $meteorStopper($meteorCollection);\n\t scopeProto.$meteorCollectionFS = $meteorStopper($meteorCollectionFS);\n\t}]);\n\n/***/ },\n/* 7 */\n/***/ function(module, exports) {\n\n\t/*global\r\n\t angular, _, Mongo\r\n\t*/\n\t\n\t'use strict';\n\t\n\tvar angularMeteorObject = angular.module('angular-meteor.object', ['angular-meteor.utils', 'angular-meteor.subscribe', 'angular-meteor.collection', 'getUpdates', 'diffArray']);\n\t\n\tangularMeteorObject.factory('AngularMeteorObject', ['$q', '$meteorSubscribe', '$meteorUtils', 'diffArray', 'getUpdates', 'AngularMeteorCollection', '$angularMeteorSettings', function ($q, $meteorSubscribe, $meteorUtils, diffArray, getUpdates, AngularMeteorCollection, $angularMeteorSettings) {\n\t\n\t // A list of internals properties to not watch for, nor pass to the Document on update and etc.\n\t AngularMeteorObject.$$internalProps = ['$$collection', '$$options', '$$id', '$$hashkey', '$$internalProps', '$$scope', 'bind', 'save', 'reset', 'subscribe', 'stop', 'autorunComputation', 'unregisterAutoBind', 'unregisterAutoDestroy', 'getRawObject', '_auto', '_setAutos', '_eventEmitter', '_serverBackup', '_updateDiff', '_updateParallel', '_getId'];\n\t\n\t function AngularMeteorObject(collection, selector, options) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.$meteorObject] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorObject. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t // Make data not be an object so we can extend it to preserve\n\t // Collection Helpers and the like\n\t var helpers = collection._helpers;\n\t var data = _.isFunction(helpers) ? Object.create(helpers.prototype) : {};\n\t var doc = collection.findOne(selector, options);\n\t var collectionExtension = _.pick(AngularMeteorCollection, '_updateParallel');\n\t _.extend(data, doc);\n\t _.extend(data, AngularMeteorObject);\n\t _.extend(data, collectionExtension);\n\t\n\t // Omit options that may spoil document finding\n\t data.$$options = _.omit(options, 'skip', 'limit');\n\t data.$$collection = collection;\n\t data.$$id = data._getId(selector);\n\t data._serverBackup = doc || {};\n\t\n\t return data;\n\t }\n\t\n\t AngularMeteorObject.getRawObject = function () {\n\t return angular.copy(_.omit(this, this.$$internalProps));\n\t };\n\t\n\t AngularMeteorObject.subscribe = function () {\n\t $meteorSubscribe.subscribe.apply(this, arguments);\n\t return this;\n\t };\n\t\n\t AngularMeteorObject.save = function (custom) {\n\t var deferred = $q.defer();\n\t var collection = this.$$collection;\n\t var createFulfill = _.partial($meteorUtils.fulfill, deferred, null);\n\t var oldDoc = collection.findOne(this.$$id);\n\t var mods;\n\t\n\t // update\n\t if (oldDoc) {\n\t if (custom) mods = { $set: custom };else {\n\t mods = getUpdates(oldDoc, this.getRawObject());\n\t // If there are no updates, there is nothing to do here, returning\n\t if (_.isEmpty(mods)) {\n\t return $q.when({ action: 'updated' });\n\t }\n\t }\n\t\n\t // NOTE: do not use #upsert() method, since it does not exist in some collections\n\t this._updateDiff(mods, createFulfill({ action: 'updated' }));\n\t }\n\t // insert\n\t else {\n\t if (custom) mods = _.clone(custom);else mods = this.getRawObject();\n\t\n\t mods._id = mods._id || this.$$id;\n\t collection.insert(mods, createFulfill({ action: 'inserted' }));\n\t }\n\t\n\t return deferred.promise;\n\t };\n\t\n\t AngularMeteorObject._updateDiff = function (update, callback) {\n\t var selector = this.$$id;\n\t AngularMeteorCollection._updateDiff.call(this, selector, update, callback);\n\t };\n\t\n\t AngularMeteorObject.reset = function (keepClientProps) {\n\t var self = this;\n\t var options = this.$$options;\n\t var id = this.$$id;\n\t var doc = this.$$collection.findOne(id, options);\n\t\n\t if (doc) {\n\t // extend SubObject\n\t var docKeys = _.keys(doc);\n\t var docExtension = _.pick(doc, docKeys);\n\t var clientProps;\n\t\n\t _.extend(self, docExtension);\n\t _.extend(self._serverBackup, docExtension);\n\t\n\t if (keepClientProps) {\n\t clientProps = _.intersection(_.keys(self), _.keys(self._serverBackup));\n\t } else {\n\t clientProps = _.keys(self);\n\t }\n\t\n\t var serverProps = _.keys(doc);\n\t var removedKeys = _.difference(clientProps, serverProps, self.$$internalProps);\n\t\n\t removedKeys.forEach(function (prop) {\n\t delete self[prop];\n\t delete self._serverBackup[prop];\n\t });\n\t } else {\n\t _.keys(this.getRawObject()).forEach(function (prop) {\n\t delete self[prop];\n\t });\n\t\n\t self._serverBackup = {};\n\t }\n\t };\n\t\n\t AngularMeteorObject.stop = function () {\n\t if (this.unregisterAutoDestroy) this.unregisterAutoDestroy();\n\t\n\t if (this.unregisterAutoBind) this.unregisterAutoBind();\n\t\n\t if (this.autorunComputation && this.autorunComputation.stop) this.autorunComputation.stop();\n\t };\n\t\n\t AngularMeteorObject._getId = function (selector) {\n\t var options = _.extend({}, this.$$options, {\n\t fields: { _id: 1 },\n\t reactive: false,\n\t transform: null\n\t });\n\t\n\t var doc = this.$$collection.findOne(selector, options);\n\t\n\t if (doc) return doc._id;\n\t if (selector instanceof Mongo.ObjectID) return selector;\n\t if (_.isString(selector)) return selector;\n\t return new Mongo.ObjectID();\n\t };\n\t\n\t return AngularMeteorObject;\n\t}]);\n\t\n\tangularMeteorObject.factory('$meteorObject', ['$rootScope', '$meteorUtils', 'getUpdates', 'AngularMeteorObject', function ($rootScope, $meteorUtils, getUpdates, AngularMeteorObject) {\n\t function $meteorObject(collection, id, auto, options) {\n\t // Validate parameters\n\t if (!collection) {\n\t throw new TypeError(\"The first argument of $meteorObject is undefined.\");\n\t }\n\t\n\t if (!angular.isFunction(collection.findOne)) {\n\t throw new TypeError(\"The first argument of $meteorObject must be a function or a have a findOne function property.\");\n\t }\n\t\n\t var data = new AngularMeteorObject(collection, id, options);\n\t // Making auto default true - http://stackoverflow.com/a/15464208/1426570\n\t data._auto = auto !== false;\n\t _.extend(data, $meteorObject);\n\t data._setAutos();\n\t return data;\n\t }\n\t\n\t $meteorObject._setAutos = function () {\n\t var self = this;\n\t\n\t this.autorunComputation = $meteorUtils.autorun($rootScope, function () {\n\t self.reset(true);\n\t });\n\t\n\t // Deep watches the model and performs autobind\n\t this.unregisterAutoBind = this._auto && $rootScope.$watch(function () {\n\t return self.getRawObject();\n\t }, function (item, oldItem) {\n\t if (item !== oldItem) self.save();\n\t }, true);\n\t\n\t this.unregisterAutoDestroy = $rootScope.$on('$destroy', function () {\n\t if (self && self.stop) self.pop();\n\t });\n\t };\n\t\n\t return $meteorObject;\n\t}]);\n\t\n\tangularMeteorObject.run(['$rootScope', '$meteorObject', '$meteorStopper', function ($rootScope, $meteorObject, $meteorStopper) {\n\t var scopeProto = Object.getPrototypeOf($rootScope);\n\t scopeProto.$meteorObject = $meteorStopper($meteorObject);\n\t}]);\n\n/***/ },\n/* 8 */\n/***/ function(module, exports) {\n\n\t/*global\r\n\t angular, _, Package, Meteor\r\n\t */\n\t\n\t'use strict';\n\t\n\tvar angularMeteorUser = angular.module('angular-meteor.user', ['angular-meteor.utils', 'angular-meteor.core']);\n\t\n\t// requires package 'accounts-password'\n\tangularMeteorUser.service('$meteorUser', ['$rootScope', '$meteorUtils', '$q', '$angularMeteorSettings', function ($rootScope, $meteorUtils, $q, $angularMeteorSettings) {\n\t\n\t var pack = Package['accounts-base'];\n\t if (!pack) return;\n\t\n\t var self = this;\n\t var Accounts = pack.Accounts;\n\t\n\t this.waitForUser = function () {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.waitForUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t var deferred = $q.defer();\n\t\n\t $meteorUtils.autorun($rootScope, function () {\n\t if (!Meteor.loggingIn()) deferred.resolve(Meteor.user());\n\t }, true);\n\t\n\t return deferred.promise;\n\t };\n\t\n\t this.requireUser = function () {\n\t if (!$angularMeteorSettings.suppressWarnings) {\n\t console.warn('[angular-meteor.requireUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t }\n\t\n\t var deferred = $q.defer();\n\t\n\t $meteorUtils.autorun($rootScope, function () {\n\t if (!Meteor.loggingIn()) {\n\t if (Meteor.user() === null) deferred.reject(\"AUTH_REQUIRED\");else deferred.resolve(Meteor.user());\n\t }\n\t }, true);\n\t\n\t return deferred.promise;\n\t };\n\t\n\t this.requireValidUser = function (validatorFn) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.requireValidUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t return self.requireUser(true).then(function (user) {\n\t var valid = validatorFn(user);\n\t\n\t if (valid === true) return user;else if (typeof valid === \"string\") return $q.reject(valid);else return $q.reject(\"FORBIDDEN\");\n\t });\n\t };\n\t\n\t this.loginWithPassword = $meteorUtils.promissor(Meteor, 'loginWithPassword');\n\t this.createUser = $meteorUtils.promissor(Accounts, 'createUser');\n\t this.changePassword = $meteorUtils.promissor(Accounts, 'changePassword');\n\t this.forgotPassword = $meteorUtils.promissor(Accounts, 'forgotPassword');\n\t this.resetPassword = $meteorUtils.promissor(Accounts, 'resetPassword');\n\t this.verifyEmail = $meteorUtils.promissor(Accounts, 'verifyEmail');\n\t this.logout = $meteorUtils.promissor(Meteor, 'logout');\n\t this.logoutOtherClients = $meteorUtils.promissor(Meteor, 'logoutOtherClients');\n\t this.loginWithFacebook = $meteorUtils.promissor(Meteor, 'loginWithFacebook');\n\t this.loginWithTwitter = $meteorUtils.promissor(Meteor, 'loginWithTwitter');\n\t this.loginWithGoogle = $meteorUtils.promissor(Meteor, 'loginWithGoogle');\n\t this.loginWithGithub = $meteorUtils.promissor(Meteor, 'loginWithGithub');\n\t this.loginWithMeteorDeveloperAccount = $meteorUtils.promissor(Meteor, 'loginWithMeteorDeveloperAccount');\n\t this.loginWithMeetup = $meteorUtils.promissor(Meteor, 'loginWithMeetup');\n\t this.loginWithWeibo = $meteorUtils.promissor(Meteor, 'loginWithWeibo');\n\t}]);\n\t\n\tangularMeteorUser.run(['$rootScope', '$angularMeteorSettings', '$$Core', function ($rootScope, $angularMeteorSettings, $$Core) {\n\t\n\t var ScopeProto = Object.getPrototypeOf($rootScope);\n\t _.extend(ScopeProto, $$Core);\n\t\n\t $rootScope.autorun(function () {\n\t if (!Meteor.user) return;\n\t $rootScope.currentUser = Meteor.user();\n\t $rootScope.loggingIn = Meteor.loggingIn();\n\t });\n\t}]);\n\n/***/ },\n/* 9 */\n/***/ function(module, exports) {\n\n\t/*global\r\n\t angular, _, Meteor\r\n\t */\n\t\n\t'use strict';\n\t\n\tvar angularMeteorMethods = angular.module('angular-meteor.methods', ['angular-meteor.utils']);\n\t\n\tangularMeteorMethods.service('$meteorMethods', ['$q', '$meteorUtils', '$angularMeteorSettings', function ($q, $meteorUtils, $angularMeteorSettings) {\n\t this.call = function () {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.$meteor.call] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/methods. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t var deferred = $q.defer();\n\t var fulfill = $meteorUtils.fulfill(deferred);\n\t var args = _.toArray(arguments).concat(fulfill);\n\t Meteor.call.apply(this, args);\n\t return deferred.promise;\n\t };\n\t}]);\n\n/***/ },\n/* 10 */\n/***/ function(module, exports) {\n\n\t/*global\r\n\t angular, Session\r\n\t */\n\t\n\t'use strict';\n\t\n\tvar angularMeteorSession = angular.module('angular-meteor.session', ['angular-meteor.utils']);\n\t\n\tangularMeteorSession.factory('$meteorSession', ['$meteorUtils', '$parse', '$angularMeteorSettings', function ($meteorUtils, $parse, $angularMeteorSettings) {\n\t return function (session) {\n\t\n\t return {\n\t\n\t bind: function bind(scope, model) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.session.bind] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://www.angular-meteor.com/api/1.3.0/session. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t var getter = $parse(model);\n\t var setter = getter.assign;\n\t $meteorUtils.autorun(scope, function () {\n\t setter(scope, Session.get(session));\n\t });\n\t\n\t scope.$watch(model, function (newItem, oldItem) {\n\t Session.set(session, getter(scope));\n\t }, true);\n\t }\n\t };\n\t };\n\t}]);\n\n/***/ },\n/* 11 */\n/***/ function(module, exports) {\n\n\t/*global\r\n\t angular, Package\r\n\t */\n\t\n\t'use strict';\n\t\n\tvar angularMeteorCamera = angular.module('angular-meteor.camera', ['angular-meteor.utils']);\n\t\n\t// requires package 'mdg:camera'\n\tangularMeteorCamera.service('$meteorCamera', ['$q', '$meteorUtils', '$angularMeteorSettings', function ($q, $meteorUtils, $angularMeteorSettings) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t var pack = Package['mdg:camera'];\n\t if (!pack) return;\n\t\n\t var MeteorCamera = pack.MeteorCamera;\n\t\n\t this.getPicture = function (options) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t options = options || {};\n\t var deferred = $q.defer();\n\t MeteorCamera.getPicture(options, $meteorUtils.fulfill(deferred));\n\t return deferred.promise;\n\t };\n\t}]);\n\n/***/ },\n/* 12 */\n/***/ function(module, exports) {\n\n\t/*global\r\n\t angular\r\n\t */\n\t\n\t'use strict';\n\t\n\tvar angularMeteorStopper = angular.module('angular-meteor.stopper', ['angular-meteor.subscribe']);\n\t\n\tangularMeteorStopper.factory('$meteorStopper', ['$q', '$meteorSubscribe', function ($q, $meteorSubscribe) {\n\t function $meteorStopper($meteorEntity) {\n\t return function () {\n\t var args = Array.prototype.slice.call(arguments);\n\t var meteorEntity = $meteorEntity.apply(this, args);\n\t\n\t angular.extend(meteorEntity, $meteorStopper);\n\t meteorEntity.$$scope = this;\n\t\n\t this.$on('$destroy', function () {\n\t meteorEntity.stop();\n\t if (meteorEntity.subscription) meteorEntity.subscription.stop();\n\t });\n\t\n\t return meteorEntity;\n\t };\n\t }\n\t\n\t $meteorStopper.subscribe = function () {\n\t var args = Array.prototype.slice.call(arguments);\n\t this.subscription = $meteorSubscribe._subscribe(this.$$scope, $q.defer(), args);\n\t return this;\n\t };\n\t\n\t return $meteorStopper;\n\t}]);\n\n/***/ },\n/* 13 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\tvar _module = 'angular-meteor.utilities';\n\texports.module = _module;\n\tvar utils = exports.utils = '$$utils';\n\t\n\tangular.module(_module, [])\n\t\n\t/*\n\t A utility service which is provided with general utility functions\n\t */\n\t.service(utils, ['$rootScope', function ($rootScope) {\n\t var _this = this;\n\t\n\t // Checks if an object is a cursor\n\t this.isCursor = function (obj) {\n\t return obj instanceof Meteor.Collection.Cursor;\n\t };\n\t\n\t // Cheecks if an object is a scope\n\t this.isScope = function (obj) {\n\t return obj instanceof $rootScope.constructor;\n\t };\n\t\n\t // Checks if two objects are siblings\n\t this.areSiblings = function (obj1, obj2) {\n\t return _.isObject(obj1) && _.isObject(obj2) && Object.getPrototypeOf(obj1) === Object.getPrototypeOf(obj2);\n\t };\n\t\n\t // Binds function into a scpecified context. If an object is provided, will bind every\n\t // value in the object which is a function. If a tap function is provided, it will be\n\t // called right after the function has been invoked.\n\t this.bind = function (fn, context, tap) {\n\t tap = _.isFunction(tap) ? tap : angular.noop;\n\t if (_.isFunction(fn)) return bindFn(fn, context, tap);\n\t if (_.isObject(fn)) return bindObj(fn, context, tap);\n\t return fn;\n\t };\n\t\n\t var bindFn = function bindFn(fn, context, tap) {\n\t return function () {\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t var result = fn.apply(context, args);\n\t tap.call(context, {\n\t result: result,\n\t args: args\n\t });\n\t return result;\n\t };\n\t };\n\t\n\t var bindObj = function bindObj(obj, context, tap) {\n\t return _.keys(obj).reduce(function (bound, k) {\n\t bound[k] = _this.bind(obj[k], context, tap);\n\t return bound;\n\t }, {});\n\t };\n\t}]);\n\n/***/ },\n/* 14 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\t\n\tvar _module = 'angular-meteor.mixer';\n\texports.module = _module;\n\tvar Mixer = exports.Mixer = '$Mixer';\n\t\n\tangular.module(_module, [])\n\t\n\t/*\n\t A service which lets us apply mixins into the `ChildScope` prototype.\n\t The flow is simple. Once we define a mixin, it will be stored in the `$Mixer`,\n\t and any time a `ChildScope` prototype is created\n\t it will be extended by the `$Mixer`.\n\t This concept is good because it keeps our code\n\t clean and simple, and easy to extend.\n\t So any time we would like to define a new behaviour to our scope,\n\t we will just use the `$Mixer` service.\n\t */\n\t.service(Mixer, function () {\n\t var _this = this;\n\t\n\t this._mixins = [];\n\t\n\t // Adds a new mixin\n\t this.mixin = function (mixin) {\n\t if (!_.isObject(mixin)) {\n\t throw Error('argument 1 must be an object');\n\t }\n\t\n\t _this._mixins = _.union(_this._mixins, [mixin]);\n\t return _this;\n\t };\n\t\n\t // Removes a mixin. Useful mainly for test purposes\n\t this._mixout = function (mixin) {\n\t _this._mixins = _.without(_this._mixins, mixin);\n\t return _this;\n\t };\n\t\n\t // Invoke function mixins with the provided context and arguments\n\t this._construct = function (context) {\n\t for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n\t args[_key - 1] = arguments[_key];\n\t }\n\t\n\t _this._mixins.filter(_.isFunction).forEach(function (mixin) {\n\t mixin.call.apply(mixin, [context].concat(args));\n\t });\n\t\n\t return context;\n\t };\n\t\n\t // Extend prototype with the defined mixins\n\t this._extend = function (obj) {\n\t var _ref;\n\t\n\t return (_ref = _).extend.apply(_ref, [obj].concat(_toConsumableArray(_this._mixins)));\n\t };\n\t});\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.module = undefined;\n\t\n\tvar _mixer = __webpack_require__(14);\n\t\n\tvar _module = 'angular-meteor.scope';\n\t\n\texports.module = _module;\n\tangular.module(_module, [_mixer.module]).run(['$rootScope', _mixer.Mixer, function ($rootScope, $Mixer) {\n\t var Scope = $rootScope.constructor;\n\t var $new = $rootScope.$new;\n\t\n\t // Extends and constructs every newly created scope without affecting the root scope\n\t Scope.prototype.$new = function (isolate, parent) {\n\t var firstChild = this === $rootScope && !this.$$ChildScope;\n\t var scope = $new.call(this, isolate, parent);\n\t\n\t // If the scope is isolated we would like to extend it aswell\n\t if (isolate) {\n\t // The scope is the prototype of its upcomming child scopes, so the methods would\n\t // be accessable to them as well\n\t $Mixer._extend(scope);\n\t }\n\t // Else, if this is the first child of the root scope we would like to apply the extensions\n\t // without affection the root scope\n\t else if (firstChild) {\n\t // Creating a middle layer where all the extensions are gonna be applied to\n\t scope.__proto__ = this.$$ChildScope.prototype = $Mixer._extend(Object.create(this));\n\t }\n\t\n\t return $Mixer._construct(scope);\n\t };\n\t}]);\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.Core = exports.module = undefined;\n\t\n\tvar _utils = __webpack_require__(13);\n\t\n\tvar _mixer = __webpack_require__(14);\n\t\n\tfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\t\n\tvar _module = 'angular-meteor.core';\n\texports.module = _module;\n\tvar Core = exports.Core = '$$Core';\n\t\n\tangular.module(_module, [_utils.module, _mixer.module])\n\t\n\t/*\n\t A mixin which provides us with core Meteor functions.\n\t */\n\t.factory(Core, ['$q', _utils.utils, function ($q, $$utils) {\n\t function $$Core() {}\n\t\n\t // Calls Meteor.autorun() which will be digested after each run and automatically destroyed\n\t $$Core.autorun = function (fn) {\n\t var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\t\n\t fn = this.$bindToContext(fn);\n\t\n\t if (!_.isFunction(fn)) {\n\t throw Error('argument 1 must be a function');\n\t }\n\t if (!_.isObject(options)) {\n\t throw Error('argument 2 must be an object');\n\t }\n\t\n\t var computation = Tracker.autorun(fn, options);\n\t this.$$autoStop(computation);\n\t return computation;\n\t };\n\t\n\t // Calls Meteor.subscribe() which will be digested after each invokation\n\t // and automatically destroyed\n\t $$Core.subscribe = function (name, fn, cb) {\n\t fn = this.$bindToContext(fn || angular.noop);\n\t cb = cb ? this.$bindToContext(cb) : angular.noop;\n\t\n\t if (!_.isString(name)) {\n\t throw Error('argument 1 must be a string');\n\t }\n\t if (!_.isFunction(fn)) {\n\t throw Error('argument 2 must be a function');\n\t }\n\t if (!_.isFunction(cb) && !_.isObject(cb)) {\n\t throw Error('argument 3 must be a function or an object');\n\t }\n\t\n\t var result = {};\n\t\n\t var computation = this.autorun(function () {\n\t var _Meteor;\n\t\n\t var args = fn();\n\t if (angular.isUndefined(args)) args = [];\n\t\n\t if (!_.isArray(args)) {\n\t throw Error('reactive function\\'s return value must be an array');\n\t }\n\t\n\t var subscription = (_Meteor = Meteor).subscribe.apply(_Meteor, [name].concat(_toConsumableArray(args), [cb]));\n\t result.ready = subscription.ready.bind(subscription);\n\t result.subscriptionId = subscription.subscriptionId;\n\t });\n\t\n\t // Once the computation has been stopped,\n\t // any subscriptions made inside will be stopped as well\n\t result.stop = computation.stop.bind(computation);\n\t return result;\n\t };\n\t\n\t // Calls Meteor.call() wrapped by a digestion cycle\n\t $$Core.callMethod = function () {\n\t var _Meteor2;\n\t\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t var fn = args.pop();\n\t if (_.isFunction(fn)) fn = this.$bindToContext(fn);\n\t return (_Meteor2 = Meteor).call.apply(_Meteor2, args.concat([fn]));\n\t };\n\t\n\t // Calls Meteor.apply() wrapped by a digestion cycle\n\t $$Core.applyMethod = function () {\n\t var _Meteor3;\n\t\n\t for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n\t args[_key2] = arguments[_key2];\n\t }\n\t\n\t var fn = args.pop();\n\t if (_.isFunction(fn)) fn = this.$bindToContext(fn);\n\t return (_Meteor3 = Meteor).apply.apply(_Meteor3, args.concat([fn]));\n\t };\n\t\n\t $$Core.$$autoStop = function (stoppable) {\n\t this.$on('$destroy', stoppable.stop.bind(stoppable));\n\t };\n\t\n\t // Digests scope only if there is no phase at the moment\n\t $$Core.$$throttledDigest = function () {\n\t var isDigestable = !this.$$destroyed && !this.$$phase && !this.$root.$$phase;\n\t\n\t if (isDigestable) this.$digest();\n\t };\n\t\n\t // Creates a promise only that the digestion cycle will be called at its fulfillment\n\t $$Core.$$defer = function () {\n\t var deferred = $q.defer();\n\t // Once promise has been fulfilled, digest\n\t deferred.promise = deferred.promise.finally(this.$$throttledDigest.bind(this));\n\t return deferred;\n\t };\n\t\n\t // Binds an object or a function to the scope to the view model and digest it once it is invoked\n\t $$Core.$bindToContext = function (fn) {\n\t return $$utils.bind(fn, this, this.$$throttledDigest.bind(this));\n\t };\n\t\n\t return $$Core;\n\t}]);\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.reactive = exports.ViewModel = exports.module = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _utils = __webpack_require__(13);\n\t\n\tvar _mixer = __webpack_require__(14);\n\t\n\tvar _core = __webpack_require__(16);\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar _module = 'angular-meteor.view-model';\n\texports.module = _module;\n\tvar ViewModel = exports.ViewModel = '$$ViewModel';\n\tvar reactive = exports.reactive = '$reactive';\n\t\n\tangular.module(_module, [_utils.module, _mixer.module, _core.module])\n\t\n\t/*\n\t A mixin which lets us bind a view model into a scope.\n\t Note that only a single view model can be bound,\n\t otherwise the scope might behave unexpectedly.\n\t Mainly used to define the controller as the view model,\n\t and very useful when wanting to use Angular's `controllerAs` syntax.\n\t */\n\t.factory(ViewModel, [_utils.utils, _mixer.Mixer, function ($$utils, $Mixer) {\n\t function $$ViewModel() {\n\t var vm = arguments.length <= 0 || arguments[0] === undefined ? this : arguments[0];\n\t\n\t // Defines the view model on the scope.\n\t this.$$vm = vm;\n\t }\n\t\n\t // Gets an object, wraps it with scope functions and returns it\n\t $$ViewModel.viewModel = function (vm) {\n\t var _this = this;\n\t\n\t if (!_.isObject(vm)) {\n\t throw Error('argument 1 must be an object');\n\t }\n\t\n\t // Apply mixin functions\n\t $Mixer._mixins.forEach(function (mixin) {\n\t // Reject methods which starts with double $\n\t var keys = _.keys(mixin).filter(function (k) {\n\t return k.match(/^(?!\\$\\$).*$/);\n\t });\n\t var proto = _.pick(mixin, keys);\n\t // Bind all the methods to the prototype\n\t var boundProto = $$utils.bind(proto, _this);\n\t // Add the methods to the view model\n\t _.extend(vm, boundProto);\n\t });\n\t\n\t // Apply mixin constructors on the view model\n\t $Mixer._construct(this, vm);\n\t return vm;\n\t };\n\t\n\t // Override $$Core.$bindToContext to be bound to view model instead of scope\n\t $$ViewModel.$bindToContext = function (fn) {\n\t return $$utils.bind(fn, this.$$vm, this.$$throttledDigest.bind(this));\n\t };\n\t\n\t return $$ViewModel;\n\t}])\n\t\n\t/*\n\t Illustrates the old API where a view model is created using $reactive service\n\t */\n\t.service(reactive, [_utils.utils, function ($$utils) {\n\t var Reactive = function () {\n\t function Reactive(vm) {\n\t var _this2 = this;\n\t\n\t _classCallCheck(this, Reactive);\n\t\n\t if (!_.isObject(vm)) {\n\t throw Error('argument 1 must be an object');\n\t }\n\t\n\t _.defer(function () {\n\t if (!_this2._attached) {\n\t console.warn('view model was not attached to any scope');\n\t }\n\t });\n\t\n\t this._vm = vm;\n\t }\n\t\n\t _createClass(Reactive, [{\n\t key: 'attach',\n\t value: function attach(scope) {\n\t this._attached = true;\n\t\n\t if (!$$utils.isScope(scope)) {\n\t throw Error('argument 1 must be a scope');\n\t }\n\t\n\t var viewModel = scope.viewModel(this._vm);\n\t\n\t // Similar to the old/Meteor API\n\t viewModel.call = viewModel.callMethod;\n\t viewModel.apply = viewModel.applyMethod;\n\t\n\t return viewModel;\n\t }\n\t }]);\n\t\n\t return Reactive;\n\t }();\n\t\n\t return function (vm) {\n\t return new Reactive(vm);\n\t };\n\t}]);\n\n/***/ },\n/* 18 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.Reactive = exports.module = undefined;\n\t\n\tvar _utils = __webpack_require__(13);\n\t\n\tvar _mixer = __webpack_require__(14);\n\t\n\tvar _core = __webpack_require__(16);\n\t\n\tvar _viewModel = __webpack_require__(17);\n\t\n\tvar _module = 'angular-meteor.reactive';\n\texports.module = _module;\n\tvar Reactive = exports.Reactive = '$$Reactive';\n\t\n\tangular.module(_module, [_utils.module, _mixer.module, _core.module, _viewModel.module])\n\t\n\t/*\n\t A mixin which enhance our reactive abilities by providing methods\n\t that are capable of updating our scope reactively.\n\t */\n\t.factory(Reactive, ['$parse', _utils.utils, '$angularMeteorSettings', function ($parse, $$utils, $angularMeteorSettings) {\n\t function $$Reactive() {\n\t var vm = arguments.length <= 0 || arguments[0] === undefined ? this : arguments[0];\n\t\n\t // Helps us track changes made in the view model\n\t vm.$$dependencies = {};\n\t }\n\t\n\t // Gets an object containing functions and define their results as reactive properties.\n\t // Once a return value has been changed the property will be reset.\n\t $$Reactive.helpers = function () {\n\t var _this = this;\n\t\n\t var props = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t if (!_.isObject(props)) {\n\t throw Error('argument 1 must be an object');\n\t }\n\t\n\t _.each(props, function (v, k, i) {\n\t if (!_.isFunction(v)) {\n\t throw Error('helper ' + (i + 1) + ' must be a function');\n\t }\n\t\n\t if (!_this.$$vm.$$dependencies[k]) {\n\t // Registers a new dependency to the specified helper\n\t _this.$$vm.$$dependencies[k] = new Tracker.Dependency();\n\t }\n\t\n\t _this.$$setFnHelper(k, v);\n\t });\n\t };\n\t\n\t // Gets a model reactively\n\t $$Reactive.getReactively = function (k) {\n\t var isDeep = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];\n\t\n\t if (!_.isBoolean(isDeep)) {\n\t throw Error('argument 2 must be a boolean');\n\t }\n\t\n\t return this.$$reactivateEntity(k, this.$watch, isDeep);\n\t };\n\t\n\t // Gets a collection reactively\n\t $$Reactive.getCollectionReactively = function (k) {\n\t return this.$$reactivateEntity(k, this.$watchCollection);\n\t };\n\t\n\t // Gets an entity reactively, and once it has been changed the computation will be recomputed\n\t $$Reactive.$$reactivateEntity = function (k, watcher) {\n\t if (!_.isString(k)) {\n\t throw Error('argument 1 must be a string');\n\t }\n\t\n\t if (!this.$$vm.$$dependencies[k]) {\n\t this.$$vm.$$dependencies[k] = new Tracker.Dependency();\n\t\n\t for (var _len = arguments.length, watcherArgs = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n\t watcherArgs[_key - 2] = arguments[_key];\n\t }\n\t\n\t this.$$watchEntity.apply(this, [k, watcher].concat(watcherArgs));\n\t }\n\t\n\t this.$$vm.$$dependencies[k].depend();\n\t return $parse(k)(this.$$vm);\n\t };\n\t\n\t // Watches for changes in the view model, and if so will notify a change\n\t $$Reactive.$$watchEntity = function (k, watcher) {\n\t var _this2 = this;\n\t\n\t // Gets a deep property from the view model\n\t var getVal = _.partial($parse(k), this.$$vm);\n\t var initialVal = getVal();\n\t\n\t // Watches for changes in the view model\n\t\n\t for (var _len2 = arguments.length, watcherArgs = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n\t watcherArgs[_key2 - 2] = arguments[_key2];\n\t }\n\t\n\t watcher.call.apply(watcher, [this, getVal, function (val, oldVal) {\n\t var hasChanged = val !== initialVal || val !== oldVal;\n\t\n\t // Notify if a change has been detected\n\t if (hasChanged) _this2.$$changed(k);\n\t }].concat(watcherArgs));\n\t };\n\t\n\t // Invokes a function and sets the return value as a property\n\t $$Reactive.$$setFnHelper = function (k, fn) {\n\t var _this3 = this;\n\t\n\t this.autorun(function (computation) {\n\t // Invokes the reactive functon\n\t var model = fn.apply(_this3.$$vm);\n\t\n\t // Ignore notifications made by the following handler\n\t Tracker.nonreactive(function () {\n\t // If a cursor, observe its changes and update acoordingly\n\t if ($$utils.isCursor(model)) {\n\t (function () {\n\t var observation = _this3.$$handleCursor(k, model);\n\t\n\t computation.onInvalidate(function () {\n\t observation.stop();\n\t _this3.$$vm[k].splice(0);\n\t });\n\t })();\n\t } else {\n\t _this3.$$handleNonCursor(k, model);\n\t }\n\t\n\t // Notify change and update the view model\n\t _this3.$$changed(k);\n\t });\n\t });\n\t };\n\t\n\t // Sets a value helper as a setter and a getter which will notify computations once used\n\t $$Reactive.$$setValHelper = function (k, v) {\n\t var _this4 = this;\n\t\n\t var watch = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2];\n\t\n\t // If set, reactives property\n\t if (watch) {\n\t var isDeep = _.isObject(v);\n\t this.getReactively(k, isDeep);\n\t }\n\t\n\t Object.defineProperty(this.$$vm, k, {\n\t configurable: true,\n\t enumerable: true,\n\t\n\t get: function get() {\n\t return v;\n\t },\n\t set: function set(newVal) {\n\t v = newVal;\n\t _this4.$$changed(k);\n\t }\n\t });\n\t };\n\t\n\t // Fetching a cursor and updates properties once the result set has been changed\n\t $$Reactive.$$handleCursor = function (k, cursor) {\n\t var _this5 = this;\n\t\n\t // If not defined set it\n\t if (angular.isUndefined(this.$$vm[k])) {\n\t this.$$setValHelper(k, cursor.fetch(), false);\n\t }\n\t // If defined update it\n\t else {\n\t var diff = jsondiffpatch.diff(this.$$vm[k], cursor.fetch());\n\t jsondiffpatch.patch(this.$$vm[k], diff);\n\t }\n\t\n\t // Observe changes made in the result set\n\t var observation = cursor.observe({\n\t addedAt: function addedAt(doc, atIndex) {\n\t if (!observation) return;\n\t _this5.$$vm[k].splice(atIndex, 0, doc);\n\t _this5.$$changed(k);\n\t },\n\t changedAt: function changedAt(doc, oldDoc, atIndex) {\n\t var diff = jsondiffpatch.diff(_this5.$$vm[k][atIndex], doc);\n\t jsondiffpatch.patch(_this5.$$vm[k][atIndex], diff);\n\t _this5.$$changed(k);\n\t },\n\t movedTo: function movedTo(doc, fromIndex, toIndex) {\n\t _this5.$$vm[k].splice(fromIndex, 1);\n\t _this5.$$vm[k].splice(toIndex, 0, doc);\n\t _this5.$$changed(k);\n\t },\n\t removedAt: function removedAt(oldDoc, atIndex) {\n\t _this5.$$vm[k].splice(atIndex, 1);\n\t _this5.$$changed(k);\n\t }\n\t });\n\t\n\t return observation;\n\t };\n\t\n\t $$Reactive.$$handleNonCursor = function (k, data) {\n\t var v = this.$$vm[k];\n\t\n\t if (angular.isDefined(v)) {\n\t delete this.$$vm[k];\n\t v = null;\n\t }\n\t\n\t if (angular.isUndefined(v)) {\n\t this.$$setValHelper(k, data);\n\t }\n\t // Update property if the new value is from the same type\n\t else if ($$utils.areSiblings(v, data)) {\n\t var diff = jsondiffpatch.diff(v, data);\n\t jsondiffpatch.patch(v, diff);\n\t this.$$changed(k);\n\t } else {\n\t this.$$vm[k] = data;\n\t }\n\t };\n\t\n\t // Notifies dependency in view model\n\t $$Reactive.$$depend = function (k) {\n\t this.$$vm.$$dependencies[k].depend();\n\t };\n\t\n\t // Notifies change in view model\n\t $$Reactive.$$changed = function (k) {\n\t this.$$throttledDigest();\n\t this.$$vm.$$dependencies[k].changed();\n\t };\n\t\n\t return $$Reactive;\n\t}]);\n\n/***/ }\n/******/ ]);\n\n\n/** WEBPACK FOOTER **\n ** dist/angular-meteor.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 39a73188e98df3db7f81\n **/","// lib\nimport './lib/get-updates';\nimport './lib/diff-array';\n// legacy\nimport './modules/angular-meteor-ironrouter';\nimport './modules/angular-meteor-utils';\nimport './modules/angular-meteor-subscribe';\nimport './modules/angular-meteor-collection';\nimport './modules/angular-meteor-object';\nimport './modules/angular-meteor-user';\nimport './modules/angular-meteor-methods';\nimport './modules/angular-meteor-session';\nimport './modules/angular-meteor-camera';\nimport './modules/angular-meteor-stopper';\n\n// new\nimport { module as utilsModule } from './modules/utils';\nimport { module as mixerModule, Mixer } from './modules/mixer';\nimport { module as scopeModule } from './modules/scope';\nimport { module as coreModule, Core } from './modules/core';\nimport { module as viewModelModule, ViewModel } from './modules/view-model';\nimport { module as reactiveModule, Reactive } from './modules/reactive';\n\nconst module = 'angular-meteor';\nexport default module;\n\nangular.module(module, [\n // new\n utilsModule,\n mixerModule,\n scopeModule,\n coreModule,\n viewModelModule,\n reactiveModule,\n\n // legacy\n 'angular-meteor.ironrouter',\n 'angular-meteor.utils',\n 'angular-meteor.subscribe',\n 'angular-meteor.collection',\n 'angular-meteor.object',\n 'angular-meteor.user',\n 'angular-meteor.methods',\n 'angular-meteor.session',\n 'angular-meteor.camera'\n\n])\n\n.constant('$angularMeteorSettings', {\n suppressWarnings: false\n})\n\n.run([\n Mixer,\n Core,\n ViewModel,\n Reactive,\n\n function($Mixer, $$Core, $$ViewModel, $$Reactive) {\n // Load all mixins\n $Mixer\n .mixin($$Core)\n .mixin($$ViewModel)\n .mixin($$Reactive);\n }\n])\n\n// legacy\n// Putting all services under $meteor service for syntactic sugar\n.service('$meteor', [\n '$meteorCollection',\n '$meteorCollectionFS',\n '$meteorObject',\n '$meteorMethods',\n '$meteorSession',\n '$meteorSubscribe',\n '$meteorUtils',\n '$meteorCamera',\n '$meteorUser',\n function($meteorCollection, $meteorCollectionFS, $meteorObject,\n $meteorMethods, $meteorSession, $meteorSubscribe, $meteorUtils,\n $meteorCamera, $meteorUser) {\n this.collection = $meteorCollection;\n this.collectionFS = $meteorCollectionFS;\n this.object = $meteorObject;\n this.subscribe = $meteorSubscribe.subscribe;\n this.call = $meteorMethods.call;\n this.session = $meteorSession;\n this.autorun = $meteorUtils.autorun;\n this.getCollectionByName = $meteorUtils.getCollectionByName;\n this.getPicture = $meteorCamera.getPicture;\n\n // $meteorUser\n [\n 'loginWithPassword',\n 'requireUser',\n 'requireValidUser',\n 'waitForUser',\n 'createUser',\n 'changePassword',\n 'forgotPassword',\n 'resetPassword',\n 'verifyEmail',\n 'loginWithMeteorDeveloperAccount',\n 'loginWithFacebook',\n 'loginWithGithub',\n 'loginWithGoogle',\n 'loginWithMeetup',\n 'loginWithTwitter',\n 'loginWithWeibo',\n 'logout',\n 'logoutOtherClients'\n ].forEach((method) => {\n this[method] = $meteorUser[method];\n });\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/angular-meteor.js\n **/","/*global\r\n angular, _\r\n */\r\n\r\n'use strict';\r\n\r\n// https://github.com/DAB0mB/get-updates\r\n(function() {\r\n var module = angular.module('getUpdates', []);\r\n\r\n var utils = (function() {\r\n var rip = function(obj, level) {\r\n if (level < 1) return {};\r\n\r\n return _.reduce(obj, function(clone, v, k) {\r\n v = _.isObject(v) ? rip(v, --level) : v;\r\n clone[k] = v;\r\n return clone;\r\n }, {});\r\n };\r\n\r\n var toPaths = function(obj) {\r\n var keys = getKeyPaths(obj);\r\n var values = getDeepValues(obj);\r\n return _.object(keys, values);\r\n };\r\n\r\n var getKeyPaths = function(obj) {\r\n var keys = _.keys(obj).map(function(k) {\r\n var v = obj[k];\r\n if (!_.isObject(v) || _.isEmpty(v) || _.isArray(v)) return k;\r\n\r\n return getKeyPaths(v).map(function(subKey) {\r\n return k + '.' + subKey;\r\n });\r\n });\r\n\r\n return _.flatten(keys);\r\n };\r\n\r\n var getDeepValues = function(obj,arr) {\r\n arr = arr || [];\r\n\r\n _.values(obj).forEach(function(v) {\r\n if (!_.isObject(v) || _.isEmpty(v) || _.isArray(v))\r\n arr.push(v);\r\n else\r\n getDeepValues(v, arr);\r\n });\r\n\r\n return arr;\r\n };\r\n\r\n var flatten = function(arr) {\r\n return arr.reduce(function(flattened, v, i) {\r\n if (_.isArray(v) && !_.isEmpty(v))\r\n flattened.push.apply(flattened, flatten(v));\r\n else\r\n flattened.push(v);\r\n\r\n return flattened;\r\n }, []);\r\n };\r\n\r\n var setFilled = function(obj, k, v) {\r\n if (!_.isEmpty(v)) obj[k] = v;\r\n };\r\n\r\n var assert = function(result, msg) {\r\n if (!result) throwErr(msg);\r\n };\r\n\r\n var throwErr = function(msg) {\r\n throw Error('get-updates error - ' + msg);\r\n };\r\n\r\n return {\r\n rip: rip,\r\n toPaths: toPaths,\r\n getKeyPaths: getKeyPaths,\r\n getDeepValues: getDeepValues,\r\n setFilled: setFilled,\r\n assert: assert,\r\n throwErr: throwErr\r\n };\r\n })();\r\n\r\n var getDifference = (function() {\r\n var getDifference = function(src, dst, isShallow) {\r\n var level;\r\n\r\n if (isShallow > 1)\r\n level = isShallow;\r\n else if (isShallow)\r\n level = 1;\r\n\r\n if (level) {\r\n src = utils.rip(src, level);\r\n dst = utils.rip(dst, level);\r\n }\r\n\r\n return compare(src, dst);\r\n };\r\n\r\n var compare = function(src, dst) {\r\n var srcKeys = _.keys(src);\r\n var dstKeys = _.keys(dst);\r\n\r\n var keys = _.chain([])\r\n .concat(srcKeys)\r\n .concat(dstKeys)\r\n .uniq()\r\n .without('$$hashKey')\r\n .value();\r\n\r\n return keys.reduce(function(diff, k) {\r\n var srcValue = src[k];\r\n var dstValue = dst[k];\r\n\r\n if (_.isDate(srcValue) && _.isDate(dstValue)) {\r\n if (srcValue.getTime() != dstValue.getTime()) diff[k] = dstValue;\r\n }\r\n\r\n if (_.isObject(srcValue) && _.isObject(dstValue)) {\r\n var valueDiff = getDifference(srcValue, dstValue);\r\n utils.setFilled(diff, k, valueDiff);\r\n }\r\n\r\n else if (srcValue !== dstValue) {\r\n diff[k] = dstValue;\r\n }\r\n\r\n return diff;\r\n }, {});\r\n };\r\n\r\n return getDifference;\r\n })();\r\n\r\n var getUpdates = (function() {\r\n var getUpdates = function(src, dst, isShallow) {\r\n utils.assert(_.isObject(src), 'first argument must be an object');\r\n utils.assert(_.isObject(dst), 'second argument must be an object');\r\n\r\n var diff = getDifference(src, dst, isShallow);\r\n var paths = utils.toPaths(diff);\r\n\r\n var set = createSet(paths);\r\n var unset = createUnset(paths);\r\n var pull = createPull(unset);\r\n\r\n var updates = {};\r\n utils.setFilled(updates, '$set', set);\r\n utils.setFilled(updates, '$unset', unset);\r\n utils.setFilled(updates, '$pull', pull);\r\n\r\n return updates;\r\n };\r\n\r\n var createSet = function(paths) {\r\n var undefinedKeys = getUndefinedKeys(paths);\r\n return _.omit(paths, undefinedKeys);\r\n };\r\n\r\n var createUnset = function(paths) {\r\n var undefinedKeys = getUndefinedKeys(paths);\r\n var unset = _.pick(paths, undefinedKeys);\r\n\r\n return _.reduce(unset, function(result, v, k) {\r\n result[k] = true;\r\n return result;\r\n }, {});\r\n };\r\n\r\n var createPull = function(unset) {\r\n var arrKeyPaths = _.keys(unset).map(function(k) {\r\n var split = k.match(/(.*)\\.\\d+$/);\r\n return split && split[1];\r\n });\r\n\r\n return _.compact(arrKeyPaths).reduce(function(pull, k) {\r\n pull[k] = null;\r\n return pull;\r\n }, {});\r\n };\r\n\r\n var getUndefinedKeys = function(obj) {\r\n return _.keys(obj).filter(function (k) {\r\n var v = obj[k];\r\n return _.isUndefined(v);\r\n });\r\n };\r\n\r\n return getUpdates;\r\n })();\r\n\r\n module.value('getUpdates', getUpdates);\r\n})();\r\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/lib/get-updates.js\n **/","/*global\r\n angular, _, Package\r\n */\r\n\r\n'use strict';\r\n\r\nvar _module = angular.module('diffArray', ['getUpdates']);\r\n\r\n_module.factory('diffArray', ['getUpdates',\r\n function(getUpdates) {\r\n var LocalCollection = Package.minimongo.LocalCollection;\r\n var idStringify = LocalCollection._idStringify || Package['mongo-id'].MongoID.idStringify;\r\n var idParse = LocalCollection._idParse || Package['mongo-id'].MongoID.idParse;\r\n\r\n // Calculates the differences between `lastSeqArray` and\r\n // `seqArray` and calls appropriate functions from `callbacks`.\r\n // Reuses Minimongo's diff algorithm implementation.\r\n // XXX Should be replaced with the original diffArray function here:\r\n // https://github.com/meteor/meteor/blob/devel/packages/observe-sequence/observe_sequence.js#L152\r\n // When it will become nested as well, tracking here: https://github.com/meteor/meteor/issues/3764\r\n function diffArray(lastSeqArray, seqArray, callbacks, preventNestedDiff) {\r\n preventNestedDiff = !!preventNestedDiff;\r\n\r\n var diffFn = Package.minimongo.LocalCollection._diffQueryOrderedChanges ||\r\n Package['diff-sequence'].DiffSequence.diffQueryOrderedChanges;\r\n\r\n var oldObjIds = [];\r\n var newObjIds = [];\r\n var posOld = {}; // maps from idStringify'd ids\r\n var posNew = {}; // ditto\r\n var posCur = {};\r\n var lengthCur = lastSeqArray.length;\r\n\r\n _.each(seqArray, function (doc, i) {\r\n newObjIds.push({_id: doc._id});\r\n posNew[idStringify(doc._id)] = i;\r\n });\r\n\r\n _.each(lastSeqArray, function (doc, i) {\r\n oldObjIds.push({_id: doc._id});\r\n posOld[idStringify(doc._id)] = i;\r\n posCur[idStringify(doc._id)] = i;\r\n });\r\n\r\n // Arrays can contain arbitrary objects. We don't diff the\r\n // objects. Instead we always fire 'changedAt' callback on every\r\n // object. The consumer of `observe-sequence` should deal with\r\n // it appropriately.\r\n diffFn(oldObjIds, newObjIds, {\r\n addedBefore: function (id, doc, before) {\r\n var position = before ? posCur[idStringify(before)] : lengthCur;\r\n\r\n _.each(posCur, function (pos, id) {\r\n if (pos >= position) posCur[id]++;\r\n });\r\n\r\n lengthCur++;\r\n posCur[idStringify(id)] = position;\r\n\r\n callbacks.addedAt(\r\n id,\r\n seqArray[posNew[idStringify(id)]],\r\n position,\r\n before\r\n );\r\n },\r\n\r\n movedBefore: function (id, before) {\r\n var prevPosition = posCur[idStringify(id)];\r\n var position = before ? posCur[idStringify(before)] : lengthCur - 1;\r\n\r\n _.each(posCur, function (pos, id) {\r\n if (pos >= prevPosition && pos <= position)\r\n posCur[id]--;\r\n else if (pos <= prevPosition && pos >= position)\r\n posCur[id]++;\r\n });\r\n\r\n posCur[idStringify(id)] = position;\r\n\r\n callbacks.movedTo(\r\n id,\r\n seqArray[posNew[idStringify(id)]],\r\n prevPosition,\r\n position,\r\n before\r\n );\r\n },\r\n removed: function (id) {\r\n var prevPosition = posCur[idStringify(id)];\r\n\r\n _.each(posCur, function (pos, id) {\r\n if (pos >= prevPosition) posCur[id]--;\r\n });\r\n\r\n delete posCur[idStringify(id)];\r\n lengthCur--;\r\n\r\n callbacks.removedAt(\r\n id,\r\n lastSeqArray[posOld[idStringify(id)]],\r\n prevPosition\r\n );\r\n }\r\n });\r\n\r\n _.each(posNew, function (pos, idString) {\r\n if (!_.has(posOld, idString)) return;\r\n\r\n var id = idParse(idString);\r\n var newItem = seqArray[pos] || {};\r\n var oldItem = lastSeqArray[posOld[idString]];\r\n var updates = getUpdates(oldItem, newItem, preventNestedDiff);\r\n\r\n if (!_.isEmpty(updates))\r\n callbacks.changedAt(id, updates, pos, oldItem);\r\n });\r\n }\r\n\r\n diffArray.shallow = function(lastSeqArray, seqArray, callbacks) {\r\n return diffArray(lastSeqArray, seqArray, callbacks, true);\r\n };\r\n\r\n diffArray.deepCopyChanges = function (oldItem, newItem) {\r\n var setDiff = getUpdates(oldItem, newItem).$set;\r\n\r\n _.each(setDiff, function(v, deepKey) {\r\n setDeep(oldItem, deepKey, v);\r\n });\r\n };\r\n\r\n diffArray.deepCopyRemovals = function (oldItem, newItem) {\r\n var unsetDiff = getUpdates(oldItem, newItem).$unset;\r\n\r\n _.each(unsetDiff, function(v, deepKey) {\r\n unsetDeep(oldItem, deepKey);\r\n });\r\n };\r\n\r\n // Finds changes between two collections\r\n diffArray.getChanges = function(newCollection, oldCollection, diffMethod) {\r\n var changes = {added: [], removed: [], changed: []};\r\n\r\n diffMethod(oldCollection, newCollection, {\r\n addedAt: function(id, item, index) {\r\n changes.added.push({item: item, index: index});\r\n },\r\n\r\n removedAt: function(id, item, index) {\r\n changes.removed.push({item: item, index: index});\r\n },\r\n\r\n changedAt: function(id, updates, index, oldItem) {\r\n changes.changed.push({selector: id, modifier: updates});\r\n },\r\n\r\n movedTo: function(id, item, fromIndex, toIndex) {\r\n // XXX do we need this?\r\n }\r\n });\r\n\r\n return changes;\r\n };\r\n\r\n var setDeep = function(obj, deepKey, v) {\r\n var split = deepKey.split('.');\r\n var initialKeys = _.initial(split);\r\n var lastKey = _.last(split);\r\n\r\n initialKeys.reduce(function(subObj, k, i) {\r\n var nextKey = split[i + 1];\r\n\r\n if (isNumStr(nextKey)) {\r\n if (subObj[k] === null) subObj[k] = [];\r\n if (subObj[k].length == parseInt(nextKey)) subObj[k].push(null);\r\n }\r\n\r\n else if (subObj[k] === null || !isHash(subObj[k])) {\r\n subObj[k] = {};\r\n }\r\n\r\n return subObj[k];\r\n }, obj);\r\n\r\n var deepObj = getDeep(obj, initialKeys);\r\n deepObj[lastKey] = v;\r\n return v;\r\n };\r\n\r\n var unsetDeep = function(obj, deepKey) {\r\n var split = deepKey.split('.');\r\n var initialKeys = _.initial(split);\r\n var lastKey = _.last(split);\r\n var deepObj = getDeep(obj, initialKeys);\r\n\r\n if (_.isArray(deepObj) && isNumStr(lastKey))\r\n return !!deepObj.splice(lastKey, 1);\r\n else\r\n return delete deepObj[lastKey];\r\n };\r\n\r\n var getDeep = function(obj, keys) {\r\n return keys.reduce(function(subObj, k) {\r\n return subObj[k];\r\n }, obj);\r\n };\r\n\r\n var isHash = function(obj) {\r\n return _.isObject(obj) &&\r\n Object.getPrototypeOf(obj) === Object.prototype;\r\n };\r\n\r\n var isNumStr = function(str) {\r\n return str.match(/^\\d+$/);\r\n };\r\n\r\n return diffArray;\r\n}]);\r\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/lib/diff-array.js\n **/","angular.module('angular-meteor.ironrouter', [])\r\n\r\n\r\n.run([\r\n '$compile',\r\n '$document',\r\n '$rootScope',\r\n\r\nfunction ($compile, $document, $rootScope) {\r\n const Router = (Package['iron:router'] || {}).Router;\r\n if (!Router) return;\r\n\r\n let isLoaded = false;\r\n\r\n // Recompile after iron:router builds page\r\n Router.onAfterAction((req, res, next) => {\r\n Tracker.afterFlush(() => {\r\n if (isLoaded) return;\r\n $compile($document)($rootScope);\r\n if (!$rootScope.$$phase) $rootScope.$apply();\r\n isLoaded = true;\r\n });\r\n });\r\n}]);\r\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-ironrouter.js\n **/","/*global\r\n angular, _, Tracker, EJSON, FS, Mongo\r\n */\r\n\r\n'use strict';\r\n\r\nvar angularMeteorUtils = angular.module('angular-meteor.utils', []);\r\n\r\nangularMeteorUtils.service('$meteorUtils', [\r\n '$q', '$timeout', '$angularMeteorSettings',\r\n function ($q, $timeout, $angularMeteorSettings) {\r\n\r\n var self = this;\r\n\r\n this.autorun = function(scope, fn) {\r\n if (!$angularMeteorSettings.suppressWarnings)\r\n console.warn('[angular-meteor.utils.autorun] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.6/autorun. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\r\n\r\n\r\n // wrapping around Deps.autorun\r\n var comp = Tracker.autorun(function(c) {\r\n fn(c);\r\n // this is run immediately for the first call\r\n // but after that, we need to $apply to start Angular digest\r\n if (!c.firstRun) $timeout(angular.noop, 0);\r\n });\r\n\r\n // stop autorun when scope is destroyed\r\n scope.$on('$destroy', function() {\r\n comp.stop();\r\n });\r\n\r\n // return autorun object so that it can be stopped manually\r\n return comp;\r\n };\r\n\r\n // Borrowed from angularFire\r\n // https://github.com/firebase/angularfire/blob/master/src/utils.js#L445-L454\r\n this.stripDollarPrefixedKeys = function (data) {\r\n if (!_.isObject(data) ||\r\n data instanceof Date ||\r\n data instanceof File ||\r\n EJSON.toJSONValue(data).$type === 'oid' ||\r\n (typeof FS === 'object' && data instanceof FS.File))\r\n return data;\r\n\r\n var out = _.isArray(data) ? [] : {};\r\n\r\n _.each(data, function(v,k) {\r\n if(typeof k !== 'string' || k.charAt(0) !== '$')\r\n out[k] = self.stripDollarPrefixedKeys(v);\r\n });\r\n\r\n return out;\r\n };\r\n\r\n // Returns a callback which fulfills promise\r\n this.fulfill = function(deferred, boundError, boundResult) {\r\n return function(err, result) {\r\n if (err)\r\n deferred.reject(boundError === null ? err : boundError);\r\n else if (typeof boundResult == \"function\")\r\n deferred.resolve(boundResult === null ? result : boundResult(result));\r\n else\r\n deferred.resolve(boundResult === null ? result : boundResult);\r\n };\r\n };\r\n\r\n // creates a function which invokes method with the given arguments and returns a promise\r\n this.promissor = function(obj, method) {\r\n return function() {\r\n var deferred = $q.defer();\r\n var fulfill = self.fulfill(deferred);\r\n var args = _.toArray(arguments).concat(fulfill);\r\n obj[method].apply(obj, args);\r\n return deferred.promise;\r\n };\r\n };\r\n\r\n // creates a $q.all() promise and call digestion loop on fulfillment\r\n this.promiseAll = function(promises) {\r\n var allPromise = $q.all(promises);\r\n\r\n allPromise.finally(function() {\r\n // calls digestion loop with no conflicts\r\n $timeout(angular.noop);\r\n });\r\n\r\n return allPromise;\r\n };\r\n\r\n this.getCollectionByName = function(string){\r\n return Mongo.Collection.get(string);\r\n };\r\n\r\n this.findIndexById = function(collection, doc) {\r\n var foundDoc = _.find(collection, function(colDoc) {\r\n // EJSON.equals used to compare Mongo.ObjectIDs and Strings.\r\n return EJSON.equals(colDoc._id, doc._id);\r\n });\r\n\r\n return _.indexOf(collection, foundDoc);\r\n };\r\n }\r\n]);\r\n\r\nangularMeteorUtils.run([\r\n '$rootScope', '$meteorUtils',\r\n function($rootScope, $meteorUtils) {\r\n Object.getPrototypeOf($rootScope).$meteorAutorun = function(fn) {\r\n return $meteorUtils.autorun(this, fn);\r\n };\r\n}]);\r\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-utils.js\n **/","/*global\r\n angular, Meteor\r\n */\r\n\r\n'use strict';\r\nvar angularMeteorSubscribe = angular.module('angular-meteor.subscribe', []);\r\n\r\nangularMeteorSubscribe.service('$meteorSubscribe', ['$q', '$angularMeteorSettings',\r\n function ($q, $angularMeteorSettings) {\r\n\r\n var self = this;\r\n\r\n this._subscribe = function(scope, deferred, args) {\r\n if (!$angularMeteorSettings.suppressWarnings)\r\n console.warn('[angular-meteor.subscribe] Please note that this module is deprecated since 1.3.0 and will be removed in 1.4.0! Replace it with the new syntax described here: http://www.angular-meteor.com/api/1.3.6/subscribe. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\r\n\r\n var subscription = null;\r\n var lastArg = args[args.length - 1];\r\n\r\n // User supplied onStop callback\r\n // save it for later use and remove\r\n // from subscription arguments\r\n if (angular.isObject(lastArg) &&\r\n angular.isFunction(lastArg.onStop)) {\r\n var onStop = lastArg.onStop;\r\n\r\n args.pop();\r\n }\r\n\r\n args.push({\r\n onReady: function() {\r\n deferred.resolve(subscription);\r\n },\r\n onStop: function(err) {\r\n if (!deferred.promise.$$state.status) {\r\n if (err)\r\n deferred.reject(err);\r\n else\r\n deferred.reject(new Meteor.Error(\"Subscription Stopped\",\r\n \"Subscription stopped by a call to stop method. Either by the client or by the server.\"));\r\n } else if (onStop)\r\n // After promise was resolved or rejected\r\n // call user supplied onStop callback.\r\n onStop.apply(this, Array.prototype.slice.call(arguments));\r\n\r\n }\r\n });\r\n\r\n subscription = Meteor.subscribe.apply(scope, args);\r\n\r\n return subscription;\r\n };\r\n\r\n this.subscribe = function(){\r\n var deferred = $q.defer();\r\n var args = Array.prototype.slice.call(arguments);\r\n var subscription = null;\r\n\r\n self._subscribe(this, deferred, args);\r\n\r\n return deferred.promise;\r\n };\r\n }]);\r\n\r\nangularMeteorSubscribe.run(['$rootScope', '$q', '$meteorSubscribe',\r\n function($rootScope, $q, $meteorSubscribe) {\r\n Object.getPrototypeOf($rootScope).$meteorSubscribe = function() {\r\n var deferred = $q.defer();\r\n var args = Array.prototype.slice.call(arguments);\r\n\r\n var subscription = $meteorSubscribe._subscribe(this, deferred, args);\r\n\r\n this.$on('$destroy', function() {\r\n subscription.stop();\r\n });\r\n\r\n return deferred.promise;\r\n };\r\n}]);\r\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-subscribe.js\n **/","/*global\r\n angular, _, Tracker, check, Match, Mongo\r\n */\r\n\r\n'use strict';\r\n\r\nvar angularMeteorCollection = angular.module('angular-meteor.collection',\r\n ['angular-meteor.stopper', 'angular-meteor.subscribe', 'angular-meteor.utils', 'diffArray']);\r\n\r\n// The reason angular meteor collection is a factory function and not something\r\n// that inherit from array comes from here:\r\n// http://perfectionkills.com/how-ecmascript-5-still-does-not-allow-to-subclass-an-array/\r\n// We went with the direct extensions approach.\r\nangularMeteorCollection.factory('AngularMeteorCollection', [\r\n '$q', '$meteorSubscribe', '$meteorUtils', '$rootScope', '$timeout', 'diffArray', '$angularMeteorSettings',\r\n function($q, $meteorSubscribe, $meteorUtils, $rootScope, $timeout, diffArray, $angularMeteorSettings) {\r\n\r\n function AngularMeteorCollection(curDefFunc, collection, diffArrayFunc, autoClientSave) {\r\n if (!$angularMeteorSettings.suppressWarnings)\r\n console.warn('[angular-meteor.$meteorCollection] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorCollection. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\r\n\r\n var data = [];\r\n // Server backup data to evaluate what changes come from client\r\n // after each server update.\r\n data._serverBackup = [];\r\n // Array differ function.\r\n data._diffArrayFunc = diffArrayFunc;\r\n // Handler of the cursor observer.\r\n data._hObserve = null;\r\n // On new cursor autorun handler\r\n // (autorun for reactive variables).\r\n data._hNewCurAutorun = null;\r\n // On new data autorun handler\r\n // (autorun for cursor.fetch).\r\n data._hDataAutorun = null;\r\n\r\n if (angular.isDefined(collection)) {\r\n data.$$collection = collection;\r\n } else {\r\n var cursor = curDefFunc();\r\n data.$$collection = $meteorUtils.getCollectionByName(cursor.collection.name);\r\n }\r\n\r\n _.extend(data, AngularMeteorCollection);\r\n data._startCurAutorun(curDefFunc, autoClientSave);\r\n\r\n return data;\r\n }\r\n\r\n AngularMeteorCollection._startCurAutorun = function(curDefFunc, autoClientSave) {\r\n var self = this;\r\n\r\n self._hNewCurAutorun = Tracker.autorun(function() {\r\n // When the reactive func gets recomputated we need to stop any previous\r\n // observeChanges.\r\n Tracker.onInvalidate(function() {\r\n self._stopCursor();\r\n });\r\n\r\n if (autoClientSave) self._setAutoClientSave();\r\n self._updateCursor(curDefFunc(), autoClientSave);\r\n });\r\n };\r\n\r\n AngularMeteorCollection.subscribe = function() {\r\n $meteorSubscribe.subscribe.apply(this, arguments);\r\n return this;\r\n };\r\n\r\n AngularMeteorCollection.save = function(docs, useUnsetModifier) {\r\n // save whole collection\r\n if (!docs) docs = this;\r\n // save single doc\r\n docs = [].concat(docs);\r\n\r\n var promises = docs.map(function(doc) {\r\n return this._upsertDoc(doc, useUnsetModifier);\r\n }, this);\r\n\r\n return $meteorUtils.promiseAll(promises);\r\n };\r\n\r\n AngularMeteorCollection._upsertDoc = function(doc, useUnsetModifier) {\r\n var deferred = $q.defer();\r\n var collection = this.$$collection;\r\n var createFulfill = _.partial($meteorUtils.fulfill, deferred, null);\r\n\r\n // delete $$hashkey\r\n doc = $meteorUtils.stripDollarPrefixedKeys(doc);\r\n var docId = doc._id;\r\n var isExist = collection.findOne(docId);\r\n\r\n // update\r\n if (isExist) {\r\n // Deletes _id property (from the copy) so that\r\n // it can be $set using update.\r\n delete doc._id;\r\n var modifier = useUnsetModifier ? {$unset: doc} : {$set: doc};\r\n // NOTE: do not use #upsert() method, since it does not exist in some collections\r\n collection.update(docId, modifier, createFulfill(function() {\r\n return {_id: docId, action: 'updated'};\r\n }));\r\n }\r\n // insert\r\n else {\r\n collection.insert(doc, createFulfill(function(id) {\r\n return {_id: id, action: 'inserted'};\r\n }));\r\n }\r\n\r\n return deferred.promise;\r\n };\r\n\r\n // performs $pull operations parallely.\r\n // used for handling splice operations returned from getUpdates() to prevent conflicts.\r\n // see issue: https://github.com/Urigo/angular-meteor/issues/793\r\n AngularMeteorCollection._updateDiff = function(selector, update, callback) {\r\n callback = callback || angular.noop;\r\n var setters = _.omit(update, '$pull');\r\n var updates = [setters];\r\n\r\n _.each(update.$pull, function(pull, prop) {\r\n var puller = {};\r\n puller[prop] = pull;\r\n updates.push({ $pull: puller });\r\n });\r\n\r\n this._updateParallel(selector, updates, callback);\r\n };\r\n\r\n // performs each update operation parallely\r\n AngularMeteorCollection._updateParallel = function(selector, updates, callback) {\r\n var self = this;\r\n var done = _.after(updates.length, callback);\r\n\r\n var next = function(err, affectedDocsNum) {\r\n if (err) return callback(err);\r\n done(null, affectedDocsNum);\r\n };\r\n\r\n _.each(updates, function(update) {\r\n self.$$collection.update(selector, update, next);\r\n });\r\n };\r\n\r\n AngularMeteorCollection.remove = function(keyOrDocs) {\r\n var keys;\r\n\r\n // remove whole collection\r\n if (!keyOrDocs) {\r\n keys = _.pluck(this, '_id');\r\n }\r\n // remove docs\r\n else {\r\n keyOrDocs = [].concat(keyOrDocs);\r\n\r\n keys = _.map(keyOrDocs, function(keyOrDoc) {\r\n return keyOrDoc._id || keyOrDoc;\r\n });\r\n }\r\n\r\n // Checks if all keys are correct.\r\n check(keys, [Match.OneOf(String, Mongo.ObjectID)]);\r\n\r\n var promises = keys.map(function(key) {\r\n return this._removeDoc(key);\r\n }, this);\r\n\r\n return $meteorUtils.promiseAll(promises);\r\n };\r\n\r\n AngularMeteorCollection._removeDoc = function(id) {\r\n var deferred = $q.defer();\r\n var collection = this.$$collection;\r\n var fulfill = $meteorUtils.fulfill(deferred, null, { _id: id, action: 'removed' });\r\n collection.remove(id, fulfill);\r\n return deferred.promise;\r\n };\r\n\r\n AngularMeteorCollection._updateCursor = function(cursor, autoClientSave) {\r\n var self = this;\r\n // XXX - consider adding an option for a non-orderd result for faster performance\r\n if (self._hObserve) self._stopObserving();\r\n\r\n\r\n self._hObserve = cursor.observe({\r\n addedAt: function(doc, atIndex) {\r\n self.splice(atIndex, 0, doc);\r\n self._serverBackup.splice(atIndex, 0, doc);\r\n self._setServerUpdateMode();\r\n },\r\n\r\n changedAt: function(doc, oldDoc, atIndex) {\r\n diffArray.deepCopyChanges(self[atIndex], doc);\r\n diffArray.deepCopyRemovals(self[atIndex], doc);\r\n self._serverBackup[atIndex] = self[atIndex];\r\n self._setServerUpdateMode();\r\n },\r\n\r\n movedTo: function(doc, fromIndex, toIndex) {\r\n self.splice(fromIndex, 1);\r\n self.splice(toIndex, 0, doc);\r\n self._serverBackup.splice(fromIndex, 1);\r\n self._serverBackup.splice(toIndex, 0, doc);\r\n self._setServerUpdateMode();\r\n },\r\n\r\n removedAt: function(oldDoc) {\r\n var removedIndex = $meteorUtils.findIndexById(self, oldDoc);\r\n\r\n if (removedIndex != -1) {\r\n self.splice(removedIndex, 1);\r\n self._serverBackup.splice(removedIndex, 1);\r\n self._setServerUpdateMode();\r\n } else {\r\n // If it's been removed on client then it's already not in collection\r\n // itself but still is in the _serverBackup.\r\n removedIndex = $meteorUtils.findIndexById(self._serverBackup, oldDoc);\r\n\r\n if (removedIndex != -1) {\r\n self._serverBackup.splice(removedIndex, 1);\r\n }\r\n }\r\n }\r\n });\r\n\r\n self._hDataAutorun = Tracker.autorun(function() {\r\n cursor.fetch();\r\n if (self._serverMode) self._unsetServerUpdateMode(autoClientSave);\r\n });\r\n };\r\n\r\n AngularMeteorCollection._stopObserving = function() {\r\n this._hObserve.stop();\r\n this._hDataAutorun.stop();\r\n delete this._serverMode;\r\n delete this._hUnsetTimeout;\r\n };\r\n\r\n AngularMeteorCollection._setServerUpdateMode = function(name) {\r\n this._serverMode = true;\r\n // To simplify server update logic, we don't follow\r\n // updates from the client at the same time.\r\n this._unsetAutoClientSave();\r\n };\r\n\r\n // Here we use $timeout to combine multiple updates that go\r\n // each one after another.\r\n AngularMeteorCollection._unsetServerUpdateMode = function(autoClientSave) {\r\n var self = this;\r\n\r\n if (self._hUnsetTimeout) {\r\n $timeout.cancel(self._hUnsetTimeout);\r\n self._hUnsetTimeout = null;\r\n }\r\n\r\n self._hUnsetTimeout = $timeout(function() {\r\n self._serverMode = false;\r\n // Finds updates that was potentially done from the client side\r\n // and saves them.\r\n var changes = diffArray.getChanges(self, self._serverBackup, self._diffArrayFunc);\r\n self._saveChanges(changes);\r\n // After, continues following client updates.\r\n if (autoClientSave) self._setAutoClientSave();\r\n }, 0);\r\n };\r\n\r\n AngularMeteorCollection.stop = function() {\r\n this._stopCursor();\r\n this._hNewCurAutorun.stop();\r\n };\r\n\r\n AngularMeteorCollection._stopCursor = function() {\r\n this._unsetAutoClientSave();\r\n\r\n if (this._hObserve) {\r\n this._hObserve.stop();\r\n this._hDataAutorun.stop();\r\n }\r\n\r\n this.splice(0);\r\n this._serverBackup.splice(0);\r\n };\r\n\r\n AngularMeteorCollection._unsetAutoClientSave = function(name) {\r\n if (this._hRegAutoBind) {\r\n this._hRegAutoBind();\r\n this._hRegAutoBind = null;\r\n }\r\n };\r\n\r\n AngularMeteorCollection._setAutoClientSave = function() {\r\n var self = this;\r\n\r\n // Always unsets auto save to keep only one $watch handler.\r\n self._unsetAutoClientSave();\r\n\r\n self._hRegAutoBind = $rootScope.$watch(function() {\r\n return self;\r\n }, function(nItems, oItems) {\r\n if (nItems === oItems) return;\r\n\r\n var changes = diffArray.getChanges(self, oItems, self._diffArrayFunc);\r\n self._unsetAutoClientSave();\r\n self._saveChanges(changes);\r\n self._setAutoClientSave();\r\n }, true);\r\n };\r\n\r\n AngularMeteorCollection._saveChanges = function(changes) {\r\n var self = this;\r\n\r\n // Saves added documents\r\n // Using reversed iteration to prevent indexes from changing during splice\r\n var addedDocs = changes.added.reverse().map(function(descriptor) {\r\n self.splice(descriptor.index, 1);\r\n return descriptor.item;\r\n });\r\n\r\n if (addedDocs.length) self.save(addedDocs);\r\n\r\n // Removes deleted documents\r\n var removedDocs = changes.removed.map(function(descriptor) {\r\n return descriptor.item;\r\n });\r\n\r\n if (removedDocs.length) self.remove(removedDocs);\r\n\r\n // Updates changed documents\r\n changes.changed.forEach(function(descriptor) {\r\n self._updateDiff(descriptor.selector, descriptor.modifier);\r\n });\r\n };\r\n\r\n return AngularMeteorCollection;\r\n}]);\r\n\r\nangularMeteorCollection.factory('$meteorCollectionFS', [\r\n '$meteorCollection', 'diffArray', '$angularMeteorSettings',\r\n function($meteorCollection, diffArray, $angularMeteorSettings) {\r\n function $meteorCollectionFS(reactiveFunc, autoClientSave, collection) {\r\n\r\n if (!$angularMeteorSettings.suppressWarnings)\r\n console.warn('[angular-meteor.$meteorCollectionFS] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/files. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\r\n return new $meteorCollection(reactiveFunc, autoClientSave, collection, diffArray.shallow);\r\n }\r\n\r\n return $meteorCollectionFS;\r\n}]);\r\n\r\nangularMeteorCollection.factory('$meteorCollection', [\r\n 'AngularMeteorCollection', '$rootScope', 'diffArray',\r\n function(AngularMeteorCollection, $rootScope, diffArray) {\r\n function $meteorCollection(reactiveFunc, autoClientSave, collection, diffFn) {\r\n // Validate parameters\r\n if (!reactiveFunc) {\r\n throw new TypeError('The first argument of $meteorCollection is undefined.');\r\n }\r\n\r\n if (!(angular.isFunction(reactiveFunc) || angular.isFunction(reactiveFunc.find))) {\r\n throw new TypeError(\r\n 'The first argument of $meteorCollection must be a function or ' +\r\n 'a have a find function property.');\r\n }\r\n\r\n if (!angular.isFunction(reactiveFunc)) {\r\n collection = angular.isDefined(collection) ? collection : reactiveFunc;\r\n reactiveFunc = _.bind(reactiveFunc.find, reactiveFunc);\r\n }\r\n\r\n // By default auto save - true.\r\n autoClientSave = angular.isDefined(autoClientSave) ? autoClientSave : true;\r\n diffFn = diffFn || diffArray;\r\n return new AngularMeteorCollection(reactiveFunc, collection, diffFn, autoClientSave);\r\n }\r\n\r\n return $meteorCollection;\r\n}]);\r\n\r\nangularMeteorCollection.run([\r\n '$rootScope', '$meteorCollection', '$meteorCollectionFS', '$meteorStopper',\r\n function($rootScope, $meteorCollection, $meteorCollectionFS, $meteorStopper) {\r\n var scopeProto = Object.getPrototypeOf($rootScope);\r\n scopeProto.$meteorCollection = $meteorStopper($meteorCollection);\r\n scopeProto.$meteorCollectionFS = $meteorStopper($meteorCollectionFS);\r\n}]);\r\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-collection.js\n **/","/*global\r\n angular, _, Mongo\r\n*/\r\n\r\n'use strict';\r\n\r\nvar angularMeteorObject = angular.module('angular-meteor.object',\r\n ['angular-meteor.utils', 'angular-meteor.subscribe', 'angular-meteor.collection', 'getUpdates', 'diffArray']);\r\n\r\nangularMeteorObject.factory('AngularMeteorObject', [\r\n '$q', '$meteorSubscribe', '$meteorUtils', 'diffArray', 'getUpdates', 'AngularMeteorCollection', '$angularMeteorSettings',\r\n function($q, $meteorSubscribe, $meteorUtils, diffArray, getUpdates, AngularMeteorCollection, $angularMeteorSettings) {\r\n\r\n // A list of internals properties to not watch for, nor pass to the Document on update and etc.\r\n AngularMeteorObject.$$internalProps = [\r\n '$$collection', '$$options', '$$id', '$$hashkey', '$$internalProps', '$$scope',\r\n 'bind', 'save', 'reset', 'subscribe', 'stop', 'autorunComputation', 'unregisterAutoBind', 'unregisterAutoDestroy', 'getRawObject',\r\n '_auto', '_setAutos', '_eventEmitter', '_serverBackup', '_updateDiff', '_updateParallel', '_getId'\r\n ];\r\n\r\n function AngularMeteorObject (collection, selector, options){\r\n if (!$angularMeteorSettings.suppressWarnings)\r\n console.warn('[angular-meteor.$meteorObject] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorObject. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\r\n // Make data not be an object so we can extend it to preserve\r\n // Collection Helpers and the like\r\n var helpers = collection._helpers;\r\n var data = _.isFunction(helpers) ? Object.create(helpers.prototype) : {};\r\n var doc = collection.findOne(selector, options);\r\n var collectionExtension = _.pick(AngularMeteorCollection, '_updateParallel');\r\n _.extend(data, doc);\r\n _.extend(data, AngularMeteorObject);\r\n _.extend(data, collectionExtension);\r\n\r\n // Omit options that may spoil document finding\r\n data.$$options = _.omit(options, 'skip', 'limit');\r\n data.$$collection = collection;\r\n data.$$id = data._getId(selector);\r\n data._serverBackup = doc || {};\r\n\r\n return data;\r\n }\r\n\r\n AngularMeteorObject.getRawObject = function () {\r\n return angular.copy(_.omit(this, this.$$internalProps));\r\n };\r\n\r\n AngularMeteorObject.subscribe = function () {\r\n $meteorSubscribe.subscribe.apply(this, arguments);\r\n return this;\r\n };\r\n\r\n AngularMeteorObject.save = function(custom) {\r\n var deferred = $q.defer();\r\n var collection = this.$$collection;\r\n var createFulfill = _.partial($meteorUtils.fulfill, deferred, null);\r\n var oldDoc = collection.findOne(this.$$id);\r\n var mods;\r\n\r\n // update\r\n if (oldDoc) {\r\n if (custom)\r\n mods = { $set: custom };\r\n else {\r\n mods = getUpdates(oldDoc, this.getRawObject());\r\n // If there are no updates, there is nothing to do here, returning\r\n if (_.isEmpty(mods)) {\r\n return $q.when({ action: 'updated' });\r\n }\r\n }\r\n\r\n // NOTE: do not use #upsert() method, since it does not exist in some collections\r\n this._updateDiff(mods, createFulfill({ action: 'updated' }));\r\n }\r\n // insert\r\n else {\r\n if (custom)\r\n mods = _.clone(custom);\r\n else\r\n mods = this.getRawObject();\r\n\r\n mods._id = mods._id || this.$$id;\r\n collection.insert(mods, createFulfill({ action: 'inserted' }));\r\n }\r\n\r\n return deferred.promise;\r\n };\r\n\r\n AngularMeteorObject._updateDiff = function(update, callback) {\r\n var selector = this.$$id;\r\n AngularMeteorCollection._updateDiff.call(this, selector, update, callback);\r\n };\r\n\r\n AngularMeteorObject.reset = function(keepClientProps) {\r\n var self = this;\r\n var options = this.$$options;\r\n var id = this.$$id;\r\n var doc = this.$$collection.findOne(id, options);\r\n\r\n if (doc) {\r\n // extend SubObject\r\n var docKeys = _.keys(doc);\r\n var docExtension = _.pick(doc, docKeys);\r\n var clientProps;\r\n\r\n _.extend(self, docExtension);\r\n _.extend(self._serverBackup, docExtension);\r\n\r\n if (keepClientProps) {\r\n clientProps = _.intersection(_.keys(self), _.keys(self._serverBackup));\r\n } else {\r\n clientProps = _.keys(self);\r\n }\r\n\r\n var serverProps = _.keys(doc);\r\n var removedKeys = _.difference(clientProps, serverProps, self.$$internalProps);\r\n\r\n removedKeys.forEach(function (prop) {\r\n delete self[prop];\r\n delete self._serverBackup[prop];\r\n });\r\n }\r\n\r\n else {\r\n _.keys(this.getRawObject()).forEach(function(prop) {\r\n delete self[prop];\r\n });\r\n\r\n self._serverBackup = {};\r\n }\r\n };\r\n\r\n AngularMeteorObject.stop = function () {\r\n if (this.unregisterAutoDestroy)\r\n this.unregisterAutoDestroy();\r\n\r\n if (this.unregisterAutoBind)\r\n this.unregisterAutoBind();\r\n\r\n if (this.autorunComputation && this.autorunComputation.stop)\r\n this.autorunComputation.stop();\r\n };\r\n\r\n AngularMeteorObject._getId = function(selector) {\r\n var options = _.extend({}, this.$$options, {\r\n fields: { _id: 1 },\r\n reactive: false,\r\n transform: null\r\n });\r\n\r\n var doc = this.$$collection.findOne(selector, options);\r\n\r\n if (doc) return doc._id;\r\n if (selector instanceof Mongo.ObjectID) return selector;\r\n if (_.isString(selector)) return selector;\r\n return new Mongo.ObjectID();\r\n };\r\n\r\n return AngularMeteorObject;\r\n}]);\r\n\r\n\r\nangularMeteorObject.factory('$meteorObject', [\r\n '$rootScope', '$meteorUtils', 'getUpdates', 'AngularMeteorObject',\r\n function($rootScope, $meteorUtils, getUpdates, AngularMeteorObject) {\r\n function $meteorObject(collection, id, auto, options) {\r\n // Validate parameters\r\n if (!collection) {\r\n throw new TypeError(\"The first argument of $meteorObject is undefined.\");\r\n }\r\n\r\n if (!angular.isFunction(collection.findOne)) {\r\n throw new TypeError(\"The first argument of $meteorObject must be a function or a have a findOne function property.\");\r\n }\r\n\r\n var data = new AngularMeteorObject(collection, id, options);\r\n // Making auto default true - http://stackoverflow.com/a/15464208/1426570\r\n data._auto = auto !== false;\r\n _.extend(data, $meteorObject);\r\n data._setAutos();\r\n return data;\r\n }\r\n\r\n $meteorObject._setAutos = function() {\r\n var self = this;\r\n\r\n this.autorunComputation = $meteorUtils.autorun($rootScope, function() {\r\n self.reset(true);\r\n });\r\n\r\n // Deep watches the model and performs autobind\r\n this.unregisterAutoBind = this._auto && $rootScope.$watch(function(){\r\n return self.getRawObject();\r\n }, function (item, oldItem) {\r\n if (item !== oldItem) self.save();\r\n }, true);\r\n\r\n this.unregisterAutoDestroy = $rootScope.$on('$destroy', function() {\r\n if (self && self.stop) self.pop();\r\n });\r\n };\r\n\r\n return $meteorObject;\r\n}]);\r\n\r\nangularMeteorObject.run([\r\n '$rootScope', '$meteorObject', '$meteorStopper',\r\n function ($rootScope, $meteorObject, $meteorStopper) {\r\n var scopeProto = Object.getPrototypeOf($rootScope);\r\n scopeProto.$meteorObject = $meteorStopper($meteorObject);\r\n}]);\r\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-object.js\n **/","/*global\r\n angular, _, Package, Meteor\r\n */\r\n\r\n'use strict';\r\n\r\nvar angularMeteorUser = angular.module('angular-meteor.user', [\r\n 'angular-meteor.utils',\r\n 'angular-meteor.core'\r\n]);\r\n\r\n// requires package 'accounts-password'\r\nangularMeteorUser.service('$meteorUser', [\r\n '$rootScope', '$meteorUtils', '$q', '$angularMeteorSettings',\r\n function($rootScope, $meteorUtils, $q, $angularMeteorSettings){\r\n\r\n var pack = Package['accounts-base'];\r\n if (!pack) return;\r\n\r\n var self = this;\r\n var Accounts = pack.Accounts;\r\n\r\n this.waitForUser = function(){\r\n if (!$angularMeteorSettings.suppressWarnings)\r\n console.warn('[angular-meteor.waitForUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\r\n\r\n var deferred = $q.defer();\r\n\r\n $meteorUtils.autorun($rootScope, function(){\r\n if ( !Meteor.loggingIn() )\r\n deferred.resolve( Meteor.user() );\r\n }, true);\r\n\r\n return deferred.promise;\r\n };\r\n\r\n this.requireUser = function(){\r\n if (!$angularMeteorSettings.suppressWarnings) {\r\n console.warn('[angular-meteor.requireUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\r\n }\r\n\r\n var deferred = $q.defer();\r\n\r\n $meteorUtils.autorun($rootScope, function(){\r\n if ( !Meteor.loggingIn() ) {\r\n if ( Meteor.user() === null)\r\n deferred.reject(\"AUTH_REQUIRED\");\r\n else\r\n deferred.resolve( Meteor.user() );\r\n }\r\n }, true);\r\n\r\n return deferred.promise;\r\n };\r\n\r\n this.requireValidUser = function(validatorFn) {\r\n if (!$angularMeteorSettings.suppressWarnings)\r\n console.warn('[angular-meteor.requireValidUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\r\n\r\n return self.requireUser(true).then(function(user){\r\n var valid = validatorFn( user );\r\n\r\n if ( valid === true )\r\n return user;\r\n else if ( typeof valid === \"string\" )\r\n return $q.reject( valid );\r\n else\r\n return $q.reject( \"FORBIDDEN\" );\r\n\t });\r\n\t };\r\n\r\n this.loginWithPassword = $meteorUtils.promissor(Meteor, 'loginWithPassword');\r\n this.createUser = $meteorUtils.promissor(Accounts, 'createUser');\r\n this.changePassword = $meteorUtils.promissor(Accounts, 'changePassword');\r\n this.forgotPassword = $meteorUtils.promissor(Accounts, 'forgotPassword');\r\n this.resetPassword = $meteorUtils.promissor(Accounts, 'resetPassword');\r\n this.verifyEmail = $meteorUtils.promissor(Accounts, 'verifyEmail');\r\n this.logout = $meteorUtils.promissor(Meteor, 'logout');\r\n this.logoutOtherClients = $meteorUtils.promissor(Meteor, 'logoutOtherClients');\r\n this.loginWithFacebook = $meteorUtils.promissor(Meteor, 'loginWithFacebook');\r\n this.loginWithTwitter = $meteorUtils.promissor(Meteor, 'loginWithTwitter');\r\n this.loginWithGoogle = $meteorUtils.promissor(Meteor, 'loginWithGoogle');\r\n this.loginWithGithub = $meteorUtils.promissor(Meteor, 'loginWithGithub');\r\n this.loginWithMeteorDeveloperAccount = $meteorUtils.promissor(Meteor, 'loginWithMeteorDeveloperAccount');\r\n this.loginWithMeetup = $meteorUtils.promissor(Meteor, 'loginWithMeetup');\r\n this.loginWithWeibo = $meteorUtils.promissor(Meteor, 'loginWithWeibo');\r\n }\r\n]);\r\n\r\nangularMeteorUser.run([\r\n '$rootScope', '$angularMeteorSettings', '$$Core',\r\n function($rootScope, $angularMeteorSettings, $$Core){\r\n\r\n let ScopeProto = Object.getPrototypeOf($rootScope);\r\n _.extend(ScopeProto, $$Core);\r\n\r\n $rootScope.autorun(function(){\r\n if (!Meteor.user) return;\r\n $rootScope.currentUser = Meteor.user();\r\n $rootScope.loggingIn = Meteor.loggingIn();\r\n });\r\n }\r\n]);\r\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-user.js\n **/","/*global\r\n angular, _, Meteor\r\n */\r\n\r\n'use strict';\r\n\r\nvar angularMeteorMethods = angular.module('angular-meteor.methods', ['angular-meteor.utils']);\r\n\r\nangularMeteorMethods.service('$meteorMethods', [\r\n '$q', '$meteorUtils', '$angularMeteorSettings',\r\n function($q, $meteorUtils, $angularMeteorSettings) {\r\n this.call = function(){\r\n if (!$angularMeteorSettings.suppressWarnings)\r\n console.warn('[angular-meteor.$meteor.call] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/methods. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\r\n\r\n var deferred = $q.defer();\r\n var fulfill = $meteorUtils.fulfill(deferred);\r\n var args = _.toArray(arguments).concat(fulfill);\r\n Meteor.call.apply(this, args);\r\n return deferred.promise;\r\n };\r\n }\r\n]);\r\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-methods.js\n **/","/*global\r\n angular, Session\r\n */\r\n\r\n'use strict';\r\nvar angularMeteorSession = angular.module('angular-meteor.session', ['angular-meteor.utils']);\r\n\r\nangularMeteorSession.factory('$meteorSession', ['$meteorUtils', '$parse', '$angularMeteorSettings',\r\n function ($meteorUtils, $parse, $angularMeteorSettings) {\r\n return function (session) {\r\n\r\n return {\r\n\r\n bind: function(scope, model) {\r\n if (!$angularMeteorSettings.suppressWarnings)\r\n console.warn('[angular-meteor.session.bind] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://www.angular-meteor.com/api/1.3.0/session. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\r\n\r\n var getter = $parse(model);\r\n var setter = getter.assign;\r\n $meteorUtils.autorun(scope, function() {\r\n setter(scope, Session.get(session));\r\n });\r\n\r\n scope.$watch(model, function(newItem, oldItem) {\r\n Session.set(session, getter(scope));\r\n }, true);\r\n\r\n }\r\n };\r\n };\r\n }\r\n]);\r\n\r\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-session.js\n **/","/*global\r\n angular, Package\r\n */\r\n\r\n'use strict';\r\n\r\nvar angularMeteorCamera = angular.module('angular-meteor.camera', ['angular-meteor.utils']);\r\n\r\n// requires package 'mdg:camera'\r\nangularMeteorCamera.service('$meteorCamera', [\r\n '$q', '$meteorUtils', '$angularMeteorSettings',\r\n function ($q, $meteorUtils, $angularMeteorSettings) {\r\n if (!$angularMeteorSettings.suppressWarnings)\r\n console.warn('[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\r\n var pack = Package['mdg:camera'];\r\n if (!pack) return;\r\n\r\n var MeteorCamera = pack.MeteorCamera;\r\n\r\n this.getPicture = function(options){\r\n if (!$angularMeteorSettings.suppressWarnings)\r\n console.warn('[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\r\n\r\n options = options || {};\r\n var deferred = $q.defer();\r\n MeteorCamera.getPicture(options, $meteorUtils.fulfill(deferred));\r\n return deferred.promise;\r\n };\r\n }\r\n]);\r\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-camera.js\n **/","/*global\r\n angular\r\n */\r\n\r\n'use strict';\r\n\r\nvar angularMeteorStopper = angular.module('angular-meteor.stopper',\r\n ['angular-meteor.subscribe']);\r\n\r\nangularMeteorStopper.factory('$meteorStopper', ['$q', '$meteorSubscribe',\r\n function($q, $meteorSubscribe) {\r\n function $meteorStopper($meteorEntity) {\r\n return function() {\r\n var args = Array.prototype.slice.call(arguments);\r\n var meteorEntity = $meteorEntity.apply(this, args);\r\n\r\n angular.extend(meteorEntity, $meteorStopper);\r\n meteorEntity.$$scope = this;\r\n\r\n this.$on('$destroy', function () {\r\n meteorEntity.stop();\r\n if (meteorEntity.subscription) meteorEntity.subscription.stop();\r\n });\r\n\r\n return meteorEntity;\r\n };\r\n }\r\n\r\n $meteorStopper.subscribe = function() {\r\n var args = Array.prototype.slice.call(arguments);\r\n this.subscription = $meteorSubscribe._subscribe(this.$$scope, $q.defer(), args);\r\n return this;\r\n };\r\n\r\n return $meteorStopper;\r\n}]);\r\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-stopper.js\n **/","export const module = 'angular-meteor.utilities';\nexport const utils = '$$utils';\n\nangular.module(module, [])\n\n/*\n A utility service which is provided with general utility functions\n */\n.service(utils, [\n '$rootScope',\n\n function($rootScope) {\n // Checks if an object is a cursor\n this.isCursor = (obj) => {\n return obj instanceof Meteor.Collection.Cursor;\n };\n\n // Cheecks if an object is a scope\n this.isScope = (obj) => {\n return obj instanceof $rootScope.constructor;\n };\n\n // Checks if two objects are siblings\n this.areSiblings = (obj1, obj2) => {\n return _.isObject(obj1) && _.isObject(obj2) &&\n Object.getPrototypeOf(obj1) === Object.getPrototypeOf(obj2);\n };\n\n // Binds function into a scpecified context. If an object is provided, will bind every\n // value in the object which is a function. If a tap function is provided, it will be\n // called right after the function has been invoked.\n this.bind = (fn, context, tap) => {\n tap = _.isFunction(tap) ? tap : angular.noop;\n if (_.isFunction(fn)) return bindFn(fn, context, tap);\n if (_.isObject(fn)) return bindObj(fn, context, tap);\n return fn;\n };\n\n const bindFn = (fn, context, tap) => {\n return (...args) => {\n const result = fn.apply(context, args);\n tap.call(context, {\n result,\n args\n });\n return result;\n };\n };\n\n const bindObj = (obj, context, tap) => {\n return _.keys(obj).reduce((bound, k) => {\n bound[k] = this.bind(obj[k], context, tap);\n return bound;\n }, {});\n };\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/utils.js\n **/","export const module = 'angular-meteor.mixer';\nexport const Mixer = '$Mixer';\n\nangular.module(module, [])\n\n/*\n A service which lets us apply mixins into the `ChildScope` prototype.\n The flow is simple. Once we define a mixin, it will be stored in the `$Mixer`,\n and any time a `ChildScope` prototype is created\n it will be extended by the `$Mixer`.\n This concept is good because it keeps our code\n clean and simple, and easy to extend.\n So any time we would like to define a new behaviour to our scope,\n we will just use the `$Mixer` service.\n */\n.service(Mixer, function() {\n this._mixins = [];\n\n // Adds a new mixin\n this.mixin = (mixin) => {\n if (!_.isObject(mixin)) {\n throw Error('argument 1 must be an object');\n }\n\n this._mixins = _.union(this._mixins, [mixin]);\n return this;\n };\n\n // Removes a mixin. Useful mainly for test purposes\n this._mixout = (mixin) => {\n this._mixins = _.without(this._mixins, mixin);\n return this;\n };\n\n // Invoke function mixins with the provided context and arguments\n this._construct = (context, ...args) => {\n this._mixins.filter(_.isFunction).forEach((mixin) => {\n mixin.call(context, ...args);\n });\n\n return context;\n };\n\n // Extend prototype with the defined mixins\n this._extend = (obj) => {\n return _.extend(obj, ...this._mixins);\n };\n});\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/mixer.js\n **/","import { module as mixerModule, Mixer } from './mixer';\n\nexport const module = 'angular-meteor.scope'\n\nangular.module(module, [\n mixerModule\n])\n\n\n.run([\n '$rootScope',\n Mixer,\n\n function($rootScope, $Mixer) {\n const Scope = $rootScope.constructor;\n const $new = $rootScope.$new;\n\n // Extends and constructs every newly created scope without affecting the root scope\n Scope.prototype.$new = function(isolate, parent) {\n const firstChild = this === $rootScope && !this.$$ChildScope;\n const scope = $new.call(this, isolate, parent);\n\n // If the scope is isolated we would like to extend it aswell\n if (isolate) {\n // The scope is the prototype of its upcomming child scopes, so the methods would\n // be accessable to them as well\n $Mixer._extend(scope);\n }\n // Else, if this is the first child of the root scope we would like to apply the extensions\n // without affection the root scope\n else if (firstChild) {\n // Creating a middle layer where all the extensions are gonna be applied to\n scope.__proto__ = this.$$ChildScope.prototype =\n $Mixer._extend(Object.create(this));\n }\n\n return $Mixer._construct(scope);\n };\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/scope.js\n **/","import { module as utilsModule, utils } from './utils';\nimport { module as mixerModule } from './mixer';\n\nexport const module = 'angular-meteor.core';\nexport const Core = '$$Core';\n\nangular.module(module, [\n utilsModule,\n mixerModule\n])\n\n\n/*\n A mixin which provides us with core Meteor functions.\n */\n.factory(Core, [\n '$q',\n utils,\n\n function($q, $$utils) {\n function $$Core() {}\n\n // Calls Meteor.autorun() which will be digested after each run and automatically destroyed\n $$Core.autorun = function(fn, options = {}) {\n fn = this.$bindToContext(fn);\n\n if (!_.isFunction(fn)) {\n throw Error('argument 1 must be a function');\n }\n if (!_.isObject(options)) {\n throw Error('argument 2 must be an object');\n }\n\n const computation = Tracker.autorun(fn, options);\n this.$$autoStop(computation);\n return computation;\n };\n\n // Calls Meteor.subscribe() which will be digested after each invokation\n // and automatically destroyed\n $$Core.subscribe = function(name, fn, cb) {\n fn = this.$bindToContext(fn || angular.noop);\n cb = cb ? this.$bindToContext(cb) : angular.noop;\n\n if (!_.isString(name)) {\n throw Error('argument 1 must be a string');\n }\n if (!_.isFunction(fn)) {\n throw Error('argument 2 must be a function');\n }\n if (!_.isFunction(cb) && !_.isObject(cb)) {\n throw Error('argument 3 must be a function or an object');\n }\n\n const result = {};\n\n const computation = this.autorun(() => {\n let args = fn();\n if (angular.isUndefined(args)) args = [];\n\n if (!_.isArray(args)) {\n throw Error(`reactive function's return value must be an array`);\n }\n\n const subscription = Meteor.subscribe(name, ...args, cb);\n result.ready = subscription.ready.bind(subscription);\n result.subscriptionId = subscription.subscriptionId;\n });\n\n // Once the computation has been stopped,\n // any subscriptions made inside will be stopped as well\n result.stop = computation.stop.bind(computation);\n return result;\n };\n\n // Calls Meteor.call() wrapped by a digestion cycle\n $$Core.callMethod = function(...args) {\n let fn = args.pop();\n if (_.isFunction(fn)) fn = this.$bindToContext(fn);\n return Meteor.call(...args, fn);\n };\n\n // Calls Meteor.apply() wrapped by a digestion cycle\n $$Core.applyMethod = function(...args) {\n let fn = args.pop();\n if (_.isFunction(fn)) fn = this.$bindToContext(fn);\n return Meteor.apply(...args, fn);\n };\n\n $$Core.$$autoStop = function(stoppable) {\n this.$on('$destroy', stoppable.stop.bind(stoppable));\n };\n\n // Digests scope only if there is no phase at the moment\n $$Core.$$throttledDigest = function() {\n const isDigestable = !this.$$destroyed &&\n !this.$$phase &&\n !this.$root.$$phase;\n\n if (isDigestable) this.$digest();\n };\n\n // Creates a promise only that the digestion cycle will be called at its fulfillment\n $$Core.$$defer = function() {\n const deferred = $q.defer();\n // Once promise has been fulfilled, digest\n deferred.promise = deferred.promise.finally(this.$$throttledDigest.bind(this));\n return deferred;\n };\n\n // Binds an object or a function to the scope to the view model and digest it once it is invoked\n $$Core.$bindToContext = function(fn) {\n return $$utils.bind(fn, this, this.$$throttledDigest.bind(this));\n };\n\n return $$Core;\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/core.js\n **/","import { module as utilsModule, utils } from './utils';\nimport { module as mixerModule, Mixer } from './mixer';\nimport { module as coreModule } from './core';\n\nexport const module = 'angular-meteor.view-model';\nexport const ViewModel = '$$ViewModel';\nexport const reactive = '$reactive';\n\nangular.module(module, [\n utilsModule,\n mixerModule,\n coreModule\n])\n\n/*\n A mixin which lets us bind a view model into a scope.\n Note that only a single view model can be bound,\n otherwise the scope might behave unexpectedly.\n Mainly used to define the controller as the view model,\n and very useful when wanting to use Angular's `controllerAs` syntax.\n */\n.factory(ViewModel, [\n utils,\n Mixer,\n\n function($$utils, $Mixer) {\n function $$ViewModel(vm = this) {\n // Defines the view model on the scope.\n this.$$vm = vm;\n }\n\n // Gets an object, wraps it with scope functions and returns it\n $$ViewModel.viewModel = function(vm) {\n if (!_.isObject(vm)) {\n throw Error('argument 1 must be an object');\n }\n\n // Apply mixin functions\n $Mixer._mixins.forEach((mixin) => {\n // Reject methods which starts with double $\n const keys = _.keys(mixin).filter(k => k.match(/^(?!\\$\\$).*$/));\n const proto = _.pick(mixin, keys);\n // Bind all the methods to the prototype\n const boundProto = $$utils.bind(proto, this);\n // Add the methods to the view model\n _.extend(vm, boundProto);\n });\n\n // Apply mixin constructors on the view model\n $Mixer._construct(this, vm);\n return vm;\n };\n\n // Override $$Core.$bindToContext to be bound to view model instead of scope\n $$ViewModel.$bindToContext = function(fn) {\n return $$utils.bind(fn, this.$$vm, this.$$throttledDigest.bind(this));\n };\n\n return $$ViewModel;\n }\n])\n\n\n/*\n Illustrates the old API where a view model is created using $reactive service\n */\n.service(reactive, [\n utils,\n\n function($$utils) {\n class Reactive {\n constructor(vm) {\n if (!_.isObject(vm)) {\n throw Error('argument 1 must be an object');\n }\n\n _.defer(() => {\n if (!this._attached) {\n console.warn('view model was not attached to any scope');\n }\n });\n\n this._vm = vm;\n }\n\n attach(scope) {\n this._attached = true;\n\n if (!$$utils.isScope(scope)) {\n throw Error('argument 1 must be a scope');\n }\n\n const viewModel = scope.viewModel(this._vm);\n\n // Similar to the old/Meteor API\n viewModel.call = viewModel.callMethod;\n viewModel.apply = viewModel.applyMethod;\n\n return viewModel;\n }\n }\n\n return (vm) => new Reactive(vm);\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/view-model.js\n **/","import { module as utilsModule, utils } from './utils';\nimport { module as mixerModule } from './mixer';\nimport { module as coreModule } from './core';\nimport { module as viewModelModule } from './view-model';\n\nexport const module = 'angular-meteor.reactive';\nexport const Reactive = '$$Reactive';\n\nangular.module(module, [\n utilsModule,\n mixerModule,\n coreModule,\n viewModelModule\n])\n\n\n/*\n A mixin which enhance our reactive abilities by providing methods\n that are capable of updating our scope reactively.\n */\n.factory(Reactive, [\n '$parse',\n utils,\n '$angularMeteorSettings',\n\n function($parse, $$utils, $angularMeteorSettings) {\n function $$Reactive(vm = this) {\n // Helps us track changes made in the view model\n vm.$$dependencies = {};\n }\n\n // Gets an object containing functions and define their results as reactive properties.\n // Once a return value has been changed the property will be reset.\n $$Reactive.helpers = function(props = {}) {\n if (!_.isObject(props)) {\n throw Error('argument 1 must be an object');\n }\n\n _.each(props, (v, k, i) => {\n if (!_.isFunction(v)) {\n throw Error(`helper ${i + 1} must be a function`);\n }\n\n if (!this.$$vm.$$dependencies[k]) {\n // Registers a new dependency to the specified helper\n this.$$vm.$$dependencies[k] = new Tracker.Dependency();\n }\n\n this.$$setFnHelper(k, v);\n });\n };\n\n // Gets a model reactively\n $$Reactive.getReactively = function(k, isDeep = false) {\n if (!_.isBoolean(isDeep)) {\n throw Error('argument 2 must be a boolean');\n }\n\n return this.$$reactivateEntity(k, this.$watch, isDeep);\n };\n\n // Gets a collection reactively\n $$Reactive.getCollectionReactively = function(k) {\n return this.$$reactivateEntity(k, this.$watchCollection);\n };\n\n // Gets an entity reactively, and once it has been changed the computation will be recomputed\n $$Reactive.$$reactivateEntity = function(k, watcher, ...watcherArgs) {\n if (!_.isString(k)) {\n throw Error('argument 1 must be a string');\n }\n\n if (!this.$$vm.$$dependencies[k]) {\n this.$$vm.$$dependencies[k] = new Tracker.Dependency();\n this.$$watchEntity(k, watcher, ...watcherArgs);\n }\n\n this.$$vm.$$dependencies[k].depend();\n return $parse(k)(this.$$vm);\n };\n\n // Watches for changes in the view model, and if so will notify a change\n $$Reactive.$$watchEntity = function(k, watcher, ...watcherArgs) {\n // Gets a deep property from the view model\n const getVal = _.partial($parse(k), this.$$vm);\n const initialVal = getVal();\n\n // Watches for changes in the view model\n watcher.call(this, getVal, (val, oldVal) => {\n const hasChanged =\n val !== initialVal ||\n val !== oldVal;\n\n // Notify if a change has been detected\n if (hasChanged) this.$$changed(k);\n }, ...watcherArgs);\n };\n\n // Invokes a function and sets the return value as a property\n $$Reactive.$$setFnHelper = function(k, fn) {\n this.autorun((computation) => {\n // Invokes the reactive functon\n const model = fn.apply(this.$$vm);\n\n // Ignore notifications made by the following handler\n Tracker.nonreactive(() => {\n // If a cursor, observe its changes and update acoordingly\n if ($$utils.isCursor(model)) {\n const observation = this.$$handleCursor(k, model);\n\n computation.onInvalidate(() => {\n observation.stop();\n this.$$vm[k].splice(0);\n });\n } else {\n this.$$handleNonCursor(k, model);\n }\n\n // Notify change and update the view model\n this.$$changed(k);\n });\n });\n };\n\n // Sets a value helper as a setter and a getter which will notify computations once used\n $$Reactive.$$setValHelper = function(k, v, watch = true) {\n // If set, reactives property\n if (watch) {\n const isDeep = _.isObject(v);\n this.getReactively(k, isDeep);\n }\n\n Object.defineProperty(this.$$vm, k, {\n configurable: true,\n enumerable: true,\n\n get: () => {\n return v;\n },\n set: (newVal) => {\n v = newVal;\n this.$$changed(k);\n }\n });\n };\n\n // Fetching a cursor and updates properties once the result set has been changed\n $$Reactive.$$handleCursor = function(k, cursor) {\n // If not defined set it\n if (angular.isUndefined(this.$$vm[k])) {\n this.$$setValHelper(k, cursor.fetch(), false);\n }\n // If defined update it\n else {\n const diff = jsondiffpatch.diff(this.$$vm[k], cursor.fetch());\n jsondiffpatch.patch(this.$$vm[k], diff);\n }\n\n // Observe changes made in the result set\n const observation = cursor.observe({\n addedAt: (doc, atIndex) => {\n if (!observation) return;\n this.$$vm[k].splice(atIndex, 0, doc);\n this.$$changed(k);\n },\n changedAt: (doc, oldDoc, atIndex) => {\n const diff = jsondiffpatch.diff(this.$$vm[k][atIndex], doc);\n jsondiffpatch.patch(this.$$vm[k][atIndex], diff);\n this.$$changed(k);\n },\n movedTo: (doc, fromIndex, toIndex) => {\n this.$$vm[k].splice(fromIndex, 1);\n this.$$vm[k].splice(toIndex, 0, doc);\n this.$$changed(k);\n },\n removedAt: (oldDoc, atIndex) => {\n this.$$vm[k].splice(atIndex, 1);\n this.$$changed(k);\n }\n });\n\n return observation;\n };\n\n $$Reactive.$$handleNonCursor = function(k, data) {\n let v = this.$$vm[k];\n\n if (angular.isDefined(v)) {\n delete this.$$vm[k];\n v = null;\n }\n\n if (angular.isUndefined(v)) {\n this.$$setValHelper(k, data);\n }\n // Update property if the new value is from the same type\n else if ($$utils.areSiblings(v, data)) {\n const diff = jsondiffpatch.diff(v, data);\n jsondiffpatch.patch(v, diff);\n this.$$changed(k);\n } else {\n this.$$vm[k] = data;\n }\n };\n\n // Notifies dependency in view model\n $$Reactive.$$depend = function(k) {\n this.$$vm.$$dependencies[k].depend();\n };\n\n // Notifies change in view model\n $$Reactive.$$changed = function(k) {\n this.$$throttledDigest();\n this.$$vm.$$dependencies[k].changed();\n };\n\n return $$Reactive;\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/reactive.js\n **/"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///dist/angular-meteor.min.js","webpack:///webpack/bootstrap 506237d669ed75851a9d","webpack:///./src/angular-meteor.js","webpack:///./src/lib/get-updates.js","webpack:///./src/lib/diff-array.js","webpack:///./src/modules/angular-meteor-settings.js","webpack:///./src/modules/angular-meteor-ironrouter.js","webpack:///./src/modules/angular-meteor-utils.js","webpack:///./src/modules/angular-meteor-subscribe.js","webpack:///./src/modules/angular-meteor-collection.js","webpack:///./src/modules/angular-meteor-object.js","webpack:///./src/modules/angular-meteor-user.js","webpack:///./src/modules/angular-meteor-methods.js","webpack:///./src/modules/angular-meteor-session.js","webpack:///./src/modules/angular-meteor-camera.js","webpack:///./src/modules/angular-meteor-stopper.js","webpack:///./src/modules/utils.js","webpack:///./src/modules/mixer.js","webpack:///./src/modules/scope.js","webpack:///./src/modules/core.js","webpack:///./src/modules/view-model.js","webpack:///./src/modules/reactive.js","webpack:///./src/modules/templates.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","id","loaded","call","m","c","p","Object","defineProperty","value","name","undefined","_utils","_mixer","_scope","_core","_viewModel","_reactive","_templates","angular","run","Mixer","Core","ViewModel","Reactive","$Mixer","$$Core","$$ViewModel","$$Reactive","mixin","service","$meteorCollection","$meteorCollectionFS","$meteorObject","$meteorMethods","$meteorSession","$meteorSubscribe","$meteorUtils","$meteorCamera","$meteorUser","_this","this","collection","collectionFS","object","subscribe","session","autorun","getCollectionByName","getPicture","forEach","method","utils","rip","obj","level","_","reduce","clone","v","k","isObject","toPaths","keys","getKeyPaths","values","getDeepValues","map","isEmpty","isArray","subKey","flatten","arr","push","setFilled","assert","result","msg","throwErr","Error","getDifference","src","dst","isShallow","compare","srcKeys","dstKeys","chain","concat","uniq","without","diff","srcValue","dstValue","isDate","getTime","valueDiff","getUpdates","paths","set","createSet","unset","createUnset","pull","createPull","updates","undefinedKeys","getUndefinedKeys","omit","pick","arrKeyPaths","split","match","compact","filter","isUndefined","_module","factory","diffArray","lastSeqArray","seqArray","callbacks","preventNestedDiff","diffFn","Package","minimongo","LocalCollection","_diffQueryOrderedChanges","DiffSequence","diffQueryOrderedChanges","oldObjIds","newObjIds","posOld","posNew","posCur","lengthCur","length","each","doc","i","_id","idStringify","addedBefore","before","position","pos","addedAt","movedBefore","prevPosition","movedTo","removed","removedAt","idString","has","idParse","newItem","oldItem","changedAt","_idStringify","MongoID","_idParse","shallow","deepCopyChanges","setDiff","$set","deepKey","setDeep","deepCopyRemovals","unsetDiff","$unset","unsetDeep","getChanges","newCollection","oldCollection","diffMethod","changes","added","changed","item","index","selector","modifier","fromIndex","toIndex","initialKeys","initial","lastKey","last","subObj","nextKey","isNumStr","parseInt","isHash","deepObj","getDeep","splice","getPrototypeOf","prototype","str","constant","suppressWarnings","$compile","$document","$rootScope","Router","isLoaded","onAfterAction","req","res","next","Tracker","afterFlush","$$phase","$apply","_typeof","Symbol","iterator","constructor","angularMeteorUtils","$q","$timeout","$angularMeteorSettings","self","scope","fn","console","warn","comp","firstRun","noop","$on","stop","stripDollarPrefixedKeys","data","Date","File","EJSON","toJSONValue","$type","FS","out","charAt","fulfill","deferred","boundError","boundResult","err","reject","resolve","promissor","defer","args","toArray","arguments","apply","promise","promiseAll","promises","allPromise","all","string","Mongo","Collection","get","findIndexById","foundDoc","find","colDoc","equals","indexOf","$meteorAutorun","angularMeteorSubscribe","_subscribe","subscription","lastArg","isFunction","onStop","_onStop","pop","onReady","$$state","status","Array","slice","Meteor","angularMeteorCollection","AngularMeteorCollection","curDefFunc","diffArrayFunc","autoClientSave","_serverBackup","_diffArrayFunc","_hObserve","_hNewCurAutorun","_hDataAutorun","isDefined","$$collection","cursor","extend","_startCurAutorun","onInvalidate","_stopCursor","_setAutoClientSave","_updateCursor","save","docs","useUnsetModifier","_upsertDoc","createFulfill","partial","docId","isExist","findOne","update","action","insert","_updateDiff","callback","setters","$pull","prop","puller","_updateParallel","done","after","affectedDocsNum","remove","keyOrDocs","keyOrDoc","pluck","check","Match","OneOf","String","ObjectID","key","_removeDoc","_stopObserving","observe","atIndex","_setServerUpdateMode","oldDoc","removedIndex","fetch","_serverMode","_unsetServerUpdateMode","_hUnsetTimeout","_unsetAutoClientSave","cancel","_saveChanges","_hRegAutoBind","$watch","nItems","oItems","addedDocs","reverse","descriptor","removedDocs","reactiveFunc","TypeError","bind","$meteorStopper","scopeProto","angularMeteorObject","AngularMeteorObject","options","helpers","_helpers","create","collectionExtension","$$options","$$id","_getId","$$internalProps","getRawObject","copy","custom","mods","when","reset","keepClientProps","clientProps","docKeys","docExtension","intersection","serverProps","removedKeys","difference","unregisterAutoDestroy","unregisterAutoBind","autorunComputation","fields","reactive","transform","isString","auto","_auto","_setAutos","angularMeteorUser","pack","Accounts","waitForUser","loggingIn","user","requireUser","requireValidUser","validatorFn","then","valid","loginWithPassword","createUser","changePassword","forgotPassword","resetPassword","verifyEmail","logout","logoutOtherClients","loginWithFacebook","loginWithTwitter","loginWithGoogle","loginWithGithub","loginWithMeteorDeveloperAccount","loginWithMeetup","loginWithWeibo","ScopeProto","currentUser","angularMeteorMethods","angularMeteorSession","$parse","model","getter","setter","assign","Session","angularMeteorCamera","MeteorCamera","angularMeteorStopper","$meteorEntity","meteorEntity","$$scope","bindFn","context","tap","_len","_key","bindObj","bound","isCursor","Cursor","isScope","areSiblings","obj1","obj2","_toConsumableArray","arr2","from","_mixins","_autoExtend","_autoConstruct","union","_extend","_construct","_mixout","_ref","Scope","$new","$$utils","$bindToContext","computation","$$autoStop","subName","cb","_Meteor","ready","subscriptionId","callMethod","_Meteor2","applyMethod","_Meteor3","_len2","_key2","stoppable","$$throttledDigest","isDigestable","$$destroyed","$root","$digest","$$defer","_classCallCheck","instance","Constructor","_createClass","defineProperties","target","props","enumerable","configurable","writable","protoProps","staticProps","vm","$$vm","viewModel","proto","boundProto","_this2","_attached","_vm","$$dependencies","Dependency","$$setFnHelper","getReactively","isDeep","isBoolean","$$reactivateEntity","getCollectionReactively","$watchCollection","watcher","watcherArgs","$$watchEntity","depend","getVal","initialVal","val","oldVal","hasChanged","$$changed","_this3","nonreactive","observation","$$handleCursor","$$handleNonCursor","$$setValHelper","_this4","watch","newVal","_this5","jsondiffpatch","patch","$$depend","e"],"mappings":";CACS,SAAUA,GCGnB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAE,WACAE,GAAAJ,EACAK,QAAA,EAUA,OANAP,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,GAGAI,EAAAE,QAAA,EAGAF,EAAAD,QAvBA,GAAAD,KAqCA,OATAF,GAAAQ,EAAAT,EAGAC,EAAAS,EAAAP,EAGAF,EAAAU,EAAA,GAGAV,EAAA,KDOM,SAASI,EAAQD,EAASH,GAE/B,YAEAW,QAAOC,eAAeT,EAAS,cAC7BU,OAAO,IAETV,EAAQW,KAAOC,OAEff,EAAoB,GAEpBA,EAAoB,GAEpBA,EAAoB,GAEpBA,EAAoB,GAEpBA,EAAoB,GAEpBA,EAAoB,GAEpBA,EAAoB,GAEpBA,EAAoB,GAEpBA,EAAoB,GAEpBA,EAAoB,IAEpBA,EAAoB,IAEpBA,EAAoB,IAEpBA,EAAoB,GAEpB,IAAIgB,GAAShB,EAAoB,IAE7BiB,EAASjB,EAAoB,IAE7BkB,EAASlB,EAAoB,IAE7BmB,EAAQnB,EAAoB,IAE5BoB,EAAapB,EAAoB,IAEjCqB,EAAYrB,EAAoB,IAEhCsB,EAAatB,EAAoB,IEnEzBc,EAAAX,EAAAW,KAAO,gBAEpBS,SAAQnB,OAAOU,GF4EdE,EAAOF,KAAMG,EAAOH,KAAMI,EAAOJ,KAAMK,EAAML,KAAMM,EAAWN,KAAMO,EAAUP,KAA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,MAAK4c,KAAKzb,GACjBD,EAAI,MAGFxC,QAAQgG,YAAYxD,GACtBlB,KAAK2e,eAAexd,EAAG6K,OAGpB,IAAIyO,EAAQhB,YAAYvY,EAAG8K,GAAO,CACrC,GAAM9I,GAAO8b,cAAc9b,KAAKhC,EAAG8K,EACnCgT,eAAcC,MAAM/d,EAAGgC,GACvBlD,KAAKqe,UAAUld,OAEfnB,MAAK4c,KAAKzb,GAAK6K,GAhLK7M,EAqLb+f,SAAW,SAAS/d,GAC7BnB,KAAK4c,KAAKO,eAAehc,GAAG4c,UAtLN5e,EA0Lbkf,UAAY,SAASld,GAC9BnB,KAAKyb,oBACLzb,KAAK4c,KAAKO,eAAehc,GAAGqH,WAGvBrJ,MrBu8DL,SAAS5B,EAAQD,GAEtB,YAEAQ,QAAOC,eAAeT,EAAS,cAC7BU,OAAO,GsBnqEH,IAAMC,GAAAX,EAAAW,KAAO,mBAEpB,KACES,QAAQnB,OAAOU,GACf,MAAOkhB,GACPzgB,QAAQnB,OAAOU","file":"dist/angular-meteor.min.js","sourcesContent":["/*! angular-meteor v1.3.7-beta.1 */\n/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.name = undefined;\n\t\n\t__webpack_require__(1);\n\t\n\t__webpack_require__(2);\n\t\n\t__webpack_require__(3);\n\t\n\t__webpack_require__(4);\n\t\n\t__webpack_require__(5);\n\t\n\t__webpack_require__(6);\n\t\n\t__webpack_require__(7);\n\t\n\t__webpack_require__(8);\n\t\n\t__webpack_require__(9);\n\t\n\t__webpack_require__(10);\n\t\n\t__webpack_require__(11);\n\t\n\t__webpack_require__(12);\n\t\n\t__webpack_require__(13);\n\t\n\tvar _utils = __webpack_require__(14);\n\t\n\tvar _mixer = __webpack_require__(15);\n\t\n\tvar _scope = __webpack_require__(16);\n\t\n\tvar _core = __webpack_require__(17);\n\t\n\tvar _viewModel = __webpack_require__(18);\n\t\n\tvar _reactive = __webpack_require__(19);\n\t\n\tvar _templates = __webpack_require__(20);\n\t\n\t// legacy\n\t// lib\n\tvar name = exports.name = 'angular-meteor';\n\t\n\t// new\n\t\n\t\n\tangular.module(name, [\n\t// new\n\t_utils.name, _mixer.name, _scope.name, _core.name, _viewModel.name, _reactive.name, _templates.name,\n\t\n\t// legacy\n\t'angular-meteor.ironrouter', 'angular-meteor.utils', 'angular-meteor.subscribe', 'angular-meteor.collection', 'angular-meteor.object', 'angular-meteor.user', 'angular-meteor.methods', 'angular-meteor.session', 'angular-meteor.camera']).run([_mixer.Mixer, _core.Core, _viewModel.ViewModel, _reactive.Reactive, function ($Mixer, $$Core, $$ViewModel, $$Reactive) {\n\t // Load all mixins\n\t $Mixer.mixin($$Core).mixin($$ViewModel).mixin($$Reactive);\n\t}])\n\t\n\t// legacy\n\t// Putting all services under $meteor service for syntactic sugar\n\t.service('$meteor', ['$meteorCollection', '$meteorCollectionFS', '$meteorObject', '$meteorMethods', '$meteorSession', '$meteorSubscribe', '$meteorUtils', '$meteorCamera', '$meteorUser', function ($meteorCollection, $meteorCollectionFS, $meteorObject, $meteorMethods, $meteorSession, $meteorSubscribe, $meteorUtils, $meteorCamera, $meteorUser) {\n\t var _this = this;\n\t\n\t this.collection = $meteorCollection;\n\t this.collectionFS = $meteorCollectionFS;\n\t this.object = $meteorObject;\n\t this.subscribe = $meteorSubscribe.subscribe;\n\t this.call = $meteorMethods.call;\n\t this.session = $meteorSession;\n\t this.autorun = $meteorUtils.autorun;\n\t this.getCollectionByName = $meteorUtils.getCollectionByName;\n\t this.getPicture = $meteorCamera.getPicture;\n\t\n\t // $meteorUser\n\t ['loginWithPassword', 'requireUser', 'requireValidUser', 'waitForUser', 'createUser', 'changePassword', 'forgotPassword', 'resetPassword', 'verifyEmail', 'loginWithMeteorDeveloperAccount', 'loginWithFacebook', 'loginWithGithub', 'loginWithGoogle', 'loginWithMeetup', 'loginWithTwitter', 'loginWithWeibo', 'logout', 'logoutOtherClients'].forEach(function (method) {\n\t _this[method] = $meteorUser[method];\n\t });\n\t}]);\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\t/*global\n\t angular, _\n\t */\n\t\n\t'use strict';\n\t\n\t// https://github.com/DAB0mB/get-updates\n\t\n\t(function () {\n\t var module = angular.module('getUpdates', []);\n\t\n\t var utils = function () {\n\t var rip = function rip(obj, level) {\n\t if (level < 1) return {};\n\t\n\t return _.reduce(obj, function (clone, v, k) {\n\t v = _.isObject(v) ? rip(v, --level) : v;\n\t clone[k] = v;\n\t return clone;\n\t }, {});\n\t };\n\t\n\t var toPaths = function toPaths(obj) {\n\t var keys = getKeyPaths(obj);\n\t var values = getDeepValues(obj);\n\t return _.object(keys, values);\n\t };\n\t\n\t var getKeyPaths = function getKeyPaths(obj) {\n\t var keys = _.keys(obj).map(function (k) {\n\t var v = obj[k];\n\t if (!_.isObject(v) || _.isEmpty(v) || _.isArray(v)) return k;\n\t\n\t return getKeyPaths(v).map(function (subKey) {\n\t return k + '.' + subKey;\n\t });\n\t });\n\t\n\t return _.flatten(keys);\n\t };\n\t\n\t var getDeepValues = function getDeepValues(obj, arr) {\n\t arr = arr || [];\n\t\n\t _.values(obj).forEach(function (v) {\n\t if (!_.isObject(v) || _.isEmpty(v) || _.isArray(v)) arr.push(v);else getDeepValues(v, arr);\n\t });\n\t\n\t return arr;\n\t };\n\t\n\t var flatten = function flatten(arr) {\n\t return arr.reduce(function (flattened, v, i) {\n\t if (_.isArray(v) && !_.isEmpty(v)) flattened.push.apply(flattened, flatten(v));else flattened.push(v);\n\t\n\t return flattened;\n\t }, []);\n\t };\n\t\n\t var setFilled = function setFilled(obj, k, v) {\n\t if (!_.isEmpty(v)) obj[k] = v;\n\t };\n\t\n\t var assert = function assert(result, msg) {\n\t if (!result) throwErr(msg);\n\t };\n\t\n\t var throwErr = function throwErr(msg) {\n\t throw Error('get-updates error - ' + msg);\n\t };\n\t\n\t return {\n\t rip: rip,\n\t toPaths: toPaths,\n\t getKeyPaths: getKeyPaths,\n\t getDeepValues: getDeepValues,\n\t setFilled: setFilled,\n\t assert: assert,\n\t throwErr: throwErr\n\t };\n\t }();\n\t\n\t var getDifference = function () {\n\t var getDifference = function getDifference(src, dst, isShallow) {\n\t var level;\n\t\n\t if (isShallow > 1) level = isShallow;else if (isShallow) level = 1;\n\t\n\t if (level) {\n\t src = utils.rip(src, level);\n\t dst = utils.rip(dst, level);\n\t }\n\t\n\t return compare(src, dst);\n\t };\n\t\n\t var compare = function compare(src, dst) {\n\t var srcKeys = _.keys(src);\n\t var dstKeys = _.keys(dst);\n\t\n\t var keys = _.chain([]).concat(srcKeys).concat(dstKeys).uniq().without('$$hashKey').value();\n\t\n\t return keys.reduce(function (diff, k) {\n\t var srcValue = src[k];\n\t var dstValue = dst[k];\n\t\n\t if (_.isDate(srcValue) && _.isDate(dstValue)) {\n\t if (srcValue.getTime() != dstValue.getTime()) diff[k] = dstValue;\n\t }\n\t\n\t if (_.isObject(srcValue) && _.isObject(dstValue)) {\n\t var valueDiff = getDifference(srcValue, dstValue);\n\t utils.setFilled(diff, k, valueDiff);\n\t } else if (srcValue !== dstValue) {\n\t diff[k] = dstValue;\n\t }\n\t\n\t return diff;\n\t }, {});\n\t };\n\t\n\t return getDifference;\n\t }();\n\t\n\t var getUpdates = function () {\n\t var getUpdates = function getUpdates(src, dst, isShallow) {\n\t utils.assert(_.isObject(src), 'first argument must be an object');\n\t utils.assert(_.isObject(dst), 'second argument must be an object');\n\t\n\t var diff = getDifference(src, dst, isShallow);\n\t var paths = utils.toPaths(diff);\n\t\n\t var set = createSet(paths);\n\t var unset = createUnset(paths);\n\t var pull = createPull(unset);\n\t\n\t var updates = {};\n\t utils.setFilled(updates, '$set', set);\n\t utils.setFilled(updates, '$unset', unset);\n\t utils.setFilled(updates, '$pull', pull);\n\t\n\t return updates;\n\t };\n\t\n\t var createSet = function createSet(paths) {\n\t var undefinedKeys = getUndefinedKeys(paths);\n\t return _.omit(paths, undefinedKeys);\n\t };\n\t\n\t var createUnset = function createUnset(paths) {\n\t var undefinedKeys = getUndefinedKeys(paths);\n\t var unset = _.pick(paths, undefinedKeys);\n\t\n\t return _.reduce(unset, function (result, v, k) {\n\t result[k] = true;\n\t return result;\n\t }, {});\n\t };\n\t\n\t var createPull = function createPull(unset) {\n\t var arrKeyPaths = _.keys(unset).map(function (k) {\n\t var split = k.match(/(.*)\\.\\d+$/);\n\t return split && split[1];\n\t });\n\t\n\t return _.compact(arrKeyPaths).reduce(function (pull, k) {\n\t pull[k] = null;\n\t return pull;\n\t }, {});\n\t };\n\t\n\t var getUndefinedKeys = function getUndefinedKeys(obj) {\n\t return _.keys(obj).filter(function (k) {\n\t var v = obj[k];\n\t return _.isUndefined(v);\n\t });\n\t };\n\t\n\t return getUpdates;\n\t }();\n\t\n\t module.value('getUpdates', getUpdates);\n\t})();\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\t/*global\n\t angular, _, Package\n\t */\n\t\n\t'use strict';\n\t\n\tvar _module = angular.module('diffArray', ['getUpdates']);\n\t\n\t_module.factory('diffArray', ['getUpdates', function (getUpdates) {\n\t var LocalCollection = Package.minimongo.LocalCollection;\n\t var idStringify = LocalCollection._idStringify || Package['mongo-id'].MongoID.idStringify;\n\t var idParse = LocalCollection._idParse || Package['mongo-id'].MongoID.idParse;\n\t\n\t // Calculates the differences between `lastSeqArray` and\n\t // `seqArray` and calls appropriate functions from `callbacks`.\n\t // Reuses Minimongo's diff algorithm implementation.\n\t // XXX Should be replaced with the original diffArray function here:\n\t // https://github.com/meteor/meteor/blob/devel/packages/observe-sequence/observe_sequence.js#L152\n\t // When it will become nested as well, tracking here: https://github.com/meteor/meteor/issues/3764\n\t function diffArray(lastSeqArray, seqArray, callbacks, preventNestedDiff) {\n\t preventNestedDiff = !!preventNestedDiff;\n\t\n\t var diffFn = Package.minimongo.LocalCollection._diffQueryOrderedChanges || Package['diff-sequence'].DiffSequence.diffQueryOrderedChanges;\n\t\n\t var oldObjIds = [];\n\t var newObjIds = [];\n\t var posOld = {}; // maps from idStringify'd ids\n\t var posNew = {}; // ditto\n\t var posCur = {};\n\t var lengthCur = lastSeqArray.length;\n\t\n\t _.each(seqArray, function (doc, i) {\n\t newObjIds.push({ _id: doc._id });\n\t posNew[idStringify(doc._id)] = i;\n\t });\n\t\n\t _.each(lastSeqArray, function (doc, i) {\n\t oldObjIds.push({ _id: doc._id });\n\t posOld[idStringify(doc._id)] = i;\n\t posCur[idStringify(doc._id)] = i;\n\t });\n\t\n\t // Arrays can contain arbitrary objects. We don't diff the\n\t // objects. Instead we always fire 'changedAt' callback on every\n\t // object. The consumer of `observe-sequence` should deal with\n\t // it appropriately.\n\t diffFn(oldObjIds, newObjIds, {\n\t addedBefore: function addedBefore(id, doc, before) {\n\t var position = before ? posCur[idStringify(before)] : lengthCur;\n\t\n\t _.each(posCur, function (pos, id) {\n\t if (pos >= position) posCur[id]++;\n\t });\n\t\n\t lengthCur++;\n\t posCur[idStringify(id)] = position;\n\t\n\t callbacks.addedAt(id, seqArray[posNew[idStringify(id)]], position, before);\n\t },\n\t\n\t movedBefore: function movedBefore(id, before) {\n\t var prevPosition = posCur[idStringify(id)];\n\t var position = before ? posCur[idStringify(before)] : lengthCur - 1;\n\t\n\t _.each(posCur, function (pos, id) {\n\t if (pos >= prevPosition && pos <= position) posCur[id]--;else if (pos <= prevPosition && pos >= position) posCur[id]++;\n\t });\n\t\n\t posCur[idStringify(id)] = position;\n\t\n\t callbacks.movedTo(id, seqArray[posNew[idStringify(id)]], prevPosition, position, before);\n\t },\n\t removed: function removed(id) {\n\t var prevPosition = posCur[idStringify(id)];\n\t\n\t _.each(posCur, function (pos, id) {\n\t if (pos >= prevPosition) posCur[id]--;\n\t });\n\t\n\t delete posCur[idStringify(id)];\n\t lengthCur--;\n\t\n\t callbacks.removedAt(id, lastSeqArray[posOld[idStringify(id)]], prevPosition);\n\t }\n\t });\n\t\n\t _.each(posNew, function (pos, idString) {\n\t if (!_.has(posOld, idString)) return;\n\t\n\t var id = idParse(idString);\n\t var newItem = seqArray[pos] || {};\n\t var oldItem = lastSeqArray[posOld[idString]];\n\t var updates = getUpdates(oldItem, newItem, preventNestedDiff);\n\t\n\t if (!_.isEmpty(updates)) callbacks.changedAt(id, updates, pos, oldItem);\n\t });\n\t }\n\t\n\t diffArray.shallow = function (lastSeqArray, seqArray, callbacks) {\n\t return diffArray(lastSeqArray, seqArray, callbacks, true);\n\t };\n\t\n\t diffArray.deepCopyChanges = function (oldItem, newItem) {\n\t var setDiff = getUpdates(oldItem, newItem).$set;\n\t\n\t _.each(setDiff, function (v, deepKey) {\n\t setDeep(oldItem, deepKey, v);\n\t });\n\t };\n\t\n\t diffArray.deepCopyRemovals = function (oldItem, newItem) {\n\t var unsetDiff = getUpdates(oldItem, newItem).$unset;\n\t\n\t _.each(unsetDiff, function (v, deepKey) {\n\t unsetDeep(oldItem, deepKey);\n\t });\n\t };\n\t\n\t // Finds changes between two collections\n\t diffArray.getChanges = function (newCollection, oldCollection, diffMethod) {\n\t var changes = { added: [], removed: [], changed: [] };\n\t\n\t diffMethod(oldCollection, newCollection, {\n\t addedAt: function addedAt(id, item, index) {\n\t changes.added.push({ item: item, index: index });\n\t },\n\t\n\t removedAt: function removedAt(id, item, index) {\n\t changes.removed.push({ item: item, index: index });\n\t },\n\t\n\t changedAt: function changedAt(id, updates, index, oldItem) {\n\t changes.changed.push({ selector: id, modifier: updates });\n\t },\n\t\n\t movedTo: function movedTo(id, item, fromIndex, toIndex) {\n\t // XXX do we need this?\n\t }\n\t });\n\t\n\t return changes;\n\t };\n\t\n\t var setDeep = function setDeep(obj, deepKey, v) {\n\t var split = deepKey.split('.');\n\t var initialKeys = _.initial(split);\n\t var lastKey = _.last(split);\n\t\n\t initialKeys.reduce(function (subObj, k, i) {\n\t var nextKey = split[i + 1];\n\t\n\t if (isNumStr(nextKey)) {\n\t if (subObj[k] === null) subObj[k] = [];\n\t if (subObj[k].length == parseInt(nextKey)) subObj[k].push(null);\n\t } else if (subObj[k] === null || !isHash(subObj[k])) {\n\t subObj[k] = {};\n\t }\n\t\n\t return subObj[k];\n\t }, obj);\n\t\n\t var deepObj = getDeep(obj, initialKeys);\n\t deepObj[lastKey] = v;\n\t return v;\n\t };\n\t\n\t var unsetDeep = function unsetDeep(obj, deepKey) {\n\t var split = deepKey.split('.');\n\t var initialKeys = _.initial(split);\n\t var lastKey = _.last(split);\n\t var deepObj = getDeep(obj, initialKeys);\n\t\n\t if (_.isArray(deepObj) && isNumStr(lastKey)) return !!deepObj.splice(lastKey, 1);else return delete deepObj[lastKey];\n\t };\n\t\n\t var getDeep = function getDeep(obj, keys) {\n\t return keys.reduce(function (subObj, k) {\n\t return subObj[k];\n\t }, obj);\n\t };\n\t\n\t var isHash = function isHash(obj) {\n\t return _.isObject(obj) && Object.getPrototypeOf(obj) === Object.prototype;\n\t };\n\t\n\t var isNumStr = function isNumStr(str) {\n\t return str.match(/^\\d+$/);\n\t };\n\t\n\t return diffArray;\n\t}]);\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tangular.module('angular-meteor.settings', []).constant('$angularMeteorSettings', {\n\t suppressWarnings: false\n\t});\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tangular.module('angular-meteor.ironrouter', []).run(['$compile', '$document', '$rootScope', function ($compile, $document, $rootScope) {\n\t var Router = (Package['iron:router'] || {}).Router;\n\t if (!Router) return;\n\t\n\t var isLoaded = false;\n\t\n\t // Recompile after iron:router builds page\n\t Router.onAfterAction(function (req, res, next) {\n\t Tracker.afterFlush(function () {\n\t if (isLoaded) return;\n\t $compile($document)($rootScope);\n\t if (!$rootScope.$$phase) $rootScope.$apply();\n\t isLoaded = true;\n\t });\n\t });\n\t}]);\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\t/*global\n\t angular, _, Tracker, EJSON, FS, Mongo\n\t */\n\t\n\t'use strict';\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\t\n\tvar angularMeteorUtils = angular.module('angular-meteor.utils', ['angular-meteor.settings']);\n\t\n\tangularMeteorUtils.service('$meteorUtils', ['$q', '$timeout', '$angularMeteorSettings', function ($q, $timeout, $angularMeteorSettings) {\n\t\n\t var self = this;\n\t\n\t this.autorun = function (scope, fn) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.utils.autorun] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.6/autorun. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t // wrapping around Deps.autorun\n\t var comp = Tracker.autorun(function (c) {\n\t fn(c);\n\t // this is run immediately for the first call\n\t // but after that, we need to $apply to start Angular digest\n\t if (!c.firstRun) $timeout(angular.noop, 0);\n\t });\n\t\n\t // stop autorun when scope is destroyed\n\t scope.$on('$destroy', function () {\n\t comp.stop();\n\t });\n\t\n\t // return autorun object so that it can be stopped manually\n\t return comp;\n\t };\n\t\n\t // Borrowed from angularFire\n\t // https://github.com/firebase/angularfire/blob/master/src/utils.js#L445-L454\n\t this.stripDollarPrefixedKeys = function (data) {\n\t if (!_.isObject(data) || data instanceof Date || data instanceof File || EJSON.toJSONValue(data).$type === 'oid' || (typeof FS === 'undefined' ? 'undefined' : _typeof(FS)) === 'object' && data instanceof FS.File) return data;\n\t\n\t var out = _.isArray(data) ? [] : {};\n\t\n\t _.each(data, function (v, k) {\n\t if (typeof k !== 'string' || k.charAt(0) !== '$') out[k] = self.stripDollarPrefixedKeys(v);\n\t });\n\t\n\t return out;\n\t };\n\t\n\t // Returns a callback which fulfills promise\n\t this.fulfill = function (deferred, boundError, boundResult) {\n\t return function (err, result) {\n\t if (err) deferred.reject(boundError == null ? err : boundError);else if (typeof boundResult == \"function\") deferred.resolve(boundResult == null ? result : boundResult(result));else deferred.resolve(boundResult == null ? result : boundResult);\n\t };\n\t };\n\t\n\t // creates a function which invokes method with the given arguments and returns a promise\n\t this.promissor = function (obj, method) {\n\t return function () {\n\t var deferred = $q.defer();\n\t var fulfill = self.fulfill(deferred);\n\t var args = _.toArray(arguments).concat(fulfill);\n\t obj[method].apply(obj, args);\n\t return deferred.promise;\n\t };\n\t };\n\t\n\t // creates a $q.all() promise and call digestion loop on fulfillment\n\t this.promiseAll = function (promises) {\n\t var allPromise = $q.all(promises);\n\t\n\t allPromise.finally(function () {\n\t // calls digestion loop with no conflicts\n\t $timeout(angular.noop);\n\t });\n\t\n\t return allPromise;\n\t };\n\t\n\t this.getCollectionByName = function (string) {\n\t return Mongo.Collection.get(string);\n\t };\n\t\n\t this.findIndexById = function (collection, doc) {\n\t var foundDoc = _.find(collection, function (colDoc) {\n\t // EJSON.equals used to compare Mongo.ObjectIDs and Strings.\n\t return EJSON.equals(colDoc._id, doc._id);\n\t });\n\t\n\t return _.indexOf(collection, foundDoc);\n\t };\n\t}]);\n\t\n\tangularMeteorUtils.run(['$rootScope', '$meteorUtils', function ($rootScope, $meteorUtils) {\n\t Object.getPrototypeOf($rootScope).$meteorAutorun = function (fn) {\n\t return $meteorUtils.autorun(this, fn);\n\t };\n\t}]);\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\t/*global\n\t angular, Meteor\n\t */\n\t\n\t'use strict';\n\t\n\tvar angularMeteorSubscribe = angular.module('angular-meteor.subscribe', ['angular-meteor.settings']);\n\t\n\tangularMeteorSubscribe.service('$meteorSubscribe', ['$q', '$angularMeteorSettings', function ($q, $angularMeteorSettings) {\n\t\n\t var self = this;\n\t\n\t this._subscribe = function (scope, deferred, args) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.subscribe] Please note that this module is deprecated since 1.3.0 and will be removed in 1.4.0! Replace it with the new syntax described here: http://www.angular-meteor.com/api/1.3.6/subscribe. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t var subscription = null;\n\t var lastArg = args[args.length - 1];\n\t\n\t // User supplied onStop callback\n\t // save it for later use and remove\n\t // from subscription arguments\n\t if (angular.isObject(lastArg) && angular.isFunction(lastArg.onStop)) {\n\t var _onStop = lastArg.onStop;\n\t\n\t args.pop();\n\t }\n\t\n\t args.push({\n\t onReady: function onReady() {\n\t deferred.resolve(subscription);\n\t },\n\t onStop: function onStop(err) {\n\t if (!deferred.promise.$$state.status) {\n\t if (err) deferred.reject(err);else deferred.reject(new Meteor.Error(\"Subscription Stopped\", \"Subscription stopped by a call to stop method. Either by the client or by the server.\"));\n\t } else if (_onStop)\n\t // After promise was resolved or rejected\n\t // call user supplied onStop callback.\n\t _onStop.apply(this, Array.prototype.slice.call(arguments));\n\t }\n\t });\n\t\n\t subscription = Meteor.subscribe.apply(scope, args);\n\t\n\t return subscription;\n\t };\n\t\n\t this.subscribe = function () {\n\t var deferred = $q.defer();\n\t var args = Array.prototype.slice.call(arguments);\n\t var subscription = null;\n\t\n\t self._subscribe(this, deferred, args);\n\t\n\t return deferred.promise;\n\t };\n\t}]);\n\t\n\tangularMeteorSubscribe.run(['$rootScope', '$q', '$meteorSubscribe', function ($rootScope, $q, $meteorSubscribe) {\n\t Object.getPrototypeOf($rootScope).$meteorSubscribe = function () {\n\t var deferred = $q.defer();\n\t var args = Array.prototype.slice.call(arguments);\n\t\n\t var subscription = $meteorSubscribe._subscribe(this, deferred, args);\n\t\n\t this.$on('$destroy', function () {\n\t subscription.stop();\n\t });\n\t\n\t return deferred.promise;\n\t };\n\t}]);\n\n/***/ },\n/* 7 */\n/***/ function(module, exports) {\n\n\t/*global\n\t angular, _, Tracker, check, Match, Mongo\n\t */\n\t\n\t'use strict';\n\t\n\tvar angularMeteorCollection = angular.module('angular-meteor.collection', ['angular-meteor.stopper', 'angular-meteor.subscribe', 'angular-meteor.utils', 'diffArray', 'angular-meteor.settings']);\n\t\n\t// The reason angular meteor collection is a factory function and not something\n\t// that inherit from array comes from here:\n\t// http://perfectionkills.com/how-ecmascript-5-still-does-not-allow-to-subclass-an-array/\n\t// We went with the direct extensions approach.\n\tangularMeteorCollection.factory('AngularMeteorCollection', ['$q', '$meteorSubscribe', '$meteorUtils', '$rootScope', '$timeout', 'diffArray', '$angularMeteorSettings', function ($q, $meteorSubscribe, $meteorUtils, $rootScope, $timeout, diffArray, $angularMeteorSettings) {\n\t\n\t function AngularMeteorCollection(curDefFunc, collection, diffArrayFunc, autoClientSave) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.$meteorCollection] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorCollection. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t var data = [];\n\t // Server backup data to evaluate what changes come from client\n\t // after each server update.\n\t data._serverBackup = [];\n\t // Array differ function.\n\t data._diffArrayFunc = diffArrayFunc;\n\t // Handler of the cursor observer.\n\t data._hObserve = null;\n\t // On new cursor autorun handler\n\t // (autorun for reactive variables).\n\t data._hNewCurAutorun = null;\n\t // On new data autorun handler\n\t // (autorun for cursor.fetch).\n\t data._hDataAutorun = null;\n\t\n\t if (angular.isDefined(collection)) {\n\t data.$$collection = collection;\n\t } else {\n\t var cursor = curDefFunc();\n\t data.$$collection = $meteorUtils.getCollectionByName(cursor.collection.name);\n\t }\n\t\n\t _.extend(data, AngularMeteorCollection);\n\t data._startCurAutorun(curDefFunc, autoClientSave);\n\t\n\t return data;\n\t }\n\t\n\t AngularMeteorCollection._startCurAutorun = function (curDefFunc, autoClientSave) {\n\t var self = this;\n\t\n\t self._hNewCurAutorun = Tracker.autorun(function () {\n\t // When the reactive func gets recomputated we need to stop any previous\n\t // observeChanges.\n\t Tracker.onInvalidate(function () {\n\t self._stopCursor();\n\t });\n\t\n\t if (autoClientSave) self._setAutoClientSave();\n\t self._updateCursor(curDefFunc(), autoClientSave);\n\t });\n\t };\n\t\n\t AngularMeteorCollection.subscribe = function () {\n\t $meteorSubscribe.subscribe.apply(this, arguments);\n\t return this;\n\t };\n\t\n\t AngularMeteorCollection.save = function (docs, useUnsetModifier) {\n\t // save whole collection\n\t if (!docs) docs = this;\n\t // save single doc\n\t docs = [].concat(docs);\n\t\n\t var promises = docs.map(function (doc) {\n\t return this._upsertDoc(doc, useUnsetModifier);\n\t }, this);\n\t\n\t return $meteorUtils.promiseAll(promises);\n\t };\n\t\n\t AngularMeteorCollection._upsertDoc = function (doc, useUnsetModifier) {\n\t var deferred = $q.defer();\n\t var collection = this.$$collection;\n\t var createFulfill = _.partial($meteorUtils.fulfill, deferred, null);\n\t\n\t // delete $$hashkey\n\t doc = $meteorUtils.stripDollarPrefixedKeys(doc);\n\t var docId = doc._id;\n\t var isExist = collection.findOne(docId);\n\t\n\t // update\n\t if (isExist) {\n\t // Deletes _id property (from the copy) so that\n\t // it can be $set using update.\n\t delete doc._id;\n\t var modifier = useUnsetModifier ? { $unset: doc } : { $set: doc };\n\t // NOTE: do not use #upsert() method, since it does not exist in some collections\n\t collection.update(docId, modifier, createFulfill(function () {\n\t return { _id: docId, action: 'updated' };\n\t }));\n\t }\n\t // insert\n\t else {\n\t collection.insert(doc, createFulfill(function (id) {\n\t return { _id: id, action: 'inserted' };\n\t }));\n\t }\n\t\n\t return deferred.promise;\n\t };\n\t\n\t // performs $pull operations parallely.\n\t // used for handling splice operations returned from getUpdates() to prevent conflicts.\n\t // see issue: https://github.com/Urigo/angular-meteor/issues/793\n\t AngularMeteorCollection._updateDiff = function (selector, update, callback) {\n\t callback = callback || angular.noop;\n\t var setters = _.omit(update, '$pull');\n\t var updates = [setters];\n\t\n\t _.each(update.$pull, function (pull, prop) {\n\t var puller = {};\n\t puller[prop] = pull;\n\t updates.push({ $pull: puller });\n\t });\n\t\n\t this._updateParallel(selector, updates, callback);\n\t };\n\t\n\t // performs each update operation parallely\n\t AngularMeteorCollection._updateParallel = function (selector, updates, callback) {\n\t var self = this;\n\t var done = _.after(updates.length, callback);\n\t\n\t var next = function next(err, affectedDocsNum) {\n\t if (err) return callback(err);\n\t done(null, affectedDocsNum);\n\t };\n\t\n\t _.each(updates, function (update) {\n\t self.$$collection.update(selector, update, next);\n\t });\n\t };\n\t\n\t AngularMeteorCollection.remove = function (keyOrDocs) {\n\t var keys;\n\t\n\t // remove whole collection\n\t if (!keyOrDocs) {\n\t keys = _.pluck(this, '_id');\n\t }\n\t // remove docs\n\t else {\n\t keyOrDocs = [].concat(keyOrDocs);\n\t\n\t keys = _.map(keyOrDocs, function (keyOrDoc) {\n\t return keyOrDoc._id || keyOrDoc;\n\t });\n\t }\n\t\n\t // Checks if all keys are correct.\n\t check(keys, [Match.OneOf(String, Mongo.ObjectID)]);\n\t\n\t var promises = keys.map(function (key) {\n\t return this._removeDoc(key);\n\t }, this);\n\t\n\t return $meteorUtils.promiseAll(promises);\n\t };\n\t\n\t AngularMeteorCollection._removeDoc = function (id) {\n\t var deferred = $q.defer();\n\t var collection = this.$$collection;\n\t var fulfill = $meteorUtils.fulfill(deferred, null, { _id: id, action: 'removed' });\n\t collection.remove(id, fulfill);\n\t return deferred.promise;\n\t };\n\t\n\t AngularMeteorCollection._updateCursor = function (cursor, autoClientSave) {\n\t var self = this;\n\t // XXX - consider adding an option for a non-orderd result for faster performance\n\t if (self._hObserve) self._stopObserving();\n\t\n\t self._hObserve = cursor.observe({\n\t addedAt: function addedAt(doc, atIndex) {\n\t self.splice(atIndex, 0, doc);\n\t self._serverBackup.splice(atIndex, 0, doc);\n\t self._setServerUpdateMode();\n\t },\n\t\n\t changedAt: function changedAt(doc, oldDoc, atIndex) {\n\t diffArray.deepCopyChanges(self[atIndex], doc);\n\t diffArray.deepCopyRemovals(self[atIndex], doc);\n\t self._serverBackup[atIndex] = self[atIndex];\n\t self._setServerUpdateMode();\n\t },\n\t\n\t movedTo: function movedTo(doc, fromIndex, toIndex) {\n\t self.splice(fromIndex, 1);\n\t self.splice(toIndex, 0, doc);\n\t self._serverBackup.splice(fromIndex, 1);\n\t self._serverBackup.splice(toIndex, 0, doc);\n\t self._setServerUpdateMode();\n\t },\n\t\n\t removedAt: function removedAt(oldDoc) {\n\t var removedIndex = $meteorUtils.findIndexById(self, oldDoc);\n\t\n\t if (removedIndex != -1) {\n\t self.splice(removedIndex, 1);\n\t self._serverBackup.splice(removedIndex, 1);\n\t self._setServerUpdateMode();\n\t } else {\n\t // If it's been removed on client then it's already not in collection\n\t // itself but still is in the _serverBackup.\n\t removedIndex = $meteorUtils.findIndexById(self._serverBackup, oldDoc);\n\t\n\t if (removedIndex != -1) {\n\t self._serverBackup.splice(removedIndex, 1);\n\t }\n\t }\n\t }\n\t });\n\t\n\t self._hDataAutorun = Tracker.autorun(function () {\n\t cursor.fetch();\n\t if (self._serverMode) self._unsetServerUpdateMode(autoClientSave);\n\t });\n\t };\n\t\n\t AngularMeteorCollection._stopObserving = function () {\n\t this._hObserve.stop();\n\t this._hDataAutorun.stop();\n\t delete this._serverMode;\n\t delete this._hUnsetTimeout;\n\t };\n\t\n\t AngularMeteorCollection._setServerUpdateMode = function (name) {\n\t this._serverMode = true;\n\t // To simplify server update logic, we don't follow\n\t // updates from the client at the same time.\n\t this._unsetAutoClientSave();\n\t };\n\t\n\t // Here we use $timeout to combine multiple updates that go\n\t // each one after another.\n\t AngularMeteorCollection._unsetServerUpdateMode = function (autoClientSave) {\n\t var self = this;\n\t\n\t if (self._hUnsetTimeout) {\n\t $timeout.cancel(self._hUnsetTimeout);\n\t self._hUnsetTimeout = null;\n\t }\n\t\n\t self._hUnsetTimeout = $timeout(function () {\n\t self._serverMode = false;\n\t // Finds updates that was potentially done from the client side\n\t // and saves them.\n\t var changes = diffArray.getChanges(self, self._serverBackup, self._diffArrayFunc);\n\t self._saveChanges(changes);\n\t // After, continues following client updates.\n\t if (autoClientSave) self._setAutoClientSave();\n\t }, 0);\n\t };\n\t\n\t AngularMeteorCollection.stop = function () {\n\t this._stopCursor();\n\t this._hNewCurAutorun.stop();\n\t };\n\t\n\t AngularMeteorCollection._stopCursor = function () {\n\t this._unsetAutoClientSave();\n\t\n\t if (this._hObserve) {\n\t this._hObserve.stop();\n\t this._hDataAutorun.stop();\n\t }\n\t\n\t this.splice(0);\n\t this._serverBackup.splice(0);\n\t };\n\t\n\t AngularMeteorCollection._unsetAutoClientSave = function (name) {\n\t if (this._hRegAutoBind) {\n\t this._hRegAutoBind();\n\t this._hRegAutoBind = null;\n\t }\n\t };\n\t\n\t AngularMeteorCollection._setAutoClientSave = function () {\n\t var self = this;\n\t\n\t // Always unsets auto save to keep only one $watch handler.\n\t self._unsetAutoClientSave();\n\t\n\t self._hRegAutoBind = $rootScope.$watch(function () {\n\t return self;\n\t }, function (nItems, oItems) {\n\t if (nItems === oItems) return;\n\t\n\t var changes = diffArray.getChanges(self, oItems, self._diffArrayFunc);\n\t self._unsetAutoClientSave();\n\t self._saveChanges(changes);\n\t self._setAutoClientSave();\n\t }, true);\n\t };\n\t\n\t AngularMeteorCollection._saveChanges = function (changes) {\n\t var self = this;\n\t\n\t // Saves added documents\n\t // Using reversed iteration to prevent indexes from changing during splice\n\t var addedDocs = changes.added.reverse().map(function (descriptor) {\n\t self.splice(descriptor.index, 1);\n\t return descriptor.item;\n\t });\n\t\n\t if (addedDocs.length) self.save(addedDocs);\n\t\n\t // Removes deleted documents\n\t var removedDocs = changes.removed.map(function (descriptor) {\n\t return descriptor.item;\n\t });\n\t\n\t if (removedDocs.length) self.remove(removedDocs);\n\t\n\t // Updates changed documents\n\t changes.changed.forEach(function (descriptor) {\n\t self._updateDiff(descriptor.selector, descriptor.modifier);\n\t });\n\t };\n\t\n\t return AngularMeteorCollection;\n\t}]);\n\t\n\tangularMeteorCollection.factory('$meteorCollectionFS', ['$meteorCollection', 'diffArray', '$angularMeteorSettings', function ($meteorCollection, diffArray, $angularMeteorSettings) {\n\t function $meteorCollectionFS(reactiveFunc, autoClientSave, collection) {\n\t\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.$meteorCollectionFS] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/files. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t return new $meteorCollection(reactiveFunc, autoClientSave, collection, diffArray.shallow);\n\t }\n\t\n\t return $meteorCollectionFS;\n\t}]);\n\t\n\tangularMeteorCollection.factory('$meteorCollection', ['AngularMeteorCollection', '$rootScope', 'diffArray', function (AngularMeteorCollection, $rootScope, diffArray) {\n\t function $meteorCollection(reactiveFunc, autoClientSave, collection, diffFn) {\n\t // Validate parameters\n\t if (!reactiveFunc) {\n\t throw new TypeError('The first argument of $meteorCollection is undefined.');\n\t }\n\t\n\t if (!(angular.isFunction(reactiveFunc) || angular.isFunction(reactiveFunc.find))) {\n\t throw new TypeError('The first argument of $meteorCollection must be a function or ' + 'a have a find function property.');\n\t }\n\t\n\t if (!angular.isFunction(reactiveFunc)) {\n\t collection = angular.isDefined(collection) ? collection : reactiveFunc;\n\t reactiveFunc = _.bind(reactiveFunc.find, reactiveFunc);\n\t }\n\t\n\t // By default auto save - true.\n\t autoClientSave = angular.isDefined(autoClientSave) ? autoClientSave : true;\n\t diffFn = diffFn || diffArray;\n\t return new AngularMeteorCollection(reactiveFunc, collection, diffFn, autoClientSave);\n\t }\n\t\n\t return $meteorCollection;\n\t}]);\n\t\n\tangularMeteorCollection.run(['$rootScope', '$meteorCollection', '$meteorCollectionFS', '$meteorStopper', function ($rootScope, $meteorCollection, $meteorCollectionFS, $meteorStopper) {\n\t var scopeProto = Object.getPrototypeOf($rootScope);\n\t scopeProto.$meteorCollection = $meteorStopper($meteorCollection);\n\t scopeProto.$meteorCollectionFS = $meteorStopper($meteorCollectionFS);\n\t}]);\n\n/***/ },\n/* 8 */\n/***/ function(module, exports) {\n\n\t/*global\n\t angular, _, Mongo\n\t*/\n\t\n\t'use strict';\n\t\n\tvar angularMeteorObject = angular.module('angular-meteor.object', ['angular-meteor.utils', 'angular-meteor.subscribe', 'angular-meteor.collection', 'getUpdates', 'diffArray', 'angular-meteor.settings']);\n\t\n\tangularMeteorObject.factory('AngularMeteorObject', ['$q', '$meteorSubscribe', '$meteorUtils', 'diffArray', 'getUpdates', 'AngularMeteorCollection', '$angularMeteorSettings', function ($q, $meteorSubscribe, $meteorUtils, diffArray, getUpdates, AngularMeteorCollection, $angularMeteorSettings) {\n\t\n\t // A list of internals properties to not watch for, nor pass to the Document on update and etc.\n\t AngularMeteorObject.$$internalProps = ['$$collection', '$$options', '$$id', '$$hashkey', '$$internalProps', '$$scope', 'bind', 'save', 'reset', 'subscribe', 'stop', 'autorunComputation', 'unregisterAutoBind', 'unregisterAutoDestroy', 'getRawObject', '_auto', '_setAutos', '_eventEmitter', '_serverBackup', '_updateDiff', '_updateParallel', '_getId'];\n\t\n\t function AngularMeteorObject(collection, selector, options) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.$meteorObject] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorObject. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t // Make data not be an object so we can extend it to preserve\n\t // Collection Helpers and the like\n\t var helpers = collection._helpers;\n\t var data = _.isFunction(helpers) ? Object.create(helpers.prototype) : {};\n\t var doc = collection.findOne(selector, options);\n\t var collectionExtension = _.pick(AngularMeteorCollection, '_updateParallel');\n\t _.extend(data, doc);\n\t _.extend(data, AngularMeteorObject);\n\t _.extend(data, collectionExtension);\n\t\n\t // Omit options that may spoil document finding\n\t data.$$options = _.omit(options, 'skip', 'limit');\n\t data.$$collection = collection;\n\t data.$$id = data._getId(selector);\n\t data._serverBackup = doc || {};\n\t\n\t return data;\n\t }\n\t\n\t AngularMeteorObject.getRawObject = function () {\n\t return angular.copy(_.omit(this, this.$$internalProps));\n\t };\n\t\n\t AngularMeteorObject.subscribe = function () {\n\t $meteorSubscribe.subscribe.apply(this, arguments);\n\t return this;\n\t };\n\t\n\t AngularMeteorObject.save = function (custom) {\n\t var deferred = $q.defer();\n\t var collection = this.$$collection;\n\t var createFulfill = _.partial($meteorUtils.fulfill, deferred, null);\n\t var oldDoc = collection.findOne(this.$$id);\n\t var mods;\n\t\n\t // update\n\t if (oldDoc) {\n\t if (custom) mods = { $set: custom };else {\n\t mods = getUpdates(oldDoc, this.getRawObject());\n\t // If there are no updates, there is nothing to do here, returning\n\t if (_.isEmpty(mods)) {\n\t return $q.when({ action: 'updated' });\n\t }\n\t }\n\t\n\t // NOTE: do not use #upsert() method, since it does not exist in some collections\n\t this._updateDiff(mods, createFulfill({ action: 'updated' }));\n\t }\n\t // insert\n\t else {\n\t if (custom) mods = _.clone(custom);else mods = this.getRawObject();\n\t\n\t mods._id = mods._id || this.$$id;\n\t collection.insert(mods, createFulfill({ action: 'inserted' }));\n\t }\n\t\n\t return deferred.promise;\n\t };\n\t\n\t AngularMeteorObject._updateDiff = function (update, callback) {\n\t var selector = this.$$id;\n\t AngularMeteorCollection._updateDiff.call(this, selector, update, callback);\n\t };\n\t\n\t AngularMeteorObject.reset = function (keepClientProps) {\n\t var self = this;\n\t var options = this.$$options;\n\t var id = this.$$id;\n\t var doc = this.$$collection.findOne(id, options);\n\t\n\t if (doc) {\n\t // extend SubObject\n\t var docKeys = _.keys(doc);\n\t var docExtension = _.pick(doc, docKeys);\n\t var clientProps;\n\t\n\t _.extend(self, docExtension);\n\t _.extend(self._serverBackup, docExtension);\n\t\n\t if (keepClientProps) {\n\t clientProps = _.intersection(_.keys(self), _.keys(self._serverBackup));\n\t } else {\n\t clientProps = _.keys(self);\n\t }\n\t\n\t var serverProps = _.keys(doc);\n\t var removedKeys = _.difference(clientProps, serverProps, self.$$internalProps);\n\t\n\t removedKeys.forEach(function (prop) {\n\t delete self[prop];\n\t delete self._serverBackup[prop];\n\t });\n\t } else {\n\t _.keys(this.getRawObject()).forEach(function (prop) {\n\t delete self[prop];\n\t });\n\t\n\t self._serverBackup = {};\n\t }\n\t };\n\t\n\t AngularMeteorObject.stop = function () {\n\t if (this.unregisterAutoDestroy) this.unregisterAutoDestroy();\n\t\n\t if (this.unregisterAutoBind) this.unregisterAutoBind();\n\t\n\t if (this.autorunComputation && this.autorunComputation.stop) this.autorunComputation.stop();\n\t };\n\t\n\t AngularMeteorObject._getId = function (selector) {\n\t var options = _.extend({}, this.$$options, {\n\t fields: { _id: 1 },\n\t reactive: false,\n\t transform: null\n\t });\n\t\n\t var doc = this.$$collection.findOne(selector, options);\n\t\n\t if (doc) return doc._id;\n\t if (selector instanceof Mongo.ObjectID) return selector;\n\t if (_.isString(selector)) return selector;\n\t return new Mongo.ObjectID();\n\t };\n\t\n\t return AngularMeteorObject;\n\t}]);\n\t\n\tangularMeteorObject.factory('$meteorObject', ['$rootScope', '$meteorUtils', 'getUpdates', 'AngularMeteorObject', function ($rootScope, $meteorUtils, getUpdates, AngularMeteorObject) {\n\t function $meteorObject(collection, id, auto, options) {\n\t // Validate parameters\n\t if (!collection) {\n\t throw new TypeError(\"The first argument of $meteorObject is undefined.\");\n\t }\n\t\n\t if (!angular.isFunction(collection.findOne)) {\n\t throw new TypeError(\"The first argument of $meteorObject must be a function or a have a findOne function property.\");\n\t }\n\t\n\t var data = new AngularMeteorObject(collection, id, options);\n\t // Making auto default true - http://stackoverflow.com/a/15464208/1426570\n\t data._auto = auto !== false;\n\t _.extend(data, $meteorObject);\n\t data._setAutos();\n\t return data;\n\t }\n\t\n\t $meteorObject._setAutos = function () {\n\t var self = this;\n\t\n\t this.autorunComputation = $meteorUtils.autorun($rootScope, function () {\n\t self.reset(true);\n\t });\n\t\n\t // Deep watches the model and performs autobind\n\t this.unregisterAutoBind = this._auto && $rootScope.$watch(function () {\n\t return self.getRawObject();\n\t }, function (item, oldItem) {\n\t if (item !== oldItem) self.save();\n\t }, true);\n\t\n\t this.unregisterAutoDestroy = $rootScope.$on('$destroy', function () {\n\t if (self && self.stop) self.pop();\n\t });\n\t };\n\t\n\t return $meteorObject;\n\t}]);\n\t\n\tangularMeteorObject.run(['$rootScope', '$meteorObject', '$meteorStopper', function ($rootScope, $meteorObject, $meteorStopper) {\n\t var scopeProto = Object.getPrototypeOf($rootScope);\n\t scopeProto.$meteorObject = $meteorStopper($meteorObject);\n\t}]);\n\n/***/ },\n/* 9 */\n/***/ function(module, exports) {\n\n\t/*global\n\t angular, _, Package, Meteor\n\t */\n\t\n\t'use strict';\n\t\n\tvar angularMeteorUser = angular.module('angular-meteor.user', ['angular-meteor.utils', 'angular-meteor.core', 'angular-meteor.settings']);\n\t\n\t// requires package 'accounts-password'\n\tangularMeteorUser.service('$meteorUser', ['$rootScope', '$meteorUtils', '$q', '$angularMeteorSettings', function ($rootScope, $meteorUtils, $q, $angularMeteorSettings) {\n\t\n\t var pack = Package['accounts-base'];\n\t if (!pack) return;\n\t\n\t var self = this;\n\t var Accounts = pack.Accounts;\n\t\n\t this.waitForUser = function () {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.waitForUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t var deferred = $q.defer();\n\t\n\t $meteorUtils.autorun($rootScope, function () {\n\t if (!Meteor.loggingIn()) deferred.resolve(Meteor.user());\n\t }, true);\n\t\n\t return deferred.promise;\n\t };\n\t\n\t this.requireUser = function () {\n\t if (!$angularMeteorSettings.suppressWarnings) {\n\t console.warn('[angular-meteor.requireUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t }\n\t\n\t var deferred = $q.defer();\n\t\n\t $meteorUtils.autorun($rootScope, function () {\n\t if (!Meteor.loggingIn()) {\n\t if (Meteor.user() === null) deferred.reject(\"AUTH_REQUIRED\");else deferred.resolve(Meteor.user());\n\t }\n\t }, true);\n\t\n\t return deferred.promise;\n\t };\n\t\n\t this.requireValidUser = function (validatorFn) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.requireValidUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t return self.requireUser(true).then(function (user) {\n\t var valid = validatorFn(user);\n\t\n\t if (valid === true) return user;else if (typeof valid === \"string\") return $q.reject(valid);else return $q.reject(\"FORBIDDEN\");\n\t });\n\t };\n\t\n\t this.loginWithPassword = $meteorUtils.promissor(Meteor, 'loginWithPassword');\n\t this.createUser = $meteorUtils.promissor(Accounts, 'createUser');\n\t this.changePassword = $meteorUtils.promissor(Accounts, 'changePassword');\n\t this.forgotPassword = $meteorUtils.promissor(Accounts, 'forgotPassword');\n\t this.resetPassword = $meteorUtils.promissor(Accounts, 'resetPassword');\n\t this.verifyEmail = $meteorUtils.promissor(Accounts, 'verifyEmail');\n\t this.logout = $meteorUtils.promissor(Meteor, 'logout');\n\t this.logoutOtherClients = $meteorUtils.promissor(Meteor, 'logoutOtherClients');\n\t this.loginWithFacebook = $meteorUtils.promissor(Meteor, 'loginWithFacebook');\n\t this.loginWithTwitter = $meteorUtils.promissor(Meteor, 'loginWithTwitter');\n\t this.loginWithGoogle = $meteorUtils.promissor(Meteor, 'loginWithGoogle');\n\t this.loginWithGithub = $meteorUtils.promissor(Meteor, 'loginWithGithub');\n\t this.loginWithMeteorDeveloperAccount = $meteorUtils.promissor(Meteor, 'loginWithMeteorDeveloperAccount');\n\t this.loginWithMeetup = $meteorUtils.promissor(Meteor, 'loginWithMeetup');\n\t this.loginWithWeibo = $meteorUtils.promissor(Meteor, 'loginWithWeibo');\n\t}]);\n\t\n\tangularMeteorUser.run(['$rootScope', '$angularMeteorSettings', '$$Core', function ($rootScope, $angularMeteorSettings, $$Core) {\n\t\n\t var ScopeProto = Object.getPrototypeOf($rootScope);\n\t _.extend(ScopeProto, $$Core);\n\t\n\t $rootScope.autorun(function () {\n\t if (!Meteor.user) return;\n\t $rootScope.currentUser = Meteor.user();\n\t $rootScope.loggingIn = Meteor.loggingIn();\n\t });\n\t}]);\n\n/***/ },\n/* 10 */\n/***/ function(module, exports) {\n\n\t/*global\n\t angular, _, Meteor\n\t */\n\t\n\t'use strict';\n\t\n\tvar angularMeteorMethods = angular.module('angular-meteor.methods', ['angular-meteor.utils', 'angular-meteor.settings']);\n\t\n\tangularMeteorMethods.service('$meteorMethods', ['$q', '$meteorUtils', '$angularMeteorSettings', function ($q, $meteorUtils, $angularMeteorSettings) {\n\t this.call = function () {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.$meteor.call] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/methods. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t var deferred = $q.defer();\n\t var fulfill = $meteorUtils.fulfill(deferred);\n\t var args = _.toArray(arguments).concat(fulfill);\n\t Meteor.call.apply(this, args);\n\t return deferred.promise;\n\t };\n\t}]);\n\n/***/ },\n/* 11 */\n/***/ function(module, exports) {\n\n\t/*global\n\t angular, Session\n\t */\n\t\n\t'use strict';\n\t\n\tvar angularMeteorSession = angular.module('angular-meteor.session', ['angular-meteor.utils', 'angular-meteor.settings']);\n\t\n\tangularMeteorSession.factory('$meteorSession', ['$meteorUtils', '$parse', '$angularMeteorSettings', function ($meteorUtils, $parse, $angularMeteorSettings) {\n\t return function (session) {\n\t\n\t return {\n\t\n\t bind: function bind(scope, model) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.session.bind] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://www.angular-meteor.com/api/1.3.0/session. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t var getter = $parse(model);\n\t var setter = getter.assign;\n\t $meteorUtils.autorun(scope, function () {\n\t setter(scope, Session.get(session));\n\t });\n\t\n\t scope.$watch(model, function (newItem, oldItem) {\n\t Session.set(session, getter(scope));\n\t }, true);\n\t }\n\t };\n\t };\n\t}]);\n\n/***/ },\n/* 12 */\n/***/ function(module, exports) {\n\n\t/*global\n\t angular, Package\n\t */\n\t\n\t'use strict';\n\t\n\tvar angularMeteorCamera = angular.module('angular-meteor.camera', ['angular-meteor.utils', 'angular-meteor.settings']);\n\t\n\t// requires package 'mdg:camera'\n\tangularMeteorCamera.service('$meteorCamera', ['$q', '$meteorUtils', '$angularMeteorSettings', function ($q, $meteorUtils, $angularMeteorSettings) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t var pack = Package['mdg:camera'];\n\t if (!pack) return;\n\t\n\t var MeteorCamera = pack.MeteorCamera;\n\t\n\t this.getPicture = function (options) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t options = options || {};\n\t var deferred = $q.defer();\n\t MeteorCamera.getPicture(options, $meteorUtils.fulfill(deferred));\n\t return deferred.promise;\n\t };\n\t}]);\n\n/***/ },\n/* 13 */\n/***/ function(module, exports) {\n\n\t/*global\n\t angular\n\t */\n\t\n\t'use strict';\n\t\n\tvar angularMeteorStopper = angular.module('angular-meteor.stopper', ['angular-meteor.subscribe']);\n\t\n\tangularMeteorStopper.factory('$meteorStopper', ['$q', '$meteorSubscribe', function ($q, $meteorSubscribe) {\n\t function $meteorStopper($meteorEntity) {\n\t return function () {\n\t var args = Array.prototype.slice.call(arguments);\n\t var meteorEntity = $meteorEntity.apply(this, args);\n\t\n\t angular.extend(meteorEntity, $meteorStopper);\n\t meteorEntity.$$scope = this;\n\t\n\t this.$on('$destroy', function () {\n\t meteorEntity.stop();\n\t if (meteorEntity.subscription) meteorEntity.subscription.stop();\n\t });\n\t\n\t return meteorEntity;\n\t };\n\t }\n\t\n\t $meteorStopper.subscribe = function () {\n\t var args = Array.prototype.slice.call(arguments);\n\t this.subscription = $meteorSubscribe._subscribe(this.$$scope, $q.defer(), args);\n\t return this;\n\t };\n\t\n\t return $meteorStopper;\n\t}]);\n\n/***/ },\n/* 14 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\tvar name = exports.name = 'angular-meteor.utilities';\n\tvar utils = exports.utils = '$$utils';\n\t\n\tangular.module(name, [])\n\t\n\t/*\n\t A utility service which is provided with general utility functions\n\t */\n\t.service(utils, ['$rootScope', function ($rootScope) {\n\t var self = this;\n\t\n\t // Checks if an object is a cursor\n\t this.isCursor = function (obj) {\n\t return obj instanceof Meteor.Collection.Cursor;\n\t };\n\t\n\t // Cheecks if an object is a scope\n\t this.isScope = function (obj) {\n\t return obj instanceof $rootScope.constructor;\n\t };\n\t\n\t // Checks if two objects are siblings\n\t this.areSiblings = function (obj1, obj2) {\n\t return _.isObject(obj1) && _.isObject(obj2) && Object.getPrototypeOf(obj1) === Object.getPrototypeOf(obj2);\n\t };\n\t\n\t // Binds function into a scpecified context. If an object is provided, will bind every\n\t // value in the object which is a function. If a tap function is provided, it will be\n\t // called right after the function has been invoked.\n\t this.bind = function (fn, context, tap) {\n\t tap = _.isFunction(tap) ? tap : angular.noop;\n\t if (_.isFunction(fn)) return bindFn(fn, context, tap);\n\t if (_.isObject(fn)) return bindObj(fn, context, tap);\n\t return fn;\n\t };\n\t\n\t function bindFn(fn, context, tap) {\n\t return function () {\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t var result = fn.apply(context, args);\n\t tap.call(context, {\n\t result: result,\n\t args: args\n\t });\n\t return result;\n\t };\n\t }\n\t\n\t function bindObj(obj, context, tap) {\n\t return _.keys(obj).reduce(function (bound, k) {\n\t bound[k] = self.bind(obj[k], context, tap);\n\t return bound;\n\t }, {});\n\t }\n\t}]);\n\n/***/ },\n/* 15 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\t\n\tvar name = exports.name = 'angular-meteor.mixer';\n\tvar Mixer = exports.Mixer = '$Mixer';\n\t\n\tangular.module(name, [])\n\t\n\t/*\n\t A service which lets us apply mixins into Scope.prototype.\n\t The flow is simple. Once we define a mixin, it will be stored in the `$Mixer`,\n\t and any time a `ChildScope` prototype is created\n\t it will be extended by the `$Mixer`.\n\t This concept is good because it keeps our code\n\t clean and simple, and easy to extend.\n\t So any time we would like to define a new behaviour to our scope,\n\t we will just use the `$Mixer` service.\n\t */\n\t.service(Mixer, function () {\n\t var _this = this;\n\t\n\t this._mixins = [];\n\t // Apply mixins automatically on specified contexts\n\t this._autoExtend = [];\n\t this._autoConstruct = [];\n\t\n\t // Adds a new mixin\n\t this.mixin = function (mixin) {\n\t if (!_.isObject(mixin)) {\n\t throw Error('argument 1 must be an object');\n\t }\n\t\n\t _this._mixins = _.union(_this._mixins, [mixin]);\n\t // Apply mixins to stored contexts\n\t _this._autoExtend.forEach(function (context) {\n\t return _this._extend(context);\n\t });\n\t _this._autoConstruct.forEach(function (context) {\n\t return _this._construct(context);\n\t });\n\t return _this;\n\t };\n\t\n\t // Removes a mixin. Useful mainly for test purposes\n\t this._mixout = function (mixin) {\n\t _this._mixins = _.without(_this._mixins, mixin);\n\t return _this;\n\t };\n\t\n\t // Invoke function mixins with the provided context and arguments\n\t this._construct = function (context) {\n\t for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n\t args[_key - 1] = arguments[_key];\n\t }\n\t\n\t _this._mixins.filter(_.isFunction).forEach(function (mixin) {\n\t mixin.call.apply(mixin, [context].concat(args));\n\t });\n\t\n\t return context;\n\t };\n\t\n\t // Extend prototype with the defined mixins\n\t this._extend = function (obj) {\n\t var _ref;\n\t\n\t return (_ref = _).extend.apply(_ref, [obj].concat(_toConsumableArray(_this._mixins)));\n\t };\n\t});\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.name = undefined;\n\t\n\tvar _mixer = __webpack_require__(15);\n\t\n\tvar name = exports.name = 'angular-meteor.scope';\n\t\n\tangular.module(name, [_mixer.name]).run(['$rootScope', _mixer.Mixer, function ($rootScope, $Mixer) {\n\t var Scope = $rootScope.constructor;\n\t var $new = $rootScope.$new;\n\t\n\t // Apply extensions whether a mixin in defined.\n\t // Note that this way mixins which are initialized later\n\t // can be applied on rootScope.\n\t $Mixer._autoExtend.push(Scope.prototype);\n\t $Mixer._autoConstruct.push($rootScope);\n\t\n\t Scope.prototype.$new = function () {\n\t var scope = $new.apply(this, arguments);\n\t // Apply constructors to newly created scopes\n\t return $Mixer._construct(scope);\n\t };\n\t}]);\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.Core = exports.name = undefined;\n\t\n\tvar _utils = __webpack_require__(14);\n\t\n\tvar _mixer = __webpack_require__(15);\n\t\n\tfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\t\n\tvar name = exports.name = 'angular-meteor.core';\n\tvar Core = exports.Core = '$$Core';\n\t\n\tangular.module(name, [_utils.name, _mixer.name])\n\t\n\t/*\n\t A mixin which provides us with core Meteor functions.\n\t */\n\t.factory(Core, ['$q', _utils.utils, function ($q, $$utils) {\n\t function $$Core() {}\n\t\n\t // Calls Meteor.autorun() which will be digested after each run and automatically destroyed\n\t $$Core.autorun = function (fn) {\n\t var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\t\n\t fn = this.$bindToContext(fn);\n\t\n\t if (!_.isFunction(fn)) {\n\t throw Error('argument 1 must be a function');\n\t }\n\t if (!_.isObject(options)) {\n\t throw Error('argument 2 must be an object');\n\t }\n\t\n\t var computation = Tracker.autorun(fn, options);\n\t this.$$autoStop(computation);\n\t return computation;\n\t };\n\t\n\t // Calls Meteor.subscribe() which will be digested after each invokation\n\t // and automatically destroyed\n\t $$Core.subscribe = function (subName, fn, cb) {\n\t fn = this.$bindToContext(fn || angular.noop);\n\t cb = cb ? this.$bindToContext(cb) : angular.noop;\n\t\n\t if (!_.isString(subName)) {\n\t throw Error('argument 1 must be a string');\n\t }\n\t if (!_.isFunction(fn)) {\n\t throw Error('argument 2 must be a function');\n\t }\n\t if (!_.isFunction(cb) && !_.isObject(cb)) {\n\t throw Error('argument 3 must be a function or an object');\n\t }\n\t\n\t var result = {};\n\t\n\t var computation = this.autorun(function () {\n\t var _Meteor;\n\t\n\t var args = fn();\n\t if (angular.isUndefined(args)) args = [];\n\t\n\t if (!_.isArray(args)) {\n\t throw Error('reactive function\\'s return value must be an array');\n\t }\n\t\n\t var subscription = (_Meteor = Meteor).subscribe.apply(_Meteor, [subName].concat(_toConsumableArray(args), [cb]));\n\t result.ready = subscription.ready.bind(subscription);\n\t result.subscriptionId = subscription.subscriptionId;\n\t });\n\t\n\t // Once the computation has been stopped,\n\t // any subscriptions made inside will be stopped as well\n\t result.stop = computation.stop.bind(computation);\n\t return result;\n\t };\n\t\n\t // Calls Meteor.call() wrapped by a digestion cycle\n\t $$Core.callMethod = function () {\n\t var _Meteor2;\n\t\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t var fn = args.pop();\n\t if (_.isFunction(fn)) fn = this.$bindToContext(fn);\n\t return (_Meteor2 = Meteor).call.apply(_Meteor2, args.concat([fn]));\n\t };\n\t\n\t // Calls Meteor.apply() wrapped by a digestion cycle\n\t $$Core.applyMethod = function () {\n\t var _Meteor3;\n\t\n\t for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n\t args[_key2] = arguments[_key2];\n\t }\n\t\n\t var fn = args.pop();\n\t if (_.isFunction(fn)) fn = this.$bindToContext(fn);\n\t return (_Meteor3 = Meteor).apply.apply(_Meteor3, args.concat([fn]));\n\t };\n\t\n\t $$Core.$$autoStop = function (stoppable) {\n\t this.$on('$destroy', stoppable.stop.bind(stoppable));\n\t };\n\t\n\t // Digests scope only if there is no phase at the moment\n\t $$Core.$$throttledDigest = function () {\n\t var isDigestable = !this.$$destroyed && !this.$$phase && !this.$root.$$phase;\n\t\n\t if (isDigestable) this.$digest();\n\t };\n\t\n\t // Creates a promise only that the digestion cycle will be called at its fulfillment\n\t $$Core.$$defer = function () {\n\t var deferred = $q.defer();\n\t // Once promise has been fulfilled, digest\n\t deferred.promise = deferred.promise.finally(this.$$throttledDigest.bind(this));\n\t return deferred;\n\t };\n\t\n\t // Binds an object or a function to the scope to the view model and digest it once it is invoked\n\t $$Core.$bindToContext = function (fn) {\n\t return $$utils.bind(fn, this, this.$$throttledDigest.bind(this));\n\t };\n\t\n\t return $$Core;\n\t}]);\n\n/***/ },\n/* 18 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.reactive = exports.ViewModel = exports.name = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _utils = __webpack_require__(14);\n\t\n\tvar _mixer = __webpack_require__(15);\n\t\n\tvar _core = __webpack_require__(17);\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar name = exports.name = 'angular-meteor.view-model';\n\tvar ViewModel = exports.ViewModel = '$$ViewModel';\n\tvar reactive = exports.reactive = '$reactive';\n\t\n\tangular.module(name, [_utils.name, _mixer.name, _core.name])\n\t\n\t/*\n\t A mixin which lets us bind a view model into a scope.\n\t Note that only a single view model can be bound,\n\t otherwise the scope might behave unexpectedly.\n\t Mainly used to define the controller as the view model,\n\t and very useful when wanting to use Angular's `controllerAs` syntax.\n\t */\n\t.factory(ViewModel, [_utils.utils, _mixer.Mixer, function ($$utils, $Mixer) {\n\t function $$ViewModel() {\n\t var vm = arguments.length <= 0 || arguments[0] === undefined ? this : arguments[0];\n\t\n\t // Defines the view model on the scope.\n\t this.$$vm = vm;\n\t }\n\t\n\t // Gets an object, wraps it with scope functions and returns it\n\t $$ViewModel.viewModel = function (vm) {\n\t var _this = this;\n\t\n\t if (!_.isObject(vm)) {\n\t throw Error('argument 1 must be an object');\n\t }\n\t\n\t // Apply mixin functions\n\t $Mixer._mixins.forEach(function (mixin) {\n\t // Reject methods which starts with double $\n\t var keys = _.keys(mixin).filter(function (k) {\n\t return k.match(/^(?!\\$\\$).*$/);\n\t });\n\t var proto = _.pick(mixin, keys);\n\t // Bind all the methods to the prototype\n\t var boundProto = $$utils.bind(proto, _this);\n\t // Add the methods to the view model\n\t _.extend(vm, boundProto);\n\t });\n\t\n\t // Apply mixin constructors on the view model\n\t $Mixer._construct(this, vm);\n\t return vm;\n\t };\n\t\n\t // Override $$Core.$bindToContext to be bound to view model instead of scope\n\t $$ViewModel.$bindToContext = function (fn) {\n\t return $$utils.bind(fn, this.$$vm, this.$$throttledDigest.bind(this));\n\t };\n\t\n\t return $$ViewModel;\n\t}])\n\t\n\t/*\n\t Illustrates the old API where a view model is created using $reactive service\n\t */\n\t.service(reactive, [_utils.utils, function ($$utils) {\n\t var Reactive = function () {\n\t function Reactive(vm) {\n\t var _this2 = this;\n\t\n\t _classCallCheck(this, Reactive);\n\t\n\t if (!_.isObject(vm)) {\n\t throw Error('argument 1 must be an object');\n\t }\n\t\n\t _.defer(function () {\n\t if (!_this2._attached) {\n\t console.warn('view model was not attached to any scope');\n\t }\n\t });\n\t\n\t this._vm = vm;\n\t }\n\t\n\t _createClass(Reactive, [{\n\t key: 'attach',\n\t value: function attach(scope) {\n\t this._attached = true;\n\t\n\t if (!$$utils.isScope(scope)) {\n\t throw Error('argument 1 must be a scope');\n\t }\n\t\n\t var viewModel = scope.viewModel(this._vm);\n\t\n\t // Similar to the old/Meteor API\n\t viewModel.call = viewModel.callMethod;\n\t viewModel.apply = viewModel.applyMethod;\n\t\n\t return viewModel;\n\t }\n\t }]);\n\t\n\t return Reactive;\n\t }();\n\t\n\t return function (vm) {\n\t return new Reactive(vm);\n\t };\n\t}]);\n\n/***/ },\n/* 19 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.Reactive = exports.name = undefined;\n\t\n\tvar _utils = __webpack_require__(14);\n\t\n\tvar _mixer = __webpack_require__(15);\n\t\n\tvar _core = __webpack_require__(17);\n\t\n\tvar _viewModel = __webpack_require__(18);\n\t\n\tvar name = exports.name = 'angular-meteor.reactive';\n\tvar Reactive = exports.Reactive = '$$Reactive';\n\t\n\tangular.module(name, [_utils.name, _mixer.name, _core.name, _viewModel.name])\n\t\n\t/*\n\t A mixin which enhance our reactive abilities by providing methods\n\t that are capable of updating our scope reactively.\n\t */\n\t.factory(Reactive, ['$parse', _utils.utils, function ($parse, $$utils) {\n\t function $$Reactive() {\n\t var vm = arguments.length <= 0 || arguments[0] === undefined ? this : arguments[0];\n\t\n\t // Helps us track changes made in the view model\n\t vm.$$dependencies = {};\n\t }\n\t\n\t // Gets an object containing functions and define their results as reactive properties.\n\t // Once a return value has been changed the property will be reset.\n\t $$Reactive.helpers = function () {\n\t var _this = this;\n\t\n\t var props = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t if (!_.isObject(props)) {\n\t throw Error('argument 1 must be an object');\n\t }\n\t\n\t _.each(props, function (v, k, i) {\n\t if (!_.isFunction(v)) {\n\t throw Error('helper ' + (i + 1) + ' must be a function');\n\t }\n\t\n\t if (!_this.$$vm.$$dependencies[k]) {\n\t // Registers a new dependency to the specified helper\n\t _this.$$vm.$$dependencies[k] = new Tracker.Dependency();\n\t }\n\t\n\t _this.$$setFnHelper(k, v);\n\t });\n\t };\n\t\n\t // Gets a model reactively\n\t $$Reactive.getReactively = function (k) {\n\t var isDeep = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];\n\t\n\t if (!_.isBoolean(isDeep)) {\n\t throw Error('argument 2 must be a boolean');\n\t }\n\t\n\t return this.$$reactivateEntity(k, this.$watch, isDeep);\n\t };\n\t\n\t // Gets a collection reactively\n\t $$Reactive.getCollectionReactively = function (k) {\n\t return this.$$reactivateEntity(k, this.$watchCollection);\n\t };\n\t\n\t // Gets an entity reactively, and once it has been changed the computation will be recomputed\n\t $$Reactive.$$reactivateEntity = function (k, watcher) {\n\t if (!_.isString(k)) {\n\t throw Error('argument 1 must be a string');\n\t }\n\t\n\t if (!this.$$vm.$$dependencies[k]) {\n\t this.$$vm.$$dependencies[k] = new Tracker.Dependency();\n\t\n\t for (var _len = arguments.length, watcherArgs = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n\t watcherArgs[_key - 2] = arguments[_key];\n\t }\n\t\n\t this.$$watchEntity.apply(this, [k, watcher].concat(watcherArgs));\n\t }\n\t\n\t this.$$vm.$$dependencies[k].depend();\n\t return $parse(k)(this.$$vm);\n\t };\n\t\n\t // Watches for changes in the view model, and if so will notify a change\n\t $$Reactive.$$watchEntity = function (k, watcher) {\n\t var _this2 = this;\n\t\n\t // Gets a deep property from the view model\n\t var getVal = _.partial($parse(k), this.$$vm);\n\t var initialVal = getVal();\n\t\n\t // Watches for changes in the view model\n\t\n\t for (var _len2 = arguments.length, watcherArgs = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n\t watcherArgs[_key2 - 2] = arguments[_key2];\n\t }\n\t\n\t watcher.call.apply(watcher, [this, getVal, function (val, oldVal) {\n\t var hasChanged = val !== initialVal || val !== oldVal;\n\t\n\t // Notify if a change has been detected\n\t if (hasChanged) _this2.$$changed(k);\n\t }].concat(watcherArgs));\n\t };\n\t\n\t // Invokes a function and sets the return value as a property\n\t $$Reactive.$$setFnHelper = function (k, fn) {\n\t var _this3 = this;\n\t\n\t this.autorun(function (computation) {\n\t // Invokes the reactive functon\n\t var model = fn.apply(_this3.$$vm);\n\t\n\t // Ignore notifications made by the following handler\n\t Tracker.nonreactive(function () {\n\t // If a cursor, observe its changes and update acoordingly\n\t if ($$utils.isCursor(model)) {\n\t (function () {\n\t var observation = _this3.$$handleCursor(k, model);\n\t\n\t computation.onInvalidate(function () {\n\t observation.stop();\n\t _this3.$$vm[k].splice(0);\n\t });\n\t })();\n\t } else {\n\t _this3.$$handleNonCursor(k, model);\n\t }\n\t\n\t // Notify change and update the view model\n\t _this3.$$changed(k);\n\t });\n\t });\n\t };\n\t\n\t // Sets a value helper as a setter and a getter which will notify computations once used\n\t $$Reactive.$$setValHelper = function (k, v) {\n\t var _this4 = this;\n\t\n\t var watch = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2];\n\t\n\t // If set, reactives property\n\t if (watch) {\n\t var isDeep = _.isObject(v);\n\t this.getReactively(k, isDeep);\n\t }\n\t\n\t Object.defineProperty(this.$$vm, k, {\n\t configurable: true,\n\t enumerable: true,\n\t\n\t get: function get() {\n\t return v;\n\t },\n\t set: function set(newVal) {\n\t v = newVal;\n\t _this4.$$changed(k);\n\t }\n\t });\n\t };\n\t\n\t // Fetching a cursor and updates properties once the result set has been changed\n\t $$Reactive.$$handleCursor = function (k, cursor) {\n\t var _this5 = this;\n\t\n\t // If not defined set it\n\t if (angular.isUndefined(this.$$vm[k])) {\n\t this.$$setValHelper(k, cursor.fetch(), false);\n\t }\n\t // If defined update it\n\t else {\n\t var diff = jsondiffpatch.diff(this.$$vm[k], cursor.fetch());\n\t jsondiffpatch.patch(this.$$vm[k], diff);\n\t }\n\t\n\t // Observe changes made in the result set\n\t var observation = cursor.observe({\n\t addedAt: function addedAt(doc, atIndex) {\n\t if (!observation) return;\n\t _this5.$$vm[k].splice(atIndex, 0, doc);\n\t _this5.$$changed(k);\n\t },\n\t changedAt: function changedAt(doc, oldDoc, atIndex) {\n\t var diff = jsondiffpatch.diff(_this5.$$vm[k][atIndex], doc);\n\t jsondiffpatch.patch(_this5.$$vm[k][atIndex], diff);\n\t _this5.$$changed(k);\n\t },\n\t movedTo: function movedTo(doc, fromIndex, toIndex) {\n\t _this5.$$vm[k].splice(fromIndex, 1);\n\t _this5.$$vm[k].splice(toIndex, 0, doc);\n\t _this5.$$changed(k);\n\t },\n\t removedAt: function removedAt(oldDoc, atIndex) {\n\t _this5.$$vm[k].splice(atIndex, 1);\n\t _this5.$$changed(k);\n\t }\n\t });\n\t\n\t return observation;\n\t };\n\t\n\t $$Reactive.$$handleNonCursor = function (k, data) {\n\t var v = this.$$vm[k];\n\t\n\t if (angular.isDefined(v)) {\n\t delete this.$$vm[k];\n\t v = null;\n\t }\n\t\n\t if (angular.isUndefined(v)) {\n\t this.$$setValHelper(k, data);\n\t }\n\t // Update property if the new value is from the same type\n\t else if ($$utils.areSiblings(v, data)) {\n\t var diff = jsondiffpatch.diff(v, data);\n\t jsondiffpatch.patch(v, diff);\n\t this.$$changed(k);\n\t } else {\n\t this.$$vm[k] = data;\n\t }\n\t };\n\t\n\t // Notifies dependency in view model\n\t $$Reactive.$$depend = function (k) {\n\t this.$$vm.$$dependencies[k].depend();\n\t };\n\t\n\t // Notifies change in view model\n\t $$Reactive.$$changed = function (k) {\n\t this.$$throttledDigest();\n\t this.$$vm.$$dependencies[k].changed();\n\t };\n\t\n\t return $$Reactive;\n\t}]);\n\n/***/ },\n/* 20 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\tvar name = exports.name = 'angular-templates';\n\t\n\ttry {\n\t angular.module(name);\n\t} catch (e) {\n\t angular.module(name, []);\n\t}\n\n/***/ }\n/******/ ]);\n\n\n/** WEBPACK FOOTER **\n ** dist/angular-meteor.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 506237d669ed75851a9d\n **/","// lib\nimport './lib/get-updates';\nimport './lib/diff-array';\n// legacy\nimport './modules/angular-meteor-settings';\nimport './modules/angular-meteor-ironrouter';\nimport './modules/angular-meteor-utils';\nimport './modules/angular-meteor-subscribe';\nimport './modules/angular-meteor-collection';\nimport './modules/angular-meteor-object';\nimport './modules/angular-meteor-user';\nimport './modules/angular-meteor-methods';\nimport './modules/angular-meteor-session';\nimport './modules/angular-meteor-camera';\nimport './modules/angular-meteor-stopper';\n\n// new\nimport { name as utilsName } from './modules/utils';\nimport { name as mixerName, Mixer } from './modules/mixer';\nimport { name as scopeName } from './modules/scope';\nimport { name as coreName, Core } from './modules/core';\nimport { name as viewModelName, ViewModel } from './modules/view-model';\nimport { name as reactiveName, Reactive } from './modules/reactive';\nimport { name as templatesName } from './modules/templates';\n\nexport const name = 'angular-meteor';\n\nangular.module(name, [\n // new\n utilsName,\n mixerName,\n scopeName,\n coreName,\n viewModelName,\n reactiveName,\n templatesName,\n\n // legacy\n 'angular-meteor.ironrouter',\n 'angular-meteor.utils',\n 'angular-meteor.subscribe',\n 'angular-meteor.collection',\n 'angular-meteor.object',\n 'angular-meteor.user',\n 'angular-meteor.methods',\n 'angular-meteor.session',\n 'angular-meteor.camera'\n\n])\n\n.run([\n Mixer,\n Core,\n ViewModel,\n Reactive,\n\n function($Mixer, $$Core, $$ViewModel, $$Reactive) {\n // Load all mixins\n $Mixer\n .mixin($$Core)\n .mixin($$ViewModel)\n .mixin($$Reactive);\n }\n])\n\n// legacy\n// Putting all services under $meteor service for syntactic sugar\n.service('$meteor', [\n '$meteorCollection',\n '$meteorCollectionFS',\n '$meteorObject',\n '$meteorMethods',\n '$meteorSession',\n '$meteorSubscribe',\n '$meteorUtils',\n '$meteorCamera',\n '$meteorUser',\n function($meteorCollection, $meteorCollectionFS, $meteorObject,\n $meteorMethods, $meteorSession, $meteorSubscribe, $meteorUtils,\n $meteorCamera, $meteorUser) {\n this.collection = $meteorCollection;\n this.collectionFS = $meteorCollectionFS;\n this.object = $meteorObject;\n this.subscribe = $meteorSubscribe.subscribe;\n this.call = $meteorMethods.call;\n this.session = $meteorSession;\n this.autorun = $meteorUtils.autorun;\n this.getCollectionByName = $meteorUtils.getCollectionByName;\n this.getPicture = $meteorCamera.getPicture;\n\n // $meteorUser\n [\n 'loginWithPassword',\n 'requireUser',\n 'requireValidUser',\n 'waitForUser',\n 'createUser',\n 'changePassword',\n 'forgotPassword',\n 'resetPassword',\n 'verifyEmail',\n 'loginWithMeteorDeveloperAccount',\n 'loginWithFacebook',\n 'loginWithGithub',\n 'loginWithGoogle',\n 'loginWithMeetup',\n 'loginWithTwitter',\n 'loginWithWeibo',\n 'logout',\n 'logoutOtherClients'\n ].forEach((method) => {\n this[method] = $meteorUser[method];\n });\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/angular-meteor.js\n **/","/*global\n angular, _\n */\n\n'use strict';\n\n// https://github.com/DAB0mB/get-updates\n(function() {\n var module = angular.module('getUpdates', []);\n\n var utils = (function() {\n var rip = function(obj, level) {\n if (level < 1) return {};\n\n return _.reduce(obj, function(clone, v, k) {\n v = _.isObject(v) ? rip(v, --level) : v;\n clone[k] = v;\n return clone;\n }, {});\n };\n\n var toPaths = function(obj) {\n var keys = getKeyPaths(obj);\n var values = getDeepValues(obj);\n return _.object(keys, values);\n };\n\n var getKeyPaths = function(obj) {\n var keys = _.keys(obj).map(function(k) {\n var v = obj[k];\n if (!_.isObject(v) || _.isEmpty(v) || _.isArray(v)) return k;\n\n return getKeyPaths(v).map(function(subKey) {\n return k + '.' + subKey;\n });\n });\n\n return _.flatten(keys);\n };\n\n var getDeepValues = function(obj,arr) {\n arr = arr || [];\n\n _.values(obj).forEach(function(v) {\n if (!_.isObject(v) || _.isEmpty(v) || _.isArray(v))\n arr.push(v);\n else\n getDeepValues(v, arr);\n });\n\n return arr;\n };\n\n var flatten = function(arr) {\n return arr.reduce(function(flattened, v, i) {\n if (_.isArray(v) && !_.isEmpty(v))\n flattened.push.apply(flattened, flatten(v));\n else\n flattened.push(v);\n\n return flattened;\n }, []);\n };\n\n var setFilled = function(obj, k, v) {\n if (!_.isEmpty(v)) obj[k] = v;\n };\n\n var assert = function(result, msg) {\n if (!result) throwErr(msg);\n };\n\n var throwErr = function(msg) {\n throw Error('get-updates error - ' + msg);\n };\n\n return {\n rip: rip,\n toPaths: toPaths,\n getKeyPaths: getKeyPaths,\n getDeepValues: getDeepValues,\n setFilled: setFilled,\n assert: assert,\n throwErr: throwErr\n };\n })();\n\n var getDifference = (function() {\n var getDifference = function(src, dst, isShallow) {\n var level;\n\n if (isShallow > 1)\n level = isShallow;\n else if (isShallow)\n level = 1;\n\n if (level) {\n src = utils.rip(src, level);\n dst = utils.rip(dst, level);\n }\n\n return compare(src, dst);\n };\n\n var compare = function(src, dst) {\n var srcKeys = _.keys(src);\n var dstKeys = _.keys(dst);\n\n var keys = _.chain([])\n .concat(srcKeys)\n .concat(dstKeys)\n .uniq()\n .without('$$hashKey')\n .value();\n\n return keys.reduce(function(diff, k) {\n var srcValue = src[k];\n var dstValue = dst[k];\n\n if (_.isDate(srcValue) && _.isDate(dstValue)) {\n if (srcValue.getTime() != dstValue.getTime()) diff[k] = dstValue;\n }\n\n if (_.isObject(srcValue) && _.isObject(dstValue)) {\n var valueDiff = getDifference(srcValue, dstValue);\n utils.setFilled(diff, k, valueDiff);\n }\n\n else if (srcValue !== dstValue) {\n diff[k] = dstValue;\n }\n\n return diff;\n }, {});\n };\n\n return getDifference;\n })();\n\n var getUpdates = (function() {\n var getUpdates = function(src, dst, isShallow) {\n utils.assert(_.isObject(src), 'first argument must be an object');\n utils.assert(_.isObject(dst), 'second argument must be an object');\n\n var diff = getDifference(src, dst, isShallow);\n var paths = utils.toPaths(diff);\n\n var set = createSet(paths);\n var unset = createUnset(paths);\n var pull = createPull(unset);\n\n var updates = {};\n utils.setFilled(updates, '$set', set);\n utils.setFilled(updates, '$unset', unset);\n utils.setFilled(updates, '$pull', pull);\n\n return updates;\n };\n\n var createSet = function(paths) {\n var undefinedKeys = getUndefinedKeys(paths);\n return _.omit(paths, undefinedKeys);\n };\n\n var createUnset = function(paths) {\n var undefinedKeys = getUndefinedKeys(paths);\n var unset = _.pick(paths, undefinedKeys);\n\n return _.reduce(unset, function(result, v, k) {\n result[k] = true;\n return result;\n }, {});\n };\n\n var createPull = function(unset) {\n var arrKeyPaths = _.keys(unset).map(function(k) {\n var split = k.match(/(.*)\\.\\d+$/);\n return split && split[1];\n });\n\n return _.compact(arrKeyPaths).reduce(function(pull, k) {\n pull[k] = null;\n return pull;\n }, {});\n };\n\n var getUndefinedKeys = function(obj) {\n return _.keys(obj).filter(function (k) {\n var v = obj[k];\n return _.isUndefined(v);\n });\n };\n\n return getUpdates;\n })();\n\n module.value('getUpdates', getUpdates);\n})();\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/lib/get-updates.js\n **/","/*global\n angular, _, Package\n */\n\n'use strict';\n\nvar _module = angular.module('diffArray', ['getUpdates']);\n\n_module.factory('diffArray', ['getUpdates',\n function(getUpdates) {\n var LocalCollection = Package.minimongo.LocalCollection;\n var idStringify = LocalCollection._idStringify || Package['mongo-id'].MongoID.idStringify;\n var idParse = LocalCollection._idParse || Package['mongo-id'].MongoID.idParse;\n\n // Calculates the differences between `lastSeqArray` and\n // `seqArray` and calls appropriate functions from `callbacks`.\n // Reuses Minimongo's diff algorithm implementation.\n // XXX Should be replaced with the original diffArray function here:\n // https://github.com/meteor/meteor/blob/devel/packages/observe-sequence/observe_sequence.js#L152\n // When it will become nested as well, tracking here: https://github.com/meteor/meteor/issues/3764\n function diffArray(lastSeqArray, seqArray, callbacks, preventNestedDiff) {\n preventNestedDiff = !!preventNestedDiff;\n\n var diffFn = Package.minimongo.LocalCollection._diffQueryOrderedChanges ||\n Package['diff-sequence'].DiffSequence.diffQueryOrderedChanges;\n\n var oldObjIds = [];\n var newObjIds = [];\n var posOld = {}; // maps from idStringify'd ids\n var posNew = {}; // ditto\n var posCur = {};\n var lengthCur = lastSeqArray.length;\n\n _.each(seqArray, function (doc, i) {\n newObjIds.push({_id: doc._id});\n posNew[idStringify(doc._id)] = i;\n });\n\n _.each(lastSeqArray, function (doc, i) {\n oldObjIds.push({_id: doc._id});\n posOld[idStringify(doc._id)] = i;\n posCur[idStringify(doc._id)] = i;\n });\n\n // Arrays can contain arbitrary objects. We don't diff the\n // objects. Instead we always fire 'changedAt' callback on every\n // object. The consumer of `observe-sequence` should deal with\n // it appropriately.\n diffFn(oldObjIds, newObjIds, {\n addedBefore: function (id, doc, before) {\n var position = before ? posCur[idStringify(before)] : lengthCur;\n\n _.each(posCur, function (pos, id) {\n if (pos >= position) posCur[id]++;\n });\n\n lengthCur++;\n posCur[idStringify(id)] = position;\n\n callbacks.addedAt(\n id,\n seqArray[posNew[idStringify(id)]],\n position,\n before\n );\n },\n\n movedBefore: function (id, before) {\n var prevPosition = posCur[idStringify(id)];\n var position = before ? posCur[idStringify(before)] : lengthCur - 1;\n\n _.each(posCur, function (pos, id) {\n if (pos >= prevPosition && pos <= position)\n posCur[id]--;\n else if (pos <= prevPosition && pos >= position)\n posCur[id]++;\n });\n\n posCur[idStringify(id)] = position;\n\n callbacks.movedTo(\n id,\n seqArray[posNew[idStringify(id)]],\n prevPosition,\n position,\n before\n );\n },\n removed: function (id) {\n var prevPosition = posCur[idStringify(id)];\n\n _.each(posCur, function (pos, id) {\n if (pos >= prevPosition) posCur[id]--;\n });\n\n delete posCur[idStringify(id)];\n lengthCur--;\n\n callbacks.removedAt(\n id,\n lastSeqArray[posOld[idStringify(id)]],\n prevPosition\n );\n }\n });\n\n _.each(posNew, function (pos, idString) {\n if (!_.has(posOld, idString)) return;\n\n var id = idParse(idString);\n var newItem = seqArray[pos] || {};\n var oldItem = lastSeqArray[posOld[idString]];\n var updates = getUpdates(oldItem, newItem, preventNestedDiff);\n\n if (!_.isEmpty(updates))\n callbacks.changedAt(id, updates, pos, oldItem);\n });\n }\n\n diffArray.shallow = function(lastSeqArray, seqArray, callbacks) {\n return diffArray(lastSeqArray, seqArray, callbacks, true);\n };\n\n diffArray.deepCopyChanges = function (oldItem, newItem) {\n var setDiff = getUpdates(oldItem, newItem).$set;\n\n _.each(setDiff, function(v, deepKey) {\n setDeep(oldItem, deepKey, v);\n });\n };\n\n diffArray.deepCopyRemovals = function (oldItem, newItem) {\n var unsetDiff = getUpdates(oldItem, newItem).$unset;\n\n _.each(unsetDiff, function(v, deepKey) {\n unsetDeep(oldItem, deepKey);\n });\n };\n\n // Finds changes between two collections\n diffArray.getChanges = function(newCollection, oldCollection, diffMethod) {\n var changes = {added: [], removed: [], changed: []};\n\n diffMethod(oldCollection, newCollection, {\n addedAt: function(id, item, index) {\n changes.added.push({item: item, index: index});\n },\n\n removedAt: function(id, item, index) {\n changes.removed.push({item: item, index: index});\n },\n\n changedAt: function(id, updates, index, oldItem) {\n changes.changed.push({selector: id, modifier: updates});\n },\n\n movedTo: function(id, item, fromIndex, toIndex) {\n // XXX do we need this?\n }\n });\n\n return changes;\n };\n\n var setDeep = function(obj, deepKey, v) {\n var split = deepKey.split('.');\n var initialKeys = _.initial(split);\n var lastKey = _.last(split);\n\n initialKeys.reduce(function(subObj, k, i) {\n var nextKey = split[i + 1];\n\n if (isNumStr(nextKey)) {\n if (subObj[k] === null) subObj[k] = [];\n if (subObj[k].length == parseInt(nextKey)) subObj[k].push(null);\n }\n\n else if (subObj[k] === null || !isHash(subObj[k])) {\n subObj[k] = {};\n }\n\n return subObj[k];\n }, obj);\n\n var deepObj = getDeep(obj, initialKeys);\n deepObj[lastKey] = v;\n return v;\n };\n\n var unsetDeep = function(obj, deepKey) {\n var split = deepKey.split('.');\n var initialKeys = _.initial(split);\n var lastKey = _.last(split);\n var deepObj = getDeep(obj, initialKeys);\n\n if (_.isArray(deepObj) && isNumStr(lastKey))\n return !!deepObj.splice(lastKey, 1);\n else\n return delete deepObj[lastKey];\n };\n\n var getDeep = function(obj, keys) {\n return keys.reduce(function(subObj, k) {\n return subObj[k];\n }, obj);\n };\n\n var isHash = function(obj) {\n return _.isObject(obj) &&\n Object.getPrototypeOf(obj) === Object.prototype;\n };\n\n var isNumStr = function(str) {\n return str.match(/^\\d+$/);\n };\n\n return diffArray;\n}]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/lib/diff-array.js\n **/","angular.module('angular-meteor.settings', [])\n .constant('$angularMeteorSettings', {\n suppressWarnings: false\n });\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-settings.js\n **/","angular.module('angular-meteor.ironrouter', [])\n\n\n.run([\n '$compile',\n '$document',\n '$rootScope',\n\nfunction ($compile, $document, $rootScope) {\n const Router = (Package['iron:router'] || {}).Router;\n if (!Router) return;\n\n let isLoaded = false;\n\n // Recompile after iron:router builds page\n Router.onAfterAction((req, res, next) => {\n Tracker.afterFlush(() => {\n if (isLoaded) return;\n $compile($document)($rootScope);\n if (!$rootScope.$$phase) $rootScope.$apply();\n isLoaded = true;\n });\n });\n}]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-ironrouter.js\n **/","/*global\n angular, _, Tracker, EJSON, FS, Mongo\n */\n\n'use strict';\n\nvar angularMeteorUtils = angular.module('angular-meteor.utils', ['angular-meteor.settings']);\n\nangularMeteorUtils.service('$meteorUtils', [\n '$q', '$timeout', '$angularMeteorSettings',\n function ($q, $timeout, $angularMeteorSettings) {\n\n var self = this;\n\n this.autorun = function(scope, fn) {\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.utils.autorun] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.6/autorun. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\n\n // wrapping around Deps.autorun\n var comp = Tracker.autorun(function(c) {\n fn(c);\n // this is run immediately for the first call\n // but after that, we need to $apply to start Angular digest\n if (!c.firstRun) $timeout(angular.noop, 0);\n });\n\n // stop autorun when scope is destroyed\n scope.$on('$destroy', function() {\n comp.stop();\n });\n\n // return autorun object so that it can be stopped manually\n return comp;\n };\n\n // Borrowed from angularFire\n // https://github.com/firebase/angularfire/blob/master/src/utils.js#L445-L454\n this.stripDollarPrefixedKeys = function (data) {\n if (!_.isObject(data) ||\n data instanceof Date ||\n data instanceof File ||\n EJSON.toJSONValue(data).$type === 'oid' ||\n (typeof FS === 'object' && data instanceof FS.File))\n return data;\n\n var out = _.isArray(data) ? [] : {};\n\n _.each(data, function(v,k) {\n if(typeof k !== 'string' || k.charAt(0) !== '$')\n out[k] = self.stripDollarPrefixedKeys(v);\n });\n\n return out;\n };\n\n // Returns a callback which fulfills promise\n this.fulfill = function(deferred, boundError, boundResult) {\n return function(err, result) {\n if (err)\n deferred.reject(boundError == null ? err : boundError);\n else if (typeof boundResult == \"function\")\n deferred.resolve(boundResult == null ? result : boundResult(result));\n else\n deferred.resolve(boundResult == null ? result : boundResult);\n };\n };\n\n // creates a function which invokes method with the given arguments and returns a promise\n this.promissor = function(obj, method) {\n return function() {\n var deferred = $q.defer();\n var fulfill = self.fulfill(deferred);\n var args = _.toArray(arguments).concat(fulfill);\n obj[method].apply(obj, args);\n return deferred.promise;\n };\n };\n\n // creates a $q.all() promise and call digestion loop on fulfillment\n this.promiseAll = function(promises) {\n var allPromise = $q.all(promises);\n\n allPromise.finally(function() {\n // calls digestion loop with no conflicts\n $timeout(angular.noop);\n });\n\n return allPromise;\n };\n\n this.getCollectionByName = function(string){\n return Mongo.Collection.get(string);\n };\n\n this.findIndexById = function(collection, doc) {\n var foundDoc = _.find(collection, function(colDoc) {\n // EJSON.equals used to compare Mongo.ObjectIDs and Strings.\n return EJSON.equals(colDoc._id, doc._id);\n });\n\n return _.indexOf(collection, foundDoc);\n };\n }\n]);\n\nangularMeteorUtils.run([\n '$rootScope', '$meteorUtils',\n function($rootScope, $meteorUtils) {\n Object.getPrototypeOf($rootScope).$meteorAutorun = function(fn) {\n return $meteorUtils.autorun(this, fn);\n };\n}]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-utils.js\n **/","/*global\n angular, Meteor\n */\n\n'use strict';\nvar angularMeteorSubscribe = angular.module('angular-meteor.subscribe', ['angular-meteor.settings']);\n\nangularMeteorSubscribe.service('$meteorSubscribe', ['$q', '$angularMeteorSettings',\n function ($q, $angularMeteorSettings) {\n\n var self = this;\n\n this._subscribe = function(scope, deferred, args) {\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.subscribe] Please note that this module is deprecated since 1.3.0 and will be removed in 1.4.0! Replace it with the new syntax described here: http://www.angular-meteor.com/api/1.3.6/subscribe. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\n var subscription = null;\n var lastArg = args[args.length - 1];\n\n // User supplied onStop callback\n // save it for later use and remove\n // from subscription arguments\n if (angular.isObject(lastArg) &&\n angular.isFunction(lastArg.onStop)) {\n var onStop = lastArg.onStop;\n\n args.pop();\n }\n\n args.push({\n onReady: function() {\n deferred.resolve(subscription);\n },\n onStop: function(err) {\n if (!deferred.promise.$$state.status) {\n if (err)\n deferred.reject(err);\n else\n deferred.reject(new Meteor.Error(\"Subscription Stopped\",\n \"Subscription stopped by a call to stop method. Either by the client or by the server.\"));\n } else if (onStop)\n // After promise was resolved or rejected\n // call user supplied onStop callback.\n onStop.apply(this, Array.prototype.slice.call(arguments));\n\n }\n });\n\n subscription = Meteor.subscribe.apply(scope, args);\n\n return subscription;\n };\n\n this.subscribe = function(){\n var deferred = $q.defer();\n var args = Array.prototype.slice.call(arguments);\n var subscription = null;\n\n self._subscribe(this, deferred, args);\n\n return deferred.promise;\n };\n }]);\n\nangularMeteorSubscribe.run(['$rootScope', '$q', '$meteorSubscribe',\n function($rootScope, $q, $meteorSubscribe) {\n Object.getPrototypeOf($rootScope).$meteorSubscribe = function() {\n var deferred = $q.defer();\n var args = Array.prototype.slice.call(arguments);\n\n var subscription = $meteorSubscribe._subscribe(this, deferred, args);\n\n this.$on('$destroy', function() {\n subscription.stop();\n });\n\n return deferred.promise;\n };\n}]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-subscribe.js\n **/","/*global\n angular, _, Tracker, check, Match, Mongo\n */\n\n'use strict';\n\nvar angularMeteorCollection = angular.module('angular-meteor.collection',\n ['angular-meteor.stopper', 'angular-meteor.subscribe', 'angular-meteor.utils', 'diffArray', 'angular-meteor.settings']);\n\n// The reason angular meteor collection is a factory function and not something\n// that inherit from array comes from here:\n// http://perfectionkills.com/how-ecmascript-5-still-does-not-allow-to-subclass-an-array/\n// We went with the direct extensions approach.\nangularMeteorCollection.factory('AngularMeteorCollection', [\n '$q', '$meteorSubscribe', '$meteorUtils', '$rootScope', '$timeout', 'diffArray', '$angularMeteorSettings',\n function($q, $meteorSubscribe, $meteorUtils, $rootScope, $timeout, diffArray, $angularMeteorSettings) {\n\n function AngularMeteorCollection(curDefFunc, collection, diffArrayFunc, autoClientSave) {\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.$meteorCollection] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorCollection. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\n var data = [];\n // Server backup data to evaluate what changes come from client\n // after each server update.\n data._serverBackup = [];\n // Array differ function.\n data._diffArrayFunc = diffArrayFunc;\n // Handler of the cursor observer.\n data._hObserve = null;\n // On new cursor autorun handler\n // (autorun for reactive variables).\n data._hNewCurAutorun = null;\n // On new data autorun handler\n // (autorun for cursor.fetch).\n data._hDataAutorun = null;\n\n if (angular.isDefined(collection)) {\n data.$$collection = collection;\n } else {\n var cursor = curDefFunc();\n data.$$collection = $meteorUtils.getCollectionByName(cursor.collection.name);\n }\n\n _.extend(data, AngularMeteorCollection);\n data._startCurAutorun(curDefFunc, autoClientSave);\n\n return data;\n }\n\n AngularMeteorCollection._startCurAutorun = function(curDefFunc, autoClientSave) {\n var self = this;\n\n self._hNewCurAutorun = Tracker.autorun(function() {\n // When the reactive func gets recomputated we need to stop any previous\n // observeChanges.\n Tracker.onInvalidate(function() {\n self._stopCursor();\n });\n\n if (autoClientSave) self._setAutoClientSave();\n self._updateCursor(curDefFunc(), autoClientSave);\n });\n };\n\n AngularMeteorCollection.subscribe = function() {\n $meteorSubscribe.subscribe.apply(this, arguments);\n return this;\n };\n\n AngularMeteorCollection.save = function(docs, useUnsetModifier) {\n // save whole collection\n if (!docs) docs = this;\n // save single doc\n docs = [].concat(docs);\n\n var promises = docs.map(function(doc) {\n return this._upsertDoc(doc, useUnsetModifier);\n }, this);\n\n return $meteorUtils.promiseAll(promises);\n };\n\n AngularMeteorCollection._upsertDoc = function(doc, useUnsetModifier) {\n var deferred = $q.defer();\n var collection = this.$$collection;\n var createFulfill = _.partial($meteorUtils.fulfill, deferred, null);\n\n // delete $$hashkey\n doc = $meteorUtils.stripDollarPrefixedKeys(doc);\n var docId = doc._id;\n var isExist = collection.findOne(docId);\n\n // update\n if (isExist) {\n // Deletes _id property (from the copy) so that\n // it can be $set using update.\n delete doc._id;\n var modifier = useUnsetModifier ? {$unset: doc} : {$set: doc};\n // NOTE: do not use #upsert() method, since it does not exist in some collections\n collection.update(docId, modifier, createFulfill(function() {\n return {_id: docId, action: 'updated'};\n }));\n }\n // insert\n else {\n collection.insert(doc, createFulfill(function(id) {\n return {_id: id, action: 'inserted'};\n }));\n }\n\n return deferred.promise;\n };\n\n // performs $pull operations parallely.\n // used for handling splice operations returned from getUpdates() to prevent conflicts.\n // see issue: https://github.com/Urigo/angular-meteor/issues/793\n AngularMeteorCollection._updateDiff = function(selector, update, callback) {\n callback = callback || angular.noop;\n var setters = _.omit(update, '$pull');\n var updates = [setters];\n\n _.each(update.$pull, function(pull, prop) {\n var puller = {};\n puller[prop] = pull;\n updates.push({ $pull: puller });\n });\n\n this._updateParallel(selector, updates, callback);\n };\n\n // performs each update operation parallely\n AngularMeteorCollection._updateParallel = function(selector, updates, callback) {\n var self = this;\n var done = _.after(updates.length, callback);\n\n var next = function(err, affectedDocsNum) {\n if (err) return callback(err);\n done(null, affectedDocsNum);\n };\n\n _.each(updates, function(update) {\n self.$$collection.update(selector, update, next);\n });\n };\n\n AngularMeteorCollection.remove = function(keyOrDocs) {\n var keys;\n\n // remove whole collection\n if (!keyOrDocs) {\n keys = _.pluck(this, '_id');\n }\n // remove docs\n else {\n keyOrDocs = [].concat(keyOrDocs);\n\n keys = _.map(keyOrDocs, function(keyOrDoc) {\n return keyOrDoc._id || keyOrDoc;\n });\n }\n\n // Checks if all keys are correct.\n check(keys, [Match.OneOf(String, Mongo.ObjectID)]);\n\n var promises = keys.map(function(key) {\n return this._removeDoc(key);\n }, this);\n\n return $meteorUtils.promiseAll(promises);\n };\n\n AngularMeteorCollection._removeDoc = function(id) {\n var deferred = $q.defer();\n var collection = this.$$collection;\n var fulfill = $meteorUtils.fulfill(deferred, null, { _id: id, action: 'removed' });\n collection.remove(id, fulfill);\n return deferred.promise;\n };\n\n AngularMeteorCollection._updateCursor = function(cursor, autoClientSave) {\n var self = this;\n // XXX - consider adding an option for a non-orderd result for faster performance\n if (self._hObserve) self._stopObserving();\n\n\n self._hObserve = cursor.observe({\n addedAt: function(doc, atIndex) {\n self.splice(atIndex, 0, doc);\n self._serverBackup.splice(atIndex, 0, doc);\n self._setServerUpdateMode();\n },\n\n changedAt: function(doc, oldDoc, atIndex) {\n diffArray.deepCopyChanges(self[atIndex], doc);\n diffArray.deepCopyRemovals(self[atIndex], doc);\n self._serverBackup[atIndex] = self[atIndex];\n self._setServerUpdateMode();\n },\n\n movedTo: function(doc, fromIndex, toIndex) {\n self.splice(fromIndex, 1);\n self.splice(toIndex, 0, doc);\n self._serverBackup.splice(fromIndex, 1);\n self._serverBackup.splice(toIndex, 0, doc);\n self._setServerUpdateMode();\n },\n\n removedAt: function(oldDoc) {\n var removedIndex = $meteorUtils.findIndexById(self, oldDoc);\n\n if (removedIndex != -1) {\n self.splice(removedIndex, 1);\n self._serverBackup.splice(removedIndex, 1);\n self._setServerUpdateMode();\n } else {\n // If it's been removed on client then it's already not in collection\n // itself but still is in the _serverBackup.\n removedIndex = $meteorUtils.findIndexById(self._serverBackup, oldDoc);\n\n if (removedIndex != -1) {\n self._serverBackup.splice(removedIndex, 1);\n }\n }\n }\n });\n\n self._hDataAutorun = Tracker.autorun(function() {\n cursor.fetch();\n if (self._serverMode) self._unsetServerUpdateMode(autoClientSave);\n });\n };\n\n AngularMeteorCollection._stopObserving = function() {\n this._hObserve.stop();\n this._hDataAutorun.stop();\n delete this._serverMode;\n delete this._hUnsetTimeout;\n };\n\n AngularMeteorCollection._setServerUpdateMode = function(name) {\n this._serverMode = true;\n // To simplify server update logic, we don't follow\n // updates from the client at the same time.\n this._unsetAutoClientSave();\n };\n\n // Here we use $timeout to combine multiple updates that go\n // each one after another.\n AngularMeteorCollection._unsetServerUpdateMode = function(autoClientSave) {\n var self = this;\n\n if (self._hUnsetTimeout) {\n $timeout.cancel(self._hUnsetTimeout);\n self._hUnsetTimeout = null;\n }\n\n self._hUnsetTimeout = $timeout(function() {\n self._serverMode = false;\n // Finds updates that was potentially done from the client side\n // and saves them.\n var changes = diffArray.getChanges(self, self._serverBackup, self._diffArrayFunc);\n self._saveChanges(changes);\n // After, continues following client updates.\n if (autoClientSave) self._setAutoClientSave();\n }, 0);\n };\n\n AngularMeteorCollection.stop = function() {\n this._stopCursor();\n this._hNewCurAutorun.stop();\n };\n\n AngularMeteorCollection._stopCursor = function() {\n this._unsetAutoClientSave();\n\n if (this._hObserve) {\n this._hObserve.stop();\n this._hDataAutorun.stop();\n }\n\n this.splice(0);\n this._serverBackup.splice(0);\n };\n\n AngularMeteorCollection._unsetAutoClientSave = function(name) {\n if (this._hRegAutoBind) {\n this._hRegAutoBind();\n this._hRegAutoBind = null;\n }\n };\n\n AngularMeteorCollection._setAutoClientSave = function() {\n var self = this;\n\n // Always unsets auto save to keep only one $watch handler.\n self._unsetAutoClientSave();\n\n self._hRegAutoBind = $rootScope.$watch(function() {\n return self;\n }, function(nItems, oItems) {\n if (nItems === oItems) return;\n\n var changes = diffArray.getChanges(self, oItems, self._diffArrayFunc);\n self._unsetAutoClientSave();\n self._saveChanges(changes);\n self._setAutoClientSave();\n }, true);\n };\n\n AngularMeteorCollection._saveChanges = function(changes) {\n var self = this;\n\n // Saves added documents\n // Using reversed iteration to prevent indexes from changing during splice\n var addedDocs = changes.added.reverse().map(function(descriptor) {\n self.splice(descriptor.index, 1);\n return descriptor.item;\n });\n\n if (addedDocs.length) self.save(addedDocs);\n\n // Removes deleted documents\n var removedDocs = changes.removed.map(function(descriptor) {\n return descriptor.item;\n });\n\n if (removedDocs.length) self.remove(removedDocs);\n\n // Updates changed documents\n changes.changed.forEach(function(descriptor) {\n self._updateDiff(descriptor.selector, descriptor.modifier);\n });\n };\n\n return AngularMeteorCollection;\n}]);\n\nangularMeteorCollection.factory('$meteorCollectionFS', [\n '$meteorCollection', 'diffArray', '$angularMeteorSettings',\n function($meteorCollection, diffArray, $angularMeteorSettings) {\n function $meteorCollectionFS(reactiveFunc, autoClientSave, collection) {\n\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.$meteorCollectionFS] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/files. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n return new $meteorCollection(reactiveFunc, autoClientSave, collection, diffArray.shallow);\n }\n\n return $meteorCollectionFS;\n}]);\n\nangularMeteorCollection.factory('$meteorCollection', [\n 'AngularMeteorCollection', '$rootScope', 'diffArray',\n function(AngularMeteorCollection, $rootScope, diffArray) {\n function $meteorCollection(reactiveFunc, autoClientSave, collection, diffFn) {\n // Validate parameters\n if (!reactiveFunc) {\n throw new TypeError('The first argument of $meteorCollection is undefined.');\n }\n\n if (!(angular.isFunction(reactiveFunc) || angular.isFunction(reactiveFunc.find))) {\n throw new TypeError(\n 'The first argument of $meteorCollection must be a function or ' +\n 'a have a find function property.');\n }\n\n if (!angular.isFunction(reactiveFunc)) {\n collection = angular.isDefined(collection) ? collection : reactiveFunc;\n reactiveFunc = _.bind(reactiveFunc.find, reactiveFunc);\n }\n\n // By default auto save - true.\n autoClientSave = angular.isDefined(autoClientSave) ? autoClientSave : true;\n diffFn = diffFn || diffArray;\n return new AngularMeteorCollection(reactiveFunc, collection, diffFn, autoClientSave);\n }\n\n return $meteorCollection;\n}]);\n\nangularMeteorCollection.run([\n '$rootScope', '$meteorCollection', '$meteorCollectionFS', '$meteorStopper',\n function($rootScope, $meteorCollection, $meteorCollectionFS, $meteorStopper) {\n var scopeProto = Object.getPrototypeOf($rootScope);\n scopeProto.$meteorCollection = $meteorStopper($meteorCollection);\n scopeProto.$meteorCollectionFS = $meteorStopper($meteorCollectionFS);\n}]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-collection.js\n **/","/*global\n angular, _, Mongo\n*/\n\n'use strict';\n\nvar angularMeteorObject = angular.module('angular-meteor.object',\n ['angular-meteor.utils', 'angular-meteor.subscribe', 'angular-meteor.collection', 'getUpdates', 'diffArray', 'angular-meteor.settings']);\n\nangularMeteorObject.factory('AngularMeteorObject', [\n '$q', '$meteorSubscribe', '$meteorUtils', 'diffArray', 'getUpdates', 'AngularMeteorCollection', '$angularMeteorSettings',\n function($q, $meteorSubscribe, $meteorUtils, diffArray, getUpdates, AngularMeteorCollection, $angularMeteorSettings) {\n\n // A list of internals properties to not watch for, nor pass to the Document on update and etc.\n AngularMeteorObject.$$internalProps = [\n '$$collection', '$$options', '$$id', '$$hashkey', '$$internalProps', '$$scope',\n 'bind', 'save', 'reset', 'subscribe', 'stop', 'autorunComputation', 'unregisterAutoBind', 'unregisterAutoDestroy', 'getRawObject',\n '_auto', '_setAutos', '_eventEmitter', '_serverBackup', '_updateDiff', '_updateParallel', '_getId'\n ];\n\n function AngularMeteorObject (collection, selector, options){\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.$meteorObject] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorObject. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n // Make data not be an object so we can extend it to preserve\n // Collection Helpers and the like\n var helpers = collection._helpers;\n var data = _.isFunction(helpers) ? Object.create(helpers.prototype) : {};\n var doc = collection.findOne(selector, options);\n var collectionExtension = _.pick(AngularMeteorCollection, '_updateParallel');\n _.extend(data, doc);\n _.extend(data, AngularMeteorObject);\n _.extend(data, collectionExtension);\n\n // Omit options that may spoil document finding\n data.$$options = _.omit(options, 'skip', 'limit');\n data.$$collection = collection;\n data.$$id = data._getId(selector);\n data._serverBackup = doc || {};\n\n return data;\n }\n\n AngularMeteorObject.getRawObject = function () {\n return angular.copy(_.omit(this, this.$$internalProps));\n };\n\n AngularMeteorObject.subscribe = function () {\n $meteorSubscribe.subscribe.apply(this, arguments);\n return this;\n };\n\n AngularMeteorObject.save = function(custom) {\n var deferred = $q.defer();\n var collection = this.$$collection;\n var createFulfill = _.partial($meteorUtils.fulfill, deferred, null);\n var oldDoc = collection.findOne(this.$$id);\n var mods;\n\n // update\n if (oldDoc) {\n if (custom)\n mods = { $set: custom };\n else {\n mods = getUpdates(oldDoc, this.getRawObject());\n // If there are no updates, there is nothing to do here, returning\n if (_.isEmpty(mods)) {\n return $q.when({ action: 'updated' });\n }\n }\n\n // NOTE: do not use #upsert() method, since it does not exist in some collections\n this._updateDiff(mods, createFulfill({ action: 'updated' }));\n }\n // insert\n else {\n if (custom)\n mods = _.clone(custom);\n else\n mods = this.getRawObject();\n\n mods._id = mods._id || this.$$id;\n collection.insert(mods, createFulfill({ action: 'inserted' }));\n }\n\n return deferred.promise;\n };\n\n AngularMeteorObject._updateDiff = function(update, callback) {\n var selector = this.$$id;\n AngularMeteorCollection._updateDiff.call(this, selector, update, callback);\n };\n\n AngularMeteorObject.reset = function(keepClientProps) {\n var self = this;\n var options = this.$$options;\n var id = this.$$id;\n var doc = this.$$collection.findOne(id, options);\n\n if (doc) {\n // extend SubObject\n var docKeys = _.keys(doc);\n var docExtension = _.pick(doc, docKeys);\n var clientProps;\n\n _.extend(self, docExtension);\n _.extend(self._serverBackup, docExtension);\n\n if (keepClientProps) {\n clientProps = _.intersection(_.keys(self), _.keys(self._serverBackup));\n } else {\n clientProps = _.keys(self);\n }\n\n var serverProps = _.keys(doc);\n var removedKeys = _.difference(clientProps, serverProps, self.$$internalProps);\n\n removedKeys.forEach(function (prop) {\n delete self[prop];\n delete self._serverBackup[prop];\n });\n }\n\n else {\n _.keys(this.getRawObject()).forEach(function(prop) {\n delete self[prop];\n });\n\n self._serverBackup = {};\n }\n };\n\n AngularMeteorObject.stop = function () {\n if (this.unregisterAutoDestroy)\n this.unregisterAutoDestroy();\n\n if (this.unregisterAutoBind)\n this.unregisterAutoBind();\n\n if (this.autorunComputation && this.autorunComputation.stop)\n this.autorunComputation.stop();\n };\n\n AngularMeteorObject._getId = function(selector) {\n var options = _.extend({}, this.$$options, {\n fields: { _id: 1 },\n reactive: false,\n transform: null\n });\n\n var doc = this.$$collection.findOne(selector, options);\n\n if (doc) return doc._id;\n if (selector instanceof Mongo.ObjectID) return selector;\n if (_.isString(selector)) return selector;\n return new Mongo.ObjectID();\n };\n\n return AngularMeteorObject;\n}]);\n\n\nangularMeteorObject.factory('$meteorObject', [\n '$rootScope', '$meteorUtils', 'getUpdates', 'AngularMeteorObject',\n function($rootScope, $meteorUtils, getUpdates, AngularMeteorObject) {\n function $meteorObject(collection, id, auto, options) {\n // Validate parameters\n if (!collection) {\n throw new TypeError(\"The first argument of $meteorObject is undefined.\");\n }\n\n if (!angular.isFunction(collection.findOne)) {\n throw new TypeError(\"The first argument of $meteorObject must be a function or a have a findOne function property.\");\n }\n\n var data = new AngularMeteorObject(collection, id, options);\n // Making auto default true - http://stackoverflow.com/a/15464208/1426570\n data._auto = auto !== false;\n _.extend(data, $meteorObject);\n data._setAutos();\n return data;\n }\n\n $meteorObject._setAutos = function() {\n var self = this;\n\n this.autorunComputation = $meteorUtils.autorun($rootScope, function() {\n self.reset(true);\n });\n\n // Deep watches the model and performs autobind\n this.unregisterAutoBind = this._auto && $rootScope.$watch(function(){\n return self.getRawObject();\n }, function (item, oldItem) {\n if (item !== oldItem) self.save();\n }, true);\n\n this.unregisterAutoDestroy = $rootScope.$on('$destroy', function() {\n if (self && self.stop) self.pop();\n });\n };\n\n return $meteorObject;\n}]);\n\nangularMeteorObject.run([\n '$rootScope', '$meteorObject', '$meteorStopper',\n function ($rootScope, $meteorObject, $meteorStopper) {\n var scopeProto = Object.getPrototypeOf($rootScope);\n scopeProto.$meteorObject = $meteorStopper($meteorObject);\n}]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-object.js\n **/","/*global\n angular, _, Package, Meteor\n */\n\n'use strict';\n\nvar angularMeteorUser = angular.module('angular-meteor.user', [\n 'angular-meteor.utils',\n 'angular-meteor.core',\n 'angular-meteor.settings'\n]);\n\n// requires package 'accounts-password'\nangularMeteorUser.service('$meteorUser', [\n '$rootScope', '$meteorUtils', '$q', '$angularMeteorSettings',\n function($rootScope, $meteorUtils, $q, $angularMeteorSettings){\n\n var pack = Package['accounts-base'];\n if (!pack) return;\n\n var self = this;\n var Accounts = pack.Accounts;\n\n this.waitForUser = function(){\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.waitForUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\n var deferred = $q.defer();\n\n $meteorUtils.autorun($rootScope, function(){\n if ( !Meteor.loggingIn() )\n deferred.resolve( Meteor.user() );\n }, true);\n\n return deferred.promise;\n };\n\n this.requireUser = function(){\n if (!$angularMeteorSettings.suppressWarnings) {\n console.warn('[angular-meteor.requireUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n }\n\n var deferred = $q.defer();\n\n $meteorUtils.autorun($rootScope, function(){\n if ( !Meteor.loggingIn() ) {\n if ( Meteor.user() === null)\n deferred.reject(\"AUTH_REQUIRED\");\n else\n deferred.resolve( Meteor.user() );\n }\n }, true);\n\n return deferred.promise;\n };\n\n this.requireValidUser = function(validatorFn) {\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.requireValidUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\n return self.requireUser(true).then(function(user){\n var valid = validatorFn( user );\n\n if ( valid === true )\n return user;\n else if ( typeof valid === \"string\" )\n return $q.reject( valid );\n else\n return $q.reject( \"FORBIDDEN\" );\n\t });\n\t };\n\n this.loginWithPassword = $meteorUtils.promissor(Meteor, 'loginWithPassword');\n this.createUser = $meteorUtils.promissor(Accounts, 'createUser');\n this.changePassword = $meteorUtils.promissor(Accounts, 'changePassword');\n this.forgotPassword = $meteorUtils.promissor(Accounts, 'forgotPassword');\n this.resetPassword = $meteorUtils.promissor(Accounts, 'resetPassword');\n this.verifyEmail = $meteorUtils.promissor(Accounts, 'verifyEmail');\n this.logout = $meteorUtils.promissor(Meteor, 'logout');\n this.logoutOtherClients = $meteorUtils.promissor(Meteor, 'logoutOtherClients');\n this.loginWithFacebook = $meteorUtils.promissor(Meteor, 'loginWithFacebook');\n this.loginWithTwitter = $meteorUtils.promissor(Meteor, 'loginWithTwitter');\n this.loginWithGoogle = $meteorUtils.promissor(Meteor, 'loginWithGoogle');\n this.loginWithGithub = $meteorUtils.promissor(Meteor, 'loginWithGithub');\n this.loginWithMeteorDeveloperAccount = $meteorUtils.promissor(Meteor, 'loginWithMeteorDeveloperAccount');\n this.loginWithMeetup = $meteorUtils.promissor(Meteor, 'loginWithMeetup');\n this.loginWithWeibo = $meteorUtils.promissor(Meteor, 'loginWithWeibo');\n }\n]);\n\nangularMeteorUser.run([\n '$rootScope', '$angularMeteorSettings', '$$Core',\n function($rootScope, $angularMeteorSettings, $$Core){\n\n let ScopeProto = Object.getPrototypeOf($rootScope);\n _.extend(ScopeProto, $$Core);\n\n $rootScope.autorun(function(){\n if (!Meteor.user) return;\n $rootScope.currentUser = Meteor.user();\n $rootScope.loggingIn = Meteor.loggingIn();\n });\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-user.js\n **/","/*global\n angular, _, Meteor\n */\n\n'use strict';\n\nvar angularMeteorMethods = angular.module('angular-meteor.methods', ['angular-meteor.utils', 'angular-meteor.settings']);\n\nangularMeteorMethods.service('$meteorMethods', [\n '$q', '$meteorUtils', '$angularMeteorSettings',\n function($q, $meteorUtils, $angularMeteorSettings) {\n this.call = function(){\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.$meteor.call] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/methods. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\n var deferred = $q.defer();\n var fulfill = $meteorUtils.fulfill(deferred);\n var args = _.toArray(arguments).concat(fulfill);\n Meteor.call.apply(this, args);\n return deferred.promise;\n };\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-methods.js\n **/","/*global\n angular, Session\n */\n\n'use strict';\nvar angularMeteorSession = angular.module('angular-meteor.session', ['angular-meteor.utils', 'angular-meteor.settings']);\n\nangularMeteorSession.factory('$meteorSession', ['$meteorUtils', '$parse', '$angularMeteorSettings',\n function ($meteorUtils, $parse, $angularMeteorSettings) {\n return function (session) {\n\n return {\n\n bind: function(scope, model) {\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.session.bind] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://www.angular-meteor.com/api/1.3.0/session. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\n var getter = $parse(model);\n var setter = getter.assign;\n $meteorUtils.autorun(scope, function() {\n setter(scope, Session.get(session));\n });\n\n scope.$watch(model, function(newItem, oldItem) {\n Session.set(session, getter(scope));\n }, true);\n\n }\n };\n };\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-session.js\n **/","/*global\n angular, Package\n */\n\n'use strict';\n\nvar angularMeteorCamera = angular.module('angular-meteor.camera', ['angular-meteor.utils', 'angular-meteor.settings']);\n\n// requires package 'mdg:camera'\nangularMeteorCamera.service('$meteorCamera', [\n '$q', '$meteorUtils', '$angularMeteorSettings',\n function ($q, $meteorUtils, $angularMeteorSettings) {\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n var pack = Package['mdg:camera'];\n if (!pack) return;\n\n var MeteorCamera = pack.MeteorCamera;\n\n this.getPicture = function(options){\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\n options = options || {};\n var deferred = $q.defer();\n MeteorCamera.getPicture(options, $meteorUtils.fulfill(deferred));\n return deferred.promise;\n };\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-camera.js\n **/","/*global\n angular\n */\n\n'use strict';\n\nvar angularMeteorStopper = angular.module('angular-meteor.stopper',\n ['angular-meteor.subscribe']);\n\nangularMeteorStopper.factory('$meteorStopper', ['$q', '$meteorSubscribe',\n function($q, $meteorSubscribe) {\n function $meteorStopper($meteorEntity) {\n return function() {\n var args = Array.prototype.slice.call(arguments);\n var meteorEntity = $meteorEntity.apply(this, args);\n\n angular.extend(meteorEntity, $meteorStopper);\n meteorEntity.$$scope = this;\n\n this.$on('$destroy', function () {\n meteorEntity.stop();\n if (meteorEntity.subscription) meteorEntity.subscription.stop();\n });\n\n return meteorEntity;\n };\n }\n\n $meteorStopper.subscribe = function() {\n var args = Array.prototype.slice.call(arguments);\n this.subscription = $meteorSubscribe._subscribe(this.$$scope, $q.defer(), args);\n return this;\n };\n\n return $meteorStopper;\n}]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-stopper.js\n **/","export const name = 'angular-meteor.utilities';\nexport const utils = '$$utils';\n\nangular.module(name, [])\n\n/*\n A utility service which is provided with general utility functions\n */\n.service(utils, [\n '$rootScope',\n\n function($rootScope) {\n const self = this;\n\n // Checks if an object is a cursor\n this.isCursor = (obj) => {\n return obj instanceof Meteor.Collection.Cursor;\n };\n\n // Cheecks if an object is a scope\n this.isScope = (obj) => {\n return obj instanceof $rootScope.constructor;\n };\n\n // Checks if two objects are siblings\n this.areSiblings = (obj1, obj2) => {\n return _.isObject(obj1) && _.isObject(obj2) &&\n Object.getPrototypeOf(obj1) === Object.getPrototypeOf(obj2);\n };\n\n // Binds function into a scpecified context. If an object is provided, will bind every\n // value in the object which is a function. If a tap function is provided, it will be\n // called right after the function has been invoked.\n this.bind = (fn, context, tap) => {\n tap = _.isFunction(tap) ? tap : angular.noop;\n if (_.isFunction(fn)) return bindFn(fn, context, tap);\n if (_.isObject(fn)) return bindObj(fn, context, tap);\n return fn;\n };\n\n function bindFn(fn, context, tap) {\n return (...args) => {\n const result = fn.apply(context, args);\n tap.call(context, {\n result,\n args\n });\n return result;\n };\n }\n\n function bindObj(obj, context, tap) {\n return _.keys(obj).reduce((bound, k) => {\n bound[k] = self.bind(obj[k], context, tap);\n return bound;\n }, {});\n }\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/utils.js\n **/","export const name = 'angular-meteor.mixer';\nexport const Mixer = '$Mixer';\n\nangular.module(name, [])\n\n/*\n A service which lets us apply mixins into Scope.prototype.\n The flow is simple. Once we define a mixin, it will be stored in the `$Mixer`,\n and any time a `ChildScope` prototype is created\n it will be extended by the `$Mixer`.\n This concept is good because it keeps our code\n clean and simple, and easy to extend.\n So any time we would like to define a new behaviour to our scope,\n we will just use the `$Mixer` service.\n */\n.service(Mixer, function() {\n this._mixins = [];\n // Apply mixins automatically on specified contexts\n this._autoExtend = [];\n this._autoConstruct = [];\n\n // Adds a new mixin\n this.mixin = (mixin) => {\n if (!_.isObject(mixin)) {\n throw Error('argument 1 must be an object');\n }\n\n this._mixins = _.union(this._mixins, [mixin]);\n // Apply mixins to stored contexts\n this._autoExtend.forEach(context => this._extend(context));\n this._autoConstruct.forEach(context => this._construct(context));\n return this;\n };\n\n // Removes a mixin. Useful mainly for test purposes\n this._mixout = (mixin) => {\n this._mixins = _.without(this._mixins, mixin);\n return this;\n };\n\n // Invoke function mixins with the provided context and arguments\n this._construct = (context, ...args) => {\n this._mixins.filter(_.isFunction).forEach((mixin) => {\n mixin.call(context, ...args);\n });\n\n return context;\n };\n\n // Extend prototype with the defined mixins\n this._extend = (obj) => {\n return _.extend(obj, ...this._mixins);\n };\n});\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/mixer.js\n **/","import { name as mixerName, Mixer } from './mixer';\n\nexport const name = 'angular-meteor.scope';\n\nangular.module(name, [\n mixerName\n])\n\n.run([\n '$rootScope',\n Mixer,\n function($rootScope, $Mixer) {\n const Scope = $rootScope.constructor;\n const $new = $rootScope.$new;\n\n // Apply extensions whether a mixin in defined.\n // Note that this way mixins which are initialized later\n // can be applied on rootScope.\n $Mixer._autoExtend.push(Scope.prototype);\n $Mixer._autoConstruct.push($rootScope);\n\n Scope.prototype.$new = function() {\n const scope = $new.apply(this, arguments);\n // Apply constructors to newly created scopes\n return $Mixer._construct(scope);\n };\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/scope.js\n **/","import { name as utilsName, utils } from './utils';\nimport { name as mixerName } from './mixer';\n\nexport const name = 'angular-meteor.core';\nexport const Core = '$$Core';\n\nangular.module(name, [\n utilsName,\n mixerName\n])\n\n\n/*\n A mixin which provides us with core Meteor functions.\n */\n.factory(Core, [\n '$q',\n utils,\n\n function($q, $$utils) {\n function $$Core() {}\n\n // Calls Meteor.autorun() which will be digested after each run and automatically destroyed\n $$Core.autorun = function(fn, options = {}) {\n fn = this.$bindToContext(fn);\n\n if (!_.isFunction(fn)) {\n throw Error('argument 1 must be a function');\n }\n if (!_.isObject(options)) {\n throw Error('argument 2 must be an object');\n }\n\n const computation = Tracker.autorun(fn, options);\n this.$$autoStop(computation);\n return computation;\n };\n\n // Calls Meteor.subscribe() which will be digested after each invokation\n // and automatically destroyed\n $$Core.subscribe = function(subName, fn, cb) {\n fn = this.$bindToContext(fn || angular.noop);\n cb = cb ? this.$bindToContext(cb) : angular.noop;\n\n if (!_.isString(subName)) {\n throw Error('argument 1 must be a string');\n }\n if (!_.isFunction(fn)) {\n throw Error('argument 2 must be a function');\n }\n if (!_.isFunction(cb) && !_.isObject(cb)) {\n throw Error('argument 3 must be a function or an object');\n }\n\n const result = {};\n\n const computation = this.autorun(() => {\n let args = fn();\n if (angular.isUndefined(args)) args = [];\n\n if (!_.isArray(args)) {\n throw Error(`reactive function's return value must be an array`);\n }\n\n const subscription = Meteor.subscribe(subName, ...args, cb);\n result.ready = subscription.ready.bind(subscription);\n result.subscriptionId = subscription.subscriptionId;\n });\n\n // Once the computation has been stopped,\n // any subscriptions made inside will be stopped as well\n result.stop = computation.stop.bind(computation);\n return result;\n };\n\n // Calls Meteor.call() wrapped by a digestion cycle\n $$Core.callMethod = function(...args) {\n let fn = args.pop();\n if (_.isFunction(fn)) fn = this.$bindToContext(fn);\n return Meteor.call(...args, fn);\n };\n\n // Calls Meteor.apply() wrapped by a digestion cycle\n $$Core.applyMethod = function(...args) {\n let fn = args.pop();\n if (_.isFunction(fn)) fn = this.$bindToContext(fn);\n return Meteor.apply(...args, fn);\n };\n\n $$Core.$$autoStop = function(stoppable) {\n this.$on('$destroy', stoppable.stop.bind(stoppable));\n };\n\n // Digests scope only if there is no phase at the moment\n $$Core.$$throttledDigest = function() {\n const isDigestable = !this.$$destroyed &&\n !this.$$phase &&\n !this.$root.$$phase;\n\n if (isDigestable) this.$digest();\n };\n\n // Creates a promise only that the digestion cycle will be called at its fulfillment\n $$Core.$$defer = function() {\n const deferred = $q.defer();\n // Once promise has been fulfilled, digest\n deferred.promise = deferred.promise.finally(this.$$throttledDigest.bind(this));\n return deferred;\n };\n\n // Binds an object or a function to the scope to the view model and digest it once it is invoked\n $$Core.$bindToContext = function(fn) {\n return $$utils.bind(fn, this, this.$$throttledDigest.bind(this));\n };\n\n return $$Core;\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/core.js\n **/","import { name as utilsName, utils } from './utils';\nimport { name as mixerName, Mixer } from './mixer';\nimport { name as coreName } from './core';\n\nexport const name = 'angular-meteor.view-model';\nexport const ViewModel = '$$ViewModel';\nexport const reactive = '$reactive';\n\nangular.module(name, [\n utilsName,\n mixerName,\n coreName\n])\n\n/*\n A mixin which lets us bind a view model into a scope.\n Note that only a single view model can be bound,\n otherwise the scope might behave unexpectedly.\n Mainly used to define the controller as the view model,\n and very useful when wanting to use Angular's `controllerAs` syntax.\n */\n.factory(ViewModel, [\n utils,\n Mixer,\n\n function($$utils, $Mixer) {\n function $$ViewModel(vm = this) {\n // Defines the view model on the scope.\n this.$$vm = vm;\n }\n\n // Gets an object, wraps it with scope functions and returns it\n $$ViewModel.viewModel = function(vm) {\n if (!_.isObject(vm)) {\n throw Error('argument 1 must be an object');\n }\n\n // Apply mixin functions\n $Mixer._mixins.forEach((mixin) => {\n // Reject methods which starts with double $\n const keys = _.keys(mixin).filter(k => k.match(/^(?!\\$\\$).*$/));\n const proto = _.pick(mixin, keys);\n // Bind all the methods to the prototype\n const boundProto = $$utils.bind(proto, this);\n // Add the methods to the view model\n _.extend(vm, boundProto);\n });\n\n // Apply mixin constructors on the view model\n $Mixer._construct(this, vm);\n return vm;\n };\n\n // Override $$Core.$bindToContext to be bound to view model instead of scope\n $$ViewModel.$bindToContext = function(fn) {\n return $$utils.bind(fn, this.$$vm, this.$$throttledDigest.bind(this));\n };\n\n return $$ViewModel;\n }\n])\n\n\n/*\n Illustrates the old API where a view model is created using $reactive service\n */\n.service(reactive, [\n utils,\n\n function($$utils) {\n class Reactive {\n constructor(vm) {\n if (!_.isObject(vm)) {\n throw Error('argument 1 must be an object');\n }\n\n _.defer(() => {\n if (!this._attached) {\n console.warn('view model was not attached to any scope');\n }\n });\n\n this._vm = vm;\n }\n\n attach(scope) {\n this._attached = true;\n\n if (!$$utils.isScope(scope)) {\n throw Error('argument 1 must be a scope');\n }\n\n const viewModel = scope.viewModel(this._vm);\n\n // Similar to the old/Meteor API\n viewModel.call = viewModel.callMethod;\n viewModel.apply = viewModel.applyMethod;\n\n return viewModel;\n }\n }\n\n return (vm) => new Reactive(vm);\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/view-model.js\n **/","import { name as utilsName, utils } from './utils';\nimport { name as mixerName } from './mixer';\nimport { name as coreName } from './core';\nimport { name as viewModelName } from './view-model';\n\nexport const name = 'angular-meteor.reactive';\nexport const Reactive = '$$Reactive';\n\nangular.module(name, [\n utilsName,\n mixerName,\n coreName,\n viewModelName\n])\n\n\n/*\n A mixin which enhance our reactive abilities by providing methods\n that are capable of updating our scope reactively.\n */\n.factory(Reactive, [\n '$parse',\n utils,\n\n function($parse, $$utils) {\n function $$Reactive(vm = this) {\n // Helps us track changes made in the view model\n vm.$$dependencies = {};\n }\n\n // Gets an object containing functions and define their results as reactive properties.\n // Once a return value has been changed the property will be reset.\n $$Reactive.helpers = function(props = {}) {\n if (!_.isObject(props)) {\n throw Error('argument 1 must be an object');\n }\n\n _.each(props, (v, k, i) => {\n if (!_.isFunction(v)) {\n throw Error(`helper ${i + 1} must be a function`);\n }\n\n if (!this.$$vm.$$dependencies[k]) {\n // Registers a new dependency to the specified helper\n this.$$vm.$$dependencies[k] = new Tracker.Dependency();\n }\n\n this.$$setFnHelper(k, v);\n });\n };\n\n // Gets a model reactively\n $$Reactive.getReactively = function(k, isDeep = false) {\n if (!_.isBoolean(isDeep)) {\n throw Error('argument 2 must be a boolean');\n }\n\n return this.$$reactivateEntity(k, this.$watch, isDeep);\n };\n\n // Gets a collection reactively\n $$Reactive.getCollectionReactively = function(k) {\n return this.$$reactivateEntity(k, this.$watchCollection);\n };\n\n // Gets an entity reactively, and once it has been changed the computation will be recomputed\n $$Reactive.$$reactivateEntity = function(k, watcher, ...watcherArgs) {\n if (!_.isString(k)) {\n throw Error('argument 1 must be a string');\n }\n\n if (!this.$$vm.$$dependencies[k]) {\n this.$$vm.$$dependencies[k] = new Tracker.Dependency();\n this.$$watchEntity(k, watcher, ...watcherArgs);\n }\n\n this.$$vm.$$dependencies[k].depend();\n return $parse(k)(this.$$vm);\n };\n\n // Watches for changes in the view model, and if so will notify a change\n $$Reactive.$$watchEntity = function(k, watcher, ...watcherArgs) {\n // Gets a deep property from the view model\n const getVal = _.partial($parse(k), this.$$vm);\n const initialVal = getVal();\n\n // Watches for changes in the view model\n watcher.call(this, getVal, (val, oldVal) => {\n const hasChanged =\n val !== initialVal ||\n val !== oldVal;\n\n // Notify if a change has been detected\n if (hasChanged) this.$$changed(k);\n }, ...watcherArgs);\n };\n\n // Invokes a function and sets the return value as a property\n $$Reactive.$$setFnHelper = function(k, fn) {\n this.autorun((computation) => {\n // Invokes the reactive functon\n const model = fn.apply(this.$$vm);\n\n // Ignore notifications made by the following handler\n Tracker.nonreactive(() => {\n // If a cursor, observe its changes and update acoordingly\n if ($$utils.isCursor(model)) {\n const observation = this.$$handleCursor(k, model);\n\n computation.onInvalidate(() => {\n observation.stop();\n this.$$vm[k].splice(0);\n });\n } else {\n this.$$handleNonCursor(k, model);\n }\n\n // Notify change and update the view model\n this.$$changed(k);\n });\n });\n };\n\n // Sets a value helper as a setter and a getter which will notify computations once used\n $$Reactive.$$setValHelper = function(k, v, watch = true) {\n // If set, reactives property\n if (watch) {\n const isDeep = _.isObject(v);\n this.getReactively(k, isDeep);\n }\n\n Object.defineProperty(this.$$vm, k, {\n configurable: true,\n enumerable: true,\n\n get: () => {\n return v;\n },\n set: (newVal) => {\n v = newVal;\n this.$$changed(k);\n }\n });\n };\n\n // Fetching a cursor and updates properties once the result set has been changed\n $$Reactive.$$handleCursor = function(k, cursor) {\n // If not defined set it\n if (angular.isUndefined(this.$$vm[k])) {\n this.$$setValHelper(k, cursor.fetch(), false);\n }\n // If defined update it\n else {\n const diff = jsondiffpatch.diff(this.$$vm[k], cursor.fetch());\n jsondiffpatch.patch(this.$$vm[k], diff);\n }\n\n // Observe changes made in the result set\n const observation = cursor.observe({\n addedAt: (doc, atIndex) => {\n if (!observation) return;\n this.$$vm[k].splice(atIndex, 0, doc);\n this.$$changed(k);\n },\n changedAt: (doc, oldDoc, atIndex) => {\n const diff = jsondiffpatch.diff(this.$$vm[k][atIndex], doc);\n jsondiffpatch.patch(this.$$vm[k][atIndex], diff);\n this.$$changed(k);\n },\n movedTo: (doc, fromIndex, toIndex) => {\n this.$$vm[k].splice(fromIndex, 1);\n this.$$vm[k].splice(toIndex, 0, doc);\n this.$$changed(k);\n },\n removedAt: (oldDoc, atIndex) => {\n this.$$vm[k].splice(atIndex, 1);\n this.$$changed(k);\n }\n });\n\n return observation;\n };\n\n $$Reactive.$$handleNonCursor = function(k, data) {\n let v = this.$$vm[k];\n\n if (angular.isDefined(v)) {\n delete this.$$vm[k];\n v = null;\n }\n\n if (angular.isUndefined(v)) {\n this.$$setValHelper(k, data);\n }\n // Update property if the new value is from the same type\n else if ($$utils.areSiblings(v, data)) {\n const diff = jsondiffpatch.diff(v, data);\n jsondiffpatch.patch(v, diff);\n this.$$changed(k);\n } else {\n this.$$vm[k] = data;\n }\n };\n\n // Notifies dependency in view model\n $$Reactive.$$depend = function(k) {\n this.$$vm.$$dependencies[k].depend();\n };\n\n // Notifies change in view model\n $$Reactive.$$changed = function(k) {\n this.$$throttledDigest();\n this.$$vm.$$dependencies[k].changed();\n };\n\n return $$Reactive;\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/reactive.js\n **/","export const name = 'angular-templates';\n\ntry {\n angular.module(name);\n} catch (e) {\n angular.module(name, []);\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/templates.js\n **/"],"sourceRoot":""} \ No newline at end of file diff --git a/package.json b/package.json index a41cdf67d..4da2c025b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,6 @@ { "name": "angular-meteor", "version": "1.3.7-beta.1", - "private": true, "main": "dist/angular-meteor.js", "description": "Combining the simplicity and power of AngularJS and Meteor", "keywords": [ diff --git a/packages/angular-meteor-data/.versions b/packages/angular-meteor-data/.versions index a869bddbf..97b130db8 100644 --- a/packages/angular-meteor-data/.versions +++ b/packages/angular-meteor-data/.versions @@ -1,6 +1,5 @@ -angular-meteor-data@0.2.0 +angular-meteor-data@0.3.0-beta.1 angular:angular@1.4.8 -angular:angular-mocks@1.4.8 babel-compiler@5.8.24_1 babel-runtime@0.1.4 base64@1.0.4 @@ -9,10 +8,8 @@ binary-heap@1.0.4 blaze@2.1.3 blaze-tools@1.0.4 boilerplate-generator@1.0.4 -caching-compiler@1.0.0 callback-hook@1.0.4 check@1.1.0 -coffeescript@1.0.11 dburles:mongo-collection-instances@0.3.4 ddp@1.2.2 ddp-client@1.2.1 @@ -29,7 +26,6 @@ htmljs@1.0.5 id-map@1.0.4 jquery@1.11.4 lai:collection-extensions@0.1.4 -local-test:angular-meteor-data@0.2.0 logging@1.0.8 meteor@1.1.10 minimongo@1.0.10 @@ -38,31 +34,17 @@ mongo-id@1.0.1 npm-mongo@1.4.39_1 observe-sequence@1.0.7 ordered-dict@1.0.4 -package-version-parser@3.0.4 -practicalmeteor:chai@2.1.0_1 -practicalmeteor:loglevel@1.2.0_2 promise@0.5.1 random@1.0.5 reactive-dict@1.1.3 reactive-var@1.0.6 retry@1.0.4 routepolicy@1.0.6 -sanjo:jasmine@0.19.0 -sanjo:karma@1.7.0 -sanjo:long-running-child-process@1.1.3 -sanjo:meteor-files-helpers@1.1.0_7 -sanjo:meteor-version@1.0.0 session@1.1.1 spacebars@1.0.7 spacebars-compiler@1.0.7 tracker@1.0.9 ui@1.0.8 underscore@1.0.4 -velocity:chokidar@1.0.3_1 -velocity:core@0.10.0 -velocity:meteor-internals@1.1.0_7 -velocity:meteor-stubs@1.1.0 -velocity:shim@0.1.0 -velocity:source-map-support@0.3.2_1 webapp@1.2.3 webapp-hashing@1.0.5 diff --git a/packages/angular-meteor-data/package.js b/packages/angular-meteor-data/package.js index 6e8ab5cff..f272562c5 100644 --- a/packages/angular-meteor-data/package.js +++ b/packages/angular-meteor-data/package.js @@ -1,12 +1,12 @@ Package.describe({ name: 'angular-meteor-data', summary: 'Everything you need to use AngularJS in your Meteor app', - version: '0.2.0', + version: '0.3.0-beta.1', git: 'https://github.com/Urigo/angular-meteor.git' }); Npm.depends({ - 'angular-meteor': '1.3.6' + 'angular-meteor': '1.3.7-beta.1' }); Package.onUse(function (api) { diff --git a/packages/angular-templates/.versions b/packages/angular-templates/.versions index 7be8be3c2..b546a7040 100644 --- a/packages/angular-templates/.versions +++ b/packages/angular-templates/.versions @@ -1,4 +1,4 @@ -angular-templates@0.0.3 +angular-templates@1.0.0 babel-compiler@5.8.24_1 babel-runtime@0.1.4 base64@1.0.4 diff --git a/packages/angular-templates/package.js b/packages/angular-templates/package.js index 976c7e832..0b1a992c0 100644 --- a/packages/angular-templates/package.js +++ b/packages/angular-templates/package.js @@ -1,7 +1,7 @@ Package.describe({ name: "angular-templates", summary: "Compile angular templates into the template cache", - version: "0.0.3", + version: "1.0.0", git: "https://github.com/Urigo/angular-meteor.git", documentation: null }); diff --git a/packages/angular-with-blaze/.versions b/packages/angular-with-blaze/.versions index e8c10f918..39ddf041f 100644 --- a/packages/angular-with-blaze/.versions +++ b/packages/angular-with-blaze/.versions @@ -1,6 +1,6 @@ angular-blaze-templates-compiler@0.0.1 -angular-meteor-data@0.2.0 -angular-with-blaze@1.3.6 +angular-meteor-data@0.3.0-beta.1 +angular-with-blaze@1.3.7-beta.1 angular:angular@1.4.8 babel-compiler@5.8.24_1 babel-runtime@0.1.4 diff --git a/packages/angular-with-blaze/package.js b/packages/angular-with-blaze/package.js index 0e5a2d844..9482dc7e5 100644 --- a/packages/angular-with-blaze/package.js +++ b/packages/angular-with-blaze/package.js @@ -1,7 +1,7 @@ Package.describe({ name: "angular-with-blaze", summary: "Everything you need to use both AngularJS and Blaze templates in your Meteor app", - version: "1.3.6", + version: "1.3.7-beta.1", git: "https://github.com/Urigo/angular-meteor.git", documentation: "../../README.md" }); @@ -12,7 +12,7 @@ Package.onUse(function (api) { api.imply([ 'blaze-html-templates', - 'angular-meteor-data@0.2.0', + 'angular-meteor-data@0.3.0-beta.1', 'angular-blaze-templates-compiler@0.0.1' ]); }); diff --git a/packages/angular/.versions b/packages/angular/.versions index f61b01fc9..f6f3af2b6 100644 --- a/packages/angular/.versions +++ b/packages/angular/.versions @@ -1,6 +1,6 @@ -angular@1.3.6 -angular-meteor-data@0.2.0 -angular-templates@0.0.3 +angular@1.3.7-beta.1_1 +angular-meteor-data@0.3.0-beta.1 +angular-templates@1.0.0 angular:angular@1.4.8 babel-compiler@5.8.24_1 babel-runtime@0.1.4 diff --git a/packages/angular/package.js b/packages/angular/package.js index 8cfaf3149..2bd94fadc 100644 --- a/packages/angular/package.js +++ b/packages/angular/package.js @@ -1,7 +1,7 @@ Package.describe({ name: "angular", summary: "Everything you need to use AngularJS in your Meteor app", - version: "1.3.6", + version: "1.3.7-beta.1_1", git: "https://github.com/Urigo/angular-meteor.git", documentation: "../../README.md" }); @@ -10,8 +10,8 @@ Package.onUse(function (api) { api.versionsFrom('METEOR@1.2.0.1'); api.imply([ - 'angular-meteor-data@0.2.0', - 'angular-templates@0.0.3', + 'angular-meteor-data@0.3.0-beta.1', + 'angular-templates@1.0.0', 'pbastowski:angular-babel@1.0.9' ]); });