!function(D,j,R,z){"use strict";j=void 0!==j&&j.Math==Math?j:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),D.fn.sidebar=function(C){var k,e=D(this),w=D(j),T=D(R),x=D("html"),S=D("head"),A=e.selector||"",F=(new Date).getTime(),O=[],P=C,E="string"==typeof P,H=[].slice.call(arguments,1),M=j.requestAnimationFrame||j.mozRequestAnimationFrame||j.webkitRequestAnimationFrame||j.msRequestAnimationFrame||function(e){setTimeout(e,0)};return e.each(function(){var s,a,e,i,l,c=D.isPlainObject(C)?D.extend(!0,{},D.fn.sidebar.settings,C):D.extend({},D.fn.sidebar.settings),n=c.selector,r=c.className,t=c.namespace,o=c.regExp,d=c.error,u="."+t,f="module-"+t,b=D(this),h=D(c.context),m=b.children(n.sidebar),g=(h.children(n.fixed),h.children(n.pusher)),v=this,p=b.data(f),y={initialize:function(){y.debug("Initializing sidebar",C),y.create.id(),l=y.get.transitionEvent(),c.delaySetup?M(y.setup.layout):y.setup.layout(),M(function(){y.setup.cache()}),y.instantiate()},instantiate:function(){y.verbose("Storing instance of module",y),p=y,b.data(f,y)},create:{id:function(){e=(Math.random().toString(16)+"000000000").substr(2,8),a="."+e,y.verbose("Creating unique id for element",e)}},destroy:function(){y.verbose("Destroying previous module for",b),b.off(u).removeData(f),y.is.ios()&&y.remove.ios(),h.off(a),w.off(a),T.off(a)},event:{clickaway:function(e){var i=0=v.scrollHeight&&(v.scrollTop=v.scrollHeight-v.offsetHeight-1)},scroll:function(e){0===D(e.target).closest(n.sidebar).length&&e.preventDefault()}},bind:{clickaway:function(){y.verbose("Adding clickaway events to context",h),c.closable&&h.on("click"+a,y.event.clickaway).on("touchend"+a,y.event.clickaway)},scrollLock:function(){c.scrollLock&&(y.debug("Disabling page scroll"),w.on("DOMMouseScroll"+a,y.event.scroll)),y.verbose("Adding events to contain sidebar scroll"),T.on("touchmove"+a,y.event.touch),b.on("scroll"+u,y.event.containScroll)}},unbind:{clickaway:function(){y.verbose("Removing clickaway events from context",h),h.off(a)},scrollLock:function(){y.verbose("Removing scroll lock from page"),T.off(a),w.off(a),b.off("scroll"+u)}},add:{inlineCSS:function(){var e,i=y.cache.width||b.outerWidth(),n=y.cache.height||b.outerHeight(),t=y.is.rtl(),o=y.get.direction(),r={left:i,right:-i,top:n,bottom:-n};t&&(y.verbose("RTL detected, flipping widths"),r.left=-i,r.right=i),e="").appendTo(S),y.debug("Adding sizing css to head",s)}},refresh:function(){y.verbose("Refreshing selector cache"),h=D(c.context),m=h.children(n.sidebar),g=h.children(n.pusher),h.children(n.fixed),y.clear.cache()},refreshSidebars:function(){y.verbose("Refreshing other sidebars"),m=h.children(n.sidebar)},repaint:function(){y.verbose("Forcing repaint event"),v.style.display="none";v.offsetHeight;v.scrollTop=v.scrollTop,v.style.display=""},setup:{cache:function(){y.cache={width:b.outerWidth(),height:b.outerHeight(),rtl:"rtl"==b.css("direction")}},layout:function(){0===h.children(n.pusher).length&&(y.debug("Adding wrapper element for sidebar"),y.error(d.pusher),g=D('
'),h.children().not(n.omitted).not(m).wrapAll(g),y.refresh()),0!==b.nextAll(n.pusher).length&&b.nextAll(n.pusher)[0]===g[0]||(y.debug("Moved sidebar to correct parent element"),y.error(d.movedSidebar,v),b.detach().prependTo(h),y.refresh()),y.clear.cache(),y.set.pushable(),y.set.direction()}},attachEvents:function(e,i){var n=D(e);i=D.isFunction(y[i])?y[i]:y.toggle,0