File: /var/www/html/wp-content/plugins/ultimate-member/assets/js/um-scrollbar.min.js
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e:e(jQuery)}(function(h){function t(e){var t=e||window.event,o=v.call(arguments,1),a=0,n=0,i=0,r=0,l=0,s=0;if((e=h.event.fix(t)).type="mousewheel","detail"in t&&(i=-1*t.detail),"wheelDelta"in t&&(i=t.wheelDelta),"wheelDeltaY"in t&&(i=t.wheelDeltaY),"wheelDeltaX"in t&&(n=-1*t.wheelDeltaX),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(n=-1*i,i=0),a=0===i?n:i,"deltaY"in t&&(a=i=-1*t.deltaY),"deltaX"in t&&(n=t.deltaX,0===i&&(a=-1*n)),0!==i||0!==n){if(1===t.deltaMode){var c=h.data(this,"mousewheel-line-height");a*=c,i*=c,n*=c}else if(2===t.deltaMode){var d=h.data(this,"mousewheel-page-height");a*=d,i*=d,n*=d}if(r=Math.max(Math.abs(i),Math.abs(n)),(!g||r<g)&&(m(t,g=r)&&(g/=40)),m(t,r)&&(a/=40,n/=40,i/=40),a=Math[1<=a?"floor":"ceil"](a/g),n=Math[1<=n?"floor":"ceil"](n/g),i=Math[1<=i?"floor":"ceil"](i/g),x.settings.normalizeOffset&&this.getBoundingClientRect){var u=this.getBoundingClientRect();l=e.clientX-u.left,s=e.clientY-u.top}return e.deltaX=n,e.deltaY=i,e.deltaFactor=g,e.offsetX=l,e.offsetY=s,e.deltaMode=0,o.unshift(e,a,n,i),p&&clearTimeout(p),p=setTimeout(f,200),(h.event.dispatch||h.event.handle).apply(this,o)}}function f(){g=null}function m(e,t){return x.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120==0}var p,g,e=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],o="onwheel"in document||9<=document.documentMode?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],v=Array.prototype.slice;if(h.event.fixHooks)for(var a=e.length;a;)h.event.fixHooks[e[--a]]=h.event.mouseHooks;var x=h.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var e=o.length;e;)this.addEventListener(o[--e],t,!1);else this.onmousewheel=t;h.data(this,"mousewheel-line-height",x.getLineHeight(this)),h.data(this,"mousewheel-page-height",x.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var e=o.length;e;)this.removeEventListener(o[--e],t,!1);else this.onmousewheel=null;h.removeData(this,"mousewheel-line-height"),h.removeData(this,"mousewheel-page-height")},getLineHeight:function(e){var t=h(e),o=t["offsetParent"in h.fn?"offsetParent":"parent"]();return o.length||(o=h("body")),parseInt(o.css("fontSize"),10)||parseInt(t.css("fontSize"),10)||16},getPageHeight:function(e){return h(e).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};h.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}),function(e){"undefined"!=typeof module&&module.exports?module.exports=e:e(jQuery,window,document)}(function(E){var L,f,W,a,n,l,i,p,A,w,v,c,s,d,u,h,m,g,x,_,S,b,C,T,y,B,M,k,O,P,r,I,D,R,z,H,X,Y,U,j,q,F,N,V,Q,Z,G,J,K,$,ee,te,oe,ae,ne,e,t,o;e="function"==typeof define&&define.amd,t="undefined"!=typeof module&&module.exports,o="https:"==document.location.protocol?"https:":"http:",e||(t?require("jquery-mousewheel")(E):E.event.special.mousewheel||E("head").append(decodeURI("%3Cscript src="+o+"//cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.12/jquery.mousewheel.min.js%3E%3C/script%3E"))),f="mCustomScrollbar",W="mCS",a=".mCustomScrollbar",n={setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:950,autoDraggerLength:!0,alwaysShowScrollbar:0,snapOffset:0,mouseWheel:{enable:!0,scrollAmount:"auto",axis:"y",deltaFactor:"auto",disableOver:["select","option","keygen","datalist","textarea"]},scrollButtons:{scrollType:"stepless",scrollAmount:"auto"},keyboard:{enable:!0,scrollType:"stepless",scrollAmount:"auto"},contentTouchScroll:25,advanced:{autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:!0,updateOnImageLoad:!0},theme:"light",callbacks:{onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:!0}},l=0,i={},p=window.attachEvent&&!window.addEventListener?1:0,A=!1,w=["mCSB_dragger_onDrag","mCSB_scrollTools_onDrag","mCS_img_loaded","mCS_disabled","mCS_destroyed","mCS_no_scrollbar","mCS-autoHide","mCS-dir-rtl","mCS_no_scrollbar_y","mCS_no_scrollbar_x","mCS_y_hidden","mCS_x_hidden","mCSB_draggerContainer","mCSB_buttonUp","mCSB_buttonDown","mCSB_buttonLeft","mCSB_buttonRight"],v={init:function(r){var r=E.extend(!0,{},n,r),e=c.call(this);if(r.live){var t=r.liveSelector||this.selector||a,o=E(t);if("off"===r.live)return void d(t);i[t]=setTimeout(function(){o.mCustomScrollbar(r),"once"===r.live&&o.length&&d(t)},500)}else d(t);return r.setWidth=r.set_width?r.set_width:r.setWidth,r.setHeight=r.set_height?r.set_height:r.setHeight,r.axis=r.horizontalScroll?"x":u(r.axis),r.scrollInertia=0<r.scrollInertia&&r.scrollInertia<17?17:r.scrollInertia,"object"!=typeof r.mouseWheel&&1==r.mouseWheel&&(r.mouseWheel={enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1}),r.mouseWheel.scrollAmount=r.mouseWheelPixels?r.mouseWheelPixels:r.mouseWheel.scrollAmount,r.mouseWheel.normalizeDelta=r.advanced.normalizeMouseWheelDelta?r.advanced.normalizeMouseWheelDelta:r.mouseWheel.normalizeDelta,r.scrollButtons.scrollType=h(r.scrollButtons.scrollType),s(r),E(e).each(function(){var e=E(this);if(!e.data(W)){e.data(W,{idx:++l,opt:r,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:e.css("direction"),cbOffsets:null,trigger:null});var t=e.data(W),o=t.opt,a=e.data("mcs-axis"),n=e.data("mcs-scrollbar-position"),i=e.data("mcs-theme");a&&(o.axis=a),n&&(o.scrollbarPosition=n),i&&(o.theme=i,s(o)),m.call(this),E("#mCSB_"+t.idx+"_container img:not(."+w[2]+")").addClass(w[2]),v.update.call(null,e)}})},update:function(e,r){var t=e||c.call(this);return E(t).each(function(){var e=E(this);if(e.data(W)){var t=e.data(W),o=t.opt,a=E("#mCSB_"+t.idx+"_container"),n=[E("#mCSB_"+t.idx+"_dragger_vertical"),E("#mCSB_"+t.idx+"_dragger_horizontal")];if(!a.length)return;t.tweenRunning&&Z(e),e.hasClass(w[3])&&e.removeClass(w[3]),e.hasClass(w[4])&&e.removeClass(w[4]),S.call(this),x.call(this),"y"===o.axis||o.advanced.autoExpandHorizontalScroll||a.css("width",g(a.children())),t.overflowed=y.call(this),O.call(this),o.autoDraggerLength&&b.call(this),C.call(this),M.call(this);var i=[Math.abs(a[0].offsetTop),Math.abs(a[0].offsetLeft)];"x"!==o.axis&&(t.overflowed[0]?n[0].height()>n[0].parent().height()?B.call(this):(G(e,i[0].toString(),{dir:"y",dur:0,overwrite:"none"}),t.contentReset.y=null):(B.call(this),"y"===o.axis?k.call(this):"yx"===o.axis&&t.overflowed[1]&&G(e,i[1].toString(),{dir:"x",dur:0,overwrite:"none"}))),"y"!==o.axis&&(t.overflowed[1]?n[1].width()>n[1].parent().width()?B.call(this):(G(e,i[1].toString(),{dir:"x",dur:0,overwrite:"none"}),t.contentReset.x=null):(B.call(this),"x"===o.axis?k.call(this):"yx"===o.axis&&t.overflowed[0]&&G(e,i[0].toString(),{dir:"y",dur:0,overwrite:"none"}))),r&&t&&(2===r&&o.callbacks.onImageLoad&&"function"==typeof o.callbacks.onImageLoad?o.callbacks.onImageLoad.call(this):3===r&&o.callbacks.onSelectorChange&&"function"==typeof o.callbacks.onSelectorChange?o.callbacks.onSelectorChange.call(this):o.callbacks.onUpdate&&"function"==typeof o.callbacks.onUpdate&&o.callbacks.onUpdate.call(this)),Q.call(this)}})},scrollTo:function(l,s){if(void 0!==l&&null!=l){var e=c.call(this);return E(e).each(function(){var e=E(this);if(e.data(W)){var t=e.data(W),o=t.opt,a={trigger:"external",scrollInertia:o.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:!1,timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},n=E.extend(!0,{},a,s),i=N.call(this,l),r=0<n.scrollInertia&&n.scrollInertia<17?17:n.scrollInertia;i[0]=V.call(this,i[0],"y"),i[1]=V.call(this,i[1],"x"),n.moveDragger&&(i[0]*=t.scrollRatio.y,i[1]*=t.scrollRatio.x),n.dur=r,setTimeout(function(){null!==i[0]&&void 0!==i[0]&&"x"!==o.axis&&t.overflowed[0]&&(n.dir="y",n.overwrite="all",G(e,i[0].toString(),n)),null!==i[1]&&void 0!==i[1]&&"y"!==o.axis&&t.overflowed[1]&&(n.dir="x",n.overwrite="none",G(e,i[1].toString(),n))},n.timeout)}})}},stop:function(){var e=c.call(this);return E(e).each(function(){var e=E(this);e.data(W)&&Z(e)})},disable:function(t){var e=c.call(this);return E(e).each(function(){var e=E(this);e.data(W)&&(e.data(W),Q.call(this,"remove"),k.call(this),t&&B.call(this),O.call(this,!0),e.addClass(w[3]))})},destroy:function(){var r=c.call(this);return E(r).each(function(){var e=E(this);if(e.data(W)){var t=e.data(W),o=t.opt,a=E("#mCSB_"+t.idx),n=E("#mCSB_"+t.idx+"_container"),i=E(".mCSB_"+t.idx+"_scrollbar");o.live&&d(o.liveSelector||E(r).selector),Q.call(this,"remove"),k.call(this),B.call(this),e.removeData(W),ee(this,"mcs"),i.remove(),n.find("img."+w[2]).removeClass(w[2]),a.replaceWith(n.contents()),e.removeClass(f+" _"+W+"_"+t.idx+" "+w[6]+" "+w[7]+" "+w[5]+" "+w[3]).addClass(w[4])}})}},c=function(){return"object"!=typeof E(this)||E(this).length<1?a:this},s=function(e){e.autoDraggerLength=!(-1<E.inArray(e.theme,["rounded","rounded-dark","rounded-dots","rounded-dots-dark"]))&&e.autoDraggerLength,e.autoExpandScrollbar=!(-1<E.inArray(e.theme,["rounded-dots","rounded-dots-dark","3d","3d-dark","3d-thick","3d-thick-dark","inset","inset-dark","inset-2","inset-2-dark","inset-3","inset-3-dark"]))&&e.autoExpandScrollbar,e.scrollButtons.enable=!(-1<E.inArray(e.theme,["minimal","minimal-dark"]))&&e.scrollButtons.enable,e.autoHideScrollbar=-1<E.inArray(e.theme,["minimal","minimal-dark"])||e.autoHideScrollbar,e.scrollbarPosition=-1<E.inArray(e.theme,["minimal","minimal-dark"])?"outside":e.scrollbarPosition},d=function(e){i[e]&&(clearTimeout(i[e]),ee(i,e))},u=function(e){return"yx"===e||"xy"===e||"auto"===e?"yx":"x"===e||"horizontal"===e?"x":"y"},h=function(e){return"stepped"===e||"pixels"===e||"step"===e||"click"===e?"stepped":"stepless"},m=function(){var e=E(this),t=e.data(W),o=t.opt,a=o.autoExpandScrollbar?" "+w[1]+"_expand":"",n=["<div id='mCSB_"+t.idx+"_scrollbar_vertical' class='mCSB_scrollTools mCSB_"+t.idx+"_scrollbar mCS-"+o.theme+" mCSB_scrollTools_vertical"+a+"'><div class='"+w[12]+"'><div id='mCSB_"+t.idx+"_dragger_vertical' class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><div class='mCSB_dragger_bar' /></div><div class='mCSB_draggerRail' /></div></div>","<div id='mCSB_"+t.idx+"_scrollbar_horizontal' class='mCSB_scrollTools mCSB_"+t.idx+"_scrollbar mCS-"+o.theme+" mCSB_scrollTools_horizontal"+a+"'><div class='"+w[12]+"'><div id='mCSB_"+t.idx+"_dragger_horizontal' class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><div class='mCSB_dragger_bar' /></div><div class='mCSB_draggerRail' /></div></div>"],i="yx"===o.axis?"mCSB_vertical_horizontal":"x"===o.axis?"mCSB_horizontal":"mCSB_vertical",r="yx"===o.axis?n[0]+n[1]:"x"===o.axis?n[1]:n[0],l="yx"===o.axis?"<div id='mCSB_"+t.idx+"_container_wrapper' class='mCSB_container_wrapper' />":"",s=o.autoHideScrollbar?" "+w[6]:"",c="x"!==o.axis&&"rtl"===t.langDir?" "+w[7]:"";o.setWidth&&e.css("width",o.setWidth),o.setHeight&&e.css("height",o.setHeight),o.setLeft="y"!==o.axis&&"rtl"===t.langDir?"989999px":o.setLeft,e.addClass(f+" _"+W+"_"+t.idx+s+c).wrapInner("<div id='mCSB_"+t.idx+"' class='mCustomScrollBox mCS-"+o.theme+" "+i+"'><div id='mCSB_"+t.idx+"_container' class='mCSB_container' style='position:relative; top:"+o.setTop+"; left:"+o.setLeft+";' dir="+t.langDir+" /></div>");var d=E("#mCSB_"+t.idx),u=E("#mCSB_"+t.idx+"_container");"y"===o.axis||o.advanced.autoExpandHorizontalScroll||u.css("width",g(u.children())),"outside"===o.scrollbarPosition?("static"===e.css("position")&&e.css("position","relative"),e.css("overflow","visible"),d.addClass("mCSB_outside").after(r)):(d.addClass("mCSB_inside").append(r),u.wrap(l)),_.call(this);var h=[E("#mCSB_"+t.idx+"_dragger_vertical"),E("#mCSB_"+t.idx+"_dragger_horizontal")];h[0].css("min-height",h[0].height()),h[1].css("min-width",h[1].width())},g=function(e){return Math.max.apply(Math,e.map(function(){return E(this).outerWidth(!0)}).get())},x=function(){var e=E(this),t=e.data(W),o=t.opt,a=E("#mCSB_"+t.idx+"_container");o.advanced.autoExpandHorizontalScroll&&"y"!==o.axis&&a.css({position:"absolute",width:"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:Math.ceil(a[0].getBoundingClientRect().right+.4)-Math.floor(a[0].getBoundingClientRect().left),position:"relative"}).unwrap()},_=function(){var e=E(this),t=e.data(W),o=t.opt,a=E(".mCSB_"+t.idx+"_scrollbar:first"),n=ae(o.scrollButtons.tabindex)?"tabindex='"+o.scrollButtons.tabindex+"'":"",i=["<a href='#' class='"+w[13]+"' oncontextmenu='return false;' "+n+" />","<a href='#' class='"+w[14]+"' oncontextmenu='return false;' "+n+" />","<a href='#' class='"+w[15]+"' oncontextmenu='return false;' "+n+" />","<a href='#' class='"+w[16]+"' oncontextmenu='return false;' "+n+" />"],r=["x"===o.axis?i[2]:i[0],"x"===o.axis?i[3]:i[1],i[2],i[3]];o.scrollButtons.enable&&a.prepend(r[0]).append(r[1]).next(".mCSB_scrollTools").prepend(r[2]).append(r[3])},S=function(){var e=E(this),t=e.data(W),o=E("#mCSB_"+t.idx),a=e.css("max-height")||"none",n=-1!==a.indexOf("%"),i=e.css("box-sizing");if("none"!==a){var r=n?e.parent().height()*parseInt(a)/100:parseInt(a);"border-box"===i&&(r-=e.innerHeight()-e.height()+(e.outerHeight()-e.innerHeight())),o.css("max-height",Math.round(r))}},b=function(){var e=E(this),t=e.data(W),o=E("#mCSB_"+t.idx),a=E("#mCSB_"+t.idx+"_container"),n=[E("#mCSB_"+t.idx+"_dragger_vertical"),E("#mCSB_"+t.idx+"_dragger_horizontal")],i=[o.height()/a.outerHeight(!1),o.width()/a.outerWidth(!1)],r=[parseInt(n[0].css("min-height")),Math.round(i[0]*n[0].parent().height()),parseInt(n[1].css("min-width")),Math.round(i[1]*n[1].parent().width())],l=p&&r[1]<r[0]?r[0]:r[1],s=p&&r[3]<r[2]?r[2]:r[3];n[0].css({height:l,"max-height":n[0].parent().height()-10}).find(".mCSB_dragger_bar").css({"line-height":r[0]+"px"}),n[1].css({width:s,"max-width":n[1].parent().width()-10})},C=function(){var e=E(this),t=e.data(W),o=E("#mCSB_"+t.idx),a=E("#mCSB_"+t.idx+"_container"),n=[E("#mCSB_"+t.idx+"_dragger_vertical"),E("#mCSB_"+t.idx+"_dragger_horizontal")],i=[a.outerHeight(!1)-o.height(),a.outerWidth(!1)-o.width()],r=[i[0]/(n[0].parent().height()-n[0].height()),i[1]/(n[1].parent().width()-n[1].width())];t.scrollRatio={y:r[0],x:r[1]}},T=function(e,t,o){var a=o?w[0]+"_expanded":"",n=e.closest(".mCSB_scrollTools");"active"===t?(e.toggleClass(w[0]+" "+a),n.toggleClass(w[1]),e[0]._draggable=e[0]._draggable?0:1):e[0]._draggable||("hide"===t?(e.removeClass(w[0]),n.removeClass(w[1])):(e.addClass(w[0]),n.addClass(w[1])))},y=function(){var e=E(this),t=e.data(W),o=E("#mCSB_"+t.idx),a=E("#mCSB_"+t.idx+"_container"),n=null==t.overflowed?a.height():a.outerHeight(!1),i=null==t.overflowed?a.width():a.outerWidth(!1);return[n>o.height(),i>o.width()]},B=function(){var e=E(this),t=e.data(W),o=t.opt,a=E("#mCSB_"+t.idx),n=E("#mCSB_"+t.idx+"_container"),i=[E("#mCSB_"+t.idx+"_dragger_vertical"),E("#mCSB_"+t.idx+"_dragger_horizontal")];if(Z(e),("x"!==o.axis&&!t.overflowed[0]||"y"===o.axis&&t.overflowed[0])&&(i[0].add(n).css("top",0),G(e,"_resetY")),"y"!==o.axis&&!t.overflowed[1]||"x"===o.axis&&t.overflowed[1]){var r=dx=0;"rtl"===t.langDir&&(r=a.width()-n.outerWidth(!1),dx=Math.abs(r/t.scrollRatio.x)),n.css("left",r),i[1].css("left",dx),G(e,"_resetX")}},M=function(){var t,o=E(this),e=o.data(W),a=e.opt;e.bindEvents||(r.call(this),a.contentTouchScroll&&I.call(this),D.call(this),a.mouseWheel.enable&&function e(){t=setTimeout(function(){E.event.special.mousewheel?(clearTimeout(t),R.call(o[0])):e()},100)}(),X.call(this),U.call(this),a.advanced.autoScrollOnFocus&&Y.call(this),a.scrollButtons.enable&&j.call(this),a.keyboard.enable&&q.call(this),e.bindEvents=!0)},k=function(){var e=E(this),t=e.data(W),o=t.opt,a=W+"_"+t.idx,n=".mCSB_"+t.idx+"_scrollbar",i=E("#mCSB_"+t.idx+",#mCSB_"+t.idx+"_container,#mCSB_"+t.idx+"_container_wrapper,"+n+" ."+w[12]+",#mCSB_"+t.idx+"_dragger_vertical,#mCSB_"+t.idx+"_dragger_horizontal,"+n+">a"),r=E("#mCSB_"+t.idx+"_container");o.advanced.releaseDraggableSelectors&&i.add(E(o.advanced.releaseDraggableSelectors)),t.bindEvents&&(E(document).unbind("."+a),i.each(function(){E(this).unbind("."+a)}),clearTimeout(e[0]._focusTimeout),ee(e[0],"_focusTimeout"),clearTimeout(t.sequential.step),ee(t.sequential,"step"),clearTimeout(r[0].onCompleteTimeout),ee(r[0],"onCompleteTimeout"),t.bindEvents=!1)},O=function(e){var t=E(this),o=t.data(W),a=o.opt,n=E("#mCSB_"+o.idx+"_container_wrapper"),i=n.length?n:E("#mCSB_"+o.idx+"_container"),r=[E("#mCSB_"+o.idx+"_scrollbar_vertical"),E("#mCSB_"+o.idx+"_scrollbar_horizontal")],l=[r[0].find(".mCSB_dragger"),r[1].find(".mCSB_dragger")];"x"!==a.axis&&(o.overflowed[0]&&!e?(r[0].add(l[0]).add(r[0].children("a")).css("display","block"),i.removeClass(w[8]+" "+w[10])):(a.alwaysShowScrollbar?(2!==a.alwaysShowScrollbar&&l[0].css("display","none"),i.removeClass(w[10])):(r[0].css("display","none"),i.addClass(w[10])),i.addClass(w[8]))),"y"!==a.axis&&(o.overflowed[1]&&!e?(r[1].add(l[1]).add(r[1].children("a")).css("display","block"),i.removeClass(w[9]+" "+w[11])):(a.alwaysShowScrollbar?(2!==a.alwaysShowScrollbar&&l[1].css("display","none"),i.removeClass(w[11])):(r[1].css("display","none"),i.addClass(w[11])),i.addClass(w[9]))),o.overflowed[0]||o.overflowed[1]?t.removeClass(w[5]):t.addClass(w[5])},P=function(e){var t=e.type;switch(t){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return e.target.ownerDocument!==document?[e.originalEvent.screenY,e.originalEvent.screenX,!1]:[e.originalEvent.pageY,e.originalEvent.pageX,!1];case"touchstart":case"touchmove":case"touchend":var o=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0],a=e.originalEvent.touches.length||e.originalEvent.changedTouches.length;return e.target.ownerDocument!==document?[o.screenY,o.screenX,1<a]:[o.pageY,o.pageX,1<a];default:return[e.pageY,e.pageX,!1]}},r=function(){function r(e){var t=m.find("iframe");if(t.length){var o=e?"auto":"none";t.css("pointer-events",o)}}function n(e,t,o,a){if(m[0].idleTimer=h.scrollInertia<233?250:0,l.attr("id")===f[1])var n="x",i=(l[0].offsetLeft-t+a)*u.scrollRatio.x;else var n="y",i=(l[0].offsetTop-e+o)*u.scrollRatio.y;G(d,i.toString(),{dir:n,drag:!0})}var l,s,c,d=E(this),u=d.data(W),h=u.opt,e=W+"_"+u.idx,f=["mCSB_"+u.idx+"_dragger_vertical","mCSB_"+u.idx+"_dragger_horizontal"],m=E("#mCSB_"+u.idx+"_container"),t=E("#"+f[0]+",#"+f[1]),o=h.advanced.releaseDraggableSelectors?t.add(E(h.advanced.releaseDraggableSelectors)):t;t.bind("mousedown."+e+" touchstart."+e+" pointerdown."+e+" MSPointerDown."+e,function(e){if(e.stopImmediatePropagation(),e.preventDefault(),te(e)){A=!0,p&&(document.onselectstart=function(){return!1}),r(!1),Z(d);var t=(l=E(this)).offset(),o=P(e)[0]-t.top,a=P(e)[1]-t.left,n=l.height()+t.top,i=l.width()+t.left;o<n&&0<o&&a<i&&0<a&&(s=o,c=a),T(l,"active",h.autoExpandScrollbar)}}).bind("touchmove."+e,function(e){e.stopImmediatePropagation(),e.preventDefault();var t=l.offset(),o=P(e)[0]-t.top,a=P(e)[1]-t.left;n(s,c,o,a)}),E(document).bind("mousemove."+e+" pointermove."+e+" MSPointerMove."+e,function(e){if(l){var t=l.offset(),o=P(e)[0]-t.top,a=P(e)[1]-t.left;if(s===o)return;n(s,c,o,a)}}).add(o).bind("mouseup."+e+" touchend."+e+" pointerup."+e+" MSPointerUp."+e,function(){l&&(T(l,"active",h.autoExpandScrollbar),l=null),A=!1,p&&(document.onselectstart=null),r(!0)})},I=function(){function t(e){if(!oe(e)||A||P(e)[2])L=0;else{L=1,C=b=0;var t=M.offset();c=P(e)[0]-t.top,h=P(e)[1]-t.left,R=[P(e)[0],P(e)[1]]}}function o(e){if(oe(e)&&!A&&!P(e)[2]&&(e.stopImmediatePropagation(),!C||b)){g=K();var t=T.offset(),o=P(e)[0]-t.top,a=P(e)[1]-t.left,n="mcsLinearOut";if(O.push(o),I.push(a),R[2]=Math.abs(P(e)[0]-R[0]),R[3]=Math.abs(P(e)[1]-R[1]),y.overflowed[0])var i=k[0].parent().height()-k[0].height(),r=0<c-o&&o-c>-i*y.scrollRatio.y&&(2*R[3]<R[2]||"yx"===B.axis);if(y.overflowed[1])var l=k[1].parent().width()-k[1].width(),s=0<h-a&&a-h>-l*y.scrollRatio.x&&(2*R[2]<R[3]||"yx"===B.axis);r||s?(e.preventDefault(),b=1):C=1,w="yx"===B.axis?[c-o,h-a]:"x"===B.axis?[null,h-a]:[c-o,null],M[0].idleTimer=250,y.overflowed[0]&&u(w[0],0,n,"y","all",!0),y.overflowed[1]&&u(w[1],0,n,"x",D,!0)}}function a(e){if(!oe(e)||A||P(e)[2])L=0;else{L=1,e.stopImmediatePropagation(),Z(r),p=K();var t=T.offset();f=P(e)[0]-t.top,m=P(e)[1]-t.left,O=[],I=[]}}function n(e){if(oe(e)&&!A&&!P(e)[2]){e.stopImmediatePropagation(),C=b=0,v=K();var t=T.offset(),o=P(e)[0]-t.top,a=P(e)[1]-t.left;if(!(30<v-g)){var n="mcsEaseOut",i=(_=1e3/(v-p))<2.5,r=i?[O[O.length-2],I[I.length-2]]:[0,0];x=i?[o-r[0],a-r[1]]:[o-f,a-m];var l=[Math.abs(x[0]),Math.abs(x[1])];_=i?[Math.abs(x[0]/4),Math.abs(x[1]/4)]:[_,_];var s=[Math.abs(M[0].offsetTop)-x[0]*d(l[0]/_[0],_[0]),Math.abs(M[0].offsetLeft)-x[1]*d(l[1]/_[1],_[1])];w="yx"===B.axis?[s[0],s[1]]:"x"===B.axis?[null,s[1]]:[s[0],null],S=[4*l[0]+B.scrollInertia,4*l[1]+B.scrollInertia];var c=parseInt(B.contentTouchScroll)||0;w[0]=c<l[0]?w[0]:0,w[1]=c<l[1]?w[1]:0,y.overflowed[0]&&u(w[0],S[0],n,"y",D,!1),y.overflowed[1]&&u(w[1],S[1],n,"x",D,!1)}}}function d(e,t){var o=[1.5*t,2*t,t/1.5,t/2];return 90<e?4<t?o[0]:o[3]:60<e?3<t?o[3]:o[2]:30<e?8<t?o[1]:6<t?o[0]:4<t?t:o[2]:8<t?t:o[3]}function u(e,t,o,a,n,i){e&&G(r,e.toString(),{dur:t,scrollEasing:o,dir:a,overwrite:n,drag:i})}var c,h,f,m,p,g,v,x,_,w,S,b,C,r=E(this),y=r.data(W),B=y.opt,e=W+"_"+y.idx,T=E("#mCSB_"+y.idx),M=E("#mCSB_"+y.idx+"_container"),k=[E("#mCSB_"+y.idx+"_dragger_vertical"),E("#mCSB_"+y.idx+"_dragger_horizontal")],O=[],I=[],D="yx"===B.axis?"none":"all",R=[],i=M.find("iframe"),l=["touchstart."+e+" pointerdown."+e+" MSPointerDown."+e,"touchmove."+e+" pointermove."+e+" MSPointerMove."+e,"touchend."+e+" pointerup."+e+" MSPointerUp."+e];M.bind(l[0],function(e){t(e)}).bind(l[1],function(e){o(e)}),T.bind(l[0],function(e){a(e)}).bind(l[2],function(e){n(e)}),i.length&&i.each(function(){E(this).load(function(){z(this)&&E(this.contentDocument||this.contentWindow.document).bind(l[0],function(e){t(e),a(e)}).bind(l[1],function(e){o(e)}).bind(l[2],function(e){n(e)})})})},D=function(){function n(e,t,o){s.type=o&&i?"stepped":"stepless",s.scrollAmount=10,F(a,e,t,"mcsLinearOut",o?60:null)}var i,a=E(this),r=a.data(W),l=r.opt,s=r.sequential,e=W+"_"+r.idx,c=E("#mCSB_"+r.idx+"_container"),d=c.parent();c.bind("mousedown."+e,function(){L||i||(i=1,A=!0)}).add(document).bind("mousemove."+e,function(e){if(!L&&i&&(window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type&&document.selection.createRange().text)){var t=c.offset(),o=P(e)[0]-t.top+c[0].offsetTop,a=P(e)[1]-t.left+c[0].offsetLeft;0<o&&o<d.height()&&0<a&&a<d.width()?s.step&&n("off",null,"stepped"):("x"!==l.axis&&r.overflowed[0]&&(o<0?n("on",38):o>d.height()&&n("on",40)),"y"!==l.axis&&r.overflowed[1]&&(a<0?n("on",37):a>d.width()&&n("on",39)))}}).bind("mouseup."+e,function(){L||(i&&(i=0,n("off",null)),A=!1)})},R=function(){function o(e,t){if(Z(d),!H(d,e.target)){var o="auto"!==h.mouseWheel.deltaFactor?parseInt(h.mouseWheel.deltaFactor):p&&e.deltaFactor<100?100:e.deltaFactor||100;if("x"===h.axis||"x"===h.mouseWheel.axis)var a="x",n=[Math.round(o*u.scrollRatio.x),parseInt(h.mouseWheel.scrollAmount)],i="auto"!==h.mouseWheel.scrollAmount?n[1]:n[0]>=f.width()?.9*f.width():n[0],r=Math.abs(E("#mCSB_"+u.idx+"_container")[0].offsetLeft),l=m[1][0].offsetLeft,s=m[1].parent().width()-m[1].width(),c=e.deltaX||e.deltaY||t;else var a="y",n=[Math.round(o*u.scrollRatio.y),parseInt(h.mouseWheel.scrollAmount)],i="auto"!==h.mouseWheel.scrollAmount?n[1]:n[0]>=f.height()?.9*f.height():n[0],r=Math.abs(E("#mCSB_"+u.idx+"_container")[0].offsetTop),l=m[0][0].offsetTop,s=m[0].parent().height()-m[0].height(),c=e.deltaY||t;"y"===a&&!u.overflowed[0]||"x"===a&&!u.overflowed[1]||(h.mouseWheel.invert&&(c=-c),h.mouseWheel.normalizeDelta&&(c=c<0?-1:1),(0<c&&0!==l||c<0&&l!==s||h.mouseWheel.preventDefault)&&(e.stopImmediatePropagation(),e.preventDefault()),G(d,(r-c*i).toString(),{dir:a}))}}var d=E(this),u=d.data(W),h=u.opt,e=W+"_"+u.idx,f=E("#mCSB_"+u.idx),m=[E("#mCSB_"+u.idx+"_dragger_vertical"),E("#mCSB_"+u.idx+"_dragger_horizontal")],t=E("#mCSB_"+u.idx+"_container").find("iframe");u&&(t.length&&t.each(function(){E(this).load(function(){z(this)&&E(this.contentDocument||this.contentWindow.document).bind("mousewheel."+e,function(e,t){o(e,t)})})}),f.bind("mousewheel."+e,function(e,t){o(e,t)}))},z=function(e){var t=null;try{var o=e.contentDocument||e.contentWindow.document;t=o.body.innerHTML}catch(e){}return null!==t},H=function(e,t){var o=t.nodeName.toLowerCase(),a=e.data(W).opt.mouseWheel.disableOver;return-1<E.inArray(o,a)&&!(-1<E.inArray(o,["select","textarea"])&&!E(t).is(":focus"))},X=function(){var r=E(this),l=r.data(W),e=W+"_"+l.idx,s=E("#mCSB_"+l.idx+"_container"),c=s.parent(),t=E(".mCSB_"+l.idx+"_scrollbar ."+w[12]);t.bind("touchstart."+e+" pointerdown."+e+" MSPointerDown."+e,function(){A=!0}).bind("touchend."+e+" pointerup."+e+" MSPointerUp."+e,function(){A=!1}).bind("click."+e,function(e){if(E(e.target).hasClass(w[12])||E(e.target).hasClass("mCSB_draggerRail")){Z(r);var t=E(this),o=t.find(".mCSB_dragger");if(0<t.parent(".mCSB_scrollTools_horizontal").length){if(!l.overflowed[1])return;var a="x",n=e.pageX>o.offset().left?-1:1,i=Math.abs(s[0].offsetLeft)-.9*n*c.width()}else{if(!l.overflowed[0])return;var a="y",n=e.pageY>o.offset().top?-1:1,i=Math.abs(s[0].offsetTop)-.9*n*c.height()}G(r,i.toString(),{dir:a,scrollEasing:"mcsEaseInOut"})}})},Y=function(){var i=E(this),e=i.data(W),r=e.opt,t=W+"_"+e.idx,l=E("#mCSB_"+e.idx+"_container"),s=l.parent();l.bind("focusin."+t,function(){var n=E(document.activeElement),e=l.find(".mCustomScrollBox").length;n.is(r.advanced.autoScrollOnFocus)&&(Z(i),clearTimeout(i[0]._focusTimeout),i[0]._focusTimer=e?17*e:0,i[0]._focusTimeout=setTimeout(function(){var e=[ne(n)[0],ne(n)[1]],t=[l[0].offsetTop,l[0].offsetLeft],o=[0<=t[0]+e[0]&&t[0]+e[0]<s.height()-n.outerHeight(!1),0<=t[1]+e[1]&&t[0]+e[1]<s.width()-n.outerWidth(!1)],a="yx"!==r.axis||o[0]||o[1]?"all":"none";"x"===r.axis||o[0]||G(i,e[0].toString(),{dir:"y",scrollEasing:"mcsEaseInOut",overwrite:a,dur:0}),"y"===r.axis||o[1]||G(i,e[1].toString(),{dir:"x",scrollEasing:"mcsEaseInOut",overwrite:a,dur:0})},i[0]._focusTimer))})},U=function(){var e=E(this),t=e.data(W),o=W+"_"+t.idx,a=E("#mCSB_"+t.idx+"_container").parent();a.bind("scroll."+o,function(){(0!==a.scrollTop()||0!==a.scrollLeft())&&E(".mCSB_"+t.idx+"_scrollbar").css("visibility","hidden")})},j=function(){var a=E(this),n=a.data(W),i=n.opt,r=n.sequential,e=W+"_"+n.idx,t=".mCSB_"+n.idx+"_scrollbar",o=E(t+">a");o.bind("mousedown."+e+" touchstart."+e+" pointerdown."+e+" MSPointerDown."+e+" mouseup."+e+" touchend."+e+" pointerup."+e+" MSPointerUp."+e+" mouseout."+e+" pointerout."+e+" MSPointerOut."+e+" click."+e,function(e){function t(e,t){r.scrollAmount=i.snapAmount||i.scrollButtons.scrollAmount,F(a,e,t)}if(e.preventDefault(),te(e)){var o=E(this).attr("class");switch(r.type=i.scrollButtons.scrollType,e.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if("stepped"===r.type)return;A=!0,n.tweenRunning=!1,t("on",o);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if("stepped"===r.type)return;A=!1,r.dir&&t("off",o);break;case"click":if("stepped"!==r.type||n.tweenRunning)return;t("on",o)}}})},q=function(){function t(e){function t(e,t){d.type=c.keyboard.scrollType,d.scrollAmount=c.snapAmount||c.keyboard.scrollAmount,"stepped"===d.type&&s.tweenRunning||F(l,e,t)}switch(e.type){case"blur":s.tweenRunning&&d.dir&&t("off",null);break;case"keydown":case"keyup":var o=e.keyCode?e.keyCode:e.which,a="on";if("x"!==c.axis&&(38===o||40===o)||"y"!==c.axis&&(37===o||39===o)){if((38===o||40===o)&&!s.overflowed[0]||(37===o||39===o)&&!s.overflowed[1])return;"keyup"===e.type&&(a="off"),E(document.activeElement).is(f)||(e.preventDefault(),e.stopImmediatePropagation(),t(a,o))}else if(33===o||34===o){if((s.overflowed[0]||s.overflowed[1])&&(e.preventDefault(),e.stopImmediatePropagation()),"keyup"===e.type){Z(l);var n=34===o?-1:1;if("x"===c.axis||"yx"===c.axis&&s.overflowed[1]&&!s.overflowed[0])var i="x",r=Math.abs(u[0].offsetLeft)-.9*n*h.width();else var i="y",r=Math.abs(u[0].offsetTop)-.9*n*h.height();G(l,r.toString(),{dir:i,scrollEasing:"mcsEaseInOut"})}}else if((35===o||36===o)&&!E(document.activeElement).is(f)&&((s.overflowed[0]||s.overflowed[1])&&(e.preventDefault(),e.stopImmediatePropagation()),"keyup"===e.type)){if("x"===c.axis||"yx"===c.axis&&s.overflowed[1]&&!s.overflowed[0])var i="x",r=35===o?Math.abs(h.width()-u.outerWidth(!1)):0;else var i="y",r=35===o?Math.abs(h.height()-u.outerHeight(!1)):0;G(l,r.toString(),{dir:i,scrollEasing:"mcsEaseInOut"})}}}var l=E(this),s=l.data(W),c=s.opt,d=s.sequential,e=W+"_"+s.idx,o=E("#mCSB_"+s.idx),u=E("#mCSB_"+s.idx+"_container"),h=u.parent(),f="input,textarea,select,datalist,keygen,[contenteditable='true']",a=u.find("iframe"),n=["blur."+e+" keydown."+e+" keyup."+e];a.length&&a.each(function(){E(this).load(function(){z(this)&&E(this.contentDocument||this.contentWindow.document).bind(n[0],function(e){t(e)})})}),o.attr("tabindex","0").bind(n[0],function(e){t(e)})},F=function(u,e,t,h,f){function m(e){var t="stepped"!==g.type,o=f||(e?t?x/1.5:_:1e3/60),a=e?t?7.5:40:2.5,n=[Math.abs(v[0].offsetTop),Math.abs(v[0].offsetLeft)],i=[10<p.scrollRatio.y?10:p.scrollRatio.y,10<p.scrollRatio.x?10:p.scrollRatio.x],r="x"===g.dir[0]?n[1]+g.dir[1]*i[1]*a:n[0]+g.dir[1]*i[0]*a,l="x"===g.dir[0]?n[1]+g.dir[1]*parseInt(g.scrollAmount):n[0]+g.dir[1]*parseInt(g.scrollAmount),s="auto"!==g.scrollAmount?l:r,c=h||(e?t?"mcsLinearOut":"mcsEaseInOut":"mcsLinear"),d=!!e;return e&&o<17&&(s="x"===g.dir[0]?n[1]:n[0]),G(u,s.toString(),{dir:g.dir[0],scrollEasing:c,dur:o,onComplete:d}),e?void(g.dir=!1):(clearTimeout(g.step),void(g.step=setTimeout(function(){m()},o)))}var p=u.data(W),o=p.opt,g=p.sequential,v=E("#mCSB_"+p.idx+"_container"),a="stepped"===g.type,x=o.scrollInertia<26?26:o.scrollInertia,_=o.scrollInertia<1?17:o.scrollInertia;switch(e){case"on":if(g.dir=[t===w[16]||t===w[15]||39===t||37===t?"x":"y",t===w[13]||t===w[15]||38===t||37===t?-1:1],Z(u),ae(t)&&"stepped"===g.type)return;m(a);break;case"off":clearTimeout(g.step),ee(g,"step"),Z(u),(a||p.tweenRunning&&g.dir)&&m(!0)}},N=function(e){var t=E(this).data(W).opt,o=[];return"function"==typeof e&&(e=e()),e instanceof Array?o=1<e.length?[e[0],e[1]]:"x"===t.axis?[null,e[0]]:[e[0],null]:(o[0]=e.y?e.y:e.x||"x"===t.axis?null:e,o[1]=e.x?e.x:e.y||"y"===t.axis?null:e),"function"==typeof o[0]&&(o[0]=o[0]()),"function"==typeof o[1]&&(o[1]=o[1]()),o},V=function(e,t){if(null!=e&&void 0!==e){var o=E(this),a=o.data(W),n=a.opt,i=E("#mCSB_"+a.idx+"_container"),r=i.parent(),l=typeof e;t||(t="x"===n.axis?"x":"y");var s="x"===t?i.outerWidth(!1):i.outerHeight(!1),c="x"===t?i[0].offsetLeft:i[0].offsetTop,d="x"===t?"left":"top";switch(l){case"function":return e();case"object":var u=e.jquery?e:E(e);if(!u.length)return;return"x"===t?ne(u)[1]:ne(u)[0];case"string":case"number":if(ae(e))return Math.abs(e);if(-1!==e.indexOf("%"))return Math.abs(s*parseInt(e)/100);if(-1!==e.indexOf("-="))return Math.abs(c-parseInt(e.split("-=")[1]));if(-1!==e.indexOf("+=")){var h=c+parseInt(e.split("+=")[1]);return 0<=h?0:Math.abs(h)}if(-1!==e.indexOf("px")&&ae(e.split("px")[0]))return Math.abs(e.split("px")[0]);if("top"===e||"left"===e)return 0;if("bottom"===e)return Math.abs(r.height()-i.outerHeight(!1));if("right"===e)return Math.abs(r.width()-i.outerWidth(!1));if("first"===e||"last"===e){var u=i.find(":"+e);return"x"===t?ne(u)[1]:ne(u)[0]}return E(e).length?"x"===t?ne(E(e))[1]:ne(E(e))[0]:(i.css(d,e),void v.update.call(null,o[0]))}}},Q=function(e){function t(){var e=0;return r.advanced.updateOnImageLoad&&(e=l.find("img").length),e}function o(){!0===r.advanced.updateOnSelectorChange&&(r.advanced.updateOnSelectorChange="*");var e=0,t=l.find(r.advanced.updateOnSelectorChange);return r.advanced.updateOnSelectorChange&&0<t.length&&t.each(function(){e+=E(this).height()+E(this).width()}),e}function n(e){clearTimeout(l[0].autoUpdate),v.update.call(null,a[0],e)}var a=E(this),i=a.data(W),r=i.opt,l=E("#mCSB_"+i.idx+"_container");if(e)return clearTimeout(l[0].autoUpdate),void ee(l[0],"autoUpdate");var s,c,d,u=l.parent(),h=[E("#mCSB_"+i.idx+"_scrollbar_vertical"),E("#mCSB_"+i.idx+"_scrollbar_horizontal")],f=function(){return[h[0].is(":visible")?h[0].outerHeight(!0):0,h[1].is(":visible")?h[1].outerWidth(!0):0]},m=o(),p=[l.outerHeight(!1),l.outerWidth(!1),u.height(),u.width(),f()[0],f()[1]],g=t();!function e(){clearTimeout(l[0].autoUpdate),l[0].autoUpdate=setTimeout(function(){return r.advanced.updateOnSelectorChange&&(s=o())!==m?(n(3),void(m=s)):(r.advanced.updateOnContentResize&&((c=[l.outerHeight(!1),l.outerWidth(!1),u.height(),u.width(),f()[0],f()[1]])[0]!==p[0]||c[1]!==p[1]||c[2]!==p[2]||c[3]!==p[3]||c[4]!==p[4]||c[5]!==p[5])&&(n(c[0]!==p[0]||c[1]!==p[1]),p=c),r.advanced.updateOnImageLoad&&(d=t())!==g&&(l.find("img").each(function(){!function(e){if(E(e).hasClass(w[2]))return n();var t,o,a=new Image;a.onload=(t=a,o=function(){this.onload=null,E(e).addClass(w[2]),n(2)},function(){return o.apply(t,arguments)}),a.src=e.src}(this)}),g=d),void((r.advanced.updateOnSelectorChange||r.advanced.updateOnContentResize||r.advanced.updateOnImageLoad)&&e()))},60)}()},Z=function(e){var t=e.data(W),o=E("#mCSB_"+t.idx+"_container,#mCSB_"+t.idx+"_container_wrapper,#mCSB_"+t.idx+"_dragger_vertical,#mCSB_"+t.idx+"_dragger_horizontal");o.each(function(){$.call(this)})},G=function(n,e,i){function t(e){return s&&c.callbacks[e]&&"function"==typeof c.callbacks[e]}function o(){var e=[f[0].offsetTop,f[0].offsetLeft],t=[v[0].offsetTop,v[0].offsetLeft],o=[f.outerHeight(!1),f.outerWidth(!1)],a=[h.height(),h.width()];n[0].mcs={content:f,top:e[0],left:e[1],draggerTop:t[0],draggerLeft:t[1],topPct:Math.round(100*Math.abs(e[0])/(Math.abs(o[0])-a[0])),leftPct:Math.round(100*Math.abs(e[1])/(Math.abs(o[1])-a[1])),direction:i.dir}}var a,r,l,s=n.data(W),c=s.opt,d={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:!1,dur:c.scrollInertia,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},i=E.extend(d,i),u=[i.dur,i.drag?0:i.dur],h=E("#mCSB_"+s.idx),f=E("#mCSB_"+s.idx+"_container"),m=f.parent(),p=c.callbacks.onTotalScrollOffset?N.call(n,c.callbacks.onTotalScrollOffset):[0,0],g=c.callbacks.onTotalScrollBackOffset?N.call(n,c.callbacks.onTotalScrollBackOffset):[0,0];if(s.trigger=i.trigger,(0!==m.scrollTop()||0!==m.scrollLeft())&&(E(".mCSB_"+s.idx+"_scrollbar").css("visibility","visible"),m.scrollTop(0).scrollLeft(0)),"_resetY"!==e||s.contentReset.y||(t("onOverflowYNone")&&c.callbacks.onOverflowYNone.call(n[0]),s.contentReset.y=1),"_resetX"!==e||s.contentReset.x||(t("onOverflowXNone")&&c.callbacks.onOverflowXNone.call(n[0]),s.contentReset.x=1),"_resetY"!==e&&"_resetX"!==e){switch(!s.contentReset.y&&n[0].mcs||!s.overflowed[0]||(t("onOverflowY")&&c.callbacks.onOverflowY.call(n[0]),s.contentReset.x=null),!s.contentReset.x&&n[0].mcs||!s.overflowed[1]||(t("onOverflowX")&&c.callbacks.onOverflowX.call(n[0]),s.contentReset.x=null),c.snapAmount&&(a=e,r=c.snapAmount,l=c.snapOffset,e=Math.round(a/r)*r-l),i.dir){case"x":var v=E("#mCSB_"+s.idx+"_dragger_horizontal"),x="left",_=f[0].offsetLeft,w=[h.width()-f.outerWidth(!1),v.parent().width()-v.width()],S=[e,0===e?0:e/s.scrollRatio.x],b=p[1],C=g[1],y=0<b?b/s.scrollRatio.x:0,B=0<C?C/s.scrollRatio.x:0;break;case"y":var v=E("#mCSB_"+s.idx+"_dragger_vertical"),x="top",_=f[0].offsetTop,w=[h.height()-f.outerHeight(!1),v.parent().height()-v.height()],S=[e,0===e?0:e/s.scrollRatio.y],b=p[0],C=g[0],y=0<b?b/s.scrollRatio.y:0,B=0<C?C/s.scrollRatio.y:0}S[1]<0||0===S[0]&&0===S[1]?S=[0,0]:S[1]>=w[1]?S=[w[0],w[1]]:S[0]=-S[0],n[0].mcs||(o(),t("onInit")&&c.callbacks.onInit.call(n[0])),clearTimeout(f[0].onCompleteTimeout),(s.tweenRunning||!(0===_&&0<=S[0]||_===w[0]&&S[0]<=w[0]))&&(J(v[0],x,Math.round(S[1]),u[1],i.scrollEasing),J(f[0],x,Math.round(S[0]),u[0],i.scrollEasing,i.overwrite,{onStart:function(){i.callbacks&&i.onStart&&!s.tweenRunning&&(t("onScrollStart")&&(o(),c.callbacks.onScrollStart.call(n[0])),s.tweenRunning=!0,T(v),s.cbOffsets=[c.callbacks.alwaysTriggerOffsets||_>=w[0]+b,c.callbacks.alwaysTriggerOffsets||_<=-C])},onUpdate:function(){i.callbacks&&i.onUpdate&&t("whileScrolling")&&(o(),c.callbacks.whileScrolling.call(n[0]))},onComplete:function(){if(i.callbacks&&i.onComplete){"yx"===c.axis&&clearTimeout(f[0].onCompleteTimeout);var e=f[0].idleTimer||0;f[0].onCompleteTimeout=setTimeout(function(){t("onScroll")&&(o(),c.callbacks.onScroll.call(n[0])),t("onTotalScroll")&&S[1]>=w[1]-y&&s.cbOffsets[0]&&(o(),c.callbacks.onTotalScroll.call(n[0])),t("onTotalScrollBack")&&S[1]<=B&&s.cbOffsets[1]&&(o(),c.callbacks.onTotalScrollBack.call(n[0])),s.tweenRunning=!1,f[0].idleTimer=0,T(v,"hide")},e)}}}))}},J=function(e,t,o,a,n,i,r){function l(){x.stop||(p||u.call(),p=K()-m,s(),p>=x.time&&(x.time=p>x.time?p+c-(p-x.time):p+c-1,x.time<p+1&&(x.time=p+1)),x.time<a?x.id=d(l):f.call())}function s(){0<a?(x.currVal=function(e,t,o,a,n){switch(n){case"linear":case"mcsLinear":return o*e/a+t;case"mcsLinearOut":return e/=a,e--,o*Math.sqrt(1-e*e)+t;case"easeInOutSmooth":return(e/=a/2)<1?o/2*e*e+t:-o/2*(--e*(e-2)-1)+t;case"easeInOutStrong":return(e/=a/2)<1?o/2*Math.pow(2,10*(e-1))+t:(e--,o/2*(2-Math.pow(2,-10*e))+t);case"easeInOut":case"mcsEaseInOut":return(e/=a/2)<1?o/2*e*e*e+t:o/2*((e-=2)*e*e+2)+t;case"easeOutSmooth":return e/=a,-o*(--e*e*e*e-1)+t;case"easeOutStrong":return o*(1-Math.pow(2,-10*e/a))+t;case"easeOut":case"mcsEaseOut":default:var i=(e/=a)*e,r=i*e;return t+o*(.499999999999997*r*i+-2.5*i*i+5.5*r+-6.5*i+4*e)}}(x.time,g,_,a,n),v[t]=Math.round(x.currVal)+"px"):v[t]=o+"px",h.call()}e._mTween||(e._mTween={top:{},left:{}});var c,d,r=r||{},u=r.onStart||function(){},h=r.onUpdate||function(){},f=r.onComplete||function(){},m=K(),p=0,g=e.offsetTop,v=e.style,x=e._mTween[t];"left"===t&&(g=e.offsetLeft);var _=o-g;x.stop=0,"none"!==i&&null!=x.id&&(window.requestAnimationFrame?window.cancelAnimationFrame(x.id):clearTimeout(x.id),x.id=null),c=1e3/60,x.time=p+c,d=window.requestAnimationFrame?window.requestAnimationFrame:function(e){return s(),setTimeout(e,.01)},x.id=d(l)},K=function(){return window.performance&&window.performance.now?window.performance.now():window.performance&&window.performance.webkitNow?window.performance.webkitNow():Date.now?Date.now():(new Date).getTime()},$=function(){var e=this;e._mTween||(e._mTween={top:{},left:{}});for(var t=["top","left"],o=0;o<t.length;o++){var a=t[o];e._mTween[a].id&&(window.requestAnimationFrame?window.cancelAnimationFrame(e._mTween[a].id):clearTimeout(e._mTween[a].id),e._mTween[a].id=null,e._mTween[a].stop=1)}},ee=function(t,o){try{delete t[o]}catch(e){t[o]=null}},te=function(e){return!(e.which&&1!==e.which)},oe=function(e){var t=e.originalEvent.pointerType;return!(t&&"touch"!==t&&2!==t)},ae=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},ne=function(e){var t=e.parents(".mCSB_container");return[e.offset().top-t.offset().top,e.offset().left-t.offset().left]},E.fn[f]=function(e){return v[e]?v[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void E.error("Method "+e+" does not exist"):v.init.apply(this,arguments)},E[f]=function(e){return v[e]?v[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void E.error("Method "+e+" does not exist"):v.init.apply(this,arguments)},E[f].defaults=n,window[f]=!0,E(window).load(function(){E(a)[f](),E.extend(E.expr[":"],{mcsInView:E.expr[":"].mcsInView||function(e){var t,o,a=E(e),n=a.parents(".mCSB_container");if(n.length)return t=n.parent(),0<=(o=[n[0].offsetTop,n[0].offsetLeft])[0]+ne(a)[0]&&o[0]+ne(a)[0]<t.height()-a.outerHeight(!1)&&0<=o[1]+ne(a)[1]&&o[1]+ne(a)[1]<t.width()-a.outerWidth(!1)},mcsOverflow:E.expr[":"].mcsOverflow||function(e){var t=E(e).data(W);if(t)return t.overflowed[0]||t.overflowed[1]}})})});