text: (function(){(function(a){a.CarCrashSingletonClass.prototype.api=function(d){var b,c;c=this;b=Q.defer();$.ajax({type:d.method,url:d.action,data:d.data,dataType:"json",cache:false,success:function(e){var f;if(typeof e.success!=="undefined"&&e.success){b.resolve(e)}else{f=c.composeApiError(e);b.reject(f)}},error:function(g,h,f){var e;e=new Error("Network request failed.");e.textStatus=h;e.errorThrown=f;b.reject(e)}})};a.CarCrashSingletonClass.prototype.composeApiError=function(g){var f,c,e,b,d;if(typeof g.errors!=="undefined"&&g.errors){f="API errors occurred: <br>";d=g.errors;for(e=0,b=d.length;e<b;e++){c=d[e];f+=c.code+": "+c.message+"<br>"}}else{f="General API error occurred."}return f}})(window)}).call(this);