Skip to content
This repository
Browse code

added Parse.com's JS library to the list of available JS libs

  • Loading branch information...
commit eebf21d16ac9296175402757db717dc6dc340095 1 parent 8892d27
Paul Jensen authored January 23, 2013
1  client/static/javascripts/parse-1.1.16.min.js
... ...
@@ -0,0 +1 @@
  1
+(function(a){a.Parse=a.Parse||{},a.Parse.VERSION="js1.1.16"})(this),function(){function A(a,b,c){if(a===b)return a!==0||1/a==1/b;if(a==null||b==null)return a===b;a._chain&&(a=a._wrapped),b._chain&&(b=b._wrapped);if(a.isEqual&&w.isFunction(a.isEqual))return a.isEqual(b);if(b.isEqual&&w.isFunction(b.isEqual))return b.isEqual(a);var d=i.call(a);if(d!=i.call(b))return!1;switch(d){case"[object String]":return a==String(b);case"[object Number]":return a!=+a?b!=+b:a==0?1/a==1/b:a==+b;case"[object Date]":case"[object Boolean]":return+a==+b;case"[object RegExp]":return a.source==b.source&&a.global==b.global&&a.multiline==b.multiline&&a.ignoreCase==b.ignoreCase}if(typeof a!="object"||typeof b!="object")return!1;var e=c.length;while(e--)if(c[e]==a)return!0;c.push(a);var f=0,g=!0;if(d=="[object Array]"){f=a.length,g=f==b.length;if(g)while(f--)if(!(g=f in a==f in b&&A(a[f],b[f],c)))break}else{if("constructor"in a!="constructor"in b||a.constructor!=b.constructor)return!1;for(var h in a)if(w.has(a,h)){f++;if(!(g=w.has(b,h)&&A(a[h],b[h],c)))break}if(g){for(h in b)if(w.has(b,h)&&!(f--))break;g=!f}}return c.pop(),g}var a=this,b=a._,c={},d=Array.prototype,e=Object.prototype,f=Function.prototype,g=d.slice,h=d.unshift,i=e.toString,j=e.hasOwnProperty,k=d.forEach,l=d.map,m=d.reduce,n=d.reduceRight,o=d.filter,p=d.every,q=d.some,r=d.indexOf,s=d.lastIndexOf,t=Array.isArray,u=Object.keys,v=f.bind,w=function(a){return new I(a)};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=w),exports._=w):a._=w,w.VERSION="1.3.3";var x=w.each=w.forEach=function(a,b,d){if(a==null)return;if(k&&a.forEach===k)a.forEach(b,d);else if(a.length===+a.length){for(var e=0,f=a.length;e<f;e++)if(e in a&&b.call(d,a[e],e,a)===c)return}else for(var g in a)if(w.has(a,g)&&b.call(d,a[g],g,a)===c)return};w.map=w.collect=function(a,b,c){var d=[];return a==null?d:l&&a.map===l?a.map(b,c):(x(a,function(a,e,f){d[d.length]=b.call(c,a,e,f)}),a.length===+a.length&&(d.length=a.length),d)},w.reduce=w.foldl=w.inject=function(a,b,c,d){var e=arguments.length>2;a==null&&(a=[]);if(m&&a.reduce===m)return d&&(b=w.bind(b,d)),e?a.reduce(b,c):a.reduce(b);x(a,function(a,f,g){e?c=b.call(d,c,a,f,g):(c=a,e=!0)});if(!e)throw new TypeError("Reduce of empty array with no initial value");return c},w.reduceRight=w.foldr=function(a,b,c,d){var e=arguments.length>2;a==null&&(a=[]);if(n&&a.reduceRight===n)return d&&(b=w.bind(b,d)),e?a.reduceRight(b,c):a.reduceRight(b);var f=w.toArray(a).reverse();return d&&!e&&(b=w.bind(b,d)),e?w.reduce(f,b,c,d):w.reduce(f,b)},w.find=w.detect=function(a,b,c){var d;return y(a,function(a,e,f){if(b.call(c,a,e,f))return d=a,!0}),d},w.filter=w.select=function(a,b,c){var d=[];return a==null?d:o&&a.filter===o?a.filter(b,c):(x(a,function(a,e,f){b.call(c,a,e,f)&&(d[d.length]=a)}),d)},w.reject=function(a,b,c){var d=[];return a==null?d:(x(a,function(a,e,f){b.call(c,a,e,f)||(d[d.length]=a)}),d)},w.every=w.all=function(a,b,d){var e=!0;return a==null?e:p&&a.every===p?a.every(b,d):(x(a,function(a,f,g){if(!(e=e&&b.call(d,a,f,g)))return c}),!!e)};var y=w.some=w.any=function(a,b,d){b||(b=w.identity);var e=!1;return a==null?e:q&&a.some===q?a.some(b,d):(x(a,function(a,f,g){if(e||(e=b.call(d,a,f,g)))return c}),!!e)};w.include=w.contains=function(a,b){var c=!1;return a==null?c:r&&a.indexOf===r?a.indexOf(b)!=-1:(c=y(a,function(a){return a===b}),c)},w.invoke=function(a,b){var c=g.call(arguments,2);return w.map(a,function(a){return(w.isFunction(b)?b||a:a[b]).apply(a,c)})},w.pluck=function(a,b){return w.map(a,function(a){return a[b]})},w.max=function(a,b,c){if(!b&&w.isArray(a)&&a[0]===+a[0])return Math.max.apply(Math,a);if(!b&&w.isEmpty(a))return-Infinity;var d={computed:-Infinity};return x(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;g>=d.computed&&(d={value:a,computed:g})}),d.value},w.min=function(a,b,c){if(!b&&w.isArray(a)&&a[0]===+a[0])return Math.min.apply(Math,a);if(!b&&w.isEmpty(a))return Infinity;var d={computed:Infinity};return x(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;g<d.computed&&(d={value:a,computed:g})}),d.value},w.shuffle=function(a){var b=[],c;return x(a,function(a,d,e){c=Math.floor(Math.random()*(d+1)),b[d]=b[c],b[c]=a}),b},w.sortBy=function(a,b,c){var d=w.isFunction(b)?b:function(a){return a[b]};return w.pluck(w.map(a,function(a,b,e){return{value:a,criteria:d.call(c,a,b,e)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;return c===void 0?1:d===void 0?-1:c<d?-1:c>d?1:0}),"value")},w.groupBy=function(a,b){var c={},d=w.isFunction(b)?b:function(a){return a[b]};return x(a,function(a,b){var e=d(a,b);(c[e]||(c[e]=[])).push(a)}),c},w.sortedIndex=function(a,b,c){c||(c=w.identity);var d=0,e=a.length;while(d<e){var f=d+e>>1;c(a[f])<c(b)?d=f+1:e=f}return d},w.toArray=function(a){return a?w.isArray(a)?g.call(a):w.isArguments(a)?g.call(a):a.toArray&&w.isFunction(a.toArray)?a.toArray():w.values(a):[]},w.size=function(a){return w.isArray(a)?a.length:w.keys(a).length},w.first=w.head=w.take=function(a,b,c){return b!=null&&!c?g.call(a,0,b):a[0]},w.initial=function(a,b,c){return g.call(a,0,a.length-(b==null||c?1:b))},w.last=function(a,b,c){return b!=null&&!c?g.call(a,Math.max(a.length-b,0)):a[a.length-1]},w.rest=w.tail=function(a,b,c){return g.call(a,b==null||c?1:b)},w.compact=function(a){return w.filter(a,function(a){return!!a})},w.flatten=function(a,b){return w.reduce(a,function(a,c){return w.isArray(c)?a.concat(b?c:w.flatten(c)):(a[a.length]=c,a)},[])},w.without=function(a){return w.difference(a,g.call(arguments,1))},w.uniq=w.unique=function(a,b,c){var d=c?w.map(a,c):a,e=[];return a.length<3&&(b=!0),w.reduce(d,function(c,d,f){if(b?w.last(c)!==d||!c.length:!w.include(c,d))c.push(d),e.push(a[f]);return c},[]),e},w.union=function(){return w.uniq(w.flatten(arguments,!0))},w.intersection=w.intersect=function(a){var b=g.call(arguments,1);return w.filter(w.uniq(a),function(a){return w.every(b,function(b){return w.indexOf(b,a)>=0})})},w.difference=function(a){var b=w.flatten(g.call(arguments,1),!0);return w.filter(a,function(a){return!w.include(b,a)})},w.zip=function(){var a=g.call(arguments),b=w.max(w.pluck(a,"length")),c=new Array(b);for(var d=0;d<b;d++)c[d]=w.pluck(a,""+d);return c},w.indexOf=function(a,b,c){if(a==null)return-1;var d,e;if(c)return d=w.sortedIndex(a,b),a[d]===b?d:-1;if(r&&a.indexOf===r)return a.indexOf(b);for(d=0,e=a.length;d<e;d++)if(d in a&&a[d]===b)return d;return-1},w.lastIndexOf=function(a,b){if(a==null)return-1;if(s&&a.lastIndexOf===s)return a.lastIndexOf(b);var c=a.length;while(c--)if(c in a&&a[c]===b)return c;return-1},w.range=function(a,b,c){arguments.length<=1&&(b=a||0,a=0),c=arguments[2]||1;var d=Math.max(Math.ceil((b-a)/c),0),e=0,f=new Array(d);while(e<d)f[e++]=a,a+=c;return f};var z=function(){};w.bind=function(a,b){var c,d;if(a.bind===v&&v)return v.apply(a,g.call(arguments,1));if(!w.isFunction(a))throw new TypeError;return d=g.call(arguments,2),c=function(){if(this instanceof c){z.prototype=a.prototype;var e=new z,f=a.apply(e,d.concat(g.call(arguments)));return Object(f)===f?f:e}return a.apply(b,d.concat(g.call(arguments)))}},w.bindAll=function(a){var b=g.call(arguments,1);return b.length==0&&(b=w.functions(a)),x(b,function(b){a[b]=w.bind(a[b],a)}),a},w.memoize=function(a,b){var c={};return b||(b=w.identity),function(){var d=b.apply(this,arguments);return w.has(c,d)?c[d]:c[d]=a.apply(this,arguments)}},w.delay=function(a,b){var c=g.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},w.defer=function(a){return w.delay.apply(w,[a,1].concat(g.call(arguments,1)))},w.throttle=function(a,b){var c,d,e,f,g,h,i=w.debounce(function(){g=f=!1},b);return function(){c=this,d=arguments;var j=function(){e=null,g&&a.apply(c,d),i()};return e||(e=setTimeout(j,b)),f?g=!0:h=a.apply(c,d),i(),f=!0,h}},w.debounce=function(a,b,c){var d;return function(){var e=this,f=arguments,g=function(){d=null,c||a.apply(e,f)};c&&!d&&a.apply(e,f),clearTimeout(d),d=setTimeout(g,b)}},w.once=function(a){var b=!1,c;return function(){return b?c:(b=!0,c=a.apply(this,arguments))}},w.wrap=function(a,b){return function(){var c=[a].concat(g.call(arguments,0));return b.apply(this,c)}},w.compose=function(){var a=arguments;return function(){var b=arguments;for(var c=a.length-1;c>=0;c--)b=[a[c].apply(this,b)];return b[0]}},w.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}},w.keys=u||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[];for(var c in a)w.has(a,c)&&(b[b.length]=c);return b},w.values=function(a){return w.map(a,w.identity)},w.functions=w.methods=function(a){var b=[];for(var c in a)w.isFunction(a[c])&&b.push(c);return b.sort()},w.extend=function(a){return x(g.call(arguments,1),function(b){for(var c in b)a[c]=b[c]}),a},w.pick=function(a){var b={};return x(w.flatten(g.call(arguments,1)),function(c){c in a&&(b[c]=a[c])}),b},w.defaults=function(a){return x(g.call(arguments,1),function(b){for(var c in b)a[c]==null&&(a[c]=b[c])}),a},w.clone=function(a){return w.isObject(a)?w.isArray(a)?a.slice():w.extend({},a):a},w.tap=function(a,b){return b(a),a},w.isEqual=function(a,b){return A(a,b,[])},w.isEmpty=function(a){if(a==null)return!0;if(w.isArray(a)||w.isString(a))return a.length===0;for(var b in a)if(w.has(a,b))return!1;return!0},w.isElement=function(a){return!!a&&a.nodeType==1},w.isArray=t||function(a){return i.call(a)=="[object Array]"},w.isObject=function(a){return a===Object(a)},w.isArguments=function(a){return i.call(a)=="[object Arguments]"},w.isArguments(arguments)||(w.isArguments=function(a){return!!a&&!!w.has(a,"callee")}),w.isFunction=function(a){return i.call(a)=="[object Function]"},w.isString=function(a){return i.call(a)=="[object String]"},w.isNumber=function(a){return i.call(a)=="[object Number]"},w.isFinite=function(a){return w.isNumber(a)&&isFinite(a)},w.isNaN=function(a){return a!==a},w.isBoolean=function(a){return a===!0||a===!1||i.call(a)=="[object Boolean]"},w.isDate=function(a){return i.call(a)=="[object Date]"},w.isRegExp=function(a){return i.call(a)=="[object RegExp]"},w.isNull=function(a){return a===null},w.isUndefined=function(a){return a===void 0},w.has=function(a,b){return j.call(a,b)},w.noConflict=function(){return a._=b,this},w.identity=function(a){return a},w.times=function(a,b,c){for(var d=0;d<a;d++)b.call(c,d)},w.escape=function(a){return(""+a).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")},w.result=function(a,b){if(a==null)return null;var c=a[b];return w.isFunction(c)?c.call(a):c},w.mixin=function(a){x(w.functions(a),function(b){K(b,w[b]=a[b])})};var B=0;w.uniqueId=function(a){var b=B++;return a?a+b:b},w.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var C=/.^/,D={"\\":"\\","'":"'",r:"\r",n:"\n",t:"\t",u2028:"\u2028",u2029:"\u2029"};for(var E in D)D[D[E]]=E;var F=/\\|'|\r|\n|\t|\u2028|\u2029/g,G=/\\(\\|'|r|n|t|u2028|u2029)/g,H=function(a){return a.replace(G,function(a,b){return D[b]})};w.template=function(a,b,c){c=w.defaults(c||{},w.templateSettings);var d="__p+='"+a.replace(F,function(a){return"\\"+D[a]}).replace(c.escape||C,function(a,b){return"'+\n_.escape("+H(b)+")+\n'"}).replace(c.interpolate||C,function(a,b){return"'+\n("+H(b)+")+\n'"}).replace(c.evaluate||C,function(a,b){return"';\n"+H(b)+"\n;__p+='"})+"';\n";c.variable||(d="with(obj||{}){\n"+d+"}\n"),d="var __p='';var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n"+d+"return __p;\n";var e=new Function(c.variable||"obj","_",d);if(b)return e(b,w);var f=function(a){return e.call(this,a,w)};return f.source="function("+(c.variable||"obj")+"){\n"+d+"}",f},w.chain=function(a){return w(a).chain()};var I=function(a){this._wrapped=a};w.prototype=I.prototype;var J=function(a,b){return b?w(a).chain():a},K=function(a,b){I.prototype[a]=function(){var a=g.call(arguments);return h.call(a,this._wrapped),J(b.apply(w,a),this._chain)}};w.mixin(w),x(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=d[a];I.prototype[a]=function(){var c=this._wrapped;b.apply(c,arguments);var d=c.length;return(a=="shift"||a=="splice")&&d===0&&delete c[0],J(c,this._chain)}}),x(["concat","join","slice"],function(a){var b=d[a];I.prototype[a]=function(){return J(b.apply(this._wrapped,arguments),this._chain)}}),I.prototype.chain=function(){return this._chain=!0,this},I.prototype.value=function(){return this._wrapped}}.call(this),function(a){a.Parse=a.Parse||{};var b=a.Parse;typeof exports!="undefined"&&exports._?(b._=exports._.noConflict(),b.localStorage=require("localStorage"),b.XMLHttpRequest=require("xmlhttprequest").XMLHttpRequest,exports.Parse=b):(b._=_.noConflict(),typeof localStorage!="undefined"&&(b.localStorage=localStorage),typeof XMLHttpRequest!="undefined"&&(b.XMLHttpRequest=XMLHttpRequest)),typeof $!="undefined"&&(b.$=$);var c=function(){},d=function(a,d,e){var f;return d&&d.hasOwnProperty("constructor")?f=d.constructor:f=function(){a.apply(this,arguments)},b._.extend(f,a),c.prototype=a.prototype,f.prototype=new c,d&&b._.extend(f.prototype,d),e&&b._.extend(f,e),f.prototype.constructor=f,f.__super__=a.prototype,f};b.serverURL="https://api.parse.com",b.initialize=function(a,c){b._initialize(a,c)},b._initialize=function(a,c,d){b.applicationId=a,b.javaScriptKey=c,b.masterKey=d,b._useMasterKey=!1},b._getParsePath=function(a){if(!b.applicationId)throw"You need to call Parse.initialize before using Parse.";a||(a="");if(!b._.isString(a))throw"Tried to get a localStorage path that wasn't a String.";return a[0]==="/"&&(a=a.substring(1)),"Parse/"+b.applicationId+"/"+a},b._installationId=null,b._getInstallationId=function(){if(b._installationId)return b._installationId;var a=b._getParsePath("installationId");b._installationId=b.localStorage.getItem(a);if(!b._installationId||b._installationId===""){var c=function(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)};b._installationId=c()+c()+"-"+c()+"-"+c()+"-"+c()+"-"+c()+c()+c(),b.localStorage.setItem(a,b._installationId)}return b._installationId},b._parseDate=function(a){var b=new RegExp("^([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2})T([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})(.([0-9]+))?Z$"),c=b.exec(a);if(!c)return null;var d=c[1]||0,e=(c[2]||1)-1,f=c[3]||0,g=c[4]||0,h=c[5]||0,i=c[6]||0,j=c[8]||0;return new Date(Date.UTC(d,e,f,g,h,i,j))},b._ajaxIE8=function(a,b,c,d,e){var f=new XDomainRequest;f.onload=function(){var a;try{a=JSON.parse(f.responseText)}catch(b){e&&e(f)}a&&d&&d(a,f)},f.onerror=f.ontimeout=function(){e(f)},f.onprogress=function(){},f.open(a,b),f.send(c)},b._ajax=function(a,c,d,e,f){if(typeof XDomainRequest!="undefined")return b._ajaxIE8(a,c,d,e,f);var g=!1,h=new b.XMLHttpRequest;h.onreadystatechange=function(){if(h.readyState===4){if(g)return;g=!0;if(h.status>=200&&h.status<300){var a;try{a=JSON.parse(h.responseText)}catch(b){f&&f(h)}a&&e&&e(a,h)}else f&&f(h)}},h.open(a,c,!0),h.setRequestHeader("Content-Type","text/plain"),h.send(d)},b._extend=function(a,b){var c=d(this,a,b);return c.extend=this.extend,c},b._request=function(a,c,d,e,f,g){if(!b.applicationId)throw"You must specify your applicationId using Parse.initialize";if(!b.javaScriptKey&&!b.masterKey)throw"You must specify a key using Parse.initialize";if(a!=="classes"&&a!=="push"&&a!=="users"&&a!=="login"&&a!=="functions"&&a!=="requestPasswordReset")throw"First argument must be one of classes, users, functions, or login, not '"+a+"'.";var h=b.serverURL;h.charAt(h.length-1)!=="/"&&(h+="/"),h+="1/"+a,c&&(h+="/"+c),d&&(h+="/"+d),f=b._.clone(f||{}),e!=="POST"&&(f._method=e,e="POST"),f._ApplicationId=b.applicationId,b._useMasterKey?f._MasterKey=b.masterKey:f._JavaScriptKey=b.javaScriptKey,f._ClientVersion=b.VERSION,f._InstallationId=b._getInstallationId();var i=b.User.current();i&&i._sessionToken&&(f._SessionToken=i._sessionToken);var j=JSON.stringify(f);b._ajax(e,h,j,g.success,g.error)},b._getValue=function(a,c){return!a||!a[c]?null:b._.isFunction(a[c])?a[c]():a[c]},b._encode=function(a,c,d){var e=b._;if(a instanceof b.Object){if(d)throw"Parse.Objects not allowed here";if(!c||e.include(c,a)||!a._hasData)return a._toPointer();if(!a.dirty())return c=c.concat(a),b._encode(a._toFullJSON(c),c,d);throw"Can't fully embed a dirty object"}if(a instanceof b.ACL)return a.toJSON();if(e.isDate(a))return{__type:"Date",iso:a.toJSON()};if(a instanceof b.GeoPoint)return a.toJSON();if(e.isArray(a))return e.map(a,function(a){return b._encode(a,c,d)});if(e.isRegExp(a))return a.source;if(a instanceof b.Relation)return a.toJSON();if(a instanceof b.Op)return a.toJSON();if(a instanceof Object){var f={};return b._each(a,function(a,e){f[e]=b._encode(a,c,d)}),f}return a},b._decode=function(a,c){var d=b._;if(!d.isObject(c))return c;if(d.isArray(c))return b._each(c,function(a,d){c[d]=b._decode(d,a)}),c;if(c instanceof b.Object)return c;if(c instanceof b.Op)return c;if(c.__op)return b.Op._decode(c);if(c.__type==="Pointer"){var e=b.Object._create(c.className);return e._finishFetch({objectId:c.objectId},!1),e}if(c.__type==="Object"){var f=c.className;delete c.__type,delete c.className;var g=b.Object._create(f);return g._finishFetch(c,!0),g}if(c.__type==="Date")return b._parseDate(c.iso);if(c.__type==="GeoPoint")return new b.GeoPoint({latitude:c.latitude,longitude:c.longitude});if(a==="ACL")return c instanceof b.ACL?c:new b.ACL(c);if(c.__type==="Relation"){var h=new b.Relation(null,a);return h.targetClassName=c.className,h}return b._each(c,function(a,d){c[d]=b._decode(d,a)}),c},b._each=function(a,c){var d=b._;d.isObject(a)?d.each(d.keys(a),function(b){c(a[b],b)}):d.each(a,c)},b._isNullOrUndefined=function(a){return b._.isNull(a)||b._.isUndefined(a)}}(this),function(a){a.Parse=a.Parse||{};var b=a.Parse,c=b._;b.Error=function(a,b){this.code=a,this.message=b},c.extend(b.Error,{OTHER_CAUSE:-1,INTERNAL_SERVER_ERROR:1,CONNECTION_FAILED:100,OBJECT_NOT_FOUND:101,INVALID_QUERY:102,INVALID_CLASS_NAME:103,MISSING_OBJECT_ID:104,INVALID_KEY_NAME:105,INVALID_POINTER:106,INVALID_JSON:107,COMMAND_UNAVAILABLE:108,NOT_INITIALIZED:109,INCORRECT_TYPE:111,INVALID_CHANNEL_NAME:112,PUSH_MISCONFIGURED:115,OBJECT_TOO_LARGE:116,OPERATION_FORBIDDEN:119,CACHE_MISS:120,INVALID_NESTED_KEY:121,INVALID_FILE_NAME:122,INVALID_ACL:123,TIMEOUT:124,INVALID_EMAIL_ADDRESS:125,DUPLICATE_VALUE:137,INVALID_ROLE_NAME:139,EXCEEDED_QUOTA:140,SCRIPT_FAILED:141,VALIDATION_ERROR:142,USERNAME_MISSING:200,PASSWORD_MISSING:201,USERNAME_TAKEN:202,EMAIL_TAKEN:203,EMAIL_MISSING:204,EMAIL_NOT_FOUND:205,SESSION_MISSING:206,MUST_CREATE_USER_THROUGH_SIGNUP:207,ACCOUNT_ALREADY_LINKED:208,LINKED_ID_MISSING:250,INVALID_LINKED_SESSION:251,UNSUPPORTED_SERVICE:252})}(this),function(){var a=this,b=a.Parse||(a.Parse={}),c=/\s+/,d=Array.prototype.slice;b.Events={on:function(a,b,d){var e,f,g,h,i;if(!b)return this;a=a.split(c),e=this._callbacks||(this._callbacks={}),f=a.shift();while(f)i=e[f],g=i?i.tail:{},g.next=h={},g.context=d,g.callback=b,e[f]={tail:h,next:i?i.next:g},f=a.shift();return this},off:function(a,b,d){var e,f,g,h,i,j;if(!(f=this._callbacks))return;if(!(a||b||d))return delete this._callbacks,this;a=a?a.split(c):_.keys(f),e=a.shift();while(e){g=f[e],delete f[e];if(!g||!b&&!d)continue;h=g.tail,g=g.next;while(g!==h)i=g.callback,j=g.context,(b&&i!==b||d&&j!==d)&&this.on(e,i,j),g=g.next;e=a.shift()}return this},trigger:function(a){var b,e,f,g,h,i,j;if(!(f=this._callbacks))return this;i=f.all,a=a.split(c),j=d.call(arguments,1),b=a.shift();while(b){e=f[b];if(e){g=e.tail;while((e=e.next)!==g)e.callback.apply(e.context||this,j)}e=i;if(e){g=e.tail,h=[b].concat(j);while((e=e.next)!==g)e.callback.apply(e.context||this,h)}b=a.shift()}return this}},b.Events.bind=b.Events.on,b.Events.unbind=b.Events.off}.call(this),function(a){a.Parse=a.Parse||{};var b=a.Parse,c=b._;b.GeoPoint=function(a,d){c.isArray(a)?(b.GeoPoint._validate(a[0],a[1]),this.latitude=a[0],this.longitude=a[1]):c.isObject(a)?(b.GeoPoint._validate(a.latitude,a.longitude),this.latitude=a.latitude,this.longitude=a.longitude):c.isNumber(a)&&c.isNumber(d)?(b.GeoPoint._validate(a,d),this.latitude=a,this.longitude=d):(this.latitude=0,this.longitude=0);var e=this;this.__defineGetter__&&this.__defineSetter__&&(this._latitude=this.latitude,this._longitude=this.longitude,this.__defineGetter__("latitude",function(){return e._latitude}),this.__defineGetter__("longitude",function(){return e._longitude}),this.__defineSetter__("latitude",function(a){b.GeoPoint._validate(a,e.longitude),e._latitude=a}),this.__defineSetter__("longitude",function(a){b.GeoPoint._validate(e.latitude,a),e._longitude=a}))},b.GeoPoint._validate=function(a,b){if(a<-90)throw"Parse.GeoPoint latitude "+a+" < -90.0.";if(a>90)throw"Parse.GeoPoint latitude "+a+" > 90.0.";if(b<-180)throw"Parse.GeoPoint longitude "+b+" < -180.0.";if(b>180)throw"Parse.GeoPoint longitude "+b+" > 180.0."},b.GeoPoint.current=function(a){var c=function(c){a.success&&a.success(new b.GeoPoint({latitude:c.coords.latitude,longitude:c.coords.longitude}))},d=function(b){a.error&&a.error(b)};navigator.geolocation.getCurrentPosition(c,d)},b.GeoPoint.prototype={toJSON:function(){return b.GeoPoint._validate(this.latitude,this.longitude),{__type:"GeoPoint",latitude:this.latitude,longitude:this.longitude}},radiansTo:function(a){var b=Math.PI/180,c=this.latitude*b,d=this.longitude*b,e=a.latitude*b,f=a.longitude*b,g=c-e,h=d-f,i=Math.sin(g/2),j=Math.sin(h/2),k=i*i+Math.cos(c)*Math.cos(e)*j*j;return k=Math.min(1,k),2*Math.asin(Math.sqrt(k))},kilometersTo:function(a){return this.radiansTo(a)*6371},milesTo:function(a){return this.radiansTo(a)*3958.8}}}(this),function(a){a.Parse=a.Parse||{};var b=a.Parse,c=b._,d="*";b.ACL=function(a){var d=this;d.permissionsById={};if(c.isObject(a))if(a instanceof b.User)d.setReadAccess(a,!0),d.setWriteAccess(a,!0);else{if(c.isFunction(a))throw"Parse.ACL() called with a function.  Did you forget ()?";b._each(a,function(a,e){if(!c.isString(e))throw"Tried to create an ACL with an invalid userId.";d.permissionsById[e]={},b._each(a,function(a,b){if(b!=="read"&&b!=="write")throw"Tried to create an ACL with an invalid permission type.";if(!c.isBoolean(a))throw"Tried to create an ACL with an invalid permission value.";d.permissionsById[e][b]=a})})}},b.ACL.prototype.toJSON=function(){return c.clone(this.permissionsById)},b.ACL.prototype._setAccess=function(a,d,e){d instanceof b.User?d=d.id:d instanceof b.Role&&(d="role:"+d.getName());if(!c.isString(d))throw"userId must be a string.";if(!c.isBoolean(e))throw"allowed must be either true or false.";var f=this.permissionsById[d];if(!f){if(!e)return;f={},this.permissionsById[d]=f}e?this.permissionsById[d][a]=!0:(delete f[a],c.isEmpty(f)&&delete f[d])},b.ACL.prototype._getAccess=function(a,c){c instanceof b.User?c=c.id:c instanceof b.Role&&(c="role:"+c.getName());var d=this.permissionsById[c];return d?d[a]?!0:!1:!1},b.ACL.prototype.setReadAccess=function(a,b){this._setAccess("read",a,b)},b.ACL.prototype.getReadAccess=function(a){return this._getAccess("read",a)},b.ACL.prototype.setWriteAccess=function(a,b){this._setAccess("write",a,b)},b.ACL.prototype.getWriteAccess=function(a){return this._getAccess("write",a)},b.ACL.prototype.setPublicReadAccess=function(a){this.setReadAccess(d,a)},b.ACL.prototype.getPublicReadAccess=function(){return this.getReadAccess(d)},b.ACL.prototype.setPublicWriteAccess=function(a){this.setWriteAccess(d,a)},b.ACL.prototype.getPublicWriteAccess=function(){return this.getWriteAccess(d)},b.ACL.prototype.getRoleReadAccess=function(a){a instanceof b.Role&&(a=a.getName());if(c.isString(a))return this.getReadAccess("role:"+a);throw"role must be a Parse.Role or a String"},b.ACL.prototype.getRoleWriteAccess=function(a){a instanceof b.Role&&(a=a.getName());if(c.isString(a))return this.getWriteAccess("role:"+a);throw"role must be a Parse.Role or a String"},b.ACL.prototype.setRoleReadAccess=function(a,d){a instanceof b.Role&&(a=a.getName());if(c.isString(a)){this.setReadAccess("role:"+a,d);return}throw"role must be a Parse.Role or a String"},b.ACL.prototype.setRoleWriteAccess=function(a,d){a instanceof b.Role&&(a=a.getName());if(c.isString(a)){this.setWriteAccess("role:"+a,d);return}throw"role must be a Parse.Role or a String"}}(this),function(a){a.Parse=a.Parse||{};var b=a.Parse,c=b._;b.Op=function(){this._initialize.apply(this,arguments)},b.Op.prototype={_initialize:function(){}},c.extend(b.Op,{_extend:b._extend,_opDecoderMap:{},_registerDecoder:function(a,c){b.Op._opDecoderMap[a]=c},_decode:function(a){var c=b.Op._opDecoderMap[a.__op];return c?c(a):undefined}}),b.Op._registerDecoder("Batch",function(a){var d=null;return c.each(a.ops,function(a){a=b.Op._decode(a),d=a._mergeWithPrevious(d)}),d}),b.Op.Set=b.Op._extend({_initialize:function(a){this._value=a},value:function(){return this._value},toJSON:function(){return b._encode(this.value())},_mergeWithPrevious:function(a){return this},_estimate:function(a){return this.value()}}),b.Op._UNSET={},b.Op.Unset=b.Op._extend({toJSON:function(){return{__op:"Delete"}},_mergeWithPrevious:function(a){return this},_estimate:function(a){return b.Op._UNSET}}),b.Op._registerDecoder("Delete",function(a){return new b.Op.Unset}),b.Op.Increment=b.Op._extend({_initialize:function(a){this._amount=a},amount:function(){return this._amount},toJSON:function(){return{__op:"Increment",amount:this._amount}},_mergeWithPrevious:function(a){if(!a)return this;if(a instanceof b.Op.Unset)return new b.Op.Set(this.amount());if(a instanceof b.Op.Set)return new b.Op.Set(a.value()+this.amount());if(a instanceof b.Op.Increment)return new b.Op.Increment(this.amount()+a.amount());throw"Op is invalid after previous op."},_estimate:function(a){return a?a+this.amount():this.amount()}}),b.Op._registerDecoder("Increment",function(a){return new b.Op.Increment(a.amount)}),b.Op.Add=b.Op._extend({_initialize:function(a){this._objects=a},objects:function(){return this._objects},toJSON:function(){return{__op:"Add",objects:b._encode(this.objects())}},_mergeWithPrevious:function(a){if(!a)return this;if(a instanceof b.Op.Unset)return new b.Op.Set(this.objects());if(a instanceof b.Op.Set)return new b.Op.Set(this._estimate(a.value()));if(a instanceof b.Op.Add)return new b.Op.Add(a.objects().concat(this.objects()));throw"Op is invalid after previous op."},_estimate:function(a){return a?a.concat(this.objects()):c.clone(this.objects())}}),b.Op._registerDecoder("Add",function(a){return new b.Op.Add(b._decode(undefined,a.objects))}),b.Op.AddUnique=b.Op._extend({_initialize:function(a){this._objects=c.uniq(a)},objects:function(){return this._objects},toJSON:function(){return{__op:"AddUnique",objects:b._encode(this.objects())}},_mergeWithPrevious:function(a){if(!a)return this;if(a instanceof b.Op.Unset)return new b.Op.Set(this.objects());if(a instanceof b.Op.Set)return new b.Op.Set(this._estimate(a.value()));if(a instanceof b.Op.AddUnique)return new b.Op.AddUnique(c.union(a.objects(),this.objects()));throw"Op is invalid after previous op."},_estimate:function(a){return a?a.concat(c.difference(this.objects(),a)):c.clone(this.objects())}}),b.Op._registerDecoder("AddUnique",function(a){return new b.Op.AddUnique(b._decode(undefined,a.objects))}),b.Op.Remove=b.Op._extend({_initialize:function(a){this._objects=c.uniq(a)},objects:function(){return this._objects},toJSON:function(){return{__op:"Remove",objects:b._encode(this.objects())}},_mergeWithPrevious:function(a){if(!a)return this;if(a instanceof b.Op.Unset)return a;if(a instanceof b.Op.Set)return new b.Op.Set(this._estimate(a.value()));if(a instanceof b.Op.Remove)return new b.Op.Remove(c.union(a.objects(),this.objects()));throw"Op is invalid after previous op."},_estimate:function(a){if(!a)return[];var d=c.difference(a,this.objects());return c.each(this.objects(),function(a){a instanceof b.Object&&a.id&&(d=c.reject(d,function(c){return c instanceof b.Object&&c.id===a.id}))}),d}}),b.Op._registerDecoder("Remove",function(a){return new b.Op.Remove(b._decode(undefined,a.objects))}),b.Op.Relation=b.Op._extend({_initialize:function(a,d){this._targetClassName=null;var e=this,f=function(a){if(a instanceof b.Object){if(!a.id)throw"You can't add an unsaved Parse.Object to a relation.";e._targetClassName||(e._targetClassName=a.className);if(e._targetClassName!==a.className)throw"Tried to create a Parse.Relation with 2 different types: "+e._targetClassName+" and "+a.className+".";return a.id}return a};this.relationsToAdd=c.uniq(c.map(a,f)),this.relationsToRemove=c.uniq(c.map(d,f))},added:function(){var a=this;return c.map(this.relationsToAdd,function(c){var d=b.Object._create(a._targetClassName);return d.id=c,d})},removed:function(){var a=this;return c.map(this.relationsToRemove,function(c){var d=b.Object._create(a._targetClassName);return d.id=c,d})},toJSON:function(){var a=null,b=null,d=this,e=function(a){return{__type:"Pointer",className:d._targetClassName,objectId:a}},f=null;return this.relationsToAdd.length>0&&(f=c.map(this.relationsToAdd,e),a={__op:"AddRelation",objects:f}),this.relationsToRemove.length>0&&(f=c.map(this.relationsToRemove,e),b={__op:"RemoveRelation",objects:f}),a&&b?{__op:"Batch",ops:[a,b]}:a||b||{}},_mergeWithPrevious:function(a){if(!a)return this;if(a instanceof b.Op.Unset)throw"You can't modify a relation after deleting it.";if(a instanceof b.Op.Relation){if(a._targetClassName&&a._targetClassName!==this._targetClassName)throw"Related object must be of class "+a._targetClassName+", but "+this._targetClassName+" was passed in.";var d=c.union(c.difference(a.relationsToAdd,this.relationsToRemove),this.relationsToAdd),e=c.union(c.difference(a.relationsToRemove,this.relationsToAdd),this.relationsToRemove),f=new b.Op.Relation(d,e);return f._targetClassName=this._targetClassName,f}throw"Op is invalid after previous op."},_estimate:function(a,c,d){if(!!a){if(a instanceof b.Relation){if(this._targetClassName)if(a.targetClassName){if(a.targetClassName!==this._targetClassName)throw"Related object must be a "+a.targetClassName+", but a "+this._targetClassName+" was passed in."}else a.targetClassName=this._targetClassName;return a}throw"Op is invalid after previous op."}var e=new b.Relation(c,d);e.targetClassName=this._targetClassName}}),b.Op._registerDecoder("AddRelation",function(a){return new b.Op.Relation(b._decode(undefined,a.objects),[])}),b.Op._registerDecoder("RemoveRelation",function(a){return new b.Op.Relation([],b._decode(undefined,a.objects))})}(this),function(a){a.Parse=a.Parse||{};var b=a.Parse,c=b._;b.Relation=function(a,b){this.parent=a,this.key=b,this.targetClassName=null},b.Relation.prototype={_ensureParentAndKey:function(a,b){this.parent=this.parent||a,this.key=this.key||b;if(this.parent!==a)throw"Internal Error. Relation retrieved from two different Objects.";if(this.key!==b)throw"Internal Error. Relation retrieved from two different keys."},add:function(a){c.isArray(a)||(a=[a]);var d=new b.Op.Relation(a,[]);this.parent.set(this.key,d),this.targetClassName=d._targetClassName},remove:function(a){c.isArray(a)||(a=[a]);var d=new b.Op.Relation([],a);this.parent.set(this.key,d),this.targetClassName=d._targetClassName},toJSON:function(){return{__type:"Relation",className:this.targetClassName}},query:function(){var a,c;return this.targetClassName?(a=b.Object._getSubclass(this.targetClassName),c=new b.Query(a)):(a=b.Object._getSubclass(this.parent.className),c=new b.Query(a),c._extraOptions.redirectClassNameForKey=this.key),c._addCondition("$relatedTo","object",this.parent._toPointer()),c._addCondition("$relatedTo","key",this.key),c}}}(this),function(a){a.Parse=a.Parse||{};var b=a.Parse,c=b._;b.Object=function(a,d){if(c.isString(a))return b.Object._create.apply(this,arguments);a=a||{},d&&d.parse&&(a=this.parse(a));var e=b._getValue(this,"defaults");e&&(a=c.extend({},e,a)),d&&d.collection&&(this.collection=d.collection),this._serverData={},this._opSetQueue=[{}],this.attributes={},this._hashedJSON={},this._escapedAttributes={},this.cid=c.uniqueId("c"),this.changed={},this._silent={},this._pending={};if(!this.set(a,{silent:!0}))throw new Error("Can't create an invalid Parse.Object");this.changed={},this._silent={},this._pending={},this._hasData=!0,this._previousAttributes=c.clone(this.attributes),this.initialize.apply(this,arguments)};var d=function(a,b,e,f){e=e||[];var g;if(c.isFunction(f)){var h=f;g={success:function(a){h(a,null)},error:function(a){h(null,a)}}}else g=f;if(a.length){var i=g,j=g?c.clone(g):{};j.success=function(f,g){e.push(f),d(c.rest(a),b,e,i)},b.call(this,c.first(a),j)}else g.success&&g.success(e)};b.Object.saveAll=function(a,b){d(a,function(a,b){a.save(null,b)},[],b)},b.Object._signUpAll=function(a,b){d(a,function(a,b){a.signUp(null,b)},[],b)},c.extend(b.Object.prototype,b.Events,{_existed:!1,initialize:function(){},toJSON:function(){var a=this._toFullJSON();return c.each(["__type","className"],function(b){delete a[b]}),a},_toFullJSON:function(a){var d=c.clone(this.attributes);return b._each(d,function(c,e){d[e]=b._encode(c,a)}),b._each(this._operations,function(a,b){d[b]=a}),c.has(this,"id")&&(d.objectId=this.id),c.has(this,"createdAt")&&(c.isDate(this.createdAt)?d.createdAt=this.createdAt.toJSON():d.createdAt=this.createdAt),c.has(this,"updatedAt")&&(c.isDate(this.updatedAt)?d.updatedAt=this.updatedAt.toJSON():d.updatedAt=this.updatedAt),d.__type="Object",d.className=this.className,d},_refreshCache:function(){var a=this;b._each(this.attributes,function(d,e){d instanceof b.Object?d._refreshCache():c.isObject(d)&&a._resetCacheForKey(e)&&a.set(e,new b.Op.Set(d),{silent:!0})})},dirty:function(a){this._refreshCache();var b=c.last(this._opSetQueue);return a?b[a]?!0:!1:this.id?c.keys(b).length>0?!0:!1:!0},_toPointer:function(){if(!this.id)throw new Error("Can't serialize an unsaved Parse.Object");return{__type:"Pointer",className:this.className,objectId:this.id}},get:function(a){return this.attributes[a]},relation:function(a){var c=this.get(a);if(c){if(c instanceof b.Relation)return c._ensureParentAndKey(this,a),c;throw"Called relation() on non-relation field "+a}return new b.Relation(this,a)},escape:function(a){var d=this._escapedAttributes[a];if(d)return d;var e=this.attributes[a],f;return b._isNullOrUndefined(e)?f="":f=c.escape(e.toString()),this._escapedAttributes[a]=f,f},has:function(a){return!b._isNullOrUndefined(this.attributes[a])},_mergeMagicFields:function(a){var d=this;c.each(["id","objectId","createdAt","updatedAt"],function(e){a[e]&&(e==="objectId"?d.id=a[e]:e!=="createdAt"&&e!=="updatedAt"||!!c.isDate(a[e])?d[e]=a[e]:d[e]=b._parseDate(a[e]),delete a[e])})},_startSave:function(){this._opSetQueue.push({})},_processSaveQueue:function(){if(this._saveQueue&&this._saveQueue.length>0){var a=c.first(this._saveQueue);this._saveQueue=c.rest(this._saveQueue),a()}else this._saving=!1},_cancelSave:function(){var a=this,d=c.first(this._opSetQueue);this._opSetQueue=c.rest(this._opSetQueue);var e=c.first(this._opSetQueue);b._each(d,function(a,b){var c=d[b],f=e[b];c&&f?e[b]=f._mergeWithPrevious(c):c&&(e[b]=c)}),this._processSaveQueue()},_finishSave:function(a){var d=c.first(this._opSetQueue);this._opSetQueue=c.rest(this._opSetQueue),this._applyOpSet(d,this._serverData),this._mergeMagicFields(a);var e=this;b._each(a,function(a,c){e._serverData[c]=b._decode(c,a)}),this._rebuildAllEstimatedData(),this._processSaveQueue()},_finishFetch:function(a,c){this._opSetQueue=[{}],this._mergeMagicFields(a);var d=this;b._each(a,function(a,c){d._serverData[c]=b._decode(c,a)}),this._rebuildAllEstimatedData(),this._refreshCache(),this._opSetQueue=[{}],this._hasData=c},_applyOpSet:function(a,c){var d=this;b._.each(a,function(a,e){c[e]=a._estimate(c[e],d,e),c[e]===b.Op._UNSET&&delete c[e]})},_resetCacheForKey:function(a){var d=this.attributes[a];if(c.isObject(d)&&!(d instanceof b.Object)){d=d.toJSON?d.toJSON():d;var e=JSON.stringify(d);if(this._hashedJSON[a]!==e)return this._hashedJSON[a]=e,!0}return!1},_rebuildEstimatedDataForKey:function(a){var d=this;delete this.attributes[a],this._serverData[a]&&(this.attributes[a]=this._serverData[a]),c.each(this._opSetQueue,function(c){var e=c[a];e&&(d.attributes[a]=e._estimate(d.attributes[a],d,a),d.attributes[a]===b.Op._UNSET?delete d.attributes[a]:d._resetCacheForKey(a))})},_rebuildAllEstimatedData:function(){var a=this;this.attributes=c.clone(this._serverData),c.each(this._opSetQueue,function(b){a._applyOpSet(b,a.attributes),c.each(b,function(b,c){a._resetCacheForKey(c)})})},set:function(a,d,e){var f,g;c.isObject(a)||b._isNullOrUndefined(a)?(f=a,b._each(f,function(a,c){f[c]=b._decode(c,a)}),e=d):(f={},f[a]=b._decode(a,d)),e=e||{};if(!f)return this;f instanceof b.Object&&(f=f.attributes),e.unset&&b._each(f,function(a,c){f[c]=new b.Op.Unset});var h=c.clone(f),i=this;b._each(h,function(a,c){a instanceof b.Op&&(h[c]=a._estimate(i.attributes[c],i,c),h[c]===b.Op._UNSET&&delete h[c])});if(!this._validate(f,e))return!1;this._mergeMagicFields(f),e.changes={};var j=this._escapedAttributes,k=this._previousAttributes||{};return b._each(c.keys(f),function(a){var d=f[a];d instanceof b.Relation&&(d.parent=i),d instanceof b.Op||(d=new b.Op.Set(d));var g=!0;d instanceof b.Op.Set&&c.isEqual(i.attributes[a],d.value)&&(g=!1),g&&(delete j[a],e.silent?i._silent[a]=!0:e.changes[a]=!0);var h=c.last(i._opSetQueue);h[a]=d._mergeWithPrevious(h[a]),i._rebuildEstimatedDataForKey(a),g?(i.changed[a]=i.attributes[a],e.silent||(i._pending[a]=!0)):(delete i.changed[a],delete i._pending[a])}),e.silent||this.change(e),this},unset:function(a,b){return b=b||{},b.unset=!0,this.set(a,null,b)},increment:function(a,d){if(c.isUndefined(d)||c.isNull(d))d=1;return this.set(a,new b.Op.Increment(d))},add:function(a,c){return this.set(a,new b.Op.Add([c]))},addUnique:function(a,c){return this.set(a,new b.Op.AddUnique([c]))},remove:function(a,c){return this.set(a,new b.Op.Remove([c]))},op:function(a){return c.last(this._opSetQueue)[a]},clear:function(a){a=a||{},a.unset=!0;var b=c.extend(this.attributes,this._operations);return this.set(b,a)},_getSaveJSON:function(){var a=c.clone(c.first(this._opSetQueue));return b._each(a,function(b,c){a[c]=b.toJSON()}),a},fetch:function(a){a=a?c.clone(a):{};var d=this,e=a.success;a.success=function(a,b,c){d._finishFetch(d.parse(a,b,c),!0),e&&e(d,a)},a.error=b.Object._wrapError(a.error,d,a),b._request("classes",d.className,d.id,"GET",null,a)},save:function(a,d,e){var f,g,h,i,j;c.isObject(a)||b._isNullOrUndefined(a)?(g=a,i=d):(g={},g[a]=d,i=e);if(!i&&g){var k=c.reject(g,function(a,b){return c.include(["success","error","wait"],b)});if(k.length===0){var l=!0;c.has(g,"success")&&!c.isFunction(g.success)&&(l=!1),c.has(g,"error")&&!c.isFunction(g.error)&&(l=!1);if(l)return this.save(null,g)}}i=i?c.clone(i):{},i.wait&&(h=c.clone(this.attributes));var m=c.extend({},i,{silent:!0});if(g&&!this.set(g,i.wait?m:i))return!1;var n=i,o=c.clone(i),p=this;p._refreshCache();var q=b.Object._findUnsavedChildren(p.attributes);if(q.length>0)return b.Object.saveAll(q,{success:function(a){p.save(null,n)},error:function(a){i.error&&i.error.apply(this,arguments)}}),this;o.success=function(a,b,d){var e=p.parse(a,b,d);o.wait&&(e=c.extend(g||{},e)),p._finishSave(e),n.success?n.success(p,a):p.trigger("sync",p,a,o)},o.error=function(){p._cancelSave(),n.error&&n.error.apply(this,arguments)},o.error=b.Object._wrapError(o.error,p,o),this._startSave();var r=function(){var a=p.id?"PUT":"POST",c=p._getSaveJSON(),d="classes",e=p.className;p.className==="_User"&&!p.id&&(d="users",e=null),b._request(d,e,p.id,a,c,o),o.wait&&p.set(h,m)};return this._saving?(this._saveQueue=this._saveQueue||[],this._saveQueue.push(r)):(this._saving=!0,r()),this},destroy:function(a){a=a?c.clone(a):{};var d=this,e=a.success,f=function(){d.trigger("destroy",d,d.collection,a)};if(!this.id)return f();a.success=function(b){a.wait&&f(),e?e(d,b):d.trigger("sync",d,b,a)},a.error=b.Object._wrapError(a.error,d,a),b._request("classes",this.className,this.id,"DELETE",null,a),a.wait||f()},parse:function(a,d,e){var f=c.clone(a);return c(["createdAt","updatedAt"]).each(function(a){f[a]&&(f[a]=b._parseDate(f[a]))}),f.updatedAt||(f.updatedAt=f.createdAt),d&&(this._existed=d.status!==201),f},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.id},change:function(a){a=a||{};var d=this._changing;this._changing=!0;var e=this;b._each(this._silent,function(a){e._pending[a]=!0});var f=c.extend({},a.changes,this._silent);this._silent={},b._each(f,function(b,c){e.trigger("change:"+c,e,e.get(c),a)});if(d)return this;var g=function(a){!e._pending[a]&&!e._silent[a]&&delete e.changed[a]};while(!c.isEmpty(this._pending))this._pending={},this.trigger("change",this,a),b._each(this.changed,g),e._previousAttributes=c.clone(this.attributes);return this._changing=!1,this},existed:function(){return this._existed},hasChanged:function(a){return arguments.length?this._changed&&c.has(this._changed,a):!c.isEmpty(this._changed)},changedAttributes:function(a){if(!a)return this.hasChanged()?c.clone(this._changed):!1;var d={},e=this._previousAttributes;return b._each(a,function(a,b){c.isEqual(e[b],a)||(d[b]=a)}),d},previous:function(a){return!arguments.length||!this._previousAttributes?null:this._previousAttributes[a]},previousAttributes:function(){return c.clone(this._previousAttributes)},isValid:function(){return!this.validate(this.attributes)},validate:function(a,d){return!c.has(a,"ACL")||a.ACL instanceof b.ACL?!1:new b.Error(b.Error.OTHER_CAUSE,"ACL must be a Parse.ACL.")},_validate:function(a,b){if(b.silent||!this.validate)return!0;a=c.extend({},this.attributes,a);var d=this.validate(a,b);return d?(b&&b.error?b.error(this,d,b):this.trigger("error",this,d,b),!1):!0},getACL:function(){return this.get("ACL")},setACL:function(a,b){return this.set("ACL",a,b)}}),b.Object._getSubclass=function(a){if(!c.isString(a))throw"Parse.Object._getSubclass requires a string argument.";var d=b.Object._classMap[a];return d||(d=b.Object.extend(a),b.Object._classMap[a]=d),d},b.Object._create=function(a,c,d){var e=b.Object._getSubclass(a);return new e(c,d)},b.Object._classMap={},b.Object._extend=b._extend,b.Object.extend=function(a,d,e){if(!c.isString(a)){if(a&&c.has(a,"className"))return b.Object.extend(a.className,a,d);throw new Error("Parse.Object.extend's first argument should be the className.")}a==="User"&&(a="_User");var f=null;if(c.has(b.Object._classMap,a)){var g=b.Object._classMap[a];f=g._extend(d,e)}else d=d||{},d.className=a,f=this._extend(d,e);return f.extend=function(d){if(c.isString(d)||d&&c.has(d,"className"))return b.Object.extend.apply(f,arguments);var e=[a].concat(b._.toArray(arguments));return b.Object.extend.apply(f,e)},b.Object._classMap[a]=f,f},b.Object._wrapError=function(a,c,d){return function(e,f){e!==c&&(f=e);var g=new b.Error(-1,f.responseText);if(f.responseText){var h=JSON.parse(f.responseText);h&&(g=new b.Error(h.code,h.error))}a?a(c,g,d):c.trigger("error",c,g,d)}},b.Object._findUnsavedChildren=function(a){var d=[];if(a instanceof b.Object)a._refreshCache(),a.dirty()&&(d=[a]),d.push.apply(d,b.Object._findUnsavedChildren(a.attributes));else if(a instanceof b.Relation)var e=null;else c.isArray(a)?c.each(a,function(a){d.push.apply(d,b.Object._findUnsavedChildren(a))}):c.isObject(a)&&b._each(a,function(a){d.push.apply(d,b.Object._findUnsavedChildren(a))});return d}}(this),function(a){a.Parse=a.Parse||{};var b=a.Parse,c=b._;b.Role=b.Object.extend("_Role",{constructor:function(a,d){c.isString(a)&&d instanceof b.ACL?(b.Object.prototype.constructor.call(this,null,null),this.setName(a),this.setACL(d)):b.Object.prototype.constructor.call(this,a,d)},getName:function(){return this.get("name")},setName:function(a,b){return this.set("name",a,b)},getUsers:function(){return this.relation("users")},getRoles:function(){return this.relation("roles")},validate:function(a,d){if("name"in a&&a.name!==this.getName()){var e=a.name;if(this.id&&this.id!==a.objectId)return new b.Error(b.Error.OTHER_CAUSE,"A role's name can only be set before it has been saved.");if(!c.isString(e))return new b.Error(b.Error.OTHER_CAUSE,"A role's name must be a String.");if(!/^[0-9a-zA-Z\-_ ]+$/.test(e))return new b.Error(b.Error.OTHER_CAUSE,"A role's name can only contain alphanumeric characters, _, -, and spaces.")}return b.Object.prototype.validate?b.Object.prototype.validate.call(this,a,d):!1}})}(this),function(a){a.Parse=a.Parse||{};var b=a.Parse,c=b._;b.Collection=function(a,b){b=b||{},b.comparator&&(this.comparator=b.comparator),b.model&&(this.model=b.model),b.query&&(this.query=b.query),this._reset(),this.initialize.apply(this,arguments),a&&this.reset(a,{silent:!0,parse:b.parse})},c.extend(b.Collection.prototype,b.Events,{model:b.Object,initialize:function(){},toJSON:function(){return this.map(function(a){return a.toJSON()})},add:function(a,d){var e,f,g,h,i,j,k={},l={};d=d||{},a=c.isArray(a)?a.slice():[a];for(e=0,g=a.length;e<g;e++){a[e]=this._prepareModel(a[e],d),h=a[e];if(!h)throw new Error("Can't add an invalid model to a collection");i=h.cid;if(k[i]||this._byCid[i])throw new Error("Duplicate cid: can't add the same model to a collection twice");j=h.id;if(!b._isNullOrUndefined(j)&&(l[j]||this._byId[j]))throw new Error("Duplicate id: can't add the same model to a collection twice");l[j]=h,k[i]=h}for(e=0;e<g;e++)(h=a[e]).on("all",this._onModelEvent,this),this._byCid[h.cid]=h,h.id&&(this._byId[h.id]=h);this.length+=g,f=b._isNullOrUndefined(d.at)?this.models.length:d.at,this.models.splice.apply(this.models,[f,0].concat(a)),this.comparator&&this.sort({silent:!0});if(d.silent)return this;for(e=0,g=this.models.length;e<g;e++)h=this.models[e],k[h.cid]&&(d.index=e,h.trigger("add",h,this,d));return this},remove:function(a,b){var d,e,f,g;b=b||{},a=c.isArray(a)?a.slice():[a];for(d=0,e=a.length;d<e;d++){g=this.getByCid(a[d])||this.get(a[d]);if(!g)continue;delete this._byId[g.id],delete this._byCid[g.cid],f=this.indexOf(g),this.models.splice(f,1),this.length--,b.silent||(b.index=f,g.trigger("remove",g,this,b)),this._removeReference(g)}return this},get:function(a){return a&&this._byId[a.id||a]},getByCid:function(a){return a&&this._byCid[a.cid||a]},at:function(a){return this.models[a]},sort:function(a){a=a||{};if(!this.comparator)throw new Error("Cannot sort a set without a comparator");var b=c.bind(this.comparator,this);return this.comparator.length===1?this.models=this.sortBy(b):this.models.sort(b),a.silent||this.trigger("reset",this,a),this},pluck:function(a){return c.map(this.models,function(b){return b.get(a)})},reset:function(a,b){var d=this;return a=a||[],b=b||{},c.each(this.models,function(a){d._removeReference(a)}),this._reset(),this.add(a,{silent:!0,parse:b.parse}),b.silent||this.trigger("reset",this,b),this},fetch:function(a){a=a?c.clone(a):{},a.parse===undefined&&(a.parse=!0);var d=this,e=a.success;a.success=function(b,c){a.add?d.add(b,a):d.reset(b,a),e&&e(d,c)},a.error=b.Object._wrapError(a.error,d,a);var f=this.query||new b.Query(this.model);f.find(a)},create:function(a,b){var d=this;b=b?c.clone(b):{},a=this._prepareModel(a,b);if(!a)return!1;b.wait||d.add(a,b);var e=b.success;return b.success=function(c,f,g){b.wait&&d.add(c,b),e?e(c,f):c.trigger("sync",a,f,b)},a.save(null,b),a},parse:function(a,b){return a},chain:function(){return c(this.models).chain()},_reset:function(a){this.length=0,this.models=[],this._byId={},this._byCid={}},_prepareModel:function(a,c){if(a instanceof b.Object)a.collection||(a.collection=this);else{var d=a;c.collection=this,a=new this.model(d,c),a._validate(a.attributes,c)||(a=!1)}return a},_removeReference:function(a){this===a.collection&&delete a.collection,a.off("all",this._onModelEvent,this)},_onModelEvent:function(a,b,c,d){if(a!=="add"&&a!=="remove"||c===this)a==="destroy"&&this.remove(b,d),b&&a==="change:objectId"&&(delete this._byId[b.previous("objectId")],this._byId[b.id]=b),this.trigger.apply(this,arguments);else return}});var d=["forEach","each","map","reduce","reduceRight","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","sortBy","sortedIndex","toArray","size","first","initial","rest","last","without","indexOf","shuffle","lastIndexOf","isEmpty","groupBy"];c.each(d,function(a){b.Collection.prototype[a]=function(){return c[a].apply(c,[this.models].concat(c.toArray(arguments)))}}),b.Collection.extend=b._extend}(this),function(a){a.Parse=a.Parse||{};var b=a.Parse,c=b._;b.View=function(a){this.cid=c.uniqueId("view"),this._configure(a||{}),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()};var d=/^(\S+)\s*(.*)$/,e=["model","collection","el","id","attributes","className","tagName"];c.extend(b.View.prototype,b.Events,{tagName:"div",$:function(a){return this.$el.find(a)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this},make:function(a,c,d){var e=document.createElement(a);return c&&b.$(e).attr(c),d&&b.$(e).html(d),e},setElement:function(a,c){return this.$el=b.$(a),this.el=this.$el[0],c!==!1&&this.delegateEvents(),this},delegateEvents:function(a){a=a||b._getValue(this,"events");if(!a)return;this.undelegateEvents();var e=this;b._each(a,function(b,f){c.isFunction(b)||(b=e[a[f]]);if(!b)throw new Error('Event "'+a[f]+'" does not exist');var g=f.match(d),h=g[1],i=g[2];b=c.bind(b,e),h+=".delegateEvents"+e.cid,i===""?e.$el.bind(h,b):e.$el.delegate(i,h,b)})},undelegateEvents:function(){this.$el.unbind(".delegateEvents"+this.cid)},_configure:function(a){this.options&&(a=c.extend({},this.options,a));var b=this;c.each(e,function(c){a[c]&&(b[c]=a[c])}),this.options=a},_ensureElement:function(){if(!this.el){var a=b._getValue(this,"attributes")||{};this.id&&(a.id=this.id),this.className&&(a["class"]=this.className),this.setElement(this.make(this.tagName,a),!1)}else this.setElement(this.el,!1)}}),b.View.extend=b._extend}(this),function(a){a.Parse=a.Parse||{};var b=a.Parse,c=b._;b.User=b.Object.extend("_User",{_isCurrentUser:!1,_mergeMagicFields:function(a){a.sessionToken&&(this._sessionToken=a.sessionToken,delete a.sessionToken),b.User.__super__._mergeMagicFields.call(this,a)},_cleanupAuthData:function(){if(!this.isCurrent())return;var a=this.get("authData");if(!a)return;c.each(this.get("authData"),function(b,c){a[c]||delete a[c]})},_synchronizeAllAuthData:function(){var a=this.get("authData");if(!a)return;var b=this;c.each(this.get("authData"),function(a,c){b._synchronizeAuthData(c)})},_synchronizeAuthData:function(a){if(!this.isCurrent())return;var d;c.isString(a)?(d=a,a=b.User._authProviders[d]):d=a.getAuthType();var e=this.get("authData");if(!e||!a)return;var f=a.restoreAuthentication(e[d]);f||this._unlinkFrom(a)},_handleSaveResult:function(a){a&&(this._isCurrentUser=!0),this._cleanupAuthData(),this._synchronizeAllAuthData(),delete this._serverData.password,this._rebuildEstimatedDataForKey("password"),this._refreshCache(),(a||this.isCurrent())&&b.User._saveCurrentUser(this)},_linkWith:function(a,d){var e;c.isString(a)?(e=a,a=b.User._authProviders[a]):e=a.getAuthType();if(c.has(d,"authData")){var f=this.get("authData")||{};f[e]=d.authData,this.set("authData",f);var g=c.clone(d);return g.success=function(a){a._handleSaveResult(!0),d.success&&d.success.apply(this,arguments)},this.save({authData:f},g)}var h=this;return a.authenticate({success:function(a,b){h._linkWith(a,{authData:b,success:d.success,error:d.error})},error:function(a,b){d.error&&d.error(h,b)}})},_unlinkFrom:function(a,d){var e;c.isString(a)?(e=a,a=b.User._authProviders[a]):e=a.getAuthType();var f=c.clone(d),g=this;return f.authData=null,f.success=function(b){g._synchronizeAuthData(a),d.success&&d.success.apply(this,arguments)},this._linkWith(a,f)},_isLinked:function(a){var b;c.isString(a)?b=a:b=a.getAuthType();var d=this.get("authData")||{};return!!d[b]},_logOutWithAll:function(){var a=this.get("authData");if(!a)return;var b=this;c.each(this.get("authData"),function(a,c){b._logOutWith(c)})},_logOutWith:function(a){if(!this.isCurrent())return;c.isString(a)&&(a=b.User._authProviders[a]),a&&a.deauthenticate&&a.deauthenticate()},signUp:function(a,d){var e,f=a&&a.username||this.get("username");if(!f||f==="")return d&&d.error&&(e=new b.Error(b.Error.OTHER_CAUSE,"Cannot sign up user with an empty name."),d.error(this,e)),!1;var g=a&&a.password||this.get("password");if(!g||g==="")return d&&d.error&&(e=new b.Error(b.Error.OTHER_CAUSE,"Cannot sign up user with an empty password."),d.error(this,e)),!1;var h=c.clone(d);return h.success=function(a){a._handleSaveResult(!0),d.success&&d.success.apply(this,arguments)},this.save(a,h)},logIn:function(a){var d=this,e=c.clone(a);e.success=function(b,c,f){var g=d.parse(b,c,f);d._finishFetch(g),d._handleSaveResult(!0),a.success?a.success(d,b):d.trigger("sync",d,b,e)},e.error=b.Object._wrapError(a.error,d,e),b._request("login",null,null,"GET",this.toJSON(),e)},save:function(a,d,e){var f,g,h,i,j;c.isObject(a)||c.isNull(a)||c.isUndefined(a)?(g=a,i=d):(g={},g[a]=d,i=e);var k=c.clone(i);return k.success=function(a){a._handleSaveResult(!1),i.success&&i.success.apply(this,arguments)},b.Object.prototype.save.call(this,g,k)},fetch:function(a){var d=c.clone(a);return d.success=function(b){b._handleSaveResult(!1),a.success&&a.success.apply(this,arguments)},b.Object.prototype.fetch.call(this,d)},isCurrent:function(){return this._isCurrentUser},getUsername:function(){return this.get("username")},setUsername:function(a,b){return this.set("username",a,b)},setPassword:function(a,b){return this.set("password",a,b)},getEmail:function(){return this.get("email")},setEmail:function(a,b){return this.set("email",a,b)},authenticated:function(){return!!this._sessionToken&&b.User.current()&&b.User.current().id===this.id}},{_currentUser:null,_currentUserMatchesDisk:!1,_CURRENT_USER_KEY:"currentUser",_authProviders:{},signUp:function(a,c,d,e){d=d||{},d.username=a,d.password=c;var f=b.Object._create("_User");return f.signUp(d,e)},logIn:function(a,c,d){var e=b.Object._create("_User");e._finishFetch({username:a,password:c}),e.logIn(d)},logOut:function(){b.User._currentUser!==null&&(b.User._currentUser._logOutWithAll(),b.User._currentUser._isCurrentUser=!1),b.User._currentUserMatchesDisk=!0,b.User._currentUser=null,b.localStorage.removeItem(b._getParsePath(b.User._CURRENT_USER_KEY))},requestPasswordReset:function(a,c){var d={email:a};c.error=b.Query._wrapError(c.error,c),b._request("requestPasswordReset",null,null,"POST",d,c)},current:function(){if(b.User._currentUser)return b.User._currentUser;if(b.User._currentUserMatchesDisk)return b.User._currentUser;b.User._currentUserMatchesDisk=!0;var a=b.localStorage.getItem(b._getParsePath(b.User._CURRENT_USER_KEY));if(!a)return null;b.User._currentUser=new b.Object._create("_User"),b.User._currentUser._isCurrentUser=!0;var c=JSON.parse(a);return b.User._currentUser.id=c._id,delete c._id,b.User._currentUser._sessionToken=c._sessionToken,delete c._sessionToken,b.User._currentUser.set(c),b.User._currentUser._synchronizeAllAuthData(),b.User._currentUser._refreshCache(),b.User._currentUser._opSetQueue=[{}],b.User._currentUser},_saveCurrentUser:function(a){b.User._currentUser!==a&&b.User.logOut(),a._isCurrentUser=!0,b.User._currentUser=a,b.User._currentUserMatchesDisk=!0;var c=a.toJSON();c._id=a.id,c._sessionToken=a._sessionToken,b.localStorage.setItem(b._getParsePath(b.User._CURRENT_USER_KEY),JSON.stringify(c))},_registerAuthenticationProvider:function(a){b.User._authProviders[a.getAuthType()]=a,b.User.current()&&b.User.current()._synchronizeAuthData(a.getAuthType())},_logInWith:function(a,c){var d=new b.User;return d._linkWith(a,c)}})}(this),function(a){a.Parse=a.Parse||{};var b=a.Parse,c=b._;b.Query=function(a){c.isString(a)&&(a=b.Object._getSubclass(a)),this.objectClass=a,this.className=a.prototype.className,this._where={},this._include=[],this._limit=-1,this._skip=0,this._extraOptions={}},b.Query.or=function(){var a=c.toArray(arguments),d=null;c.each(a,function(a){c.isNull(d)&&(d=a.className);if(d!==a.className)throw"All queries must be for the same class"});var e=new b.Query(d);return e._orQuery(a),e},b.Query.prototype={get:function(a,c){var d=this,e=c.success||function(){},f=c.error||function(){},g={error:function(a){f(null,a)},success:function(a){a?e(a):f(null,new b.Error(b.Error.OBJECT_NOT_FOUND,"Object not found."))}};d.equalTo("objectId",a),d.first(g)},toJSON:function(){var a={where:this._where};return this._include.length>0&&(a.include=this._include.join(",")),this._limit>=0&&(a.limit=this._limit),this._skip>0&&(a.skip=this._skip),this._order!==undefined&&(a.order=this._order),b._each(this._extraOptions,function(b,c){a[c]=b}),a},find:function(a){var d=this,e=a.success||function(){},f={error:a.error,success:function(a){e(c.map(a.results,function(c){var e;return a.className?e=new b.Object(a.className):e=new d.objectClass,e._finishFetch(c,!0),e}))}},g=this.toJSON();f.error=b.Query._wrapError(a.error,f),b._request("classes",this.className,null,"GET",g,f)},count:function(a){var c=this,d=a.success||function(){},e={error:a.error,success:function(a){d(a.count)}},f=this.toJSON();f.limit=0,f.count=1,e.error=b.Query._wrapError(a.error,e),b._request("classes",this.className,null,"GET",f,e)},first:function(a){var d=this,e=a.success||function(){},f={error:a.error,success:function(a){e(c.map(a.results,function(a){var b=new d.objectClass;return b._finishFetch(a,!0),b})[0])}},g=this.toJSON();g.limit=1,f.error=b.Query._wrapError(a.error,f),b._request("classes",this.className,null,"GET",g,f)},collection:function(a,d){return d=d||{},new b.Collection(a,c.extend(d,{model:this.objectClass,query:this}))},skip:function(a){return this._skip=a,this},limit:function(a){return this._limit=a,this},equalTo:function(a,c){return this._where[a]=b._encode(c),this},_addCondition:function(a,c,d){return this._where[a]||(this._where[a]={}),this._where[a][c]=b._encode(d),this},notEqualTo:function(a,b){return this._addCondition(a,"$ne",b),this},lessThan:function(a,b){return this._addCondition(a,"$lt",b),this},greaterThan:function(a,b){return this._addCondition(a,"$gt",b),this},lessThanOrEqualTo:function(a,b){return this._addCondition(a,"$lte",b),this},greaterThanOrEqualTo:function(a,b){return this._addCondition(a,"$gte",b),this},containedIn:function(a,b){return this._addCondition(a,"$in",b),this},notContainedIn:function(a,b){return this._addCondition(a,"$nin",b),this},exists:function(a){return this._addCondition(a,"$exists",!0),this},doesNotExist:function(a){return this._addCondition(a,"$exists",!1),this},matches:function(a,b,c){return this._addCondition(a,"$regex",b),c||(c=""),b.ignoreCase&&(c+="i"),b.multiline&&(c+="m"),c&&c.length&&this._addCondition(a,"$options",c),this},matchesQuery:function(a,b){var c=b.toJSON();return c.className=b.className,this._addCondition(a,"$inQuery",c),this},doesNotMatchQuery:function(a,b){var c=b.toJSON();return c.className=b.className,this._addCondition(a,"$notInQuery",c),this},matchesKeyInQuery:function(a,b,c){var d=c.toJSON();return d.className=c.className,this._addCondition(a,"$select",{key:b,query:d}),this},doesNotMatchKeyInQuery:function(a,b,c){var d=c.toJSON();return d.className=c.className,this._addCondition(a,"$dontSelect",{key:b,query:d}),this},_orQuery:function(a){var b=c.map(a,function(a){return a.toJSON().where});return this._where.$or=b,this},_quote:function(a){return"\\Q"+a.replace("\\E","\\E\\\\E\\Q")+"\\E"},contains:function(a,b){return this._addCondition(a,"$regex",this._quote(b)),this},startsWith:function(a,b){return this._addCondition(a,"$regex","^"+this._quote(b)),this},endsWith:function(a,b){return this._addCondition(a,"$regex",this._quote(b)+"$"),this},ascending:function(a){return this._order=a,this},descending:function(a){return this._order="-"+a,this},near:function(a,c){return c instanceof b.GeoPoint||(c=new b.GeoPoint(c)),this._addCondition(a,"$nearSphere",c),this},withinRadians:function(a,b,c){return this.near(a,b),this._addCondition(a,"$maxDistance",c),this},withinMiles:function(a,b,c){return this.withinRadians(a,b,c/3958.8)},withinKilometers:function(a,b,c){return this.withinRadians(a,b,c/6371)},withinGeoBox:function(a,c,d){return c instanceof b.GeoPoint||(c=new b.GeoPoint(c)),d instanceof b.GeoPoint||(d=new b.GeoPoint(d)),this._addCondition(a,"$within",{$box:[c,d]}),this},include:function(a){return c.isArray(a)?this._include=this._include.concat(a):this._include.push(a),this}},b.Query._wrapError=function(a,c){return function(d){if(a){var e=new b.Error(-1,d.responseText);if(d.responseText){var f=JSON.parse(d.responseText);f&&(e=new b.Error(f.code,f.error))}a(e,c)}}}}(this),function(a){a.Parse=a.Parse||{};var b=a.Parse,c=b._,d="*",e=!1,f,g,h={authenticate:function(a){var b=this;FB.login(function(c){c.authResponse?a.success&&a.success(b,{id:c.authResponse.userID,access_token:c.authResponse.accessToken,expiration_date:(new Date(c.authResponse.expiresIn*1e3+(new Date).getTime())).toJSON()}):a.error&&a.error(b,c)},{scope:f})},restoreAuthentication:function(a){if(a){var d={userID:a.id,accessToken:a.access_token,expiresIn:(b._parseDate(a.expiration_date).getTime()-(new Date).getTime())/1e3},e=c.clone(g);e.authResponse=d,FB.init(e)}return!0},getAuthType:function(){return"facebook"},deauthenticate:function(){this.restoreAuthentication(null),FB.logout()}};b.FacebookUtils={init:function(a){if(typeof FB=="undefined")throw"The Javascript Facebook SDK must be loaded before calling init.";g=c.clone(a),FB.init(g),b.User._registerAuthenticationProvider(h),e=!0},isLinked:function(a){return a._isLinked("facebook")},logIn:function(a,d){if(!a||c.isString(a)){if(!e)throw"You must initialize FacebookUtils before calling logIn.";return f=a,b.User._logInWith("facebook",d)}var g=c.clone(d);return g.authData=a,b.User._logInWith("facebook",g)},link:function(a,b,d){if(!b||c.isString(b)){if(!e)throw"You must initialize FacebookUtils before calling link.";return f=b,a._linkWith("facebook",d)}var g=c.clone(d);return g.authData=b,a._linkWith("facebook",g)},unlink:function(a,b){if(!e)throw"You must initialize FacebookUtils before calling unlink.";return a._unlinkFrom("facebook",b)}}}(this),function(a){a.Parse=a.Parse||{};var b=a.Parse,c=b._;b.History=function(){this.handlers=[],c.bindAll(this,"checkUrl")};var d=/^[#\/]/,e=/msie [\w.]+/;b.History.started=!1,c.extend(b.History.prototype,b.Events,{interval:50,getHash:function(a){var b=a?a.location:window.location,c=b.href.match(/#(.*)$/);return c?c[1]:""},getFragment:function(a,c){if(b._isNullOrUndefined(a))if(this._hasPushState||c){a=window.location.pathname;var e=window.location.search;e&&(a+=e)}else a=this.getHash();return a.indexOf(this.options.root)||(a=a.substr(this.options.root.length)),a.replace(d,"")},start:function(a){if(b.History.started)throw new Error("Parse.history has already been started");b.History.started=!0,this.options=c.extend({},{root:"/"},this.options,a),this._wantsHashChange=this.options.hashChange!==!1,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&window.history&&window.history.pushState);var f=this.getFragment(),g=document.documentMode,h=e.exec(navigator.userAgent.toLowerCase())&&(!g||g<=7);h&&(this.iframe=b.$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(f)),this._hasPushState?b.$(window).bind("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!h?b.$(window).bind("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=window.setInterval(this.checkUrl,this.interval)),this.fragment=f;var i=window.location,j=i.pathname===this.options.root;if(this._wantsHashChange&&this._wantsPushState&&!this._hasPushState&&!j)return this.fragment=this.getFragment(null,!0),window.location.replace(this.options.root+"#"+this.fragment),!0;this._wantsPushState&&this._hasPushState&&j&&i.hash&&(this.fragment=this.getHash().replace(d,""),window.history.replaceState({},document.title,i.protocol+"//"+i.host+this.options.root+this.fragment));if(!this.options.silent)return this.loadUrl()},stop:function(){b.$(window).unbind("popstate",this.checkUrl).unbind("hashchange",this.checkUrl),window.clearInterval(this._checkUrlInterval),b.History.started=!1},route:function(a,b){this.handlers.unshift({route:a,callback:b})},checkUrl:function(a){var b=this.getFragment();b===this.fragment&&this.iframe&&(b=this.getFragment(this.getHash(this.iframe)));if(b===this.fragment)return!1;this.iframe&&this.navigate(b),this.loadUrl()||this.loadUrl(this.getHash())},loadUrl:function(a){var b=this.fragment=this.getFragment(a),d=c.any(this.handlers,function(a){if(a.route.test(b))return a.callback(b),!0});return d},navigate:function(a,c){if(!b.History.started)return!1;if(!c||c===!0)c={trigger:c};var e=(a||"").replace(d,"");if(this.fragment===e)return;if(this._hasPushState){e.indexOf(this.options.root)!==0&&(e=this.options.root+e),this.fragment=e;var f=c.replace?"replaceState":"pushState";window.history[f]({},document.title,e)}else this._wantsHashChange?(this.fragment=e,this._updateHash(window.location,e,c.replace),this.iframe&&e!==this.getFragment(this.getHash(this.iframe))&&(c.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,e,c.replace))):window.location.assign(this.options.root+a);c.trigger&&this.loadUrl(a)},_updateHash:function(a,b,c){if(c){var d=a.toString().replace(/(javascript:|#).*$/,"");a.replace(d+"#"+b)}else a.hash=b}})}(this),function(a){a.Parse=a.Parse||{};var b=a.Parse,c=b._;b.Router=function(a){a=a||{},a.routes&&(this.routes=a.routes),this._bindRoutes(),this.initialize.apply(this,arguments)};var d=/:\w+/g,e=/\*\w+/g,f=/[\-\[\]{}()+?.,\\\^\$\|#\s]/g;c.extend(b.Router.prototype,b.Events,{initialize:function(){},route:function(a,d,e){return b.history=b.history||new b.History,c.isRegExp(a)||(a=this._routeToRegExp(a)),e||(e=this[d]),b.history.route(a,c.bind(function(c){var f=this._extractParameters(a,c);e&&e.apply(this,f),this.trigger.apply(this,["route:"+d].concat(f)),b.history.trigger("route",this,d,f)},this)),this},navigate:function(a,c){b.history.navigate(a,c)},_bindRoutes:function(){if(!this.routes)return;var a=[];for(var b in this.routes)this.routes.hasOwnProperty(b)&&a.unshift([b,this.routes[b]]);for(var c=0,d=a.length;c<d;c++)this.route(a[c][0],a[c][1],this[a[c][1]])},_routeToRegExp:function(a){return a=a.replace(f,"\\$&").replace(d,"([^/]+)").replace(e,"(.*?)"),new RegExp("^"+a+"$")},_extractParameters:function(a,b){return a.exec(b).slice(1)}}),b.Router.extend=b._extend}(this),function(a){a.Parse=a.Parse||{};var b=a.Parse,c=b._;b.Cloud={run:function(a,d,e){var f=e,g=c.clone(e);g.success=function(a){var c=b._decode(null,a);f.success&&f.success(c.result)},g.error=b.Cloud._wrapError(f.error,e),b._request("functions",a,null,"POST",b._encode(d,null,!0),g)},_wrapError:function(a,c){return function(d){if(a){var e=new b.Error(-1,d.responseText);if(d.responseText){var f=JSON.parse(d.responseText);f&&(e=new b.Error(f.code,f.error))}a(e,c)}}}}}(this),function(a){a.Parse=a.Parse||{};var b=a.Parse;b.Installation=b.Object.extend("_Installation"),b.Push=b.Push||{},b.Push.send=function(a,c){a.where&&(a.where=a.where.toJSON().where),a.push_time&&(a.push_time=a.push_time.toJSON()),a.expiration_time&&(a.expiration_time=a.expiration_time.toJSON());if(a.expiration_time&&a.expiration_time_interval)throw"Both expiration_time and expiration_time_interval can't be set";var d={error:c.error,success:c.success};d.error=b.Query._wrapError(c.error,d),b._request("push",null,null,"POST",a,d)}}(this);
1  server/docs/editor/js-libs.md
Source Rendered
@@ -16,6 +16,7 @@ These are the JS libraries available for use:
16 16
 - [jQuery.knob](http://anthonyterrien.com/knob) (knob-1.1.1.js)
17 17
 - [jQuery.Sparklines](http://omnipotent.net/jquery.sparkline/#s-about) (jquery.sparkline.min.js)
18 18
 - [NVD3.js](http://novus.github.com/nvd3/) (nv.d3.min.js)
  19
+- [Parse](https://www.parse.com/docs/js_guide) (parse-1.1.16.min.js)
19 20
 - [Peity](http://benpickles.github.com/peity) (peity.min.js)      
20 21
 - [Raphael](http://raphaeljs.com) (raphael-min.js)
21 22
 - [Rickshaw](http://code.shutterstock.com/rickshaw/) (see 'Using Rickshaw' section below)    

0 notes on commit eebf21d

Please sign in to comment.
Something went wrong with that request. Please try again.