text: getJasmineRequireObj().ajax=function(e){var t={};return t.RequestStub=e.AjaxRequestStub(),t.RequestTracker=e.AjaxRequestTracker(),t.StubTracker=e.AjaxStubTracker(),t.ParamParser=e.AjaxParamParser(),t.eventBus=e.AjaxEventBus(),t.fakeRequest=e.AjaxFakeRequest(t.eventBus),t.MockAjax=e.MockAjax(t),t.MockAjax},getJasmineRequireObj().AjaxEventBus=function(){function e(){this.eventList={}}function t(e,t){return e[t]=e[t]||[],e[t]}function n(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;n++)if(t===e[n])return n;return-1}return e.prototype.addEventListener=function(e,n){t(this.eventList,e).push(n)},e.prototype.removeEventListener=function(e,t){var s=n(this.eventList[e],t);s>=0&&this.eventList[e].splice(s,1)},e.prototype.trigger=function(e){var t=this.eventList[e];if(t)for(var n=0;n<t.length;n++)t[n]()},function(){return new e}},getJasmineRequireObj().AjaxFakeRequest=function(e){function t(e,t,s){s=s||[];for(var r in t)n(s,r)||(e[r]=t[r]);return e}function n(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return!0;return!1}function s(e,t){return function(){e[t]&&e[t]()}}function r(e){e.eventBus.addEventListener("loadstart",s(e,"onloadstart")),e.eventBus.addEventListener("load",s(e,"onload")),e.eventBus.addEventListener("loadend",s(e,"onloadend")),e.eventBus.addEventListener("progress",s(e,"onprogress")),e.eventBus.addEventListener("error",s(e,"onerror")),e.eventBus.addEventListener("abort",s(e,"onabort")),e.eventBus.addEventListener("timeout",s(e,"ontimeout"))}function i(e){var t=["Can't build XHR.response for XHR.responseType of '",e,"'.","XHR.response must be explicitly stubbed"];return t.join(" ")}function a(s,a,o,u){function h(){a.track(this),this.eventBus=e(),r(this),this.requestHeaders={},this.overriddenMimeType=null}function c(e,t){e=e.toLowerCase();for(var n in t)if(n.toLowerCase()===e)return t[n]}function p(e,t){var n=[];if(e)if(e instanceof Array)n=e;else for(var s in e)e.hasOwnProperty(s)&&n.push({name:s,value:e[s]});else n.push({name:"Content-Type",value:t||"application/json"});return n}function d(e){if(s.DOMParser)return(new s.DOMParser).parseFromString(e,"text/xml");var t=new s.ActiveXObject("Microsoft.XMLDOM");return t.async="false",t.loadXML(e),t}function f(e,t){return n(l,t.toLowerCase())?d(e,t):t.match(/\+xml$/)?d(e,"text/xml"):null}var l=["text/xml","application/xml"],v=["responseBody","responseText","responseXML","status","statusText","responseTimeout"];return t(h.prototype,new s.XMLHttpRequest,v),t(h.prototype,{open:function(){this.method=arguments[0],this.url=arguments[1],this.username=arguments[3],this.password=arguments[4],this.readyState=1,this.onreadystatechange()},setRequestHeader:function(e,t){this.requestHeaders[e]=this.requestHeaders.hasOwnProperty(e)?[this.requestHeaders[e],t].join(", "):t},overrideMimeType:function(e){this.overriddenMimeType=e},abort:function(){this.readyState=0,this.status=0,this.statusText="abort",this.onreadystatechange(),this.eventBus.trigger("progress"),this.eventBus.trigger("abort"),this.eventBus.trigger("loadend")},readyState:0,onloadstart:null,onprogress:null,onabort:null,onerror:null,onload:null,ontimeout:null,onloadend:null,onreadystatechange:function(){},addEventListener:function(){this.eventBus.addEventListener.apply(this.eventBus,arguments)},removeEventListener:function(){this.eventBus.removeEventListener.apply(this.eventBus,arguments)},status:null,send:function(e){this.params=e,this.readyState=2,this.eventBus.trigger("loadstart"),this.onreadystatechange();var t=o.findStub(this.url,e,this.method);t&&this.respondWith(t)},contentType:function(){return c("content-type",this.requestHeaders)},data:function(){return this.params?u.findParser(this).parse(this.params):{}},getResponseHeader:function(e){e=e.toLowerCase();for(var t,n=0;n<this.responseHeaders.length;n++){var s=this.responseHeaders[n];e===s.name.toLowerCase()&&(t=t?[t,s.value].join(", "):s.value)}return t},getAllResponseHeaders:function(){for(var e=[],t=0;t<this.responseHeaders.length;t++)e.push(this.responseHeaders[t].name+": "+this.responseHeaders[t].value);return e.join("\r\n")+"\r\n"},responseText:null,response:null,responseType:null,responseValue:function(){switch(this.responseType){case null:case"":case"text":return this.readyState>=3?this.responseText:"";case"json":return JSON.parse(this.responseText);case"arraybuffer":throw i("arraybuffer");case"blob":throw i("blob");case"document":return this.responseXML}},respondWith:function(e){if(4===this.readyState)throw new Error("FakeXMLHttpRequest already completed");this.status=e.status,this.statusText=e.statusText||"",this.responseText=e.responseText||"",this.responseType=e.responseType||"",this.readyState=4,this.responseHeaders=p(e.responseHeaders,e.contentType),this.responseXML=f(e.responseText,this.getResponseHeader("content-type")||""),this.responseXML&&(this.responseType="document"),this.response="response"in e?e.response:this.responseValue(),this.onreadystatechange(),this.eventBus.trigger("progress"),this.eventBus.trigger("load"),this.eventBus.trigger("loadend")},responseTimeout:function(){if(4===this.readyState)throw new Error("FakeXMLHttpRequest already completed");this.readyState=4,jasmine.clock().tick(3e4),this.onreadystatechange("timeout"),this.eventBus.trigger("progress"),this.eventBus.trigger("timeout"),this.eventBus.trigger("loadend")},responseError:function(){if(4===this.readyState)throw new Error("FakeXMLHttpRequest already completed");this.readyState=4,this.onreadystatechange(),this.eventBus.trigger("progress"),this.eventBus.trigger("error"),this.eventBus.trigger("loadend")}}),h}return a},getJasmineRequireObj().MockAjax=function(e){function t(t){var n=new e.RequestTracker,s=new e.StubTracker,r=new e.ParamParser,i=t.XMLHttpRequest,a=e.fakeRequest(t,n,s,r);this.install=function(){t.XMLHttpRequest=a},this.uninstall=function(){t.XMLHttpRequest=i,this.stubs.reset(),this.requests.reset(),r.reset()},this.stubRequest=function(t,n,r){var i=new e.RequestStub(t,n,r);return s.addStub(i),i},this.withMock=function(e){this.install();try{e()}finally{this.uninstall()}},this.addCustomParamParser=function(e){r.add(e)},this.requests=n,this.stubs=s}return t},getJasmineRequireObj().AjaxParamParser=function(){function e(){var e=[{test:function(e){return/^application\/json/.test(e.contentType())},parse:function(e){return JSON.parse(e)}},{test:function(){return!0},parse:function(e){for(var t={},n=e.split("&"),s=0;s<n.length;++s){var r=n[s].replace(/\+/g," ").split("="),i=decodeURIComponent(r[0]);t[i]=t[i]||[],t[i].push(decodeURIComponent(r[1]))}return t}}],t=[];this.add=function(e){t.unshift(e)},this.findParser=function(e){for(var n in t){var s=t[n];if(s.test(e))return s}},this.reset=function(){t=[];for(var n in e)t.push(e[n])},this.reset()}return e},getJasmineRequireObj().AjaxRequestStub=function(){function e(e,t,n){var s=function(e){return e?e.split("&").sort().join("&"):void 0};if(e instanceof RegExp)this.url=e,this.query=void 0;else{var r=e.split("?");this.url=r[0],this.query=r.length>1?s(r[1]):void 0}this.data=s(t),this.method=n,this.andReturn=function(e){this.status=e.status||200,this.contentType=e.contentType,this.response=e.response,this.responseText=e.responseText,this.responseHeaders=e.responseHeaders},this.matches=function(e,t,n){var r=!1;if(e=e.toString(),this.url instanceof RegExp)r=this.url.test(e);else{var i=e.split("?"),a=i[0],o=i[1];r=this.url===a&&this.query===s(o)}return!(!r||this.data&&this.data!==s(t)||this.method&&this.method!==n)}}return e},getJasmineRequireObj().AjaxRequestTracker=function(){function e(){var e=[];this.track=function(t){e.push(t)},this.first=function(){return e[0]},this.count=function(){return e.length},this.reset=function(){e=[]},this.mostRecent=function(){return e[e.length-1]},this.at=function(t){return e[t]},this.filter=function(t){for(var n=[],s=0;s<e.length;s++)t instanceof RegExp&&t.test(e[s].url)?n.push(e[s]):t instanceof Function&&t(e[s])?n.push(e[s]):e[s].url===t&&n.push(e[s]);return n}}return e},getJasmineRequireObj().AjaxStubTracker=function(){function e(){var e=[];this.addStub=function(t){e.push(t)},this.reset=function(){e=[]},this.findStub=function(t,n,s){for(var r=e.length-1;r>=0;r--){var i=e[r];if(i.matches(t,n,s))return i}}}return e},function(){var e=getJasmineRequireObj(),t=e.ajax(e);"undefined"==typeof window&&"object"==typeof exports?(exports.MockAjax=t,jasmine.Ajax=new t(exports)):(window.MockAjax=t,jasmine.Ajax=new t(window))}();