!function(F,M,O,P){"use strict";F.isWindow=F.isWindow||function(e){returnnull!=e&&e===e.window},M=void0!==M&&M.Math==Math?M:"undefined"!=typeofself&&self.Math==Math?self:Function("return this")(),F.api=F.fn.api=function(w){varC,e=F.isFunction(this)?F(M):F(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=F.isPlainObject(w)?F.extend(!0,{},F.fn.api.settings,w):F.extend({},F.fn.api.settings),t=f.namespace,s=f.metadata,l=f.selector,c=f.error,u=f.className,d="."+t,p="module-"+t,m=F(this),g=m.closest(l.form),h=f.stateContext?[M,O].indexOf(f.stateContext)<0?F(O).find(f.stateContext):F(f.stateContext):m,v=this,b=h[0],y=m.data(p),x={initialize:function(){A||(a=f.data,x.bind.events()),x.instantiate()},instantiate:function(){x.verbose("Storing instance of module",x),y=x,m.data(p,y)},destroy:function(){x.verbose("Destroying previous module for",v),m.removeData(p).off(d)},bind:{events:function(){vare=x.get.event();e?(x.verbose("Attaching API events to element",e),m.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(M.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):M.Storage===P?x.error(c.noStorage):(F.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&&F.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=F.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<m.filter(l.disabled).length},expectingJSON:function(){return"json"===f.dataType||"jsonp"===f.dataType},form:function(){returnm.is("form")||h.is("form")},mocked:function(){returnf.mockResponse||f.mockResponseAsync||f.response||f.responseAsync},input:function(){returnm.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()&&F.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: