text: !function(e){if(!t){var t={},a={},r={_plugins:{},load:{},bind:{},event:function(e,t){return e},pre_filter:function(e){return e.data},filter:function(e){return e},target:function(e){if("string"==typeof e.params.success?"function"==typeof window[e.params.success]&&window[e.params.success](e):"function"==typeof e.params.success&&e.params.success(e),e.params.target)if(e.params.target.is("textarea,input")&&"object"==typeof e.data?e.params.target.val(JSON.stringify(e.data)).trigger("change"):e.params.target[e.params.targetInsert](e.data),"string"==typeof e.params.callback){if("function"==typeof window[e.params.callback])return window[e.params.callback](e)}else if("function"==typeof e.params.callback)return e.params.callback(e)},request_data:function(e){return e.data},request:function(r){if((r.params.trigger.data("cacheLocal")||r.params.trigger.data("cacheSession"))&&!r.params.trigger.data("cachePurge")){var s;if(r.params.trigger.data("cacheLocal")?s=r.params.trigger.data("cacheLocal"):r.params.trigger.data("cacheSession")&&(s=r.params.trigger.data("cacheSession")),"undefined"!=typeof t[s])return{data:t[s]};if("undefined"!=typeof Storage){var i;if(r.params.trigger.data("cacheLocal")?i=localStorage.getItem(s):r.params.trigger.data("cacheSession")&&(i=sessionStorage.getItem(s)),i){try{i=JSON.parse(i)}catch(n){i=i}return{data:i}}}}return a[r.params.trigger.prop("id")]&&a[r.params.trigger.prop("id")].abort(),a[r.params.trigger.prop("id")]=e.ajax(r.request),a[r.params.trigger.prop("id")]},request_complete:function(e){e.params.complete(e),e.params.loadElement.removeClass(e.params.loadClass),a[e.params.trigger.prop("id")]&&delete a[e.params.trigger.prop("id")]},request_error:function(e){e.params.error(e),e.params.complete(e.jqxhr,e.textStatus)},refresh:function(t,a){e(a.triggerClass).baldrick(a)}};e.fn.baldrick=function(t){var a=function(e,t,a){var r;for(var s in o.helpers._plugins)if("function"==typeof o.helpers._plugins[s][e]&&(r=o.helpers._plugins[s][e](t,o,a),"undefined"!=typeof r&&(t=r),t===!1))return!1;if("function"==typeof o.helpers[e]&&(r=o.helpers[e](t,o,a),"undefined"!=typeof r&&(t=r),!t))return!1;for(var i in o.helpers._plugins)if("function"==typeof o.helpers._plugins[i]["after_"+e]&&(r=o.helpers._plugins[i]["after_"+e](t,o,a),"undefined"!=typeof r&&(t=r),t===!1))return!1;return t},s=function(t){var a={},r=t.find("input,radio,checkbox,select,textarea,file"),s={};if(r.length){for(var i=0;i<r.length;i++)if(null!==r[i].getAttribute("name")){for(var n=e(r[i]),o=n.prop("name").replace(/\[/gi,":").replace(/\]/gi,""),l=o.split(":"),c=n.is(":checkbox,:radio")?n.filter(":checked").val():n.val(),d={},p=l.length-1;p>=0;p--){var u=l[p];if(0===u.length&&("undefined"==typeof s[l[p-1]]?s[l[p-1]]=0:s[l[p-1]]+=1,u=s[l[p-1]]),p===l.length-1)d[u]=c;else{var f=d;d={},d[u]=f}}e.extend(!0,a,d)}return a}},i=this.selector,n=this.not("._tisBound");n.addClass("_tisBound"),"undefined"!=typeof t&&"object"==typeof t.helper&&(r._plugins._params_helpers_=t.helper);var o=e.extend(!0,t,{helpers:r},{triggerClass:i}),l=function(){return!0},c={init:l,before:l,callback:!1,success:!1,complete:l,error:l};for(var d in c)"string"==typeof o[d]?c[d]="function"==typeof window[o[d]]?window[o[d]]:l:"function"==typeof o[d]&&(c[d]=o[d]);return n=a("bind",n),n===!1?this:a("ready",n.each(function(t){this.id||(this.id="baldrick_trigger_"+((new Date).getTime()+t));var r=e(this),i=r.data("event")?r.data("event"):o.event?o.event:r.is("form")?"submit":"click";return r.on(i,function(t){var r=e(a("event",this,t));if(r.data("for")){var l=e(r.data("for")),d=e.extend({},l.data(),r.data());return delete d["for"],l.data(d),l.is("form")?(l.submit(),this):l.trigger(l.data("event")?l.data("event"):i)}if(r.is("form")&&!r.data("request")&&r.attr("action")&&r.data("request",r.attr("action")),r.is("a")&&!r.data("request")&&r.attr("href")&&(r.attr("href").indexOf("#")<0?r.data("request",r.attr("href")):r.data("href",r.attr("href"))),(r.data("before")&&"function"==typeof window[r.data("before")]?window[r.data("before")](this,t):c.before(this,t))===!1)return void e(o.triggerClass).baldrick(o);if((r.data("init")&&"function"==typeof window[r.data("init")]?window[r.data("init")](this,t):c.init(this,t))===!1)return void e(o.triggerClass).baldrick(o);var p={trigger:r,callback:r.data("callback")?"function"==typeof window[r.data("callback")]?window[r.data("callback")]:r.data("callback"):c.callback,success:r.data("success")?"function"==typeof window[r.data("success")]?window[r.data("success")]:r.data("success"):c.success,method:r.data("method")?r.data("method"):r.attr("method")?r.attr("method"):o.method?o.method:"GET",dataType:r.data("type")?r.data("type"):o.dataType?o.dataType:!1,timeout:r.data("timeout")?r.data("timeout"):12e4,target:r.data("target")?"_parent"===r.data("target")?r.parent():e("_self"===r.data("target")?r:r.data("target")):e(o.target?o.target:"<html>"),targetInsert:r.data("targetInsert")?"replace"===r.data("targetInsert")?"replaceWith":r.data("targetInsert"):o.targetInsert?"replace"===o.targetInsert?"replaceWith":o.targetInsert:"html",loadClass:r.data("loadClass")?r.data("loadClass"):o.loadClass?o.loadClass:"loading",activeClass:r.data("activeClass")?r.data("activeClass"):o.activeClass?o.activeClass:"active",activeElement:r.data("activeElement")?"_parent"===r.data("activeElement")?r.parent():e(r.data("activeElement")):o.activeElement?"_parent"===o.activeElement?r.parent():e(o.activeElement):r,cache:r.data("cache")?r.data("cache"):o.cache?o.cache:!1,complete:r.data("complete")&&"function"==typeof window[r.data("complete")]?window[r.data("complete")]:c.complete,error:r.data("error")&&"function"==typeof window[r.data("error")]?window[r.data("error")]:c.error,resultSelector:!1,event:i};if(p.url=r.data("request")?r.data("request"):o.request?o.request:p.callback,p.loadElement=r.data("loadElement")?"_parent"===r.data("loadElement")?r.parent():e(r.data("loadElement")):o.loadElement&&e(o.loadElement)?e(o.loadElement):p.target,p=a("params",p),p===!1)return!1;if(t.preventDefault(),"function"==typeof window[p.url]){var u=window[p.url](p,i);return u=a("pre_filter",{data:u,params:p}),u=a("filter",{data:u,rawData:u,params:p}),a("target",u),a("refresh",{params:p}),a("request_complete",{jqxhr:null,textStatus:"complete",request:_,params:p}),this}try{if(e(p.url).length)var u=e(p.url).is("input,select,radio,checkbox,file,textarea")?e(p.url).val():e(p.url).is("form")?s(e(p.url)):e(p.url).html()}catch(t){}if("undefined"!=typeof u){if("json"===p.dataType)try{u=JSON.parse(u)}catch(t){}u=a("pre_filter",{data:u,params:p}),u=a("filter",{data:u,rawData:u,params:p}),a("target",u),a("refresh",{params:p}),a("request_complete",{jqxhr:null,textStatus:"complete",request:_,params:p});return this}switch(typeof p.url){case"function":return p.url(this,t);case"boolean":case"object":return;case"string":if(p.url.indexOf(" ")>-1){var f=p.url.split(" ");p.url=f[0],p.resultSelector=f[1]}}r.data("group")?e('._tisBound[data-group="'+r.data("group")+'"]').each(function(){var t=e(this),a=t.data("activeElement")?"_parent"===t.data("activeElement")?t.parent():e(t.data("activeElement")):o.activeElement?"_parent"===o.activeElement?r.parent():e(o.activeElement):t;a.removeClass(t.data("activeClass")?t.data("activeClass"):o.activeClass?o.activeClass:p.activeClass)}):e("._tisBound:not([data-group])").each(function(){var t=e(this),a=t.data("activeElement")?"_parent"===t.data("activeElement")?t.parent():e(t.data("activeElement")):o.activeElement?"_parent"===o.activeElement?r.parent():e(o.activeElement):t;a.removeClass(t.data("activeClass")?t.data("activeClass"):o.activeClass?o.activeClass:p.activeClass)});p.activeElement.addClass(p.activeClass),p.loadElement.addClass(p.loadClass);var g;if("undefined"==typeof FormData||!r.is("input:file")&&"POST"!==p.method){var m=r.serializeArray(),h=p.trigger.data(),v=[];o.data&&(h=e.extend(o.data,h)),m.length&&(e.each(m,function(e,t){v.push(t)}),p.requestData=s(r)),p.data&&(h=e.extend(h,p.data)),g=h,p.requestData=e.extend(r.data(),p.requestData)}else{p.method="POST",p.contentType=!1,p.processData=!1,p.cache=!1,p.xhrFields={onprogress:function(e){e.lengthComputable}},g=r.is("form")?new FormData(r[0]):new FormData,r.is("input,select,textarea")&&r.data("_value",r.val());for(var y in p.trigger.data())g.append(y,p.trigger.data(y));if(p.data&&g.append("data",JSON.stringify(p.data)),r.is("input,select,textarea"))if(r.is("input:file"))if(r[0].files.length>1)for(var w=0;w<r[0].files.length;w++)g.append(r.prop("name"),r[0].files[w]);else g.append(r.prop("name"),r[0].files[0]);else r.is("input:checkbox")||r.is("input:radio")?r.prop("checked")&&g.append(r.prop("name"),r.val()):g.append(r.prop("name"),r.val())}var _={url:p.url,data:a("request_data",{data:g,params:p}),cache:p.cache,timeout:p.timeout,type:p.method,success:function(t,r,s){if(p.resultSelector)if("object"==typeof t){for(var i=p.resultSelector.replace(/\[/g,".").replace(/\]/g,"").split("."),n=t,o=0;o<i.length;o++)n=n[i[o]];t=n}else if("string"==typeof t){var l=e(p.resultSelector,e("<html>").html(t));1===l.length?t=e("<html>").html(l).html():(t=e("<html>"),l.each(function(){t.append(this)}),t=t.html())}var c=t;if(p.trigger.data("cacheLocal")||p.trigger.data("cacheSession")){var d;if(p.trigger.data("cacheLocal")?d=p.trigger.data("cacheLocal"):p.trigger.data("cacheSession")&&(d=p.trigger.data("cacheSession")),"undefined"!=typeof Storage)if(p.trigger.data("cacheLocal"))try{localStorage.setItem(d,s.responseText)}catch(u){console.log(u)}else if(p.trigger.data("cacheSession"))try{sessionStorage.setItem(d,s.responseText)}catch(u){console.log(u)}e(window).trigger("baldrick.cache",d)}t=a("pre_filter",{data:t,request:_,params:p,xhr:s}),t=a("filter",{data:t,rawData:c,request:_,params:p,xhr:s}),a("target",t)},complete:function(e,t){a("request_complete",{jqxhr:e,textStatus:t,request:_,params:p}),a("refresh",{jqxhr:e,textStatus:t,request:_,params:p}),r.data("once")&&r.off(i).removeClass("_tisBound")},error:function(e,t,r){a("request_error",{jqxhr:e,textStatus:t,error:r,request:_,params:p})}};if(p.dataType&&(_.dataType=p.dataType),"undefined"!=typeof p.contentType&&(_.contentType=p.contentType),"undefined"!=typeof p.processData&&(_.processData=p.processData),"undefined"!=typeof p.xhrFields&&(_.xhrFields=p.xhrFields),_=a("request_params",_,p),_===!1)return n;var b=a("request",{request:_,params:p});if(b.data){var u=b.data;a("target",a("filter",a("pre_filter",{data:u,request:_,params:p}))),a("request_complete",{jqxhr:!1,textStatus:!0,request:_,params:p}),a("refresh",{jqxhr:!1,textStatus:!0,request:_,params:p})}}),(r.data("autoload")||r.data("poll"))&&(r.data("delay")?setTimeout(function(e,t){return e.trigger(t)},r.data("delay"),r,i):r.trigger(i)),r.data("poll")&&(r.data("delay")?setTimeout(function(e,t){return setInterval(function(e,t){return e.trigger(t)},e.data("poll"),e,t)},r.data("delay")):setInterval(function(e,t){return e.trigger(t)},r.data("poll"),r,i)),this}))},e.fn.baldrick.cacheObject=function(e,a){t[e]=a},e.fn.baldrick.registerhelper=function(t,a,s){var i={};"object"==typeof a?(i[t]=a,r._plugins=e.extend(!0,i,r._plugins)):"string"==typeof a&&"string"==typeof t&&"function"==typeof s&&(i[a]={},i[a][t]=s,r._plugins=e.extend(!0,i,r._plugins))}}}(jQuery);