!function(t){function e(e,a,r){var i=this;return this.on("click.pjax",e,function(e){var o=t.extend({},g(a,r));o.container||(o.container=t(this).attr("data-pjax")||i),n(e,o)})}function n(e,n,a){a=g(n,a);var i=e.currentTarget;if("A"!==i.tagName.toUpperCase())throw"$.fn.pjax or $.pjax.click requires an anchor element";if(!(e.which>1||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||location.protocol!==i.protocol||location.hostname!==i.hostname||i.href.indexOf("#")>-1&&x(i)==x(location)||e.isDefaultPrevented())){var o={url:i.href,container:t(i).attr("data-pjax"),target:i},s=t.extend({},o,a),c=t.Event("pjax:click");t(i).trigger(c,[s]),c.isDefaultPrevented()||(r(s),e.preventDefault(),t(i).trigger("pjax:clicked",[s]))}}function a(e,n,a){a=g(n,a);var i=e.currentTarget,o=t(i);if("FORM"!==i.tagName.toUpperCase())throw"$.pjax.submit requires a form element";var s={type:(o.attr("method")||"GET").toUpperCase(),url:o.attr("action"),container:o.attr("data-pjax"),target:i};if("GET"!==s.type&&void 0!==window.FormData)s.data=new FormData(i),s.processData=!1,s.contentType=!1;else{if(t(i).find(":file").length)return;s.data=t(i).serializeArray()}r(t.extend({},s,a)),e.preventDefault()}function r(e){e=t.extend(!0,{},t.ajaxSettings,r.defaults,e),t.isFunction(e.url)&&(e.url=e.url());var n,a=e.target,i=v(e.url).hash,s=j(e.container),c=e.context=s[0],u=s[1];function l(e,n,r){r||(r={}),r.relatedTarget=a;var i=t.Event(e,r);return c.trigger(i,n),!i.isDefaultPrevented()}e.data||(e.data={}),t.isArray(e.data)?e.data.push({name:"_pjax",value:u}):e.data._pjax=u,e.beforeSend=function(t,a){if("GET"!==a.type&&(a.timeout=0),t.setRequestHeader("X-PJAX","true"),t.setRequestHeader("X-PJAX-Container",u),!l("pjax:beforeSend",[t,a]))return!1;a.timeout>0&&(n=setTimeout(function(){l("pjax:timeout",[t,e])&&t.abort("timeout")},a.timeout),a.timeout=0);var r=v(a.url);i&&(r.hash=i),e.requestUrl=m(r)},e.complete=function(t,a){n&&clearTimeout(n),l("pjax:complete",[t,a,e]),l("pjax:end",[t,e])},e.error=function(t,n,a){var r=b("",t,e),i=l("pjax:error",[t,n,a,e]);"GET"==e.type&&"abort"!==n&&i&&o(r.url)},e.success=function(n,a,s){var p=r.state,f="function"==typeof t.pjax.defaults.version?t.pjax.defaults.version():t.pjax.defaults.version,h=s.getResponseHeader("X-PJAX-Version"),m=b(n,s,e),x=v(m.url);if(i&&(x.hash=i,m.url=x.href),f&&h&&f!==h)o(m.url);else if(m.contents){if(r.state={id:e.id||d(),url:m.url,title:m.title,container:u,fragment:e.fragment,timeout:e.timeout},(e.push||e.replace)&&window.history.replaceState(r.state,m.title,m.url),t.contains(e.container,document.activeElement))try{document.activeElement.blur()}catch(t){}m.title&&(document.title=m.title),l("pjax:beforeReplace",[m.contents,e],{state:r.state,previousState:p}),c.html(m.contents);var g=c.find("input[autofocus], textarea[autofocus]").last()[0];g&&document.activeElement!==g&&g.focus(),function(e){if(!e)return;var n=t("script[src]");e.each(function(){var e=this.src,a=n.filter(function(){return this.src===e});if(!a.length){var r=document.createElement("script"),i=t(this).attr("type");i&&(r.type=i),r.src=t(this).attr("src"),document.head.appendChild(r)}})}(m.scripts);var j=e.scrollTo;if(i){var y=decodeURIComponent(i.slice(1)),w=document.getElementById(y)||document.getElementsByName(y)[0];w&&(j=t(w).offset().top)}"number"==typeof j&&t(window).scrollTop(j),l("pjax:success",[n,a,s,e])}else o(m.url)},r.state||(r.state={id:d(),url:window.location.href,title:document.title,container:u,fragment:e.fragment,timeout:e.timeout},window.history.replaceState(r.state,document.title)),f(r.xhr),r.options=e;var p,x,g=r.xhr=t.ajax(e);return g.readyState>0&&(e.push&&!e.replace&&(p=r.state.id,x=h(c,u),T[p]=x,S.push(p),P(E,0),P(S,r.defaults.maxCacheLength),window.history.pushState(null,"",e.requestUrl)),l("pjax:start",[g,e]),l("pjax:send",[g,e])),r.xhr}function i(e,n){var a={url:window.location.href,push:!1,replace:!0,scrollTo:!1};return r(t.extend(a,g(e,n)))}function o(t){window.history.replaceState(null,"",r.state.url),window.location.replace(t)}var s=!0,c=window.location.href,u=window.history.state;function l(e){s||f(r.xhr);var n,a=r.state,i=e.state;if(i&&i.container){if(s&&c==i.url)return;if(a){if(a.id===i.id)return;n=a.id",{method:"GET"===a?"GET":"POST",action:n,style:"display:none"});"GET"!==a&&"POST"!==a&&r.append(t("",{type:"hidden",name:"_method",value:a.toLowerCase()}));var i=e.data;if("string"==typeof i)t.each(i.split("&"),function(e,n){var a=n.split("=");r.append(t("",{type:"hidden",name:a[0],value:a[1]}))});else if(t.isArray(i))t.each(i,function(e,n){r.append(t("",{type:"hidden",name:n.name,value:n.value}))});else if("object"==typeof i){var o;for(o in i)r.append(t("",{type:"hidden",name:o,value:i[o]}))}t(document.body).append(r),r.submit()}function f(e){e&&e.readyState<4&&(e.onreadystatechange=t.noop,e.abort())}function d(){return(new Date).getTime()}function h(t,e){var n=t.clone();return n.find("script").each(function(){this.src||jQuery._data(this,"globalEval",!1)}),[e,n.contents()]}function m(t){return t.search=t.search.replace(/([?&])(_pjax|_)=[^&]*/g,""),t.href.replace(/\?($|#)/,"$1")}function v(t){var e=document.createElement("a");return e.href=t,e}function x(t){return t.href.replace(/#.*/,"")}function g(e,n){return e&&n?n.container=e:n=t.isPlainObject(e)?e:{container:e},n.container&&(n.container=j(n.container)),n}function j(e){var n,a;if(t.isArray(e)?(a=e[0],n=e[1]):a=t(n=e),a.length)return[a,n];throw"no pjax container for "+n}function y(t,e){return t.filter(e).add(t.find(e))}function w(e){return t.parseHTML(e,document,!0)}function b(e,n,a){var r={},i=/]*>([\s\S.]*)<\/head>/i)[0])),c=t(w(e.match(/]*>([\s\S.]*)<\/body>/i)[0]));else s=c=t(w(e));if(0===c.length)return r;if(r.title=y(s,"title").last().text(),a.fragment){if("body"===a.fragment)var u=c;else u=y(c,a.fragment).first();u.length&&(r.contents="body"===a.fragment?u:u.contents(),r.title||(r.title=u.attr("title")||u.data("title")))}else i||(r.contents=c);return r.contents&&(r.contents=r.contents.not(function(){return t(this).is("title")}),r.contents.find("title").remove(),r.scripts=y(r.contents,"script[src]").remove(),r.contents=r.contents.not(r.scripts)),r.title&&(r.title=t.trim(r.title)),r}u&&u.container&&(r.state=u),"state"in window.history&&(s=!1);var T={},E=[],S=[];function P(t,e){for(;t.length>e;)delete T[t.shift()]}function A(){return t("meta").filter(function(){var e=t(this).attr("http-equiv");return e&&"X-PJAX-VERSION"===e.toUpperCase()}).attr("content")}function C(){t.fn.pjax=e,t.pjax=r,t.pjax.enable=t.noop,t.pjax.disable=D,t.pjax.click=n,t.pjax.submit=a,t.pjax.reload=i,t.pjax.defaults={timeout:650,push:!0,replace:!1,type:"GET",dataType:"html",scrollTo:0,maxCacheLength:20,version:A},t(window).on("popstate.pjax",l)}function D(){t.fn.pjax=function(){return this},t.pjax=p,t.pjax.enable=C,t.pjax.disable=t.noop,t.pjax.click=t.noop,t.pjax.submit=t.noop,t.pjax.reload=function(){window.location.reload()},t(window).off("popstate.pjax",l)}t.event.props&&t.inArray("state",t.event.props)<0?t.event.props.push("state"):"state"in t.Event.prototype||t.event.addProp("state"),t.support.pjax=window.history&&window.history.pushState&&window.history.replaceState&&!navigator.userAgent.match(/((iPod|iPhone|iPad).+\bOS\s+[1-4]\D|WebApps\/.+CFNetwork)/),t.support.pjax?C():D()}(jQuery);