function sidebarHeight(){jQuery(".js-sidebar-inner").height()+jQuery(".js-sidebar-footer").height()+192>jQuery(window).height()?jQuery(".js-sidebar-footer").addClass("sidebar-footer-static"):jQuery(".js-sidebar-footer").removeClass("sidebar-footer-static")}!function(e){var t=[],r=!1,i=!1,n={interval:250,force_process:!1},s=e(window),o=[];function a(){return e(this).is(":appeared")}function l(){return!e(this).data("_appear_triggered")}function u(){i=!1;for(var r=0,n=t.length;r=n&&l-(r.data("appear-top-offset")||0)<=n+s.height()&&a+r.width()>=i&&a-(r.data("appear-left-offset")||0)<=i+s.width()}})),e.fn.extend({appear:function(t,r){return e.appear(this,r),this}}),e.extend({appear:function(s,a){var l=e.extend({},n,a||{});if(!r){var c=function(){i||(i=!0,setTimeout(u,l.interval))};e(window).scroll(c).resize(c),r=!0}l.force_process&&setTimeout(u,l.interval),function(e){t.push(e),o.push()}(s)},force_appear:function(){return!!r&&(u(),!0)}})}("undefined"!=typeof module?require("jquery"):jQuery),function(e){"use strict";e.fn.fitVids=function(t){var r={customSelector:null,ignore:null};if(!document.getElementById("fit-vids-style")){var i=document.head||document.getElementsByTagName("head")[0],n=document.createElement("div");n.innerHTML='

x

',i.appendChild(n.childNodes[1])}return t&&e.extend(r,t),this.each((function(){var t=['iframe[src*="player.vimeo.com"]','iframe[src*="youtube.com"]','iframe[src*="youtube-nocookie.com"]','iframe[src*="kickstarter.com"][src*="video.html"]',"object","embed"];r.customSelector&&t.push(r.customSelector);var i=".fitvidsignore";r.ignore&&(i=i+", "+r.ignore);var n=e(this).find(t.join(","));(n=(n=n.not("object object")).not(i)).each((function(){var t=e(this);if(!(t.parents(i).length>0||"embed"===this.tagName.toLowerCase()&&t.parent("object").length||t.parent(".fluid-width-video-wrapper").length)){t.css("height")||t.css("width")||!isNaN(t.attr("height"))&&!isNaN(t.attr("width"))||(t.attr("height",9),t.attr("width",16));var r=("object"===this.tagName.toLowerCase()||t.attr("height")&&!isNaN(parseInt(t.attr("height"),10))?parseInt(t.attr("height"),10):t.height())/(isNaN(parseInt(t.attr("width"),10))?t.width():parseInt(t.attr("width"),10));if(!t.attr("name")){var n="fitvid"+e.fn.fitVids._count;t.attr("name",n),e.fn.fitVids._count++}t.wrap('
').parent(".fluid-width-video-wrapper").css("padding-top",100*r+"%"),t.removeAttr("height").removeAttr("width")}}))}))},e.fn.fitVids._count=0}(window.jQuery||window.Zepto), /** * ghostHunter - 0.6.0 * Copyright (C) 2014 Jamal Neufeld (jamal@i11u.me) * MIT Licensed * @license */ function(e){var t,r;!function(){var e,t,r,i,n,s,o,a,l,u,c,d,h,f,p,g,m,y,v,x,b,w,k,S,L,Q,_,T,I=function(e){var t=new I.Builder;return t.pipeline.add(I.trimmer,I.stopWordFilter,I.stemmer),t.searchPipeline.add(I.stemmer),e.call(t,t),t.build()};I.version="2.1.5" /*! * lunr.utils * Copyright (C) 2017 Oliver Nightingale */,I.utils={},I.utils.warn=(e=this,function(t){e.console&&console.warn&&console.warn(t)}),I.utils.asString=function(e){return null==e?"":e.toString()},I.FieldRef=function(e,t,r){this.docRef=e,this.fieldName=t,this._stringValue=r},I.FieldRef.joiner="/",I.FieldRef.fromString=function(e){var t=e.indexOf(I.FieldRef.joiner);if(-1===t)throw"malformed field ref string";var r=e.slice(0,t),i=e.slice(t+1);return new I.FieldRef(i,r,e)},I.FieldRef.prototype.toString=function(){return null==this._stringValue&&(this._stringValue=this.fieldName+I.FieldRef.joiner+this.docRef),this._stringValue},I.idf=function(e,t){var r=0;for(var i in e)"_index"!=i&&(r+=Object.keys(e[i]).length);var n=(t-r+.5)/(r+.5);return Math.log(1+Math.abs(n))},I.Token=function(e,t){this.str=e||"",this.metadata=t||{}},I.Token.prototype.toString=function(){return this.str},I.Token.prototype.update=function(e){return this.str=e(this.str,this.metadata),this},I.Token.prototype.clone=function(e){return e=e||function(e){return e},new I.Token(e(this.str,this.metadata),this.metadata)} /*! * lunr.tokenizer * Copyright (C) 2017 Oliver Nightingale */,I.tokenizer=function(e){if(null==e||null==e)return[];if(Array.isArray(e))return e.map((function(e){return new I.Token(I.utils.asString(e).toLowerCase())}));for(var t=e.toString().trim().toLowerCase(),r=t.length,i=[],n=0,s=0;n<=r;n++){var o=n-s;(t.charAt(n).match(I.tokenizer.separator)||n==r)&&(o>0&&i.push(new I.Token(t.slice(s,n),{position:[s,o],index:i.length})),s=n+1)}return i},I.tokenizer.separator=/[\s\-]+/ /*! * lunr.Pipeline * Copyright (C) 2017 Oliver Nightingale */,I.Pipeline=function(){this._stack=[]},I.Pipeline.registeredFunctions=Object.create(null),I.Pipeline.registerFunction=function(e,t){t in this.registeredFunctions&&I.utils.warn("Overwriting existing registered function: "+t),e.label=t,I.Pipeline.registeredFunctions[e.label]=e},I.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||I.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},I.Pipeline.load=function(e){var t=new I.Pipeline;return e.forEach((function(e){var r=I.Pipeline.registeredFunctions[e];if(!r)throw new Error("Cannot load unregistered function: "+e);t.add(r)})),t},I.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach((function(e){I.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)}),this)},I.Pipeline.prototype.after=function(e,t){I.Pipeline.warnIfFunctionNotRegistered(t);var r=this._stack.indexOf(e);if(-1==r)throw new Error("Cannot find existingFn");r+=1,this._stack.splice(r,0,t)},I.Pipeline.prototype.before=function(e,t){I.Pipeline.warnIfFunctionNotRegistered(t);var r=this._stack.indexOf(e);if(-1==r)throw new Error("Cannot find existingFn");this._stack.splice(r,0,t)},I.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);-1!=t&&this._stack.splice(t,1)},I.Pipeline.prototype.run=function(e){for(var t=this._stack.length,r=0;r1&&(se&&(r=n),s!=e);)i=r-t,n=t+Math.floor(i/2),s=this.elements[2*n];return s==e||s>e?2*n:sa?u+=2:o==a&&(t+=r[l+1]*i[u+1],l+=2,u+=2);return t},I.Vector.prototype.similarity=function(e){return this.dot(e)/(this.magnitude()*e.magnitude())},I.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,r=0;t0)(s=a.str.charAt(0))in a.node.edges?n=a.node.edges[s]:(n=new I.TokenSet,a.node.edges[s]=n),1==a.str.length?n.final=!0:i.push({node:n,editsRemaining:a.editsRemaining,str:a.str.slice(1)});if(a.editsRemaining>0&&a.str.length>1)(s=a.str.charAt(1))in a.node.edges?o=a.node.edges[s]:(o=new I.TokenSet,a.node.edges[s]=o),a.str.length<=2?o.final=!0:i.push({node:o,editsRemaining:a.editsRemaining-1,str:a.str.slice(2)});if(a.editsRemaining>0&&1==a.str.length&&(a.node.final=!0),a.editsRemaining>0&&a.str.length>=1){if("*"in a.node.edges)var l=a.node.edges["*"];else{l=new I.TokenSet;a.node.edges["*"]=l}1==a.str.length?l.final=!0:i.push({node:l,editsRemaining:a.editsRemaining-1,str:a.str.slice(1)})}if(a.editsRemaining>0){if("*"in a.node.edges)var u=a.node.edges["*"];else{u=new I.TokenSet;a.node.edges["*"]=u}0==a.str.length?u.final=!0:i.push({node:u,editsRemaining:a.editsRemaining-1,str:a.str})}if(a.editsRemaining>0&&a.str.length>1){var c,d=a.str.charAt(0),h=a.str.charAt(1);h in a.node.edges?c=a.node.edges[h]:(c=new I.TokenSet,a.node.edges[h]=c),1==a.str.length?c.final=!0:i.push({node:c,editsRemaining:a.editsRemaining-1,str:d+a.str.slice(2)})}}return r},I.TokenSet.fromString=function(e){for(var t=new I.TokenSet,r=t,i=!1,n=0,s=e.length;n=e;t--){var r=this.uncheckedNodes[t],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}} /*! * lunr.Index * Copyright (C) 2017 Oliver Nightingale */,I.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},I.Index.prototype.search=function(e){return this.query((function(t){new I.QueryParser(e,t).parse()}))},I.Index.prototype.query=function(e){var t=new I.Query(this.fields),r=Object.create(null),i=Object.create(null),n=Object.create(null);e.call(t,t);for(var s=0;s1?1:e},I.Builder.prototype.k1=function(e){this._k1=e},I.Builder.prototype.add=function(e){var t=e[this._ref];this.documentCount+=1;for(var r=0;r=this.length)return I.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},I.QueryLexer.prototype.width=function(){return this.pos-this.start},I.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},I.QueryLexer.prototype.backup=function(){this.pos-=1},I.QueryLexer.prototype.acceptDigitRun=function(){var e,t;do{t=(e=this.next()).charCodeAt(0)}while(t>47&&t<58);e!=I.QueryLexer.EOS&&this.backup()},I.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(I.QueryLexer.TERM)),e.ignore(),e.more())return I.QueryLexer.lexText},I.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(I.QueryLexer.EDIT_DISTANCE),I.QueryLexer.lexText},I.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(I.QueryLexer.BOOST),I.QueryLexer.lexText},I.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(I.QueryLexer.TERM)},I.QueryLexer.termSeparator=I.tokenizer.separator,I.QueryLexer.lexText=function(e){for(;;){var t=e.next();if(t==I.QueryLexer.EOS)return I.QueryLexer.lexEOS;if(92!=t.charCodeAt(0)){if(":"==t)return I.QueryLexer.lexField;if("~"==t)return e.backup(),e.width()>0&&e.emit(I.QueryLexer.TERM),I.QueryLexer.lexEditDistance;if("^"==t)return e.backup(),e.width()>0&&e.emit(I.QueryLexer.TERM),I.QueryLexer.lexBoost;if(t.match(I.QueryLexer.termSeparator))return I.QueryLexer.lexTerm}else e.escapeCharacter()}},I.QueryParser=function(e,t){this.lexer=new I.QueryLexer(e),this.query=t,this.currentClause={},this.lexemeIdx=0},I.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=I.QueryParser.parseFieldOrTerm;e;)e=e(this);return this.query},I.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},I.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},I.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},I.QueryParser.parseFieldOrTerm=function(e){var t=e.peekLexeme();if(null!=t)switch(t.type){case I.QueryLexer.FIELD:return I.QueryParser.parseField;case I.QueryLexer.TERM:return I.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+t.type;throw t.str.length>=1&&(r+=" with value '"+t.str+"'"),new I.QueryParseError(r,t.start,t.end)}},I.QueryParser.parseField=function(e){var t=e.consumeLexeme();if(null!=t){if(-1==e.query.allFields.indexOf(t.str)){var r=e.query.allFields.map((function(e){return"'"+e+"'"})).join(", "),i="unrecognised field '"+t.str+"', possible fields: "+r;throw new I.QueryParseError(i,t.start,t.end)}e.currentClause.fields=[t.str];var n=e.peekLexeme();if(null==n){i="expecting term, found nothing";throw new I.QueryParseError(i,t.start,t.end)}switch(n.type){case I.QueryLexer.TERM:return I.QueryParser.parseTerm;default:i="expecting term, found '"+n.type+"'";throw new I.QueryParseError(i,n.start,n.end)}}},I.QueryParser.parseTerm=function(e){var t=e.consumeLexeme();if(null!=t){e.currentClause.term=t.str.toLowerCase(),-1!=t.str.indexOf("*")&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(null!=r)switch(r.type){case I.QueryLexer.TERM:return e.nextClause(),I.QueryParser.parseTerm;case I.QueryLexer.FIELD:return e.nextClause(),I.QueryParser.parseField;case I.QueryLexer.EDIT_DISTANCE:return I.QueryParser.parseEditDistance;case I.QueryLexer.BOOST:return I.QueryParser.parseBoost;default:var i="Unexpected lexeme type '"+r.type+"'";throw new I.QueryParseError(i,r.start,r.end)}else e.nextClause()}},I.QueryParser.parseEditDistance=function(e){var t=e.consumeLexeme();if(null!=t){var r=parseInt(t.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new I.QueryParseError(i,t.start,t.end)}e.currentClause.editDistance=r;var n=e.peekLexeme();if(null!=n)switch(n.type){case I.QueryLexer.TERM:return e.nextClause(),I.QueryParser.parseTerm;case I.QueryLexer.FIELD:return e.nextClause(),I.QueryParser.parseField;case I.QueryLexer.EDIT_DISTANCE:return I.QueryParser.parseEditDistance;case I.QueryLexer.BOOST:return I.QueryParser.parseBoost;default:i="Unexpected lexeme type '"+n.type+"'";throw new I.QueryParseError(i,n.start,n.end)}else e.nextClause()}},I.QueryParser.parseBoost=function(e){var t=e.consumeLexeme();if(null!=t){var r=parseInt(t.str,10);if(isNaN(r)){var i="boost must be numeric";throw new I.QueryParseError(i,t.start,t.end)}e.currentClause.boost=r;var n=e.peekLexeme();if(null!=n)switch(n.type){case I.QueryLexer.TERM:return e.nextClause(),I.QueryParser.parseTerm;case I.QueryLexer.FIELD:return e.nextClause(),I.QueryParser.parseField;case I.QueryLexer.EDIT_DISTANCE:return I.QueryParser.parseEditDistance;case I.QueryLexer.BOOST:return I.QueryParser.parseBoost;default:i="Unexpected lexeme type '"+n.type+"'";throw new I.QueryParseError(i,n.start,n.end)}else e.nextClause()}},_=this,T=function(){return I},"function"==typeof define&&define.amd?define(T):"object"==typeof exports?module.exports=T():_.lunr=T()}(),t=this,r=function(e){function t(e,t){var r,i;for(r=-1,i=e.length;++r0?t[r][i-1]:Number.MAX_VALUE,s=r>0?t[r-1][i]:Number.MAX_VALUE,o=i>0&&r>0?t[r-1][i-1]:Number.MAX_VALUE,(a=Math.min(n,s,o))===o?(o

{{title}}

{{prettyPubDate}}

",info_template:"

Number of posts found: {{amount}}

",displaySearchInfo:!0,zeroResultsInfo:!0,before:!1,onComplete:!1,filterfields:!1,subpath:"",item_preprocessor:!1,indexing_start:!1,indexing_end:!1,includebodysearch:!1};var i=function(e){return e.replace(/^\//,"").replace(/\//g,"-")},n=null,s=function(){e(".gh-search-item").each((function(){var e=this.getAttribute("id").replace(/^new-/,"");this.setAttribute("id",e)}))},o=function(e,t,r){for(var i=0,n=r.length;inew Date(n.latestPost).getTime()&&(n.latestPost=e.updated_at);var t=e.tags.map((function(e){return e.name}));null==e.meta_description&&(e.meta_description="");var r=t.join(", ");r.length<1&&(r="undefined");var i={id:String(e.id),title:String(e.title),description:String(e.custom_excerpt),pubDate:String(e.published_at),tag:r};n.includebodysearch&&(i.plaintext=String(e.plaintext)),this.add(i);var s,o,a=n.subpath+e.url;n.blogData[e.id]={title:e.title,description:e.custom_excerpt,pubDate:(s=i.pubDate,o=new Date(s),o.getDate()+" "+["January","February","March","April","May","June","July","August","September","October","November","December"][o.getMonth()]+" "+o.getFullYear()),link:a,tags:t},n.item_preprocessor&&Object.assign(n.blogData[e.id],n.item_preprocessor(e))}),this)}));try{var r=i(n.subpath);localStorage.setItem("ghost_"+r+"_lunrIndex",JSON.stringify(n.index)),localStorage.setItem("ghost_"+r+"_blogData",JSON.stringify(n.blogData)),localStorage.setItem("ghost_"+r+"_latestPost",n.latestPost)}catch(e){console.warn("ghostHunter: save to localStorage failed: "+e)}n.indexing_end&&n.indexing_end(),n.isInit=!0}))},l={isInit:!1,init:function(e,t){var r=this;if(r.target=e,Object.assign(this,t),t.onPageLoad){window.setTimeout((function(){r.loadAPI()}),1)}else e.focus((function(){r.loadAPI()}));e.closest("form").submit((function(t){t.preventDefault(),r.find(e.val())})),t.onKeyUp&&(e.keydown((function(e){if(13===e.which)return!1})),e.keyup((function(t){r.find(e.val())})))},loadAPI:function(){if(!this.isInit){this.indexing_start&&this.indexing_start();try{var t=i(this.subpath);this.index=localStorage.getItem("ghost_"+t+"_lunrIndex"),this.blogData=localStorage.getItem("ghost_"+t+"_blogData"),this.latestPost=localStorage.getItem("ghost_"+t+"_latestPost"),this.latestPost&&this.index&&this.blogData&&(this.latestPost=this.latestPost,this.index=lunr.Index.load(JSON.parse(this.index)),this.blogData=JSON.parse(this.blogData),this.isInit=!0)}catch(e){console.warn("ghostHunter: retrieve from localStorage failed: "+e)}}if(this.isInit){this.latestPost.replace(/\..*/,"").replace(/T/," ");var r="/ghost/api/v2/content/posts/?key="+ghosthunter_key+"&limit=all&fields=id&filterupdated_at:>'"+this.latestPost.replace(/\..*/,"").replace(/T/," ")+"'",n=this;e.get(r).done((function(e){e.posts.length>0?a.call(n):(n.indexing_end&&n.indexing_end(),n.isInit=!0)}))}else a.call(this)},find:function(t){clearTimeout(n),t||(t=""),t=t.toLowerCase(),n=setTimeout(function(){for(var r=[],i=t.split(/\s+/),n=0,a=i.length;n1){var u=r[0];r=r.slice(1);for(n=u.length-1;n>-1;n--){var c=u[n].ref;for(j=0,jlen=r.length;j0?p.children().eq(0).replaceWith(this.format(this.info_template,{amount:u.length})):p.append(this.format(this.info_template,{amount:u.length}))),this.before&&this.before();for(n=0;n{function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function r(e){for(var r=1;rd?u-d:u-t.padding,f=c>d?c-d:c-t.padding,p=r/n,g=h/f;i.scaleFactor=r=i.offset&&h()}function p(e){e.preventDefault(),27===e.keyCode&&h()}return function(n){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=o(n),i=r(r({},t),s),c(),d(),a(e)}}();e.exports=s}},t={},function r(i){var n=t[i];if(void 0!==n)return n.exports;var s=t[i]={exports:{}};return e[i](s,s.exports,r),s.exports}(352);var e,t})),function(e,t){"use strict";e(document).ready((function(){e(".post-content").fitVids();var t=e(".js-grid").imagesLoaded((function(){t.masonry({itemSelector:".post",percentPosition:!0,transitionDuration:"0.25s"}),e.force_appear()}));e(".post--grid").appear(),e(".post--grid").on("appear",(function(t,r){e(this).addClass("animate")})),e("body").imagesLoaded((function(){e(".js-loader").fadeOut(250)}));e(".search-field").ghostHunter({results:".content-area",info_template:'

Number of posts found: {{amount}}

',result_template:'',before:function(){e(".pagination, .content").remove()}});e(window).on("resize",(function(e){sidebarHeight()})),sidebarHeight(),e(".js-toggle-nav").on("click",(function(t){t.preventDefault(),e(this).toggleClass("open"),e(".js-nav").toggleClass("is-visible")}))}))}(jQuery),window.addEventListener("load",(function(){Lightense(".kg-gallery-image img",{padding:56,offset:20,background:"rgba(255, 255, 255, .85)"})}),!1);var gallery_images=document.querySelectorAll(".kg-gallery-image img");function getParameterByName(e,t){t||(t=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var r=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);return r?r[2]?decodeURIComponent(r[2].replace(/\+/g," ")):"":null}gallery_images.forEach((function(e){var t=e.closest(".kg-gallery-image"),r=e.attributes.width.value/e.attributes.height.value;t.style.flex=r+" 1 0%"})); //# sourceMappingURL=all.min.js.map