function K(){return function(){}}function P(o){return function(){return o}} (function(o,y){function n(){}function L(a,b,c){var d=o.console;switch(arguments.length){case 1:d.log(a);break;case 2:d.log(a,b);break;default:d.log(a,b,c);break}}function Z(a,b,c){var d=o.console;switch(arguments.length){case 1:d.error(a);break;case 2:d.error(a,b);break;default:d.error(a,b,c);break}}function ea(a,b){var c=y.createElement("div");c.className=a;for(var d=a="",e=0;e/g,">")}function Ea(a){if(!a||!a.replace)return a;return a.replace(//g,">").replace(/\"/g,""")}function Fa(a,b){if(!a)throw"Missing this";if(!_.isFunction(b))throw"Missing function";return function(){return b.apply(a,arguments)}}function ha(a){var b=y.createElement("div"); b.appendChild(a);var c=b.innerHTML;b.removeChild(a);return c}function $(a){var b=(""+a).toLowerCase();if(b=="f"||b=="0"||b=="false"||b=="no")a=false;return!!a}function V(a,b){for(var c in a){var d=b[c],e=typeof d;if(e=="undefined")b[c]=M(w(a[c]));else e=="object"&&d.constructor!=array&&c.substring(0,1)!="$"&&V(a[c],d)}}function ia(a){this.location=a;this.delay=25;this.setTimeout=function(b,c){o.setTimeout(b,c)};this.Da=function(b){return b};this.M=a.href}function Ga(){var a=k.fn;a.scope=function(){for(var b= this;b&&b.get(0);){var c=b.data("scope");if(c)return c;b=b.parent()}return null};a.controller=function(){return this.data("controller")||R.Ib}}function Ha(a){if(a.Fc=="console"&&!Q){Q=y.createElement("div");Q.id="ng-console";y.getElementsByTagName("body")[0].appendChild(Q);L=function(){ea("ng-console-info",arguments)};console.error=function(){ea("ng-console-error",arguments)}}}function aa(a,b){var c={};p(b,function(d,e){c[e]=_(d).bind(a)});return c}function Ia(a,b){var c=new ja(b.server,b.database), d=new x(a[0],c,h,b.location,b);c=new S(a.find("body"),b.server,b.database);var e=b.database=="$MEMORY"?new ba(o):new ka(b.server,k.getScript);e=new la(e,new W(k(a.body)),function(){d.d()});var f=new ma(e,c),g="/data/"+b.database,h=new X(function(l,q){e.O("POST",g,l,q)},f,d.anchor);d.k=h;d.Ua.push(function(){h.U()});var i=new v({$anchor:d.anchor,$updateView:_(d.d).bind(d),$config:b,$console:o.console,$datastore:aa(h,{load:h.load,loadMany:h.ka,loadOrCreate:h.Ga,loadAll:h.Fa,save:h.save,remove:h.remove, flush:h.U,query:h.Pa,entity:h.F,entities:h.entities,documentCountsByUser:h.wb,userDocumentIdsByEntity:h.rc,join:h.join}),$save:function(l){h.kc(i.w,l,d.anchor)},$window:o,$uid:function(){return""+(new Date).getTime()},$users:f},"ROOT");a.data("scope",i);d.F(i);d.compile();c.bind();(new A(a)).bind();var j=_(aa(i,{updateView:i.d,set:i.h,get:i.get,eval:i.eval})).extend({init:function(){b.location.listen(_(d.ec).bind(d));d.Ma();d.Cb();d.d();return j},element:a[0],config:b});return j}function G(a,b,c){var d= _.last(b);p(c,function(e){d[e]=_[e]});m[a]=m[a]||{};p(b,function(e){B(m[a],e)})}function x(a,b,c,d,e){this.D=a;this.location=d;this.k=c;this.anchor={};this.wc=b;this.qb=e||{};this.Ua=[]}function S(a,b,c){this.db=a;this.da=b;this.ia=c;this.hb=o;this.G=[]}function X(a,b,c){this.post=a;this.Wa=b;this.J=[];this.ea={$collections:this.J};this.anchor=c;this.Q=[]}function w(a,b){var c=[];ca(c,a,b?"\n ":null,_([]));return c.join("")}function M(a){try{var b=new E(a,true),c=b.ba();b.K();return c()}catch(d){Z("fromJson error: ", a,d);throw d;}}function ca(a,b,c,d){if(typeof b=="object"){if(d.include(b)){a.push("RECURSION");return}d.push(b)}var e=typeof b;if(b===null)a.push("null");else if(e==="function")return;else if(e==="boolean")a.push(""+b);else if(e==="number")isNaN(b)?a.push("null"):a.push(""+b);else if(e==="string")return a.push(m.String.quoteUnicode(b));else if(e==="object")if(b instanceof Array){a.push("[");var f=b.length;e=false;for(var g=0;g>2;c=(c&3)<<4|d>>4;g=(d&15)<<2|e>>6;h=e&63;if(isNaN(d))g=h=64;else if(isNaN(e))h=64;b=b+this.A.charAt(f)+this.A.charAt(c)+this.A.charAt(g)+this.A.charAt(h)}return b},Gc:function(a){var b="",c,d,e,f,g,h=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");h>4;d=(d&15)<<4|f>>2;e=(f&3)<<6|g;b+=String.fromCharCode(c);if(f!=64)b+=String.fromCharCode(d);if(g!=64)b+= String.fromCharCode(e)}return b=da.fb(b)},gb:function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;c127&&d<2048)b+=String.fromCharCode(d>>6|192);else{b+=String.fromCharCode(d>>12|224);b+=String.fromCharCode(d>>6&63|128)}b+=String.fromCharCode(d&63|128)}}return b},fb:function(a){for(var b="",c=0,d=c1=c2=0;c191&&d<224){c2=a.charCodeAt(c+1); b+=String.fromCharCode((d&31)<<6|c2&63);c+=2}else{c2=a.charCodeAt(c+1);c3=a.charCodeAt(c+2);b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63);c+=3}}return b}};if(typeof y.getAttribute=="undefined")y.getAttribute=K();if(typeof Node=="undefined")Node={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12};o.console||(o.console= {log:n,error:n});var Q,U,k=o.jQuery||o.$,p=_.each,B=_.extend,m=o.angular||(o.angular={}),Ba=m.validator||(m.validator={}),r=m.filter||(m.filter={}),O=m.callbacks||(m.callbacks={});m.alert||(m.alert=function(){L(arguments);o.alert.apply(o,arguments)});ia.prototype={Nb:function(a){this.Da=a},watch:function(){var a=this;function b(){if(a.M!==a.location.href){var c=a.location.hash.match(/^#\$iframe_notify=(.*)$/);if(c){a.M.match(/#/)||(a.M+="#");a.location.href=a.M;c="_iframe_notify_"+c[1];var d=O[c]; delete O[c];try{(d||n)()}catch(e){alert(e)}}else{a.Da(a.location.href);a.M=a.location.href}}a.setTimeout(b,a.delay)}b()},h:function(a){var b=this.location.href;b.match(/#/)||(b+="#");if(b!=a)this.location.href=a;this.Jc=a},get:function(){return o.location.href}};m.startUrlWatcher=function(){var a=new ia(o.location);a.watch();return aa(a,{listen:a.Nb,set:a.h,get:a.get})};m.compile=function(a,b){k=o.jQuery;U=k.browser.msie;b=_({server:"",location:{get:n,set:n,listen:n}}).extend(b||{});Ha(b);Ga();return Ia(k(a), b)};var I={typeOf:function(a){if(a===null)return"null";var b=typeof a;if(b=="object"){if(a instanceof Array)return"array";if(a instanceof Date)return"date";if(a.nodeType==1)return"element"}return b}},Y={},Ca={includeIf:function(a,b,c){var d=_.indexOf(a,b);if(c)d==-1&&a.push(b);else a.splice(d,1);return a},sum:function(a,b){b=m.Function.compile(b);for(var c=0,d=0;d=0&&a.splice(c,1);return b},find:function(a, b,c){if(b){var d=m.Function.compile(b);_.detect(a,function(e){if(d(e)){c=e;return true}});return c}},findById:function(a,b){return m.yc.find(a,function(c){return c.Ya==b},null)},filter:function(a,b){var c=[];c.pb=function(j){for(var l=0;l-1;case "object":for(var q in j)if(q.charAt(0)!== "$"&&e(j[q],l))return true;return false;case "array":for(q=0;q=0&&a.splice(d,1);a.unshift((c?"-":"+")+b);return a},orderByDirection:function(a,b,c,d){c=c||"ng-ascend";d=d||"ng-descend";a=a[0]||"";var e=true;if(a.charAt(0)=="-"){a=a.substring(1);e=false}else if(a.charAt(0)=="+")a=a.substring(1);return a==b?e?c:d:""},merge:function(a,b,c){var d=a[b];if(!d){d={};a[b]=d}V(c,d);return a}},Ja={quote:function(a){return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/\t/g, "\\t").replace(/\v/g,"\\v")+'"'},quoteUnicode:function(a){a=m.String.quote(a);for(var b=[],c=0;c-1;){c1||x.L(a[0])!==null};x.L=function(a){return(a=a.replace(/\n/gm," ").match(/^\{\{(.*)\}\}$/))?a[1]:null};x.prototype={fc:function(a){var b={};a.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(c,d,e){if(d)b[decodeURIComponent(d)]=decodeURIComponent(e)});return b},Ma:function(){var a=this,b=this.location.get()||"",c=b.indexOf("#");if(!(c<0)){b=this.fc(b.substring(c+ 1));p(a.anchor,function(d,e){delete a.anchor[e]});p(b,function(d,e){a.anchor[e]=d})}},ec:function(){this.Ma();this.d()},pc:function(){var a=this.location.get()||"",b=a.indexOf("#");if(b>-1)a=a.substring(0,b);a+="#";b="";for(var c in this.anchor){var d=this.anchor[c];if(typeof d==="undefined"||d===null)delete this.anchor[c];else{a+=b+encodeURIComponent(c);if(d!==true)a+="="+encodeURIComponent(d);b="&"}}this.location.set(a);return a},d:function(){(new Date).getTime();var a=k(this.D).scope();a.h("$invalidWidgets", []);a.d();(new Date).getTime();this.pc();_.each(this.Ua,function(b){b()})},S:function(a){var b=k(this.D),c=b.find(a);if(b.is(a))c=c.andSelf();return c},Cb:function(){this.S("[ng-init]").each(function(){var a=k(this),b=a.scope();try{b.eval(a.attr("ng-init"))}catch(c){alert("EVAL ERROR:\n"+a.attr("ng-init")+"\n"+w(c,true))}})},F:function(a){var b=this;this.S("[ng-entity]").attr("ng-watch",function(){try{var c=k(this);return a.F(c.attr("ng-entity"),b.k)+(c.attr("ng-watch")||"")}catch(d){L(d);alert(d)}})}, compile:function(){var a=k(this.D);if(this.qb.autoSubmit){var b=this.S(":submit").not("[ng-action]");b.attr("ng-action","$save()");b.not(":disabled").not("ng-bind-attr").attr("ng-bind-attr",'{disabled:"{{$invalidWidgets}}"}')}this.Na(this.D)(this.D,a.scope(),"");this.S("a[ng-action]").live("click",function(){var c=k(this),d=c.scope();try{d.eval(c.attr("ng-action"));c.removeAttr("ng-error");c.removeClass("ng-exception")}catch(e){c.addClass("ng-exception");c.attr("ng-error",w(e,true))}d.get("$updateView")(); return false})},oc:function(a,b,c){b=b.concat();var d=b.pop(),e=x.Z(a.nodeValue);if(e.length>1||x.L(e[0])){var f=a.parentNode;if(fa(f)){f.setAttribute("ng-bind-template",a.nodeValue);c.push({path:b,b:function(l){return new N(l,l.getAttribute("ng-bind-template"))}})}else for(var g=0;g2&&a.setAttribute("ng-bind-attr",d)}a.getAttribute||L(a);var j=a.getAttribute("ng-repeat");if(j){a.removeAttribute("ng-repeat");var l=this.Na(a);d=y.createComment("ng-repeat: "+j);e=a.parentNode;e.insertBefore(d,a);e.removeChild(a);function q(s,t,z){var J=k(a).clone();J.css("display","");J.attr("ng-repeat-index",""+ z);J.data("scope",s);l(J[0],s,t+z+":");return J}c.push({path:b,b:function(s,t,z){return new Aa(k(s),j,q,z)}})}else{a.getAttribute("ng-eval")&&c.push({path:b,b:this.Xb});a.getAttribute("ng-bind")&&c.push({path:b,b:this.La});a.getAttribute("ng-bind-attr")&&c.push({path:b,b:this.Tb});a.getAttribute("ng-hide")&&c.push({path:b,b:this.Yb});a.getAttribute("ng-show")&&c.push({path:b,b:this.Zb});a.getAttribute("ng-class")&&c.push({path:b,b:this.Ub});a.getAttribute("ng-class-odd")&&c.push({path:b,b:this.Wb}); a.getAttribute("ng-class-even")&&c.push({path:b,b:this.Vb});a.getAttribute("ng-style")&&c.push({path:b,b:this.$b});a.getAttribute("ng-watch")&&c.push({path:b,b:this.ac});d=a.nodeName;if(d=="INPUT"||d=="TEXTAREA"||d=="SELECT"||d=="BUTTON"){var C=this;c.push({path:b,b:function(s,t,z){s.name=z+s.name.split(":").pop();return C.wc.rb(k(s),t)}})}if(d=="OPTION")if(!k("')}; B(T.prototype,{cancel:n,complete:n,httpStatus:function(a){alert("httpStatus:"+this.I+" status:"+a)},ioError:function(){alert("ioError:"+this.I)},open:function(){alert("open:"+this.I)},progress:n,securityError:function(){alert("securityError:"+this.I)},uploadCompleteData:function(a){a=M(a);a.url=this.va+"/"+a.id+"/"+a.text;this.view.find("input").attr("checked",true);var b=this.view.scope();this.value=a;this.e(b);this.value=null},select:function(a,b){this.name=a;this.view.find("a").text(a).attr("href", a);this.view.find("span").text(m.filter.bytes(b));this.upload()},e:function(a){var b=this.view.find("input").attr("checked")?this.value:null;if(this.c===b)return false;else{a.h(this.I,b);return true}},d:function(a){if((a=a.get(this.I))&&this.value!==a){this.value=a;this.view.find("a").attr("href",this.value.url).text(this.value.text);this.view.find("span").text(m.filter.bytes(this.value.size))}this.view.find("input").attr("checked",!!a)},upload:function(){this.name&&this.qc.uploadFile(this.va)}}); R.prototype={e:P(true),d:n};R.Ib=new R;var La=R;na.prototype={e:function(a){var b=this.view.value;if(this.c===b)return false;else{a.o(this.exp,b);this.c=b;return true}},d:function(a){var b=this.view,c=a.get(this.exp);if(typeof c==="undefined"){c=this.s;a.o(this.exp,c)}c=c?c:"";if(this.c!=c)this.c=b.value=c;var d=false;b.removeAttribute("ng-error");if(this.jc)d=!(c&&c.length>0);var e=d?"Required Value":null;if(!d&&this.P&&c){e=a.tc(this.P,c);d=!!e}if(this.Ca!==e){this.Ca=d;if(e!==null){b.setAttribute("ng-error", e);a.Qb(this)}k(b).toggleClass("ng-validation-error",d)}}};oa.prototype={e:function(a){var b=this.view;b=b.checked?b.value:"";if(this.c===b)return false;else{a.o(this.exp,b);this.c=b;return true}},d:function(a){var b=this.view,c=a.eval(this.exp);if(typeof c==="undefined"){c=this.s;a.o(this.exp,c)}b.checked=b.value==""+c}};pa.prototype={e:function(a){if(this.view.selectedIndex<0)a.o(this.exp,null);else{var b=this.view.value;if(this.c===b)return false;else{a.o(this.exp,b);this.c=b;return true}}},d:function(a){var b= this.view,c=a.get(this.exp);if(typeof c==="undefined"){c=this.s;a.o(this.exp,c)}if(c!==this.c){b.value=c?c:"";this.c=c}}};qa.prototype={selected:function(){for(var a=[],b=this.view.options,c=0;cd;--b){var q=this.children.pop().element[0];q.parentNode.removeChild(q)}if(h&&h.element[0].nodeName==="OPTION")if(d=k(h.element[0].parentNode).data("controller")){d.c=undefined;d.d(a)}})}};A.sa="mouseleave mouseout click dblclick keypress keyup";A.dc=function(){A.na();var a=k(this);a.bind(A.sa,A.na);var b=a.position(),c=y.documentElement,d=(self.innerWidth||c&&c.clientWidth||y.body.clientWidth)-b.left;c=a.hasClass("ng-exception")?"EXCEPTION:":"Validation error...";a=a.attr("ng-error"); d=d>375?"left":"right";c=k("
"+c+"
"+a+"
");k("body").append(c);if(d==="left")a=b.left+this.offsetWidth+11;else{a=b.left-315;c.find(".ng-arrow-right").css({left:301})}c.css({left:a+"px",top:b.top-3+"px"});return true};A.na=function(){k("#ng-callout").unbind(A.sa,A.na).remove();return true};A.prototype={bind:function(){this.D.find(".ng-validation-error,.ng-exception").live("mouseover", A.dc)}};W.Za='
loading....
';W.prototype={ob:function(){this.ca===0&&this.Ha.show();this.ca++},yb:function(){this.ca--;this.ca===0&&this.Ha.hide("fold")}}})(window,document);