!function(M,F,O,P){"use strict";M.isWindow=M.isWindow||function(e){returnnull!=e&&e===e.window},F=void0!==F&&F.Math==Math?F:"undefined"!=typeofself&&self.Math==Math?self:Function("return this")(),M.api=M.fn.api=function(w){varC,e=M.isFunction(this)?M(F):M(this),k=e.selector||"",T=(newDate).getTime(),D=[],S=w,A="string"==typeofS,E=[].slice.call(arguments,1);returne.each(function(){varo,i,n,e,r,a,f=M.isPlainObject(w)?M.extend(!0,{},M.fn.api.settings,w):M.extend({},M.fn.api.settings),t=f.namespace,s=f.metadata,l=f.selector,c=f.error,u=f.className,d="."+t,m="module-"+t,p=M(this),g=p.closest(l.form),h=f.stateContext?[F,O].indexOf(f.stateContext)<0?M(O).find(f.stateContext):M(f.stateContext):p,v=this,b=h[0],y=p.data(m),x={initialize:function(){A||(a=f.data,x.bind.events()),x.instantiate()},instantiate:function(){x.verbose("Storing instance of module",x),y=x,p.data(m,y)},destroy:function(){x.verbose("Destroying previous module for",v),p.removeData(m).off(d)},bind:{events:function(){vare=x.get.event();e?(x.verbose("Attaching API events to element",e),p.on(e+d,x.event.trigger)):"now"==f.on&&(x.debug("Querying API endpoint immediately"),x.query())}},decode:{json:function(e){if(e!==P&&"string"==typeofe)try{e=JSON.parse(e)}catch(e){}returne}},read:{cachedResponse:function(e){vart;if(F.Storage!==P)returnt=sessionStorage.getItem(e+x.get.normalizedData()),x.debug("Using cached response",e,f.data,t),x.decode.json(t);x.error(c.noStorage)}},write:{cachedResponse:function(e,t){t&&""===t?x.debug("Response empty, not caching",t):F.Storage===P?x.error(c.noStorage):(M.isPlainObject(t)&&(t=JSON.stringify(t)),sessionStorage.setItem(e+x.get.normalizedData(),t),x.verbose("Storing cached response for url",e,f.data,t))}},query:function(){if(x.is.disabled())x.debug("Element is disabled API request aborted");else{if(x.is.loading()){if(!f.interruptRequests)returnvoidx.debug("Cancelling request, previous request is still pending");x.debug("Interrupting previous request"),x.abort()}f.defaultData&&M.extend(!0,f.urlData,x.get.defaultData()),f.serializeForm&&(f.data=x.add.formData(a||f.data)),!1===(i=x.get.settings())?(x.cancelled=!0,x.error(c.beforeSend)):(x.cancelled=!1,(n=x.get.templatedURL())||x.is.mocked()?((n=x.add.urlData(n))||x.is.mocked())&&(i.url=f.base+n,o=M.extend(!0,{},f,{type:f.method||f.type,data:e,url:f.base+n,beforeSend:f.beforeXHR,success:function(){},failure:function(){},complete:function(){}}),x.debug("Querying URL",o.url),x.verbose("Using AJAX settings",o),"local"===f.cache&&x.read.cachedResponse(n)?(x.debug("Response returned from local cache"),x.request=x.create.request(),x.request.resolveWith(b,[x.read.cachedResponse(n)])):f.throttle?f.throttleFirstRequest||x.timer?(x.debug("Throttling request",f.throttle),clearTimeout(x.timer),x.timer=setTimeout(function(){x.timer&&deletex.timer,x.debug("Sending throttled request",e,o.method),x.send.request()},f.throttle)):(x.debug("Sending request",e,o.method),x.send.request(),x.timer=setTimeout(function(){},f.throttle)):(x.debug("Sending request",e,o.method),x.send.request())):x.error(c.missingURL))}},should:{removeError:function(){return!0===f.hideError||"auto"===f.hideError&&!x.is.form()}},is:{disabled:function(){return0<p.filter(l.disabled).length},expectingJSON:function(){return"json"===f.dataType||"jsonp"===f.dataType},form:function(){returnp.is("form")||h.is("form")},mocked:function(){returnf.mockResponse||f.mockResponseAsync||f.response||f.responseAsync},input:function(){returnp.is("input")},loading:function(){return!!x.request&&"pending"==x.request.state()},abortedRequest:function(e){returne&&e.readyState!==P&&0===e.readyState?(x.verbose("XHR request determined to be aborted"),!0):(x.verbose("XHR request was not aborted"),!1)},validResponse:function(e){returnx.is.expectingJSON()&&M.isFunction(f.successTest)?(x.debug("Checking JSON returned success",f.successTest,e),f.successTest(e)?(x.debug("Response passed success test",e),!0):(x.debug("Response failed success test",e),!1)):(x.verbose("Response is not JSON, skipping validation",f.successTest,e),!0)}},was:{cancelled: