Team:TAS Taipei/js/libs.min.js

From 2014hs.igem.org

Revision as of 20:30, 17 June 2014 by Xiaoyangkao2 (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

(function(e,t,n,r,i,s,o,u,a){"use strict";function p(){if(p.memo){return p.memo}var n=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||function(e){i(e,1e3/60)};var r=t.body===null;if(r){t.documentElement.appendChild(t.createElement("body"))}var s="";(function(){var n=t.createElement("div");var r=["webkit","moz","o","ms"];t.body.appendChild(n);u.each(r,function(e,t){n.style[t+"OverflowScrolling"]="touch"});n.style.overflowScrolling="touch";var i=e.getComputedStyle(n);if(!!i.overflowScrolling){s="overflow-scrolling"}else{u.each(r,function(e,t){if(!!i[t+"OverflowScrolling"]){s="-"+t+"-overflow-scrolling"}return!s})}n.parentNode.removeChild(n)})();var o={};(function(){var n=t.createElement("div");var r=["webkit","moz"];var i="https://mail.google.com/mail/images/2/";o={grab:"url("+i+"openhand.cur), move",grabbing:"url("+i+"closedhand.cur), move"};t.body.appendChild(n);u.each(r,function(t,r){var i,s="-"+r+"-grab";n.style.cursor=s;var u=e.getComputedStyle(n);i=u.cursor===s;if(i){o={grab:"-"+r+"-grab",grabbing:"-"+r+"-grabbing"}}return!i});n.parentNode.removeChild(n);return o})();p.memo={animate:function(t){return n.call(e,t)},overflowScrolling:s,cursor:o};if(r){t.documentElement.removeChild(t.body)}return p.memo}function d(e,t){t.trigger("overscroll:"+e)}function v(){return(new Date).getTime()}function m(e,t,n){t.x=e.pageX;t.y=e.pageY;t.time=v();t.index=n;return t}function g(e,t,n,r){var i,s;if(e&&e.added){if(e.horizontal){i=n*(1+t.container.width/t.container.scrollWidth);s=r+t.thumbs.horizontal.top;e.horizontal.css("margin",s+"px 0 0 "+i+"px")}if(e.vertical){i=n+t.thumbs.vertical.left;s=r*(1+t.container.height/t.container.scrollHeight);e.vertical.css("margin",s+"px 0 0 "+i+"px")}}}function y(e,t,n){if(e&&e.added&&!t.persistThumbs){if(n){if(e.vertical){e.vertical.stop(true,true).fadeTo("fast",c.thumbOpacity)}if(e.horizontal){e.horizontal.stop(true,true).fadeTo("fast",c.thumbOpacity)}}else{if(e.vertical){e.vertical.fadeTo("fast",0)}if(e.horizontal){e.horizontal.fadeTo("fast",0)}}}}function b(e){var t,n="events";var r=u._data?u._data(e[0],n):e.data(n);if(r&&r.click){t=r.click.slice();e.off("click").one("click",function(){u.each(t,function(t,n){e.click(n)});return false})}}function w(e){var t=e.data,n=t.thumbs,r=t.options,i=e.type==="mouseenter";y(n,r,i)}function E(e){var t=e.data;if(!t.flags.dragged){g(t.thumbs,t.sizing,this.scrollLeft,this.scrollTop)}}function S(e){e.preventDefault();var t=e.data,n=t.options,r=t.sizing,o=t.thumbs,u=t.wheel,a=t.flags,l=e.originalEvent,h=0,p=0,d=0;a.drifting=false;if(l.detail){h=-l.detail;if(l.detailX){p=-l.detailX}if(l.detailY){d=-l.detailY}}else if(l.wheelDelta){h=l.wheelDelta/c.wheelTicks;if(l.wheelDeltaX){p=l.wheelDeltaX/c.wheelTicks}if(l.wheelDeltaY){d=l.wheelDeltaY/c.wheelTicks}}h*=n.wheelDelta;p*=n.wheelDelta;d*=n.wheelDelta;if(!u){t.target.data(f).dragging=a.dragging=true;t.wheel=u={timeout:null};y(o,n,true)}if(n.wheelDirection==="vertical"){this.scrollTop-=h}else if(n.wheelDirection==="horizontal"){this.scrollLeft-=h}else{this.scrollLeft-=p;this.scrollTop-=d||h}if(u.timeout){s(u.timeout)}g(o,r,this.scrollLeft,this.scrollTop);u.timeout=i(function(){t.target.data(f).dragging=a.dragging=false;y(o,n,t.wheel=null)},c.thumbTimeout)}function x(e){e.preventDefault();var t=e.data,n=e.originalEvent.touches,r=t.options,i=t.sizing,s=t.thumbs,o=t.position,u=t.flags,a=t.target.get(0);if(n&&n.length){e=n[0]}if(!u.dragged){y(s,r,true)}u.dragged=true;if(r.direction!=="vertical"){a.scrollLeft-=e.pageX-o.x}if(t.options.direction!=="horizontal"){a.scrollTop-=e.pageY-o.y}m(e,t.position);if(--t.capture.index<=0){t.target.data(f).dragging=u.dragging=true;m(e,t.capture,c.captureThreshold)}g(s,i,a.scrollLeft,a.scrollTop)}function T(e,t,n){var r=t.data,i,s,o,u,a=r.capture,f=r.options,l=r.sizing,h=r.thumbs,m=v()-a.time,y=e.scrollLeft,b=e.scrollTop,w=c.driftDecay;if(m>c.driftTimeout){n(r);return}i=f.scrollDelta*(t.pageX-a.x);s=f.scrollDelta*(t.pageY-a.y);if(f.direction!=="vertical"){y-=i}if(f.direction!=="horizontal"){b-=s}o=i/c.driftSequences;u=s/c.driftSequences;d("driftstart",r.target);r.drifting=true;p().animate(function E(){if(r.drifting){var t=1,i=-1;r.drifting=false;if(u>t&&e.scrollTop>b||u<i&&e.scrollTopt&&e.scrollLeft>y||o<i&&e.scrollLeft<y){r.drifting=true;e.scrollLeft-=o;o/=w}g(h,l,e.scrollLeft,e.scrollTop);p().animate(E)}else{d("driftend",r.target);n(r)}})}function N(e){var t=e.data,n=e.originalEvent.touches,r=t.target,i=t.start=u(e.target),s=t.flags;s.drifting=false;if(i.size()&&!i.is(t.options.cancelOn)){if(!n){e.preventDefault()}if(!p().overflowScrolling){r.css("cursor",p().cursor.grabbing);r.data(f).dragging=s.dragging=s.dragged=false;if(t.options.dragHold){u(document).on(l.drag,t,x)}else{r.on(l.drag,t,x)}}t.position=m(e,{});t.capture=m(e,{},c.captureThreshold);d("dragstart",r)}}function C(e){var t=e.data,n=t.target,r=t.options,i=t.flags,s=t.thumbs,o=function(){if(s&&!r.hoverThumbs){y(s,r,false)}};if(r.dragHold){u(document).unbind(l.drag,x)}else{n.unbind(l.drag,x)}if(t.position){d("dragend",n);if(i.dragging&&!p().overflowScrolling){T(n.get(0),e,o)}else{o()}}if(i.dragging&&!p().overflowScrolling&&t.start&&t.start.is(e.target)){b(t.start)}n.data(f).dragging=t.start=t.capture=t.position=i.dragged=i.dragging=false;n.css("cursor",p().cursor.grab)}function k(e){e=u.extend({},h,e);if(e.direction!=="multi"&&e.direction!==e.wheelDirection){e.wheelDirection=e.direction}e.scrollDelta=r.abs(parseFloat(e.scrollDelta));e.wheelDelta=r.abs(parseFloat(e.wheelDelta));e.scrollLeft=e.scrollLeft===a?null:r.abs(parseFloat(e.scrollLeft));e.scrollTop=e.scrollTop===a?null:r.abs(parseFloat(e.scrollTop));return e}function L(e){var t=u(e),n=t.width(),r=t.height(),i=n>=e.scrollWidth?n:e.scrollWidth,s=r>=e.scrollHeight?r:e.scrollHeight,o=i>n||s>r;return{valid:o,container:{width:n,height:r,scrollWidth:i,scrollHeight:s},thumbs:{horizontal:{width:n*n/i,height:c.thumbThickness,corner:c.thumbThickness/2,left:0,top:r-c.thumbThickness},vertical:{width:c.thumbThickness,height:r*r/s,corner:c.thumbThickness/2,left:n-c.thumbThickness,top:0}}}}function A(e,t){var n=u(e),r,i=n.data(f)||{},s=n.attr("style"),o=t?function(){i=n.data(f);r=i.thumbs;if(s){n.attr("style",s)}else{n.removeAttr("style")}if(r){if(r.horizontal){r.horizontal.remove()}if(r.vertical){r.vertical.remove()}}n.removeData(f).off(l.wheel,S).off(l.start,N).off(l.end,C).off(l.ignored,_)}:u.noop;return u.isFunction(i.remover)?i.remover:o}function O(e,t){return{position:"absolute",opacity:t.persistThumbs?c.thumbOpacity:0,"background-color":t.thumbColor,width:e.width+"px",height:e.height+"px","border-radius":e.corner+"px",margin:e.top+"px 0 0 "+e.left+"px","z-index":t.zIndex}}function M(e,t,n){var r="<div/>",i={},s=false;if(t.container.scrollWidth>0&&n.direction!=="vertical"){s=O(t.thumbs.horizontal,n);i.horizontal=u(r).css(s).prependTo(e)}if(t.container.scrollHeight>0&&n.direction!=="horizontal"){s=O(t.thumbs.vertical,n);i.vertical=u(r).css(s).prependTo(e)}i.added=!!s;return i}function _(e){e.preventDefault()}function D(e,t){t=k(t);var n=L(e),r,i={options:t,sizing:n,flags:{dragging:false},remover:A(e,true)};if(n.valid||t.ignoreSizing){i.target=e=u(e).css({position:"relative",cursor:p().cursor.grab}).on(l.start,i,N).on(l.end,i,C).on(l.ignored,i,_);if(t.dragHold){u(document).on(l.end,i,C)}else{i.target.on(l.end,i,C)}if(t.scrollLeft!==null){e.scrollLeft(t.scrollLeft)}if(t.scrollTop!==null){e.scrollTop(t.scrollTop)}if(p().overflowScrolling){e.css(p().overflowScrolling,"touch")}else{e.on(l.scroll,i,E)}if(t.captureWheel){e.on(l.wheel,i,S)}if(t.showThumbs){if(p().overflowScrolling){e.css("overflow","scroll")}else{e.css("overflow","hidden");i.thumbs=r=M(e,n,t);if(r.added){g(r,n,e.scrollLeft(),e.scrollTop());if(t.hoverThumbs){e.on(l.hover,i,w)}}}}else{e.css("overflow","hidden")}e.data(f,i)}}function P(e){A(e)()}function H(e){return this.removeOverscroll().each(function(){D(this,e)})}function B(){return this.each(function(){P(this)})}var f="overscroll";var l={drag:"mousemove touchmove",end:"mouseup mouseleave click touchend touchcancel",hover:"mouseenter mouseleave",ignored:"select dragstart drag",scroll:"scroll",start:"mousedown touchstart",wheel:"mousewheel DOMMouseScroll"};var c={captureThreshold:3,driftDecay:1.1,driftSequences:22,driftTimeout:100,scrollDelta:15,thumbOpacity:.7,thumbThickness:6,thumbTimeout:400,wheelDelta:20,wheelTicks:120};var h={cancelOn:"select,input,textarea",direction:"multi",dragHold:false,hoverThumbs:false,scrollDelta:c.scrollDelta,showThumbs:true,persistThumbs:false,captureWheel:true,wheelDelta:c.wheelDelta,wheelDirection:"multi",zIndex:999,ignoreSizing:false,thumbColor:"black"};H.settings=c;u.extend(o,{overscroll:H,removeOverscroll:B})})(window,document,navigator,Math,setTimeout,clearTimeout,jQuery.fn,jQuery);(function(e,t,n){"use strict";function r(n){if(i=t.documentElement,s=t.body,W(),ot=this,n=n||{},ct=n.constants||{},n.easing)for(var r in n.easing)$[r]=n.easing[r];yt=n.edgeStrategy||"set",ft={beforerender:n.beforerender,render:n.render},lt=n.forceHeight!==!1,lt&&(Pt=n.scale||1),ht=n.mobileDeceleration||T,dt=n.smoothScrolling!==!1,vt=n.smoothScrollingDuration||N,mt={targetTop:ot.getScrollTop()},Ut=(n.mobileCheck||function(){return/Android|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent||navigator.vendor||e.opera)})(),Ut?(at=t.getElementById("skrollr-body"),at&&st(),J(),Lt(i,[y,E],[b])):Lt(i,[y,w],[b]),ot.refresh(),Et(e,"resize orientationchange",function(){var e=i.clientWidth,t=i.clientHeight;(t!==It||e!==Ft)&&(It=t,Ft=e,qt=!0)});var o=X();return function u(){G(),wt=o(u)}(),ot}var i,s,o=e.skrollr={get:function(){return ot},init:function(e){return ot||new r(e)},VERSION:"0.6.21"},u=Object.prototype.hasOwnProperty,a=e.Math,f=e.getComputedStyle,l="touchstart",c="touchmove",h="touchcancel",p="touchend",d="skrollable",v=d+"-before",m=d+"-between",g=d+"-after",y="skrollr",b="no-"+y,w=y+"-desktop",E=y+"-mobile",S="linear",x=1e3,T=.004,N=200,C="start",k="end",L="center",A="bottom",O="___skrollable_id",M=/^(?:input|textarea|button|select)$/i,_=/^\s+|\s+$/g,D=/^data(?:-(_\w+))?(?:-?(-?\d*\.?\d+p?))?(?:-?(start|end|top|center|bottom))?(?:-?(top|center|bottom))?$/,P=/\s*([\w\-\[\]]+)\s*:\s*(.+?)\s*(?:;|$)/gi,H=/^([a-z\-]+)\[(\w+)\]$/,B=/-([a-z])/g,j=function(e,t){return t.toUpperCase()},F=/[\-+]?[\d]*\.?[\d]+/g,I=/\{\?\}/g,q=/rgba?\(\s*-?\d+\s*,\s*-?\d+\s*,\s*-?\d+/g,R=/[a-z\-]+-gradient/g,U="",z="",W=function(){var e=/^(?:O|Moz|webkit|ms)|(?:-(?:o|moz|webkit|ms)-)/;if(f){var t=f(s,null);for(var r in t)if(U=r.match(e)||+r==r&&t[r].match(e))break;if(!U)return U=z="",n;U=U[0],"-"===U.slice(0,1)?(z=U,U={"-webkit-":"webkit","-moz-":"Moz","-ms-":"ms","-o-":"O"}[U]):z="-"+U.toLowerCase()+"-"}},X=function(){var t=e.requestAnimationFrame||e[U.toLowerCase()+"RequestAnimationFrame"],n=Mt();return(Ut||!t)&&(t=function(t){var r=Mt()-n,i=a.max(0,1e3/60-r);return e.setTimeout(function(){n=Mt(),t()},i)}),t},V=function(){var t=e.cancelAnimationFrame||e[U.toLowerCase()+"CancelAnimationFrame"];return(Ut||!t)&&(t=function(t){return e.clearTimeout(t)}),t},$={begin:function(){return 0},end:function(){return 1},linear:function(e){return e},quadratic:function(e){return e*e},cubic:function(e){return e*e*e},swing:function(e){return-a.cos(e*a.PI)/2+.5},sqrt:function(e){return a.sqrt(e)},outCubic:function(e){return a.pow(e-1,3)+1},bounce:function(e){var t;if(.5083>=e)t=3;else if(.8489>=e)t=9;else if(.96208>=e)t=27;else{if(!(.99981>=e))return 1;t=91}return 1-a.abs(3*a.cos(1.028*e*t)/t)}};r.prototype.refresh=function(e){var r,i,s=!1;for(e===n?(s=!0,ut=[],Rt=0,e=t.getElementsByTagName("*")):e=[].concat(e),r=0,i=e.length;i>r;r++){var o=e[r],u=o,a=[],f=dt,l=yt;if(o.attributes){for(var c=0,h=o.attributes.length;h>c;c++){var p=o.attributes[c];if("data-anchor-target"!==p.name)if("data-smooth-scrolling"!==p.name)if("data-edge-strategy"!==p.name){var v=p.name.match(D);if(null!==v){var m={props:p.value,element:o};a.push(m);var g=v[1];g&&(m.constant=g.substr(1));var y=v[2];/p$/.test(y)?(m.isPercentage=!0,m.offset=(0|y.slice(0,-1))/100):m.offset=0|y;var b=v[3],w=v[4]||b;b&&b!==C&&b!==k?(m.mode="relative",m.anchors=[b,w]):(m.mode="absolute",b===k?m.isEnd=!0:m.isPercentage||(m.offset=m.offset*Pt))}}else l=p.value;else f="off"!==p.value;else if(u=t.querySelector(p.value),null===u)throw'Unable to find anchor target "'+p.value+'"'}if(a.length){var E,S,x;!s&&O in o?(x=o[O],E=ut[x].styleAttr,S=ut[x].classAttr):(x=o[O]=Rt++,E=o.style.cssText,S=kt(o)),ut[x]={element:o,styleAttr:E,classAttr:S,anchorTarget:u,keyFrames:a,smoothScrolling:f,edgeStrategy:l},Lt(o,[d],[])}}}for(Tt(),r=0,i=e.length;i>r;r++){var T=ut[e[r][O]];T!==n&&(Y(T),et(T))}return ot},r.prototype.relativeToAbsolute=function(e,t,n){var r=i.clientHeight,s=e.getBoundingClientRect(),o=s.top,u=s.bottom-s.top;return t===A?o-=r:t===L&&(o-=r/2),n===A?o+=u:n===L&&(o+=u/2),o+=ot.getScrollTop(),0|o+.5},r.prototype.animateTo=function(e,t){t=t||{};var r=Mt(),i=ot.getScrollTop();return pt={startTop:i,topDiff:e-i,targetTop:e,duration:t.duration||x,startTime:r,endTime:r+(t.duration||x),easing:$[t.easing||S],done:t.done},pt.topDiff||(pt.done&&pt.done.call(ot,!1),pt=n),ot},r.prototype.stopAnimateTo=function(){pt&&pt.done&&pt.done.call(ot,!0),pt=n},r.prototype.isAnimatingTo=function(){return!!pt},r.prototype.setScrollTop=function(t,n){return gt=n===!0,Ut?zt=a.min(a.max(t,0),Dt):e.scrollTo(0,t),ot},r.prototype.getScrollTop=function(){return Ut?zt:e.pageYOffset||i.scrollTop||s.scrollTop||0},r.prototype.getMaxScrollTop=function(){return Dt},r.prototype.on=function(e,t){return ft[e]=t,ot},r.prototype.off=function(e){return delete ft[e],ot},r.prototype.destroy=function(){var e=V();e(wt),xt(),Lt(i,[b],[y,w,E]);for(var t=0,r=ut.length;r>t;t++)it(ut[t].element);i.style.overflow=s.style.overflow="auto",i.style.height=s.style.height="auto",at&&o.setStyle(at,"transform","none"),ot=n,at=n,ft=n,lt=n,Dt=0,Pt=1,ct=n,ht=n,Ht="down",Bt=-1,Ft=0,It=0,qt=!1,pt=n,dt=n,vt=n,mt=n,gt=n,Rt=0,yt=n,Ut=!1,zt=0,bt=n};var J=function(){var r,o,u,f,d,v,m,g,y,b,w,E;Et(i,[l,c,h,p].join(" "),function(e){var i=e.changedTouches[0];for(f=e.target;3===f.nodeType;)f=f.parentNode;switch(d=i.clientY,v=i.clientX,b=e.timeStamp,M.test(f.tagName)||e.preventDefault(),e.type){case l:r&&r.blur(),ot.stopAnimateTo(),r=f,o=m=d,u=v,y=b;break;case c:M.test(f.tagName)&&t.activeElement!==f&&e.preventDefault(),g=d-m,E=b-w,ot.setScrollTop(zt-g,!0),m=d,w=b;break;default:case h:case p:var s=o-d,S=u-v,x=S*S+s*s;if(49>x){if(!M.test(r.tagName)){r.focus();var T=t.createEvent("MouseEvents");T.initMouseEvent("click",!0,!0,e.view,1,i.screenX,i.screenY,i.clientX,i.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,0,null),r.dispatchEvent(T)}return}r=n;var N=g/E;N=a.max(a.min(N,3),-3);var C=a.abs(N/ht),k=N*C+.5*ht*C*C,L=ot.getScrollTop()-k,A=0;L>Dt?(A=(Dt-L)/k,L=Dt):0>L&&(A=-L/k,L=0),C*=1-A,ot.animateTo(0|L+.5,{easing:"outCubic",duration:C})}}),e.scrollTo(0,0),i.style.overflow=s.style.overflow="hidden"},K=function(){var e,t,n,r,s,o,u,f,l,c,h,p=i.clientHeight,d=Nt();for(f=0,l=ut.length;l>f;f++)for(e=ut[f],t=e.element,n=e.anchorTarget,r=e.keyFrames,s=0,o=r.length;o>s;s++)u=r[s],c=u.offset,h=d[u.constant]||0,u.frame=c,u.isPercentage&&(c*=p,u.frame=c),"relative"===u.mode&&(it(t),u.frame=ot.relativeToAbsolute(n,u.anchors[0],u.anchors[1])-c,it(t,!0)),u.frame+=h,lt&&!u.isEnd&&u.frame>Dt&&(Dt=u.frame);for(Dt=a.max(Dt,Ct()),f=0,l=ut.length;l>f;f++){for(e=ut[f],r=e.keyFrames,s=0,o=r.length;o>s;s++)u=r[s],h=d[u.constant]||0,u.isEnd&&(u.frame=Dt-u.offset+h);e.keyFrames.sort(_t)}},Q=function(e,t){for(var n=0,r=ut.length;r>n;n++){var i,s,a=ut[n],f=a.element,l=a.smoothScrolling?e:t,c=a.keyFrames,h=c[0].frame,p=c[c.length-1].frame,y=h>l,b=l>p,w=c[y?0:c.length-1];if(y||b){if(y&&-1===a.edge||b&&1===a.edge)continue;switch(Lt(f,[y?v:g],[v,m,g]),a.edge=y?-1:1,a.edgeStrategy){case"reset":it(f);continue;case"ease":l=w.frame;break;default:case"set":var E=w.props;for(i in E)u.call(E,i)&&(s=rt(E[i].value),o.setStyle(f,i,s));continue}}else 0!==a.edge&&(Lt(f,[d,m],[v,g]),a.edge=0);for(var S=0,x=c.length-1;x>S;S++)if(l>=c[S].frame&&c[S+1].frame>=l){var T=c[S],N=c[S+1];for(i in T.props)if(u.call(T.props,i)){var C=(l-T.frame)/(N.frame-T.frame);C=T.props[i].easing(C),s=nt(T.props[i].value,N.props[i].value,C),s=rt(s),o.setStyle(f,i,s)}break}}},G=function(){qt&&(qt=!1,Tt());var e,t,r=ot.getScrollTop(),i=Mt();if(pt)i>=pt.endTime?(r=pt.targetTop,e=pt.done,pt=n):(t=pt.easing((i-pt.startTime)/pt.duration),r=0|pt.startTop+t*pt.topDiff),ot.setScrollTop(r,!0);else if(!gt){var s=mt.targetTop-r;s&&(mt={startTop:Bt,topDiff:r-Bt,targetTop:r,startTime:jt,endTime:jt+vt}),mt.endTime>=i&&(t=$.sqrt((i-mt.startTime)/vt),r=0|mt.startTop+t*mt.topDiff)}if(Ut&&at&&o.setStyle(at,"transform","translate(0, "+ -zt+"px) "+bt),gt||Bt!==r){Ht=r>Bt?"down":Bt>r?"up":Ht,gt=!1;var u={curTop:r,lastTop:Bt,maxTop:Dt,direction:Ht},a=ft.beforerender&&ft.beforerender.call(ot,u);a!==!1&&(Q(r,ot.getScrollTop()),Bt=r,ft.render&&ft.render.call(ot,u)),e&&e.call(ot,!1)}jt=i},Y=function(e){for(var t=0,n=e.keyFrames.length;n>t;t++){for(var r,i,s,o,u=e.keyFrames[t],a={};null!==(o=P.exec(u.props));)s=o[1],i=o[2],r=s.match(H),null!==r?(s=r[1],r=r[2]):r=S,i=i.indexOf("!")?Z(i):[i.slice(1)],a[s]={value:i,easing:$[r]};u.props=a}},Z=function(e){var t=[];return q.lastIndex=0,e=e.replace(q,function(e){return e.replace(F,function(e){return 100*(e/255)+"%"})}),z&&(R.lastIndex=0,e=e.replace(R,function(e){return z+e})),e=e.replace(F,function(e){return t.push(+e),"{?}"}),t.unshift(e),t},et=function(e){var t,n,r={};for(t=0,n=e.keyFrames.length;n>t;t++)tt(e.keyFrames[t],r);for(r={},t=e.keyFrames.length-1;t>=0;t--)tt(e.keyFrames[t],r)},tt=function(e,t){var n;for(n in t)u.call(e.props,n)||(e.props[n]=t[n]);for(n in e.props)t[n]=e.props[n]},nt=function(e,t,n){var r,i=e.length;if(i!==t.length)throw"Can't interpolate between \""+e[0]+'" and "'+t[0]+'"';var s=[e[0]];for(r=1;i>r;r++)s[r]=e[r]+(t[r]-e[r])*n;return s},rt=function(e){var t=1;return I.lastIndex=0,e[0].replace(I,function(){return e[t++]})},it=function(e,t){e=[].concat(e);for(var n,r,i=0,s=e.length;s>i;i++)r=e[i],n=ut[r[O]],n&&(t?(r.style.cssText=n.dirtyStyleAttr,Lt(r,n.dirtyClassAttr)):(n.dirtyStyleAttr=r.style.cssText,n.dirtyClassAttr=kt(r),r.style.cssText=n.styleAttr,Lt(r,n.classAttr)))},st=function(){bt="translateZ(0)",o.setStyle(at,"transform",bt);var e=f(at),t=e.getPropertyValue("transform"),n=e.getPropertyValue(z+"transform"),r=t&&"none"!==t||n&&"none"!==n;r||(bt="")};o.setStyle=function(e,t,n){var r=e.style;if(t=t.replace(B,j).replace("-",""),"zIndex"===t)r[t]=isNaN(n)?n:""+(0|n);else if("float"===t)r.styleFloat=r.cssFloat=n;else try{U&&(r[U+t.slice(0,1).toUpperCase()+t.slice(1)]=n),r[t]=n}catch(i){}};var ot,ut,at,ft,lt,ct,ht,pt,dt,vt,mt,gt,yt,bt,wt,Et=o.addEvent=function(t,n,r){var i=function(t){return t=t||e.event,t.target||(t.target=t.srcElement),t.preventDefault||(t.preventDefault=function(){t.returnValue=!1}),r.call(this,t)};n=n.split(" ");for(var s,o=0,u=n.length;u>o;o++)s=n[o],t.addEventListener?t.addEventListener(s,r,!1):t.attachEvent("on"+s,i),Wt.push({element:t,name:s,listener:r})},St=o.removeEvent=function(e,t,n){t=t.split(" ");for(var r=0,i=t.length;i>r;r++)e.removeEventListener?e.removeEventListener(t[r],n,!1):e.detachEvent("on"+t[r],n)},xt=function(){for(var e,t=0,n=Wt.length;n>t;t++)e=Wt[t],St(e.element,e.name,e.listener);Wt=[]},Tt=function(){var e=ot.getScrollTop();Dt=0,lt&&!Ut&&(s.style.height="auto"),K(),lt&&!Ut&&(s.style.height=Dt+i.clientHeight+"px"),Ut?ot.setScrollTop(a.min(ot.getScrollTop(),Dt)):ot.setScrollTop(e,!0),gt=!0},Nt=function(){var e,t,n=i.clientHeight,r={};for(e in ct)t=ct[e],"function"==typeof t?t=t.call(ot):/p$/.test(t)&&(t=t.slice(0,-1)/100*n),r[e]=t;return r},Ct=function(){var e=at&&at.offsetHeight||0,t=a.max(e,s.scrollHeight,s.offsetHeight,i.scrollHeight,i.offsetHeight,i.clientHeight);return t-i.clientHeight},kt=function(t){var n="className";return e.SVGElement&&t instanceof e.SVGElement&&(t=t[n],n="baseVal"),t[n]},Lt=function(t,r,i){var s="className";if(e.SVGElement&&t instanceof e.SVGElement&&(t=t[s],s="baseVal"),i===n)return t[s]=r,n;for(var o=t[s],u=0,a=i.length;a>u;u++)o=Ot(o).replace(Ot(i[u])," ");o=At(o);for(var f=0,l=r.length;l>f;f++)-1===Ot(o).indexOf(Ot(r[f]))&&(o+=" "+r[f]);t[s]=At(o)},At=function(e){return e.replace(_,"")},Ot=function(e){return" "+e+" "},Mt=Date.now||function(){return+(new Date)},_t=function(e,t){return e.frame-t.frame},Dt=0,Pt=1,Ht="down",Bt=-1,jt=Mt(),Ft=0,It=0,qt=!1,Rt=0,Ut=!1,zt=0,Wt=[]})(window,document);var module,countdown=function(e){function t(e,t){var n=e.getTime();e.setUTCMonth(e.getUTCMonth()+t);return Math.round((e.getTime()-n)/864e5)}function n(e){var t=e.getTime(),n=new Date(t);n.setUTCMonth(e.getUTCMonth()+1);return Math.round((n.getTime()-t)/864e5)}function r(e,t){return e+" "+(1===e?l[t]:c[t])}function i(){}function s(e,t,r,i,s,o){0<=e[r]&&(t+=e[r],delete e[r]);t/=s;if(1>=t+1)return 0;if(0<=e[i]){e[i]=+(e[i]+t).toFixed(o);switch(i){case"seconds":if(60!==e.seconds||isNaN(e.minutes))break;e.minutes++;e.seconds=0;case"minutes":if(60!==e.minutes||isNaN(e.hours))break;e.hours++;e.minutes=0;case"hours":if(24!==e.hours||isNaN(e.days))break;e.days++;e.hours=0;case"days":if(7!==e.days||isNaN(e.weeks))break;e.weeks++;e.days=0;case"weeks":if(e.weeks!==n(e.refMonth)/7||isNaN(e.months))break;e.months++;e.weeks=0;case"months":if(12!==e.months||isNaN(e.years))break;e.years++;e.months=0;case"years":if(10!==e.years||isNaN(e.decades))break;e.decades++;e.years=0;case"decades":if(10!==e.decades||isNaN(e.centuries))break;e.centuries++;e.decades=0;case"centuries":if(10!==e.centuries||isNaN(e.millennia))break;e.millennia++;e.centuries=0}return 0}return t}function o(e,r,i,o,u,l){e.start=r;e.end=i;e.units=o;e.value=i.getTime()-r.getTime();if(0>e.value){var c=i;i=r;r=c}e.refMonth=new Date(r.getFullYear(),r.getMonth(),15);try{e.millennia=0;e.centuries=0;e.decades=0;e.years=i.getUTCFullYear()-r.getUTCFullYear();e.months=i.getUTCMonth()-r.getUTCMonth();e.weeks=0;e.days=i.getUTCDate()-r.getUTCDate();e.hours=i.getUTCHours()-r.getUTCHours();e.minutes=i.getUTCMinutes()-r.getUTCMinutes();e.seconds=i.getUTCSeconds()-r.getUTCSeconds();e.milliseconds=i.getUTCMilliseconds()-r.getUTCMilliseconds();var h;0>e.milliseconds?(h=a(-e.milliseconds/1e3),e.seconds-=h,e.milliseconds+=1e3*h):1e3<=e.milliseconds&&(e.seconds+=f(e.milliseconds/1e3),e.milliseconds%=1e3);0>e.seconds?(h=a(-e.seconds/60),e.minutes-=h,e.seconds+=60*h):60<=e.seconds&&(e.minutes+=f(e.seconds/60),e.seconds%=60);0>e.minutes?(h=a(-e.minutes/60),e.hours-=h,e.minutes+=60*h):60<=e.minutes&&(e.hours+=f(e.minutes/60),e.minutes%=60);0>e.hours?(h=a(-e.hours/24),e.days-=h,e.hours+=24*h):24<=e.hours&&(e.days+=f(e.hours/24),e.hours%=24);for(;0>e.days;)e.months--,e.days+=t(e.refMonth,1);7<=e.days&&(e.weeks+=f(e.days/7),e.days%=7);0>e.months?(h=a(-e.months/12),e.years-=h,e.months+=12*h):12<=e.months&&(e.years+=f(e.months/12),e.months%=12);10<=e.years&&(e.decades+=f(e.years/10),e.years%=10,10<=e.decades&&(e.centuries+=f(e.decades/10),e.decades%=10,10<=e.centuries&&(e.millennia+=f(e.centuries/10),e.centuries%=10)));r=0;!(o&1024)||r>=u?(e.centuries+=10*e.millennia,delete e.millennia):e.millennia&&r++;!(o&512)||r>=u?(e.decades+=10*e.centuries,delete e.centuries):e.centuries&&r++;!(o&256)||r>=u?(e.years+=10*e.decades,delete e.decades):e.decades&&r++;!(o&128)||r>=u?(e.months+=12*e.years,delete e.years):e.years&&r++;!(o&64)||r>=u?(e.months&&(e.days+=t(e.refMonth,e.months)),delete e.months,7<=e.days&&(e.weeks+=f(e.days/7),e.days%=7)):e.months&&r++;!(o&32)||r>=u?(e.days+=7*e.weeks,delete e.weeks):e.weeks&&r++;!(o&16)||r>=u?(e.hours+=24*e.days,delete e.days):e.days&&r++;!(o&8)||r>=u?(e.minutes+=60*e.hours,delete e.hours):e.hours&&r++;!(o&4)||r>=u?(e.seconds+=60*e.minutes,delete e.minutes):e.minutes&&r++;!(o&2)||r>=u?(e.milliseconds+=1e3*e.seconds,delete e.seconds):e.seconds&&r++;if(!(o&1)||r>=u){var p=s(e,0,"milliseconds","seconds",1e3,l);if(p&&(p=s(e,p,"seconds","minutes",60,l))&&(p=s(e,p,"minutes","hours",60,l))&&(p=s(e,p,"hours","days",24,l))&&(p=s(e,p,"days","weeks",7,l))&&(p=s(e,p,"weeks","months",n(e.refMonth)/7,l))){o=p;var d,g=e.refMonth,y=g.getTime(),b=new Date(y);b.setUTCFullYear(g.getUTCFullYear()+1);d=Math.round((b.getTime()-y)/864e5);if(p=s(e,o,"months","years",d/n(e.refMonth),l))if(p=s(e,p,"years","decades",10,l))if(p=s(e,p,"decades","centuries",10,l))if(p=s(e,p,"centuries","millennia",10,l))throw Error("Fractional unit overflow")}}}finally{delete e.refMonth}return e}function u(e,t,n,r,s){var u;n=+n||222;r=0<r?r:NaN;s=0s?Math.round(s):20:0;"function"===typeof e?(u=e,e=null):e instanceof Date||(e=null!==e&&isFinite(e)?new Date(e):null);"function"===typeof t?(u=t,t=null):t instanceof Date||(t=null!==t&&isFinite(t)?new Date(t):null);if(!e&&!t)return new i;if(!u)return o(new i,e||new Date,t||new Date,n,r,s);var a=n&1?1e3/30:n&2?1e3:n&4?6e4:n&8?36e5:n&16?864e5:6048e5,f,l=function(){u(o(new i,e||new Date,t||new Date,n,r,s),f)};l();return f=setInterval(l,a)}var a=Math.ceil,f=Math.floor,l,c,h;i.prototype.toString=function(){var e=h(this),t=e.length;if(!t)return"";1<t&&(e[t-1]="and "+e[t-1]);return e.join(", ")};i.prototype.toHTML=function(e){e=e||"span";var t=h(this),n=t.length;if(!n)return"";for(var r=0;r<n;r++)t[r]="<"+e+">"+t[r]+"</"+e+">";--n&&(t[n]="and "+t[n]);return t.join(", ")};h=function(e){var t=[],n=e.millennia;n&&t.push(r(n,10));(n=e.centuries)&&t.push(r(n,9));(n=e.decades)&&t.push(r(n,8));(n=e.years)&&t.push(r(n,7));(n=e.months)&&t.push(r(n,6));(n=e.weeks)&&t.push(r(n,5));(n=e.days)&&t.push(r(n,4));(n=e.hours)&&t.push(r(n,3));(n=e.minutes)&&t.push(r(n,2));(n=e.seconds)&&t.push(r(n,1));(n=e.milliseconds)&&t.push(r(n,0));return t};u.MILLISECONDS=1;u.SECONDS=2;u.MINUTES=4;u.HOURS=8;u.DAYS=16;u.WEEKS=32;u.MONTHS=64;u.YEARS=128;u.DECADES=256;u.CENTURIES=512;u.MILLENNIA=1024;u.DEFAULTS=222;u.ALL=2047;u.setLabels=function(e,t){e=e||[];e.split&&(e=e.split("|"));t=t||[];t.split&&(t=t.split("|"));for(var n=0;10>=n;n++)l[n]=e[n]||l[n],c[n]=t[n]||c[n]};(u.resetLabels=function(){l="millisecond second minute hour day week month year decade century millennium".split(" ");c="milliseconds seconds minutes hours days weeks months years decades centuries millennia".split(" ")})();e&&e.exports?e.exports=u:"function"===typeof window.define&&window.define.amd&&window.define("countdown",[],function(){return u});return u}(module);var Sketch=function(){"use strict";function e(e){return"[object Array]"==Object.prototype.toString.call(e)}function t(e){return"function"==typeof e}function n(e){return"number"==typeof e}function r(e){return"string"==typeof e}function i(e){return E[e]||String.fromCharCode(e)}function s(e,t,n){for(var r in t)!n&&r in e||(e[r]=t[r]);return e}function o(e,t){return function(){e.apply(t,arguments)}}function u(e){var n={};for(var r in e)n[r]=t(e[r])?o(e[r],e):e[r];return n}function a(e){function n(n){t(n)&&n.apply(e,[].splice.call(arguments,1))}function o(e){for(P=0;P<et.length;P++)j=et[P],r(j)?M[(e?"add":"remove")+"EventListener"].call(M,j,L,!1):t(j)?L=j:M=j}function a(){O(k),k=A(a),K||(n(e.setup),K=t(e.setup),n(e.resize)),e.running&&!$&&(e.dt=(B=+(new Date))-e.now,e.millis+=e.dt,e.now=B,n(e.update),e.autoclear&&Y&&e.clear(),n(e.draw)),$=++$%e.interval}function f(){M=G?e.style:e.canvas,H=G?"px":"",X=e.width,V=e.height,e.fullscreen&&(V=e.height=y.innerHeight,X=e.width=y.innerWidth),e.retina&&Y&&Q&&(M.style.height=V+"px",M.style.width=X+"px",X*=Q,V*=Q,e.scale(Q,Q)),M.height!==V&&(M.height=V+H),M.width!==X&&(M.width=X+H),K&&n(e.resize)}function l(e,t){return D=t.getBoundingClientRect(),e.x=e.pageX-D.left-y.scrollX,e.y=e.pageY-D.top-y.scrollY,e}function c(t,n){return l(t,e.element),n=n||{},n.ox=n.x||t.x,n.oy=n.y||t.y,n.x=t.x,n.y=t.y,n.dx=n.x-n.ox,n.dy=n.y-n.oy,n}function h(e){if(e.preventDefault(),F=u(e),F.originalEvent=e,F.touches)for(J.length=F.touches.length,P=0;P<F.touches.length;P++)J[P]=c(F.touches[P],J[P]);else J.length=0,J[0]=c(F,Z);return s(Z,J[0],!0),F}function p(t){for(t=h(t),z=(W=et.indexOf(q=t.type))-1,e.dragging=/down|start/.test(q)?!0:/up|end/.test(q)?!1:e.dragging;z;)r(et[z])?n(e[et[z--]],t):r(et[W])?n(e[et[W++]],t):z=0}function v(t){R=t.keyCode,U="keyup"==t.type,tt[R]=tt[i(R)]=!U,n(e[t.type],t)}function w(t){e.autopause&&("blur"==t.type?x:S)(),n(e[t.type],t)}function S(){e.now=+(new Date),e.running=!0}function x(){e.running=!1}function T(){(e.running?x:S)()}function N(){Y&&e.clearRect(0,0,e.width,e.height)}function C(){_=e.element.parentNode,P=b.indexOf(e),_&&_.removeChild(e.element),~P&&b.splice(P,1),o(!1),x()}var k,L,M,_,D,P,H,B,j,F,q,R,U,z,W,X,V,$=0,J=[],K=!1,Q=y.devicePixelRatio,G=e.type==m,Y=e.type==d,Z={x:0,y:0,ox:0,oy:0,dx:0,dy:0},et=[e.element,p,"mousedown","touchstart",p,"mousemove","touchmove",p,"mouseup","touchend",p,"click",g,v,"keydown","keyup",y,w,"focus","blur",f,"resize"],tt={};for(R in E)tt[E[R]]=!1;return s(e,{touches:J,mouse:Z,keys:tt,dragging:!1,running:!1,millis:0,now:0/0,dt:0/0,destroy:C,toggle:T,clear:N,start:S,stop:x}),b.push(e),e.autostart&&S(),o(!0),f(),a(),e}for(var f,l,c="E LN10 LN2 LOG2E LOG10E PI SQRT1_2 SQRT2 abs acos asin atan ceil cos exp floor log round sin sqrt tan atan2 pow max min".split(" "),h="__hasSketch",p=Math,d="canvas",v="webgl",m="dom",g=document,y=window,b=[],w={fullscreen:!0,autostart:!0,autoclear:!0,autopause:!0,container:g.body,interval:1,globals:!0,retina:!1,type:d},E={8:"BACKSPACE",9:"TAB",13:"ENTER",16:"SHIFT",27:"ESCAPE",32:"SPACE",37:"LEFT",38:"UP",39:"RIGHT",40:"DOWN"},S={CANVAS:d,WEB_GL:v,WEBGL:v,DOM:m,instances:b,install:function(t){if(!t[h]){for(var r=0;r<c.length;r++)t[c[r]]=p[c[r]];s(t,{TWO_PI:2*p.PI,HALF_PI:p.PI/2,QUATER_PI:p.PI/4,random:function(t,r){return e(t)?t[~~(p.random()*t.length)]:(n(r)||(r=t||1,t=0),t+p.random()*(r-t))},lerp:function(e,t,n){return e+n*(t-e)},map:function(e,t,n,r,i){return(e-t)/(n-t)*(i-r)+r}}),t[h]=!0}},create:function(e){return e=s(e||{},w),e.globals&&S.install(self),f=e.element=e.element||g.createElement(e.type===m?"div":"canvas"),l=e.context=e.context||function(){switch(e.type){case d:return f.getContext("2d",e);case v:return f.getContext("webgl",e)||f.getContext("experimental-webgl",e);case m:return f.canvas=f}}(),(e.container||g.body).appendChild(f),S.augment(l,e)},augment:function(e,t){return t=s(t||{},w),t.element=e.canvas||e,t.element.className+=" sketch",s(e,t,!0),a(e)}},x=["ms","moz","webkit","o"],T=self,N=0,C="AnimationFrame",k="request"+C,L="cancel"+C,A=T[k],O=T[L],M=0;M<x.length&&!A;M++)A=T[x[M]+"Request"+C],O=T[x[M]+"Cancel"+C];return T[k]=A=A||function(e){var t=+(new Date),n=p.max(0,16-(t-N)),r=setTimeout(function(){e(t+n)},n);return N=t+n,r},T[L]=O=O||function(e){clearTimeout(e)},S}()