UNPKG

25 kBJavaScriptView Raw
1(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
2var Pjax=require("pjax"),Nprogress=require("nprogress"),onmount=require("onmount"),each=require("dom101/each"),toggleClass=require("dom101/toggle-class"),ready=require("dom101/ready"),Scrolltrack=require("./scrolltrack"),Scrollclass=require("./scrollclass");void function(){function e(){var e=document.querySelector("title");window.ga&&window.ga("send","pageview",{page:window.location.href,title:e&&e.text})}ready(function(){new Pjax({selectors:[".body",".toc-menu","title"],analytics:e})}),ready(e),document.addEventListener("pjax:send",function(){Nprogress.start()}),document.addEventListener("pjax:error",function(){Nprogress.done()}),document.addEventListener("pjax:complete",function(){Nprogress.done()})}(),onmount(".js-menu-toggle",function(){this.addEventListener("click",function(){toggleClass(document.body,"-menu-visible")})}),void function(){ready(function(){onmount()}),document.addEventListener("pjax:complete",function(){onmount()})}(),void function(){var e=new Scrolltrack({menu:".toc-menu",selector:"h2, h3",onupdate:function(e,n){var o=document.querySelector(".toc-menu"),t=o.querySelector(".link.-active, .link.-notactive");toggleClass(t,"-active",!e),toggleClass(t,"-notactive",e)}});document.addEventListener("pjax:complete",function(){e.update()}),ready(function(){e.update()})}(),void function(){onmount(".footer-nav",function(e){e.sc=Scrollclass(this,{className:"-expanded",onscroll:function(e){return this.maxScroll-e<88}})},function(e){e.sc.destroy()})}(),void function(){onmount(".header-nav",function(e){e.sc=Scrollclass(this,{className:"-expanded",onscroll:function(e){return 40>e}})},function(e){e.sc.destroy()})}();
3},{"./scrollclass":2,"./scrolltrack":3,"dom101/each":8,"dom101/ready":10,"dom101/toggle-class":13,"nprogress":14,"onmount":15,"pjax":16}],2:[function(require,module,exports){
4function Scrollclass(e,o){return this instanceof Scrollclass?(o||(o={}),this.el=q(e),this.parent=q(o.parent||document),this.className=o.className||"active",this.onresize=(o.onresize||noop).bind(this),this.onscroll=(o.onscroll||noop).bind(this),this._onscroll=debounce(this.poll.bind(this),5),this._onresize=debounce(this.update.bind(this),5),void this.listen()):new Scrollclass(e,o)}function noop(){}function q(e){return"string"==typeof e?document.querySelector(e):"object"==typeof e&&e[0]?e[0]:e}var debounce=require("debounce"),documentHeight=require("dom101/document-height"),toggleClass=require("dom101/toggle-class"),scrollTop=require("dom101/scroll-top");Scrollclass.prototype.listen=function(){window.addEventListener("resize",this._onresize),window.addEventListener("resize",this._onscroll),document.addEventListener("load",this._onresize,!0),document.addEventListener("load",this._onscroll,!0),this.parent.addEventListener("scroll",this._onscroll),this._onresize(),this._onscroll()},Scrollclass.prototype.destroy=function(){window.removeEventListener("resize",this._onresize),window.removeEventListener("resize",this._onscroll),document.removeEventListener("load",this._onresize,!0),document.removeEventListener("load",this._onscroll,!0),this.parent.removeEventListener("scroll",this._onscroll)},Scrollclass.prototype.update=function(){this.documentHeight=documentHeight(),this.winHeight=window.innerHeight,this.maxScroll=this.documentHeight-this.winHeight,this.onresize()},Scrollclass.prototype.poll=function(){var e=this.onscroll(scrollTop());toggleClass(this.el,this.className,e)},module.exports=Scrollclass;
5},{"debounce":4,"dom101/document-height":7,"dom101/scroll-top":12,"dom101/toggle-class":13}],3:[function(require,module,exports){
6function Scrolltrack(t){return this instanceof Scrolltrack?(t||(t={}),this.selector=t.selector||"h1, h2, h3, h4, h5, h6",this.parent=t.parent||document,this.onupdate=t.onupdate||function(){},this.menu=t.menu||document,this.scrollParent=t.scrollParent||document,this.offsetPercent=t.offsetPercent||.1,this.listener=debounce(this.onScroll,5).bind(this),this.update=debounce(this._update,20).bind(this),this.active=void 0,this.index=[],this.listen(),void this.update()):new Scrolltrack(t)}function q(t){return"string"==typeof t?document.querySelector(t):"object"==typeof t&&t[0]?t[0]:t}var toggleClass=require("dom101/toggle-class"),scrollTop=require("dom101/scroll-top"),documentHeight=require("dom101/document-height"),debounce=require("debounce"),each=require("dom101/each");Scrolltrack.prototype.listen=function(){q(this.scrollParent).addEventListener("scroll",this.listener),document.addEventListener("load",this.update,!0),document.addEventListener("load",this.listener,!0),window.addEventListener("resize",this.update),window.addEventListener("resize",this.listener)},Scrolltrack.prototype.destroy=function(){q(this.scrollParent).removeEventListener("scroll",this.listener),document.removeEventListener("load",this.update,!0),document.removeEventListener("load",this.listener,!0),window.removeEventListener("resize",this.update),window.removeEventListener("resize",this.listener)},Scrolltrack.prototype.reindex=function(){var t=this.parent.querySelectorAll(this.selector),e=this.index=[],i={},o=q(this.menu);each(t,function(t){var r=t.getBoundingClientRect(),n=t.getAttribute("id");i[n]?i[n]++:i[n]=0;var s=o.querySelectorAll("[href="+JSON.stringify("#"+n)+"]");e.push({el:t,id:n,link:s[i[n]],top:r.top+scrollTop()})}),this.metrics={windowHeight:window.innerHeight,documentHeight:documentHeight()}},Scrolltrack.prototype._update=function(){this.reindex(),this.onScroll()},Scrolltrack.prototype.onScroll=function(){var t,e=this.scrollTop();if(each(this.index,function(i){i.top<e&&(t=i)}),t!==this.active){var i=this.active;this.active=t,this.follow(t,i),this.onupdate(t,i)}},Scrolltrack.prototype.scrollTop=function(){var t=scrollTop(),e=0,i=this.offsetPercent;if(this.metrics){var o=this.metrics.windowHeight,r=this.metrics.documentHeight-o,n=r-1.2*o;if(t>n){var s=(t-n)/o;e=o*(i+(1-i)*s)}else e=o*i}return t+e},Scrolltrack.prototype.follow=function(t,e){this.lastlink&&(toggleClass(this.lastlink,"-active",!1),this.lastlink=null),t&&t.link&&(toggleClass(t.link,"-active",!0),this.lastlink=t.link)},module.exports=Scrolltrack;
7},{"debounce":4,"dom101/document-height":7,"dom101/each":8,"dom101/scroll-top":12,"dom101/toggle-class":13}],4:[function(require,module,exports){
8var now=require("date-now");module.exports=function(n,u,t){function e(){var p=now()-a;u>p&&p>0?r=setTimeout(e,u-p):(r=null,t||(i=n.apply(o,l),r||(o=l=null)))}var r,l,o,a,i;return null==u&&(u=100),function(){o=this,l=arguments,a=now();var p=t&&!r;return r||(r=setTimeout(e,u)),p&&(i=n.apply(o,l),o=l=null),i}};
9},{"date-now":5}],5:[function(require,module,exports){
10function now(){return(new Date).getTime()}module.exports=Date.now||now;
11},{}],6:[function(require,module,exports){
12function addClass(s,a){s.classList?s.classList.add(a):s.className+=" "+a}module.exports=addClass;
13},{}],7:[function(require,module,exports){
14function documentHeight(){return Math.max(document.documentElement.clientHeight||0,document.body.scrollHeight||0,document.documentElement.scrollHeight||0,document.body.offsetHeight||0,document.documentElement.offsetHeight||0)}module.exports=documentHeight;
15},{}],8:[function(require,module,exports){
16function each(e,r){var n,o,t=e.length;if("number"==typeof t)for(n=0;t>n;n++)r(e[n],n);else{o=0;for(n in e)e.hasOwnProperty(n)&&r(e[n],n,o++)}return e}module.exports=each;
17},{}],9:[function(require,module,exports){
18function hasClass(s,a){return s.classList?s.classList.contains(a):new RegExp("(^| )"+a+"( |$)","gi").test(s.className)}module.exports=hasClass;
19},{}],10:[function(require,module,exports){
20function ready(e){document.addEventListener?document.addEventListener("DOMContentLoaded",e):document.attachEvent("onreadystatechange",function(){"interactive"===document.readyState&&e()})}module.exports=ready;
21},{}],11:[function(require,module,exports){
22function removeClass(s,e){if(s.classList)s.classList.remove(e);else{var a=new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi");s.className=s.className.replace(a," ")}}module.exports=removeClass;
23},{}],12:[function(require,module,exports){
24function scrollTop(){return window.pageYOffset?window.pageYOffset:document.documentElement.clientHeight?document.documentElement.scrollTop:document.body.scrollTop}module.exports=scrollTop;
25},{}],13:[function(require,module,exports){
26function toggleClass(s,e,a){return"undefined"==typeof a&&(a=!hasClass(s,e)),a?addClass(s,e):removeClass(s,e)}var addClass=require("./add-class"),removeClass=require("./remove-class"),hasClass=require("./has-class");module.exports=toggleClass;
27},{"./add-class":6,"./has-class":9,"./remove-class":11}],14:[function(require,module,exports){
28!function(n,e){"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=e():n.NProgress=e()}(this,function(){function n(n,e,t){return e>n?e:n>t?t:n}function e(n){return 100*(-1+n)}function t(n,t,r){var i;return i="translate3d"===c.positionUsing?{transform:"translate3d("+e(n)+"%,0,0)"}:"translate"===c.positionUsing?{transform:"translate("+e(n)+"%,0)"}:{"margin-left":e(n)+"%"},i.transition="all "+t+"ms "+r,i}function r(n,e){var t="string"==typeof n?n:o(n);return t.indexOf(" "+e+" ")>=0}function i(n,e){var t=o(n),i=t+e;r(t,e)||(n.className=i.substring(1))}function s(n,e){var t,i=o(n);r(n,e)&&(t=i.replace(" "+e+" "," "),n.className=t.substring(1,t.length-1))}function o(n){return(" "+(n.className||"")+" ").replace(/\s+/gi," ")}function a(n){n&&n.parentNode&&n.parentNode.removeChild(n)}var u={};u.version="0.2.0";var c=u.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};u.configure=function(n){var e,t;for(e in n)t=n[e],void 0!==t&&n.hasOwnProperty(e)&&(c[e]=t);return this},u.status=null,u.set=function(e){var r=u.isStarted();e=n(e,c.minimum,1),u.status=1===e?null:e;var i=u.render(!r),s=i.querySelector(c.barSelector),o=c.speed,a=c.easing;return i.offsetWidth,l(function(n){""===c.positionUsing&&(c.positionUsing=u.getPositioningCSS()),f(s,t(e,o,a)),1===e?(f(i,{transition:"none",opacity:1}),i.offsetWidth,setTimeout(function(){f(i,{transition:"all "+o+"ms linear",opacity:0}),setTimeout(function(){u.remove(),n()},o)},o)):setTimeout(n,o)}),this},u.isStarted=function(){return"number"==typeof u.status},u.start=function(){u.status||u.set(0);var n=function(){setTimeout(function(){u.status&&(u.trickle(),n())},c.trickleSpeed)};return c.trickle&&n(),this},u.done=function(n){return n||u.status?u.inc(.3+.5*Math.random()).set(1):this},u.inc=function(e){var t=u.status;return t?("number"!=typeof e&&(e=(1-t)*n(Math.random()*t,.1,.95)),t=n(t+e,0,.994),u.set(t)):u.start()},u.trickle=function(){return u.inc(Math.random()*c.trickleRate)},function(){var n=0,e=0;u.promise=function(t){return t&&"resolved"!==t.state()?(0===e&&u.start(),n++,e++,t.always(function(){e--,0===e?(n=0,u.done()):u.set((n-e)/n)}),this):this}}(),u.render=function(n){if(u.isRendered())return document.getElementById("nprogress");i(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=c.template;var r,s=t.querySelector(c.barSelector),o=n?"-100":e(u.status||0),l=document.querySelector(c.parent);return f(s,{transition:"all 0 linear",transform:"translate3d("+o+"%,0,0)"}),c.showSpinner||(r=t.querySelector(c.spinnerSelector),r&&a(r)),l!=document.body&&i(l,"nprogress-custom-parent"),l.appendChild(t),t},u.remove=function(){s(document.documentElement,"nprogress-busy"),s(document.querySelector(c.parent),"nprogress-custom-parent");var n=document.getElementById("nprogress");n&&a(n)},u.isRendered=function(){return!!document.getElementById("nprogress")},u.getPositioningCSS=function(){var n=document.body.style,e="WebkitTransform"in n?"Webkit":"MozTransform"in n?"Moz":"msTransform"in n?"ms":"OTransform"in n?"O":"";return e+"Perspective"in n?"translate3d":e+"Transform"in n?"translate":"margin"};var l=function(){function n(){var t=e.shift();t&&t(n)}var e=[];return function(t){e.push(t),1==e.length&&n()}}(),f=function(){function n(n){return n.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(n,e){return e.toUpperCase()})}function e(n){var e=document.body.style;if(n in e)return n;for(var t,r=i.length,s=n.charAt(0).toUpperCase()+n.slice(1);r--;)if(t=i[r]+s,t in e)return t;return n}function t(t){return t=n(t),s[t]||(s[t]=e(t))}function r(n,e,r){e=t(e),n.style[e]=r}var i=["Webkit","O","Moz","ms"],s={};return function(n,e){var t,i,s=arguments;if(2==s.length)for(t in e)i=e[t],void 0!==i&&e.hasOwnProperty(t)&&r(n,t,i);else r(n,s[1],s[2])}}();return u});
29},{}],15:[function(require,module,exports){
30void function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():window.jQuery?window.jQuery.onmount=t():e.onmount=t()}(this,function(e){function t(e,o,i){if(0===arguments.length||u(e)||l(e))t.poll();else if(1===arguments.length)t.poll(e);else{var r=new n(e,o,i);d.push(r),r.register()}return this}function n(e,n,o){this.id="b"+v++,this.init=n,this.exit=o,this.selector=t.selectify(e),this.loaded=[],this.key="__onmount:"+v}function o(e){for(;e;){if(e===document.documentElement)return!0;e=e.parentElement}}function i(e,n){if(t.$)return t.$(e).each(n);for(var o=document.querySelectorAll(e),i=0,r=o.length;r>i;i++)n.apply(o[i])}function r(e,t){a[e]||(a[e]=[]),a[e].push(t),f.push(t)}function s(e,n){var o=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;if(t.$)return t.$(e).is(n);if(o)return o.call(e,n);if(e.parentNode){for(var i=e.parentNode.querySelectorAll(n),r=i.length;r--;0)if(i[r]===e)return!0;return!1}}function c(e,t){var n,o=e.length;if(o===+o)for(n=0;o>n;n++)t(e[n],n);else for(n in e)e.hasOwnProperty(n)&&t(e[n],n);return e}function u(e){return"function"==typeof e&&e.fn&&e.noConflict}function l(e){return"object"==typeof e&&e.target}var f,d,a,h,v=0,p=0;t.$=window.jQuery||window.Zepto||window.Ender,t.MutationObserver=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,t.debug=!1,t.poll=function(e){e&&(e=t.selectify(e));var n=(e?a[e]:f)||[];c(n,function(e){e()})},t.observe=function(){var e=t.MutationObserver;if("undefined"!=typeof e){var n=new e(function(e){c(d,function(t){c(e,function(e){c(e.addedNodes,function(e){s(e,t.selector)&&t.visitEnter(e)}),c(e.removedNodes,function(e){s(e,t.selector)&&t.visitExit(e)})})})});return n.observe(document,{subtree:!0,childList:!0}),t.observer=n,t(),!0}},t.unobserve=function(){this.observer&&(this.observer.disconnect(),delete this.observer)},t.reset=function(){f=t.handlers=[],a=t.selectors={},d=t.behaviors=[]},t.selectify=function(e){return"@"===e[0]?'[role~="'+e.substr(1).replace(/"/g,'\\"')+'"]':e},n.prototype.register=function(){var e=this,t=this.loaded,n=this.selector;r(n,function(){c(t,function(t,n){e.visitExit(t,n)}),i(n,function(){e.visitEnter(this)})})},n.prototype.visitEnter=function(e){if(!e[this.key]){var n={id:"c"+p,selector:this.selector};this.init.call(e,n)!==!1&&(t.debug&&h("enter",this.selector,e),e[this.key]=n,this.loaded.push(e),p++)}},n.prototype.visitExit=function(e,n){e&&!o(e)&&("undefined"==typeof n&&(n=this.loaded.indexOf(e)),this.loaded[n]=void 0,this.exit&&this.exit.call(e,e[this.key])!==!1&&(t.debug&&h("exit",this.selector,e),delete e[this.key]))};var b={enter:"background-color:#dfd;font-weight:bold;color:#141",exit:"background-color:#fdd;font-weight:bold;color:#411"};return h=~navigator.userAgent.indexOf("Mozilla")?function(e,t,n){console.log("%c %s ",b[e],t,n)}:function(e,t,n){console.log("(onmount)",e,t)},t.reset(),t});
31},{}],16:[function(require,module,exports){
32!function(t,e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define([],e):t.Pjax=e()}(this,function(){"use strict";function t(){return(new Date).getTime()}var e=function(o){this.firstrun=!0,this.options=o,this.options.elements=this.options.elements||"a[href], form[action]",this.options.selectors=this.options.selectors||["title",".js-Pjax"],this.options.switches=this.options.switches||{},this.options.switchesOptions=this.options.switchesOptions||{},this.options.history=this.options.history||!0,this.options.currentUrlFullReload=this.options.currentUrlFullReload||!1,this.options.analytics=this.options.analytics||function(t){window._gaq&&_gaq.push(["_trackPageview"]),window.ga&&ga("send","pageview",{page:t.url,title:t.title})},this.options.scrollTo=this.options.scrollTo||0,this.options.debug=this.options.debug||!1,this.maxUid=this.lastUid=t(),this.options.switches.head||(this.options.switches.head=this.switchElementsAlt),this.options.switches.body||(this.options.switches.body=this.switchElementsAlt),this.log("Pjax options",this.options),"function"!=typeof o.analytics&&(o.analytics=function(){}),this.parseDOM(document),e.on(window,"popstate",function(t){if(t.state){var o=e.clone(this.options);o.url=t.state.url,o.title=t.state.title,o.history=!1,t.state.uid<this.lastUid?o.backward=!0:o.forward=!0,this.lastUid=t.state.uid,this.loadUrl(t.state.url,o)}}.bind(this))};if(e.isSupported=function(){return window.history&&window.history.pushState&&window.history.replaceState&&!navigator.userAgent.match(/((iPod|iPhone|iPad).+\bOS\s+[1-4]\D|WebApps\/.+CFNetwork)/)},e.forEachEls=function(t,e,o){return t instanceof HTMLCollection||t instanceof NodeList?Array.prototype.forEach.call(t,e,o):void e.call(o,t)},e.on=function(t,o,s,n){o="string"==typeof o?o.split(" "):o,o.forEach(function(o){e.forEachEls(t,function(t){t.addEventListener(o,s,n)})},this)},e.off=function(t,o,s,n){o="string"==typeof o?o.split(" "):o,o.forEach(function(o){e.forEachEls(t,function(t){t.removeEventListener(o,s,n)})},this)},e.trigger=function(t,o){o="string"==typeof o?o.split(" "):o,o.forEach(function(o){var s;document.createEvent?(s=document.createEvent("HTMLEvents"),s.initEvent(o,!0,!0)):(s=document.createEventObject(),s.eventType=o),s.eventName=o,document.createEvent?e.forEachEls(t,function(t){t.dispatchEvent(s)}):e.forEachEls(t,function(t){t.fireEvent("on"+s.eventType,s)})},this)},e.clone=function(t){if(null===t||"object"!=typeof t)return t;var e=t.constructor();for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);return e},e.executeScripts=function(t){e.forEachEls(t.querySelectorAll("script"),function(t){t.type&&"text/javascript"!==t.type.toLowerCase()||(t.parentNode&&t.parentNode.removeChild(t),e.evalScript(t))})},e.evalScript=function(t){var e=t.text||t.textContent||t.innerHTML||"",o=document.querySelector("head")||document.documentElement,s=document.createElement("script");if(e.match("document.write"))return console&&console.log&&console.log("Script contains document.write. Can’t be executed correctly. Code skipped ",t),!1;s.type="text/javascript";try{s.appendChild(document.createTextNode(e))}catch(n){s.text=e}return o.insertBefore(s,o.firstChild),o.removeChild(s),!0},e.prototype={log:function(){this.options.debug&&console&&("function"==typeof console.log?console.log.apply(console,arguments):console.log&&console.log(arguments))},getElements:function(t){return t.querySelectorAll(this.options.elements)},parseDOM:function(t){e.forEachEls(this.getElements(t),function(t){switch(t.tagName.toLowerCase()){case"a":this.attachLink(t);break;case"form":this.log("Pjax doesnt support <form> yet. TODO :)");break;default:throw"Pjax can only be applied on <a> or <form> submit"}},this)},attachLink:function(t){e.on(t,"click",function(o){return o.which>1||o.metaKey||o.ctrlKey||o.shiftKey||o.altKey?-1:t.protocol!==window.location.protocol||t.host!==window.location.host?-2:t.pathname===location.pathname&&t.hash.length>0?-3:t.hash&&t.href.replace(t.hash,"")===location.href.replace(location.hash,"")?-4:t.href===location.href+"#"?-5:(o.preventDefault(),this.options.currentUrlFullReload&&t.href===window.location.href?(window.location.reload(),-6):void this.loadUrl(t.href,e.clone(this.options)))}.bind(this)),e.on(t,"keyup",function(t){this.log("pjax todo")}.bind(this))},forEachSelectors:function(t,o,s){s=s||document,this.options.selectors.forEach(function(n){e.forEachEls(s.querySelectorAll(n),t,o)})},switchSelectors:function(t,o,s,n){t.forEach(function(t){var i=o.querySelectorAll(t),a=s.querySelectorAll(t);if(this.log("Pjax switch",t,i,a),i.length!==a.length)throw"DOM doesn’t look the same on new loaded page: ’"+t+"’ - new "+i.length+", old "+a.length;e.forEachEls(i,function(o,s){var i=a[s];this.log("newEl",o,"oldEl",i),this.options.switches[t]?this.options.switches[t].bind(this)(i,o,n,this.options.switchesOptions[t]):e.switches.outerHTML.bind(this)(i,o,n)},this)},this)},latestChance:function(t){window.location=t},onSwitch:function(){e.trigger(window,"resize scroll")},loadContent:function(t,o){var s=document.implementation.createHTMLDocument(""),n=/<html[^>]+>/gi,i=/\s?[a-z:]+(?:\=(?:\'|\")[^\'\">]+(?:\'|\"))*/gi,a=t.match(n);a&&a.length&&(a=a[0].match(i),a.length&&(a.shift(),a.forEach(function(t){var e=t.trim().split("=");s.documentElement.setAttribute(e[0],e[1].slice(1,-1))}))),s.documentElement.innerHTML=t,this.log("load content",s.documentElement.attributes,s.documentElement.innerHTML.length),this.switchSelectors(this.options.selectors,s,document,o);var c=Array.prototype.slice.call(document.querySelectorAll("[autofocus]")).pop();c&&document.activeElement!==c&&c.focus(),this.options.selectors.forEach(function(t){e.forEachEls(document.querySelectorAll(t),function(t){e.executeScripts(t)})})},doRequest:function(t,e){var o=new XMLHttpRequest;o.onreadystatechange=function(){4===o.readyState&&200===o.status?e(o.responseText):4!==o.readyState||404!==o.status&&500!==o.status||e(!1)},o.open("GET",t+(/[?&]/.test(t)?"&":"?")+(new Date).getTime(),!0),o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.send(null)},loadUrl:function(o,s){this.log("load href",o,s),e.trigger(document,"pjax:send",s),this.doRequest(o,function(n){if(n===!1)return void e.trigger(document,"pjax:complete pjax:error",s);document.activeElement.blur();try{this.loadContent(n,s)}catch(i){if(this.options.debug)throw i;return console&&console.error&&console.error("Pjax switch fail: ",i),void this.latestChance(o)}s.history&&(this.firstrun&&(this.lastUid=this.maxUid=t(),this.firstrun=!1,window.history.replaceState({url:window.location.href,title:document.title,uid:this.maxUid},document.title)),this.lastUid=this.maxUid=t(),window.history.pushState({url:o,title:s.title,uid:this.maxUid},s.title,o)),this.forEachSelectors(function(t){this.parseDOM(t)},this),e.trigger(document,"pjax:complete pjax:success",s),s.analytics(),s.scrollTo!==!1&&(s.scrollTo.length>1?window.scrollTo(s.scrollTo[0],s.scrollTo[1]):window.scrollTo(0,s.scrollTo))}.bind(this))}},e.switches={outerHTML:function(t,e,o){t.outerHTML=e.outerHTML,this.onSwitch()},innerHTML:function(t,e,o){t.innerHTML=e.innerHTML,t.className=e.className,this.onSwitch()},sideBySide:function(t,o,s,n){var i=Array.prototype.forEach,a=[],c=[],r=document.createDocumentFragment(),l="animationend webkitAnimationEnd MSAnimationEnd oanimationend",h=0,u=function(t){t.target==t.currentTarget&&(h--,0>=h&&a&&(a.forEach(function(t){t.parentNode&&t.parentNode.removeChild(t)}),c.forEach(function(t){t.className=t.className.replace(t.getAttribute("data-pjax-classes"),""),t.removeAttribute("data-pjax-classes")}),c=null,a=null,this.onSwitch()))}.bind(this);n=n||{},i.call(t.childNodes,function(t){a.push(t),t.classList&&!t.classList.contains("js-Pjax-remove")&&(t.hasAttribute("data-pjax-classes")&&(t.className=t.className.replace(t.getAttribute("data-pjax-classes"),""),t.removeAttribute("data-pjax-classes")),t.classList.add("js-Pjax-remove"),n.callbacks&&n.callbacks.removeElement&&n.callbacks.removeElement(t),n.classNames&&(t.className+=" "+n.classNames.remove+" "+(s.backward?n.classNames.backward:n.classNames.forward)),h++,e.on(t,l,u,!0))}),i.call(o.childNodes,function(t){if(t.classList){var o="";n.classNames&&(o=" js-Pjax-add "+n.classNames.add+" "+(s.backward?n.classNames.forward:n.classNames.backward)),n.callbacks&&n.callbacks.addElement&&n.callbacks.addElement(t),t.className+=o,t.setAttribute("data-pjax-classes",o),c.push(t),r.appendChild(t),h++,e.on(t,l,u,!0)}}),t.className=o.className,t.appendChild(r)}},e.isSupported())return e;var o=function(){};for(var s in e.prototype)e.prototype.hasOwnProperty(s)&&"function"==typeof e.prototype[s]&&(o[s]=o);return o});
33},{}]},{},[1]);