mkdocs-material/material/assets/javascripts/application.js
2016-02-09 22:57:20 +01:00

1 line
31 KiB
JavaScript

function pegasus(e,t){return t=new XMLHttpRequest,t.open("GET",e),e=[],t.onreadystatechange=t.then=function(n,o,i,r){if(n&&n.call&&(e=[,n,o]),4==t.readyState&&(i=e[0|t.status/200])){try{r=JSON.parse(t.responseText)}catch(s){r=null}i(r,t)}},t.send(),t}if("document"in self&&("classList"in document.createElement("_")?!function(){"use strict";var e=document.createElement("_");if(e.classList.add("c1","c2"),!e.classList.contains("c2")){var t=function(e){var t=DOMTokenList.prototype[e];DOMTokenList.prototype[e]=function(e){var n,o=arguments.length;for(n=0;o>n;n++)e=arguments[n],t.call(this,e)}};t("add"),t("remove")}if(e.classList.toggle("c3",!1),e.classList.contains("c3")){var n=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:n.call(this,e)}}e=null}():!function(e){"use strict";if("Element"in e){var t="classList",n="prototype",o=e.Element[n],i=Object,r=String[n].trim||function(){return this.replace(/^\s+|\s+$/g,"")},s=Array[n].indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(t in this&&this[t]===e)return t;return-1},a=function(e,t){this.name=e,this.code=DOMException[e],this.message=t},c=function(e,t){if(""===t)throw new a("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(t))throw new a("INVALID_CHARACTER_ERR","String contains an invalid character");return s.call(e,t)},l=function(e){for(var t=r.call(e.getAttribute("class")||""),n=t?t.split(/\s+/):[],o=0,i=n.length;i>o;o++)this.push(n[o]);this._updateClassName=function(){e.setAttribute("class",this.toString())}},u=l[n]=[],h=function(){return new l(this)};if(a[n]=Error[n],u.item=function(e){return this[e]||null},u.contains=function(e){return e+="",-1!==c(this,e)},u.add=function(){var e,t=arguments,n=0,o=t.length,i=!1;do e=t[n]+"",-1===c(this,e)&&(this.push(e),i=!0);while(++n<o);i&&this._updateClassName()},u.remove=function(){var e,t,n=arguments,o=0,i=n.length,r=!1;do for(e=n[o]+"",t=c(this,e);-1!==t;)this.splice(t,1),r=!0,t=c(this,e);while(++o<i);r&&this._updateClassName()},u.toggle=function(e,t){e+="";var n=this.contains(e),o=n?t!==!0&&"remove":t!==!1&&"add";return o&&this[o](e),t===!0||t===!1?t:!n},u.toString=function(){return this.join(" ")},i.defineProperty){var d={get:h,enumerable:!0,configurable:!0};try{i.defineProperty(o,t,d)}catch(f){-2146823252===f.number&&(d.enumerable=!1,i.defineProperty(o,t,d))}}else i[n].__defineGetter__&&o.__defineGetter__(t,h)}}(self)),function(){"use strict";function e(t,o){function i(e,t){return function(){return e.apply(t,arguments)}}var r;if(o=o||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=o.touchBoundary||10,this.layer=t,this.tapDelay=o.tapDelay||200,this.tapTimeout=o.tapTimeout||700,!e.notNeeded(t)){for(var s=["onMouse","onClick","onTouchStart","onTouchMove","onTouchEnd","onTouchCancel"],a=this,c=0,l=s.length;l>c;c++)a[s[c]]=i(a[s[c]],a);n&&(t.addEventListener("mouseover",this.onMouse,!0),t.addEventListener("mousedown",this.onMouse,!0),t.addEventListener("mouseup",this.onMouse,!0)),t.addEventListener("click",this.onClick,!0),t.addEventListener("touchstart",this.onTouchStart,!1),t.addEventListener("touchmove",this.onTouchMove,!1),t.addEventListener("touchend",this.onTouchEnd,!1),t.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(t.removeEventListener=function(e,n,o){var i=Node.prototype.removeEventListener;"click"===e?i.call(t,e,n.hijacked||n,o):i.call(t,e,n,o)},t.addEventListener=function(e,n,o){var i=Node.prototype.addEventListener;"click"===e?i.call(t,e,n.hijacked||(n.hijacked=function(e){e.propagationStopped||n(e)}),o):i.call(t,e,n,o)}),"function"==typeof t.onclick&&(r=t.onclick,t.addEventListener("click",function(e){r(e)},!1),t.onclick=null)}}var t=navigator.userAgent.indexOf("Windows Phone")>=0,n=navigator.userAgent.indexOf("Android")>0&&!t,o=/iP(ad|hone|od)/.test(navigator.userAgent)&&!t,i=o&&/OS 4_\d(_\d)?/.test(navigator.userAgent),r=o&&/OS [6-7]_\d/.test(navigator.userAgent),s=navigator.userAgent.indexOf("BB10")>0;e.prototype.needsClick=function(e){switch(e.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(e.disabled)return!0;break;case"input":if(o&&"file"===e.type||e.disabled)return!0;break;case"label":case"iframe":case"video":return!0}return/\bneedsclick\b/.test(e.className)},e.prototype.needsFocus=function(e){switch(e.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!n;case"input":switch(e.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!e.disabled&&!e.readOnly;default:return/\bneedsfocus\b/.test(e.className)}},e.prototype.sendClick=function(e,t){var n,o;document.activeElement&&document.activeElement!==e&&document.activeElement.blur(),o=t.changedTouches[0],n=document.createEvent("MouseEvents"),n.initMouseEvent(this.determineEventType(e),!0,!0,window,1,o.screenX,o.screenY,o.clientX,o.clientY,!1,!1,!1,!1,0,null),n.forwardedTouchEvent=!0,e.dispatchEvent(n)},e.prototype.determineEventType=function(e){return n&&"select"===e.tagName.toLowerCase()?"mousedown":"click"},e.prototype.focus=function(e){var t;o&&e.setSelectionRange&&0!==e.type.indexOf("date")&&"time"!==e.type&&"month"!==e.type?(t=e.value.length,e.setSelectionRange(t,t)):e.focus()},e.prototype.updateScrollParent=function(e){var t,n;if(t=e.fastClickScrollParent,!t||!t.contains(e)){n=e;do{if(n.scrollHeight>n.offsetHeight){t=n,e.fastClickScrollParent=n;break}n=n.parentElement}while(n)}t&&(t.fastClickLastScrollTop=t.scrollTop)},e.prototype.getTargetElementFromEventTarget=function(e){return e.nodeType===Node.TEXT_NODE?e.parentNode:e},e.prototype.onTouchStart=function(e){var t,n,r;if(e.targetTouches.length>1)return!0;if(t=this.getTargetElementFromEventTarget(e.target),n=e.targetTouches[0],o){if(r=window.getSelection(),r.rangeCount&&!r.isCollapsed)return!0;if(!i){if(n.identifier&&n.identifier===this.lastTouchIdentifier)return e.preventDefault(),!1;this.lastTouchIdentifier=n.identifier,this.updateScrollParent(t)}}return this.trackingClick=!0,this.trackingClickStart=e.timeStamp,this.targetElement=t,this.touchStartX=n.pageX,this.touchStartY=n.pageY,e.timeStamp-this.lastClickTime<this.tapDelay&&e.preventDefault(),!0},e.prototype.touchHasMoved=function(e){var t=e.changedTouches[0],n=this.touchBoundary;return Math.abs(t.pageX-this.touchStartX)>n||Math.abs(t.pageY-this.touchStartY)>n?!0:!1},e.prototype.onTouchMove=function(e){return this.trackingClick?((this.targetElement!==this.getTargetElementFromEventTarget(e.target)||this.touchHasMoved(e))&&(this.trackingClick=!1,this.targetElement=null),!0):!0},e.prototype.findControl=function(e){return void 0!==e.control?e.control:e.htmlFor?document.getElementById(e.htmlFor):e.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},e.prototype.onTouchEnd=function(e){var t,s,a,c,l,u=this.targetElement;if(!this.trackingClick)return!0;if(e.timeStamp-this.lastClickTime<this.tapDelay)return this.cancelNextClick=!0,!0;if(e.timeStamp-this.trackingClickStart>this.tapTimeout)return!0;if(this.cancelNextClick=!1,this.lastClickTime=e.timeStamp,s=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,r&&(l=e.changedTouches[0],u=document.elementFromPoint(l.pageX-window.pageXOffset,l.pageY-window.pageYOffset)||u,u.fastClickScrollParent=this.targetElement.fastClickScrollParent),a=u.tagName.toLowerCase(),"label"===a){if(t=this.findControl(u)){if(this.focus(u),n)return!1;u=t}}else if(this.needsFocus(u))return e.timeStamp-s>100||o&&window.top!==window&&"input"===a?(this.targetElement=null,!1):(this.focus(u),this.sendClick(u,e),o&&"select"===a||(this.targetElement=null,e.preventDefault()),!1);return o&&!i&&(c=u.fastClickScrollParent,c&&c.fastClickLastScrollTop!==c.scrollTop)?!0:(this.needsClick(u)||(e.preventDefault(),this.sendClick(u,e)),!1)},e.prototype.onTouchCancel=function(){this.trackingClick=!1,this.targetElement=null},e.prototype.onMouse=function(e){return this.targetElement?e.forwardedTouchEvent?!0:e.cancelable&&(!this.needsClick(this.targetElement)||this.cancelNextClick)?(e.stopImmediatePropagation?e.stopImmediatePropagation():e.propagationStopped=!0,e.stopPropagation(),e.preventDefault(),!1):!0:!0},e.prototype.onClick=function(e){var t;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===e.target.type&&0===e.detail?!0:(t=this.onMouse(e),t||(this.targetElement=null),t)},e.prototype.destroy=function(){var e=this.layer;n&&(e.removeEventListener("mouseover",this.onMouse,!0),e.removeEventListener("mousedown",this.onMouse,!0),e.removeEventListener("mouseup",this.onMouse,!0)),e.removeEventListener("click",this.onClick,!0),e.removeEventListener("touchstart",this.onTouchStart,!1),e.removeEventListener("touchmove",this.onTouchMove,!1),e.removeEventListener("touchend",this.onTouchEnd,!1),e.removeEventListener("touchcancel",this.onTouchCancel,!1)},e.notNeeded=function(e){var t,o,i,r;if("undefined"==typeof window.ontouchstart)return!0;if(o=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!n)return!0;if(t=document.querySelector("meta[name=viewport]")){if(-1!==t.content.indexOf("user-scalable=no"))return!0;if(o>31&&document.documentElement.scrollWidth<=window.outerWidth)return!0}}if(s&&(i=navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/),i[1]>=10&&i[2]>=3&&(t=document.querySelector("meta[name=viewport]")))){if(-1!==t.content.indexOf("user-scalable=no"))return!0;if(document.documentElement.scrollWidth<=window.outerWidth)return!0}return"none"===e.style.msTouchAction||"manipulation"===e.style.touchAction?!0:(r=+(/Firefox\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1],r>=27&&(t=document.querySelector("meta[name=viewport]"),t&&(-1!==t.content.indexOf("user-scalable=no")||document.documentElement.scrollWidth<=window.outerWidth))?!0:"none"===e.style.touchAction||"manipulation"===e.style.touchAction?!0:!1)},e.attach=function(t,n){return new e(t,n)},"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return e}):"undefined"!=typeof module&&module.exports?(module.exports=e.attach,module.exports.FastClick=e):window.FastClick=e}(),function(){var e=function(t){var n=new e.Index;return n.pipeline.add(e.trimmer,e.stopWordFilter,e.stemmer),t&&t.call(n,n),n};e.version="0.5.12",e.utils={},e.utils.warn=function(e){return function(t){e.console&&console.warn&&console.warn(t)}}(this),e.EventEmitter=function(){this.events={}},e.EventEmitter.prototype.addListener=function(){var e=Array.prototype.slice.call(arguments),t=e.pop(),n=e;if("function"!=typeof t)throw new TypeError("last argument must be a function");n.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},e.EventEmitter.prototype.removeListener=function(e,t){if(this.hasHandler(e)){var n=this.events[e].indexOf(t);this.events[e].splice(n,1),this.events[e].length||delete this.events[e]}},e.EventEmitter.prototype.emit=function(e){if(this.hasHandler(e)){var t=Array.prototype.slice.call(arguments,1);this.events[e].forEach(function(e){e.apply(void 0,t)})}},e.EventEmitter.prototype.hasHandler=function(e){return e in this.events},e.tokenizer=function(e){return arguments.length&&null!=e&&void 0!=e?Array.isArray(e)?e.map(function(e){return e.toLowerCase()}):e.toString().trim().toLowerCase().split(/[\s\-]+/):[]},e.Pipeline=function(){this._stack=[]},e.Pipeline.registeredFunctions={},e.Pipeline.registerFunction=function(t,n){n in this.registeredFunctions&&e.utils.warn("Overwriting existing registered function: "+n),t.label=n,e.Pipeline.registeredFunctions[t.label]=t},e.Pipeline.warnIfFunctionNotRegistered=function(t){var n=t.label&&t.label in this.registeredFunctions;n||e.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",t)},e.Pipeline.load=function(t){var n=new e.Pipeline;return t.forEach(function(t){var o=e.Pipeline.registeredFunctions[t];if(!o)throw new Error("Cannot load un-registered function: "+t);n.add(o)}),n},e.Pipeline.prototype.add=function(){var t=Array.prototype.slice.call(arguments);t.forEach(function(t){e.Pipeline.warnIfFunctionNotRegistered(t),this._stack.push(t)},this)},e.Pipeline.prototype.after=function(t,n){e.Pipeline.warnIfFunctionNotRegistered(n);var o=this._stack.indexOf(t);if(-1==o)throw new Error("Cannot find existingFn");o+=1,this._stack.splice(o,0,n)},e.Pipeline.prototype.before=function(t,n){e.Pipeline.warnIfFunctionNotRegistered(n);var o=this._stack.indexOf(t);if(-1==o)throw new Error("Cannot find existingFn");this._stack.splice(o,0,n)},e.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);-1!=t&&this._stack.splice(t,1)},e.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,o=this._stack.length,i=0;n>i;i++){for(var r=e[i],s=0;o>s&&(r=this._stack[s](r,i,e),void 0!==r);s++);void 0!==r&&t.push(r)}return t},e.Pipeline.prototype.reset=function(){this._stack=[]},e.Pipeline.prototype.toJSON=function(){return this._stack.map(function(t){return e.Pipeline.warnIfFunctionNotRegistered(t),t.label})},e.Vector=function(){this._magnitude=null,this.list=void 0,this.length=0},e.Vector.Node=function(e,t,n){this.idx=e,this.val=t,this.next=n},e.Vector.prototype.insert=function(t,n){this._magnitude=void 0;var o=this.list;if(!o)return this.list=new e.Vector.Node(t,n,o),this.length++;if(t<o.idx)return this.list=new e.Vector.Node(t,n,o),this.length++;for(var i=o,r=o.next;void 0!=r;){if(t<r.idx)return i.next=new e.Vector.Node(t,n,r),this.length++;i=r,r=r.next}return i.next=new e.Vector.Node(t,n,r),this.length++},e.Vector.prototype.magnitude=function(){if(this._magnitude)return this._magnitude;for(var e,t=this.list,n=0;t;)e=t.val,n+=e*e,t=t.next;return this._magnitude=Math.sqrt(n)},e.Vector.prototype.dot=function(e){for(var t=this.list,n=e.list,o=0;t&&n;)t.idx<n.idx?t=t.next:t.idx>n.idx?n=n.next:(o+=t.val*n.val,t=t.next,n=n.next);return o},e.Vector.prototype.similarity=function(e){return this.dot(e)/(this.magnitude()*e.magnitude())},e.SortedSet=function(){this.length=0,this.elements=[]},e.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},e.SortedSet.prototype.add=function(){var e,t;for(e=0;e<arguments.length;e++)t=arguments[e],~this.indexOf(t)||this.elements.splice(this.locationFor(t),0,t);this.length=this.elements.length},e.SortedSet.prototype.toArray=function(){return this.elements.slice()},e.SortedSet.prototype.map=function(e,t){return this.elements.map(e,t)},e.SortedSet.prototype.forEach=function(e,t){return this.elements.forEach(e,t)},e.SortedSet.prototype.indexOf=function(e){for(var t=0,n=this.elements.length,o=n-t,i=t+Math.floor(o/2),r=this.elements[i];o>1;){if(r===e)return i;e>r&&(t=i),r>e&&(n=i),o=n-t,i=t+Math.floor(o/2),r=this.elements[i]}return r===e?i:-1},e.SortedSet.prototype.locationFor=function(e){for(var t=0,n=this.elements.length,o=n-t,i=t+Math.floor(o/2),r=this.elements[i];o>1;)e>r&&(t=i),r>e&&(n=i),o=n-t,i=t+Math.floor(o/2),r=this.elements[i];return r>e?i:e>r?i+1:void 0},e.SortedSet.prototype.intersect=function(t){for(var n=new e.SortedSet,o=0,i=0,r=this.length,s=t.length,a=this.elements,c=t.elements;;){if(o>r-1||i>s-1)break;a[o]!==c[i]?a[o]<c[i]?o++:a[o]>c[i]&&i++:(n.add(a[o]),o++,i++)}return n},e.SortedSet.prototype.clone=function(){var t=new e.SortedSet;return t.elements=this.toArray(),t.length=t.elements.length,t},e.SortedSet.prototype.union=function(e){var t,n,o;return this.length>=e.length?(t=this,n=e):(t=e,n=this),o=t.clone(),o.add.apply(o,n.toArray()),o},e.SortedSet.prototype.toJSON=function(){return this.toArray()},e.Index=function(){this._fields=[],this._ref="id",this.pipeline=new e.Pipeline,this.documentStore=new e.Store,this.tokenStore=new e.TokenStore,this.corpusTokens=new e.SortedSet,this.eventEmitter=new e.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},e.Index.prototype.on=function(){var e=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},e.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},e.Index.load=function(t){t.version!==e.version&&e.utils.warn("version mismatch: current "+e.version+" importing "+t.version);var n=new this;return n._fields=t.fields,n._ref=t.ref,n.documentStore=e.Store.load(t.documentStore),n.tokenStore=e.TokenStore.load(t.tokenStore),n.corpusTokens=e.SortedSet.load(t.corpusTokens),n.pipeline=e.Pipeline.load(t.pipeline),n},e.Index.prototype.field=function(e,t){var t=t||{},n={name:e,boost:t.boost||1};return this._fields.push(n),this},e.Index.prototype.ref=function(e){return this._ref=e,this},e.Index.prototype.add=function(t,n){var o={},i=new e.SortedSet,r=t[this._ref],n=void 0===n?!0:n;this._fields.forEach(function(n){var r=this.pipeline.run(e.tokenizer(t[n.name]));o[n.name]=r,e.SortedSet.prototype.add.apply(i,r)},this),this.documentStore.set(r,i),e.SortedSet.prototype.add.apply(this.corpusTokens,i.toArray());for(var s=0;s<i.length;s++){var a=i.elements[s],c=this._fields.reduce(function(e,t){var n=o[t.name].length;if(!n)return e;var i=o[t.name].filter(function(e){return e===a}).length;return e+i/n*t.boost},0);this.tokenStore.add(a,{ref:r,tf:c})}n&&this.eventEmitter.emit("add",t,this)},e.Index.prototype.remove=function(e,t){var n=e[this._ref],t=void 0===t?!0:t;if(this.documentStore.has(n)){var o=this.documentStore.get(n);this.documentStore.remove(n),o.forEach(function(e){this.tokenStore.remove(e,n)},this),t&&this.eventEmitter.emit("remove",e,this)}},e.Index.prototype.update=function(e,t){var t=void 0===t?!0:t;this.remove(e,!1),this.add(e,!1),t&&this.eventEmitter.emit("update",e,this)},e.Index.prototype.idf=function(e){var t="@"+e;if(Object.prototype.hasOwnProperty.call(this._idfCache,t))return this._idfCache[t];var n=this.tokenStore.count(e),o=1;return n>0&&(o=1+Math.log(this.documentStore.length/n)),this._idfCache[t]=o},e.Index.prototype.search=function(t){var n=this.pipeline.run(e.tokenizer(t)),o=new e.Vector,i=[],r=this._fields.reduce(function(e,t){return e+t.boost},0),s=n.some(function(e){return this.tokenStore.has(e)},this);if(!s)return[];n.forEach(function(t,n,s){var a=1/s.length*this._fields.length*r,c=this,l=this.tokenStore.expand(t).reduce(function(n,i){var r=c.corpusTokens.indexOf(i),s=c.idf(i),l=1,u=new e.SortedSet;if(i!==t){var h=Math.max(3,i.length-t.length);l=1/Math.log(h)}return r>-1&&o.insert(r,a*s*l),Object.keys(c.tokenStore.get(i)).forEach(function(e){u.add(e)}),n.union(u)},new e.SortedSet);i.push(l)},this);var a=i.reduce(function(e,t){return e.intersect(t)});return a.map(function(e){return{ref:e,score:o.similarity(this.documentVector(e))}},this).sort(function(e,t){return t.score-e.score})},e.Index.prototype.documentVector=function(t){for(var n=this.documentStore.get(t),o=n.length,i=new e.Vector,r=0;o>r;r++){var s=n.elements[r],a=this.tokenStore.get(s)[t].tf,c=this.idf(s);i.insert(this.corpusTokens.indexOf(s),a*c)}return i},e.Index.prototype.toJSON=function(){return{version:e.version,fields:this._fields,ref:this._ref,documentStore:this.documentStore.toJSON(),tokenStore:this.tokenStore.toJSON(),corpusTokens:this.corpusTokens.toJSON(),pipeline:this.pipeline.toJSON()}},e.Index.prototype.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(this),e.apply(this,t)},e.Store=function(){this.store={},this.length=0},e.Store.load=function(t){var n=new this;return n.length=t.length,n.store=Object.keys(t.store).reduce(function(n,o){return n[o]=e.SortedSet.load(t.store[o]),n},{}),n},e.Store.prototype.set=function(e,t){this.has(e)||this.length++,this.store[e]=t},e.Store.prototype.get=function(e){return this.store[e]},e.Store.prototype.has=function(e){return e in this.store},e.Store.prototype.remove=function(e){this.has(e)&&(delete this.store[e],this.length--)},e.Store.prototype.toJSON=function(){return{store:this.store,length:this.length}},e.stemmer=function(){var e={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},t={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},n="[^aeiou]",o="[aeiouy]",i=n+"[^aeiouy]*",r=o+"[aeiou]*",s="^("+i+")?"+r+i,a="^("+i+")?"+r+i+"("+r+")?$",c="^("+i+")?"+r+i+r+i,l="^("+i+")?"+o,u=new RegExp(s),h=new RegExp(c),d=new RegExp(a),f=new RegExp(l),p=/^(.+?)(ss|i)es$/,m=/^(.+?)([^s])s$/,v=/^(.+?)eed$/,g=/^(.+?)(ed|ing)$/,y=/.$/,w=/(at|bl|iz)$/,S=new RegExp("([^aeiouylsz])\\1$"),k=new RegExp("^"+i+o+"[^aeiouwxy]$"),E=/^(.+?[^aeiou])y$/,x=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,b=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,T=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,C=/^(.+?)(s|t)(ion)$/,L=/^(.+?)e$/,_=/ll$/,O=new RegExp("^"+i+o+"[^aeiouwxy]$"),A=function(n){var o,i,r,s,a,c,l;if(n.length<3)return n;if(r=n.substr(0,1),"y"==r&&(n=r.toUpperCase()+n.substr(1)),s=p,a=m,s.test(n)?n=n.replace(s,"$1$2"):a.test(n)&&(n=n.replace(a,"$1$2")),s=v,a=g,s.test(n)){var A=s.exec(n);s=u,s.test(A[1])&&(s=y,n=n.replace(s,""))}else if(a.test(n)){var A=a.exec(n);o=A[1],a=f,a.test(o)&&(n=o,a=w,c=S,l=k,a.test(n)?n+="e":c.test(n)?(s=y,n=n.replace(s,"")):l.test(n)&&(n+="e"))}if(s=E,s.test(n)){var A=s.exec(n);o=A[1],n=o+"i"}if(s=x,s.test(n)){var A=s.exec(n);o=A[1],i=A[2],s=u,s.test(o)&&(n=o+e[i])}if(s=b,s.test(n)){var A=s.exec(n);o=A[1],i=A[2],s=u,s.test(o)&&(n=o+t[i])}if(s=T,a=C,s.test(n)){var A=s.exec(n);o=A[1],s=h,s.test(o)&&(n=o)}else if(a.test(n)){var A=a.exec(n);o=A[1]+A[2],a=h,a.test(o)&&(n=o)}if(s=L,s.test(n)){var A=s.exec(n);o=A[1],s=h,a=d,c=O,(s.test(o)||a.test(o)&&!c.test(o))&&(n=o)}return s=_,a=h,s.test(n)&&a.test(n)&&(s=y,n=n.replace(s,"")),"y"==r&&(n=r.toLowerCase()+n.substr(1)),n};return A}(),e.Pipeline.registerFunction(e.stemmer,"stemmer"),e.stopWordFilter=function(t){return t&&e.stopWordFilter.stopWords[t]!==t?t:void 0},e.stopWordFilter.stopWords={a:"a",able:"able",about:"about",across:"across",after:"after",all:"all",almost:"almost",also:"also",am:"am",among:"among",an:"an",and:"and",any:"any",are:"are",as:"as",at:"at",be:"be",because:"because",been:"been",but:"but",by:"by",can:"can",cannot:"cannot",could:"could",dear:"dear",did:"did","do":"do",does:"does",either:"either","else":"else",ever:"ever",every:"every","for":"for",from:"from",get:"get",got:"got",had:"had",has:"has",have:"have",he:"he",her:"her",hers:"hers",him:"him",his:"his",how:"how",however:"however",i:"i","if":"if","in":"in",into:"into",is:"is",it:"it",its:"its",just:"just",least:"least",let:"let",like:"like",likely:"likely",may:"may",me:"me",might:"might",most:"most",must:"must",my:"my",neither:"neither",no:"no",nor:"nor",not:"not",of:"of",off:"off",often:"often",on:"on",only:"only",or:"or",other:"other",our:"our",own:"own",rather:"rather",said:"said",say:"say",says:"says",she:"she",should:"should",since:"since",so:"so",some:"some",than:"than",that:"that",the:"the",their:"their",them:"them",then:"then",there:"there",these:"these",they:"they","this":"this",tis:"tis",to:"to",too:"too",twas:"twas",us:"us",wants:"wants",was:"was",we:"we",were:"were",what:"what",when:"when",where:"where",which:"which","while":"while",who:"who",whom:"whom",why:"why",will:"will","with":"with",would:"would",yet:"yet",you:"you",your:"your"},e.Pipeline.registerFunction(e.stopWordFilter,"stopWordFilter"),e.trimmer=function(e){var t=e.replace(/^\W+/,"").replace(/\W+$/,"");return""===t?void 0:t},e.Pipeline.registerFunction(e.trimmer,"trimmer"),e.TokenStore=function(){this.root={docs:{}},this.length=0},e.TokenStore.load=function(e){var t=new this;return t.root=e.root,t.length=e.length,t},e.TokenStore.prototype.add=function(e,t,n){var n=n||this.root,o=e[0],i=e.slice(1);return o in n||(n[o]={docs:{}}),0===i.length?(n[o].docs[t.ref]=t,void(this.length+=1)):this.add(i,t,n[o])},e.TokenStore.prototype.has=function(e){if(!e)return!1;for(var t=this.root,n=0;n<e.length;n++){if(!t[e[n]])return!1;t=t[e[n]]}return!0},e.TokenStore.prototype.getNode=function(e){if(!e)return{};for(var t=this.root,n=0;n<e.length;n++){if(!t[e[n]])return{};t=t[e[n]]}return t},e.TokenStore.prototype.get=function(e,t){return this.getNode(e,t).docs||{}},e.TokenStore.prototype.count=function(e,t){return Object.keys(this.get(e,t)).length},e.TokenStore.prototype.remove=function(e,t){if(e){for(var n=this.root,o=0;o<e.length;o++){if(!(e[o]in n))return;n=n[e[o]]}delete n.docs[t]}},e.TokenStore.prototype.expand=function(e,t){var n=this.getNode(e),o=n.docs||{},t=t||[];return Object.keys(o).length&&t.push(e),Object.keys(n).forEach(function(n){"docs"!==n&&t.concat(this.expand(e+n,t))},this),t},e.TokenStore.prototype.toJSON=function(){return{root:this.root,length:this.length}},function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.lunr=t()}(this,function(){return e})}(),String.prototype.truncate=function(e){if(this.length>e){for(;" "!=this[e]&&--e>0;);return this.substring(0,e)+"&hellip;"}return this},HTMLElement.prototype.wrap=function(e){e.length||(e=[e]);for(var t=e.length-1;t>=0;t--){var n=t>0?this.cloneNode(!0):this,o=e[t],i=o.parentNode,r=o.nextSibling;n.appendChild(o),r?i.insertBefore(n,r):i.appendChild(n)}},document.addEventListener("DOMContentLoaded",function(){"use strict";Modernizr.addTest("ios",function(){return!!navigator.userAgent.match(/(iPad|iPhone|iPod)/g)}),Modernizr.addTest("standalone",function(){return!!navigator.standalone}),FastClick.attach(document.body);var e=document.getElementById("toggle-search"),t=(document.getElementById("reset-search"),document.querySelector(".drawer")),n=document.querySelectorAll(".anchor"),o=document.querySelector(".search .field"),i=document.querySelector(".query"),r=document.querySelector(".results .meta");Array.prototype.forEach.call(n,function(e){e.querySelector("a").addEventListener("click",function(){document.getElementById("toggle-drawer").checked=!1,document.body.classList.remove("toggle-drawer")})});var s=window.pageYOffset,a=function(){var e=window.pageYOffset+window.innerHeight,n=Math.max(0,window.innerHeight-t.offsetHeight);e>document.body.clientHeight-(96-n)?"absolute"!=t.style.position&&(t.style.position="absolute",t.style.top=null,t.style.bottom=0):t.offsetHeight<window.innerHeight?"fixed"!=t.style.position&&(t.style.position="fixed",t.style.top=0,t.style.bottom=null):"fixed"!=t.style.position?e>t.offsetTop+t.offsetHeight?(t.style.position="fixed",t.style.top=null,t.style.bottom="-96px"):window.pageYOffset<t.offsetTop&&(t.style.position="fixed",t.style.top=0,t.style.bottom=null):window.pageYOffset>s?t.style.top&&(t.style.position="absolute",t.style.top=Math.max(0,s)+"px",t.style.bottom=null):t.style.bottom&&(t.style.position="absolute",t.style.top=e-t.offsetHeight+"px",t.style.bottom=null),s=Math.max(0,window.pageYOffset)},c=function(){var e=document.querySelector(".main");window.removeEventListener("scroll",a),matchMedia("only screen and (max-width: 959px)").matches?(t.style.position=null,t.style.top=null,t.style.bottom=null):t.offsetHeight+96<e.offsetHeight&&(window.addEventListener("scroll",a),a())};Modernizr.ios||(window.addEventListener("resize",c),c());var l=function(){pegasus(base_url+"/mkdocs/search_index.json").then(function(t,n){var o=lunr(function(){this.field("title",{boost:10}),this.field("text"),this.ref("location")}),s={};t.docs.map(function(e){e.location=base_url+e.location,s[e.location]=e,o.add(e)}),i.addEventListener("keyup",function(){for(var t=document.querySelector(".results .list");t.firstChild;)t.removeChild(t.firstChild);var n=document.querySelector(".bar.search");if(!i.value.length){for(;r.firstChild;)r.removeChild(r.firstChild);return void n.classList.remove("non-empty")}n.classList.add("non-empty");var a=o.search(i.value);a.map(function(n){var o=s[n.ref],i=document.createElement("article");i.classList.add("result");var r=document.createElement("h1");r.innerHTML=o.title,i.appendChild(r);var a=document.createElement("a");a.href=o.location,a.appendChild(i);var c=document.createElement("span");c.innerHTML=a.href.split("#")[0],i.appendChild(c);var l=a.href.split("#");l[0]==window.location.href.split("#")[0]&&a.addEventListener("click",function(t){if(document.body.classList.remove("toggle-search"),document.body.classList.remove("locked"),e.checked=!1,!matchMedia("only screen and (min-width: 960px)").matches&&(t.preventDefault(),t.stopPropagation(),1!=l.length)){var n=document.getElementById(l[1]);n&&setTimeout(function(){n.scrollIntoView&&n.scrollIntoView()||window.scrollTo(0,n.offsetTop)},100)}}),t.appendChild(a)});var c=document.createElement("strong");for(c.innerHTML=a.length+" search result"+(1!=a.length?"s":"");r.firstChild;)r.removeChild(r.firstChild);r.appendChild(c)})},function(e,t){console.error(e,t.status)}),e.removeEventListener("click",l)};e.addEventListener("click",l);var u=0;e.addEventListener("click",function(e){var t=document.body.classList,n=!matchMedia("only screen and (min-width: 960px)").matches;t.contains("locked")?(t.remove("locked"),n&&setTimeout(function(){window.scrollTo(0,u)},100)):(u=window.scrollY,n&&setTimeout(function(){window.scrollTo(0,0)},400),setTimeout(function(){this.checked&&(n&&t.add("locked"),setTimeout(function(){i.focus()},200))}.bind(this),450))}),o.addEventListener("touchstart",function(){i.focus()}),window.addEventListener("keyup",function(t){var n=t.keyCode||t.which;27==n&&(document.body.classList.remove("toggle-search"),document.body.classList.remove("locked"),e.checked=!1)});var h=document.getElementById("reset-search");h.addEventListener("click",function(){for(var e=document.querySelector(".results .list");e.firstChild;)e.removeChild(e.firstChild);var t=document.querySelector(".bar.search");t.classList.remove("non-empty"),r.innerHTML="",i.value="",i.focus()});var d=document.querySelectorAll("h2");d=Array.prototype.map.call(d,function(e){return e.offsetTop});var f=null;document.addEventListener("scroll",function(){for(var e=window.scrollY+window.innerHeight/3,t=d.length-1,o=0;t>o;o++)e<d[o+1]&&(t=o);t!=f&&(f=t,Array.prototype.forEach.call(n,function(e,t){var n=e.querySelector("a");(t!=f||n.classList.add("current"))&&n.classList.remove("current")}))});var p=document.querySelectorAll(".n + .p");Array.prototype.forEach.call(p,function(e){var t=e.innerText||e.textContent;t&&"("==t[0]&&e.previousSibling.classList.add("f")});var m=document.querySelectorAll("table");if(Array.prototype.forEach.call(m,function(e){var t=document.createElement("div");t.classList.add("data"),t.wrap(e)}),Modernizr.ios){var v=document.querySelectorAll(".scrollable, .standalone .article");Array.prototype.forEach.call(v,function(e){e.addEventListener("touchstart",function(){var e=this.scrollTop;0==e?this.scrollTop=1:e+this.offsetHeight==this.scrollHeight&&(this.scrollTop=e-1)})})}var g=document.querySelectorAll(".project, .overlay, .header");Array.prototype.forEach.call(g,function(e){e.addEventListener("touchmove",function(e){e.preventDefault()})});var y=document.querySelectorAll(".toggle");Array.prototype.forEach.call(y,function(e){e.addEventListener("click",function(){document.body.classList.toggle(this.id)})}),pegasus("https://api.github.com/repos/"+repo_id).then(function(e,t){var n=e.stargazers_count;n>1e4?n=(n/1e3).toFixed(0)+"k":n>1e3&&(n=(n/1e3).toFixed(1)+"k");var o=document.querySelector(".repo-stars .count");o.innerHTML=n},function(e,t){console.error(e,t.status)})}),"standalone"in window.navigator&&window.navigator.standalone){var node,remotes=!1;document.addEventListener("click",function(e){for(node=e.target;"A"!==node.nodeName&&"HTML"!==node.nodeName;)node=node.parentNode;"href"in node&&-1!==node.href.indexOf("http")&&(-1!==node.href.indexOf(document.location.host)||remotes)&&(e.preventDefault(),document.location.href=node.href)},!1)}