vendor: 19,099 bytes, lines 1-5
1 2/* 3 Copyright (C) Federico Zivolo 2018 4 Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT). 5 */(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.Popper=t()})(this,function(){'use strict';function e(e){return e&&'[object Function]'==={}.toString.call(e)}function t(e,t){if(1!==e.nodeType)return[];var o=getComputedStyle(e,null);return t?o[t]:o}function o(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function n(e){if(!e)return document.body;switch(e.nodeName){case'HTML':case'BODY':return e.ownerDocument.body;case'#document':return e.body;}var i=t(e),r=i.overflow,p=i.overflowX,s=i.overflowY;return /(auto|scroll|overlay)/.test(r+s+p)?e:n(o(e))}function r(e){return 11===e?re:10===e?pe:re||pe}function p(e){if(!e)return document.documentElement;for(var o=r(10)?document.body:null,n=e.offsetParent;n===o&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var i=n&&n.nodeName;return i&&'BODY'!==i&&'HTML'!==i?-1!==['TD','TABLE'].indexOf(n.nodeName)&&'static'===t(n,'position')?p(n):n:e?e.ownerDocument.documentElement:document.documentElement}function s(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||p(e.firstElementChild)===e)}function d(e){return null===e.parentNode?e:d(e.parentNode)}function a(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,n=o?e:t,i=o?t:e,r=document.createRange();r.setStart(n,0),r.setEnd(i,0);var l=r.commonAncestorContainer;if(e!==l&&t!==l||n.contains(i))return s(l)?l:p(l);var f=d(e);return f.host?a(f.host,t):a(e,d(t).host)}function l(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:'top',o='top'===t?'scrollTop':'scrollLeft',n=e.nodeName;if('BODY'===n||'HTML'===n){var i=e.ownerDocument.documentElement,r=e.ownerDocument.scrollingElement||i;return r[o]}return e[o]}function f(e,t){var o=2<arguments.length&&void 0!==arguments[2]&&arguments[2],n=l(t,'top'),i=l(t,'left'),r=o?-1:1;return e.top+=n*r,e.bottom+=n*r,e.left+=i*r,e.right+=i*r,e}function m(e,t){var o='x'===t?'Left':'Top',n='Left'==o?'Right':'Bottom';return parseFloat(e['border'+o+'Width'],10)+parseFloat(e['border'+n+'Width'],10)}function h(e,t,o,n){return J(t['offset'+e],t['scroll'+e],o['client'+e],o['offset'+e],o['scroll'+e],r(10)?parseInt(o['offset'+e])+parseInt(n['margin'+('Height'===e?'Top':'Left')])+parseInt(n['margin'+('Height'===e?'Bottom':'Right')]):0)}function c(e){var t=e.body,o=e.documentElement,n=r(10)&&getComputedStyle(o);return{height:h('Height',t,o,n),width:h('Width',t,o,n)}}function g(e){return le({},e,{right:e.left+e.width,bottom:e.top+e.height})}function u(e){var o={};try{if(r(10)){o=e.getBoundingClientRect();var n=l(e,'top'),i=l(e,'left');o.top+=n,o.left+=i,o.bottom+=n,o.right+=i}else o=e.getBoundingClientRect()}catch(t){}var p={left:o.left,top:o.top,width:o.right-o.left,height:o.bottom-o.top},s='HTML'===e.nodeName?c(e.ownerDocument):{},d=s.width||e.clientWidth||p.right-p.left,a=s.height||e.clientHeight||p.bottom-p.top,f=e.offsetWidth-d,h=e.offsetHeight-a;if(f||h){var u=t(e);f-=m(u,'x'),h-=m(u,'y'),p.width-=f,p.height-=h}return g(p)}function b(e,o){var i=2<arguments.length&&void 0!==arguments[2]&&arguments[2],p=r(10),s='HTML'===o.nodeName,d=u(e),a=u(o),l=n(e),m=t(o),h=parseFloat(m.borderTopWidth,10),c=parseFloat(m.borderLeftWidth,10);i&&s&&(a.top=J(a.top,0),a.left=J(a.left,0));var b=g({top:d.top-a.top-h,left:d.left-a.left-c,width:d.width,height:d.height});if(b.marginTop=0,b.marginLeft=0,!p&&s){var y=parseFloat(m.marginTop,10),w=parseFloat(m.marginLeft,10);b.top-=h-y,b.bottom-=h-y,b.left-=c-w,b.right-=c-w,b.marginTop=y,b.marginLeft=w}return(p&&!i?o.contains(l):o===l&&'BODY'!==l.nodeName)&&(b=f(b,o)),b}function y(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],o=e.ownerDocument.documentElement,n=b(e,o),i=J(o.clientWidth,window.innerWidth||0),r=J(o.clientHeight,window.innerHeight||0),p=t?0:l(o),s=t?0:l(o,'left'),d={top:p-n.top+n.marginTop,left:s-n.left+n.marginLeft,width:i,height:r};return g(d)}function w(e){var n=e.nodeName;return'BODY'===n||'HTML'===n?!1:'fixed'===t(e,'position')||w(o(e))}function E(e){if(!e||!e.parentElement||r())return document.documentElement;for(var o=e.parentElement;o&&'none'===t(o,'transform');)o=o.parentElement;return o||document.documentElement}function v(e,t,i,r){var p=4<arguments.length&&void 0!==arguments[4]&&arguments[4],s={top:0,left:0},d=p?E(e):a(e,t);if('viewport'===r)s=y(d,p);else{var l;'scrollParent'===r?(l=n(o(t)),'BODY'===l.nodeName&&(l=e.ownerDocument.documentElement)):'window'===r?l=e.ownerDocument.documentElement:l=r;var f=b(l,d,p);if('HTML'===l.nodeName&&!w(d)){var m=c(e.ownerDocument),h=m.height,g=m.width;s.top+=f.top-f.marginTop,s.bottom=h+f.top,s.left+=f.left-f.marginLeft,s.right=g+f.left}else s=f}i=i||0;var u='number'==typeof i;return s.left+=u?i:i.left||0,s.top+=u?i:i.top||0,s.right-=u?i:i.right||0,s.bottom-=u?i:i.bottom||0,s}function x(e){var t=e.width,o=e.height;return t*o}function O(e,t,o,n,i){var r=5<arguments.length&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf('auto'))return e;var p=v(o,n,r,i),s={top:{width:p.width,height:t.top-p.top},right:{width:p.right-t.right,height:p.height},bottom:{width:p.width,height:p.bottom-t.bottom},left:{width:t.left-p.left,height:p.height}},d=Object.keys(s).map(function(e){return le({key:e},s[e],{area:x(s[e])})}).sort(function(e,t){return t.area-e.area}),a=d.filter(function(e){var t=e.width,n=e.height;return t>=o.clientWidth&&n>=o.clientHeight}),l=0<a.length?a[0].key:d[0].key,f=e.split('-')[1];return l+(f?'-'+f:'')}function L(e,t,o){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null,i=n?E(t):a(t,o);return b(o,i,n)}function S(e){var t=getComputedStyle(e),o=parseFloat(t.marginTop)+parseFloat(t.marginBottom),n=parseFloat(t.marginLeft)+parseFloat(t.marginRight),i={width:e.offsetWidth+n,height:e.offsetHeight+o};return i}function T(e){var t={left:'right',right:'left',bottom:'top',top:'bottom'};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function D(e,t,o){o=o.split('-')[0];var n=S(e),i={width:n.width,height:n.height},r=-1!==['right','left'].indexOf(o),p=r?'top':'left',s=r?'left':'top',d=r?'height':'width',a=r?'width':'height';return i[p]=t[p]+t[d]/2-n[d]/2,i[s]=o===s?t[s]-n[a]:t[T(s)],i}function C(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function N(e,t,o){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===o});var n=C(e,function(e){return e[t]===o});return e.indexOf(n)}function P(t,o,n){var i=void 0===n?t:t.slice(0,N(t,'name',n));return i.forEach(function(t){t['function']&&console.warn('`modifier.function` is deprecated, use `modifier.fn`!');var n=t['function']||t.fn;t.enabled&&e(n)&&(o.offsets.popper=g(o.offsets.popper),o.offsets.reference=g(o.offsets.reference),o=n(o,t))}),o}function k(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=L(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=O(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=D(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?'fixed':'absolute',e=P(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function W(e,t){return e.some(function(e){var o=e.name,n=e.enabled;return n&&o===t})}function H(e){for(var t=[!1,'ms','Webkit','Moz','O'],o=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<t.length;n++){var i=t[n],r=i?''+i+o:e;if('undefined'!=typeof document.body.style[r])return r}return null}function B(){return this.state.isDestroyed=!0,W(this.modifiers,'applyStyle')&&(this.popper.removeAttribute('x-placement'),this.popper.style.position='',this.popper.style.top='',this.popper.style.left='',this.popper.style.right='',this.popper.style.bottom='',this.popper.style.willChange='',this.popper.style[H('transform')]=''),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function A(e){var t=e.ownerDocument;return t?t.defaultView:window}function M(e,t,o,i){var r='BODY'===e.nodeName,p=r?e.ownerDocument.defaultView:e;p.addEventListener(t,o,{passive:!0}),r||M(n(p.parentNode),t,o,i),i.push(p)}function F(e,t,o,i){o.updateBound=i,A(e).addEventListener('resize',o.updateBound,{passive:!0});var r=n(e);return M(r,'scroll',o.updateBound,o.scrollParents),o.scrollElement=r,o.eventsEnabled=!0,o}function I(){this.state.eventsEnabled||(this.state=F(this.reference,this.options,this.state,this.scheduleUpdate))}function R(e,t){return A(e).removeEventListener('resize',t.updateBound),t.scrollParents.forEach(function(e){e.removeEventListener('scroll',t.updateBound)}),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t}function U(){this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=R(this.reference,this.state))}function Y(e){return''!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function j(e,t){Object.keys(t).forEach(function(o){var n='';-1!==['width','height','top','right','bottom','left'].indexOf(o)&&Y(t[o])&&(n='px'),e.style[o]=t[o]+n})}function K(e,t){Object.keys(t).forEach(function(o){var n=t[o];!1===n?e.removeAttribute(o):e.setAttribute(o,t[o])})}function q(e,t,o){var n=C(e,function(e){var o=e.name;return o===t}),i=!!n&&e.some(function(e){return e.name===o&&e.enabled&&e.order<n.order});if(!i){var r='`'+t+'`';console.warn('`'+o+'`'+' modifier is required by '+r+' modifier in order to work, be sure to include it before '+r+'!')}return i}function G(e){return'end'===e?'start':'start'===e?'end':e}function V(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],o=me.indexOf(e),n=me.slice(o+1).concat(me.slice(0,o));return t?n.reverse():n}function z(e,t,o,n){var i=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),r=+i[1],p=i[2];if(!r)return e;if(0===p.indexOf('%')){var s;switch(p){case'%p':s=o;break;case'%':case'%r':default:s=n;}var d=g(s);return d[t]/100*r}if('vh'===p||'vw'===p){var a;return a='vh'===p?J(document.documentElement.clientHeight,window.innerHeight||0):J(document.documentElement.clientWidth,window.innerWidth||0),a/100*r}return r}function _(e,t,o,n){var i=[0,0],r=-1!==['right','left'].indexOf(n),p=e.split(/(\+|\-)/).map(function(e){return e.trim()}),s=p.indexOf(C(p,function(e){return-1!==e.search(/,|\s/)}));p[s]&&-1===p[s].indexOf(',')&&console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');var d=/\s*,\s*|\s+/,a=-1===s?[p]:[p.slice(0,s).concat([p[s].split(d)[0]]),[p[s].split(d)[1]].concat(p.slice(s+1))];return a=a.map(function(e,n){var i=(1===n?!r:r)?'height':'width',p=!1;return e.reduce(function(e,t){return''===e[e.length-1]&&-1!==['+','-'].indexOf(t)?(e[e.length-1]=t,p=!0,e):p?(e[e.length-1]+=t,p=!1,e):e.concat(t)},[]).map(function(e){return z(e,i,t,o)})}),a.forEach(function(e,t){e.forEach(function(o,n){Y(o)&&(i[t]+=o*('-'===e[n-1]?-1:1))})}),i}function X(e,t){var o,n=t.offset,i=e.placement,r=e.offsets,p=r.popper,s=r.reference,d=i.split('-')[0];return o=Y(+n)?[+n,0]:_(n,p,s,d),'left'===d?(p.top+=o[0],p.left-=o[1]):'right'===d?(p.top+=o[0],p.left+=o[1]):'top'===d?(p.left+=o[0],p.top-=o[1]):'bottom'===d&&(p.left+=o[0],p.top+=o[1]),e.popper=p,e}for(var Q=Math.min,Z=Math.round,$=Math.floor,J=Math.max,ee='undefined'!=typeof window&&'undefined'!=typeof document,te=['Edge','Trident','Firefox'],oe=0,ne=0;ne<te.length;ne+=1)if(ee&&0<=navigator.userAgent.indexOf(te[ne])){oe=1;break}var i=ee&&window.Promise,ie=i?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},oe))}},re=ee&&!!(window.MSInputMethodContext&&document.documentMode),pe=ee&&/MSIE 10/.test(navigator.userAgent),se=function(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')},de=function(){function e(e,t){for(var o,n=0;n<t.length;n++)o=t[n],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),ae=function(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e},le=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var n in t=arguments[o],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},fe=['auto-start','auto','auto-end','top-start','top','top-end','right-start','right','right-end','bottom-end','bottom','bottom-start','left-end','left','left-start'],me=fe.slice(3),he={FLIP:'flip',CLOCKWISE:'clockwise',COUNTERCLOCKWISE:'counterclockwise'},ce=function(){function t(o,n){var i=this,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};se(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(i.update)},this.update=ie(this.update.bind(this)),this.options=le({},t.Defaults,r),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=o&&o.jquery?o[0]:o,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(le({},t.Defaults.modifiers,r.modifiers)).forEach(function(e){i.options.modifiers[e]=le({},t.Defaults.modifiers[e]||{},r.modifiers?r.modifiers[e]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return le({name:e},i.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(t){t.enabled&&e(t.onLoad)&&t.onLoad(i.reference,i.popper,i.options,t,i.state)}),this.update();var p=this.options.eventsEnabled;p&&this.enableEventListeners(),this.state.eventsEnabled=p}return de(t,[{key:'update',value:function(){return k.call(this)}},{key:'destroy',value:function(){return B.call(this)}},{key:'enableEventListeners',value:function(){return I.call(this)}},{key:'disableEventListeners',value:function(){return U.call(this)}}]),t}();return ce.Utils=('undefined'==typeof window?global:window).PopperUtils,ce.placements=fe,ce.Defaults={placement:'bottom',positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,o=t.split('-')[0],n=t.split('-')[1];if(n){var i=e.offsets,r=i.reference,p=i.popper,s=-1!==['bottom','top'].indexOf(o),d=s?'left':'top',a=s?'width':'height',l={start:ae({},d,r[d]),end:ae({},d,r[d]+r[a]-p[a])};e.offsets.popper=le({},p,l[n])}return e}},offset:{order:200,enabled:!0,fn:X,offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var o=t.boundariesElement||p(e.instance.popper);e.instance.reference===o&&(o=p(o));var n=H('transform'),i=e.instance.popper.style,r=i.top,s=i.left,d=i[n];i.top='',i.left='',i[n]='';var a=v(e.instance.popper,e.instance.reference,t.padding,o,e.positionFixed);i.top=r,i.left=s,i[n]=d,t.boundaries=a;var l=t.priority,f=e.offsets.popper,m={primary:function(e){var o=f[e];return f[e]<a[e]&&!t.escapeWithReference&&(o=J(f[e],a[e])),ae({},e,o)},secondary:function(e){var o='right'===e?'left':'top',n=f[o];return f[e]>a[e]&&!t.escapeWithReference&&(n=Q(f[o],a[e]-('right'===e?f.width:f.height))),ae({},o,n)}};return l.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';f=le({},f,m[t](e))}),e.offsets.popper=f,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,n=t.reference,i=e.placement.split('-')[0],r=$,p=-1!==['top','bottom'].indexOf(i),s=p?'right':'bottom',d=p?'left':'top',a=p?'width':'height';return o[s]<r(n[d])&&(e.offsets.popper[d]=r(n[d])-o[a]),o[d]>r(n[s])&&(e.offsets.popper[d]=r(n[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,o){var n;if(!q(e.instance.modifiers,'arrow','keepTogether'))return e;var i=o.element;if('string'==typeof i){if(i=e.instance.popper.querySelector(i),!i)return e;}else if(!e.instance.popper.contains(i))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var r=e.placement.split('-')[0],p=e.offsets,s=p.popper,d=p.reference,a=-1!==['left','right'].indexOf(r),l=a?'height':'width',f=a?'Top':'Left',m=f.toLowerCase(),h=a?'left':'top',c=a?'bottom':'right',u=S(i)[l];d[c]-u<s[m]&&(e.offsets.popper[m]-=s[m]-(d[c]-u)),d[m]+u>s[c]&&(e.offsets.popper[m]+=d[m]+u-s[c]),e.offsets.popper=g(e.offsets.popper);var b=d[m]+d[l]/2-u/2,y=t(e.instance.popper),w=parseFloat(y['margin'+f],10),E=parseFloat(y['border'+f+'Width'],10),v=b-e.offsets.popper[m]-w-E;return v=J(Q(s[l]-u,v),0),e.arrowElement=i,e.offsets.arrow=(n={},ae(n,m,Z(v)),ae(n,h,''),n),e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(W(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var o=v(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),n=e.placement.split('-')[0],i=T(n),r=e.placement.split('-')[1]||'',p=[];switch(t.behavior){case he.FLIP:p=[n,i];break;case he.CLOCKWISE:p=V(n);break;case he.COUNTERCLOCKWISE:p=V(n,!0);break;default:p=t.behavior;}return p.forEach(function(s,d){if(n!==s||p.length===d+1)return e;n=e.placement.split('-')[0],i=T(n);var a=e.offsets.popper,l=e.offsets.reference,f=$,m='left'===n&&f(a.right)>f(l.left)||'right'===n&&f(a.left)<f(l.right)||'top'===n&&f(a.bottom)>f(l.top)||'bottom'===n&&f(a.top)<f(l.bottom),h=f(a.left)<f(o.left),c=f(a.right)>f(o.right),g=f(a.top)<f(o.top),u=f(a.bottom)>f(o.bottom),b='left'===n&&h||'right'===n&&c||'top'===n&&g||'bottom'===n&&u,y=-1!==['top','bottom'].indexOf(n),w=!!t.flipVariations&&(y&&'start'===r&&h||y&&'end'===r&&c||!y&&'start'===r&&g||!y&&'end'===r&&u);(m||b||w)&&(e.flipped=!0,(m||b)&&(n=p[d+1]),w&&(r=G(r)),e.placement=n+(r?'-'+r:''),e.offsets.popper=le({},e.offsets.popper,D(e.instance.popper,e.offsets.reference,e.placement)),e=P(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport'},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split('-')[0],n=e.offsets,i=n.popper,r=n.reference,p=-1!==['left','right'].indexOf(o),s=-1===['top','left'].indexOf(o);return i[p?'left':'top']=r[o]-(s?i[p?'width':'height']:0),e.placement=T(t),e.offsets.popper=g(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!q(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,o=C(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottom<o.top||t.left>o.right||t.top>o.bottom||t.right<o.left){if(!0===e.hide)return e;e.hide=!0,e.attributes['x-out-of-boundaries']=''}else{if(!1===e.hide)return e;e.hide=!1,e.attributes['x-out-of-boundaries']=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var o=t.x,n=t.y,i=e.offsets.popper,r=C(e.instance.modifiers,function(e){return'applyStyle'===e.name}).gpuAcceleration;
5void 0!==r&&console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');var s,d,a=void 0===r?t.gpuAcceleration:r,l=p(e.instance.popper),f=u(l),m={position:i.position},h={left:$(i.left),top:Z(i.top),bottom:Z(i.bottom),right:$(i.right)},c='bottom'===o?'top':'bottom',g='right'===n?'left':'right',b=H('transform');if(d='bottom'==c?'HTML'===l.nodeName?-l.clientHeight+h.bottom:-f.height+h.bottom:h.top,s='right'==g?'HTML'===l.nodeName?-l.clientWidth+h.right:-f.width+h.right:h.left,a&&b)m[b]='translate3d('+s+'px, '+d+'px, 0)',m[c]=0,m[g]=0,m.willChange='transform';else{var y='bottom'==c?-1:1,w='right'==g?-1:1;m[c]=d*y,m[g]=s*w,m.willChange=c+', '+g}var E={"x-placement":e.placement};return e.attributes=le({},E,e.attributes),e.styles=le({},m,e.styles),e.arrowStyles=le({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:'bottom',y:'right'},applyStyle:{order:900,enabled:!0,fn:function(e){return j(e.instance.popper,e.styles),K(e.instance.popper,e.attributes),e.arrowElement&&Object.keys(e.arrowStyles).length&&j(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,o,n,i){var r=L(i,t,e,o.positionFixed),p=O(o.placement,r,t,e,o.modifiers.flip.boundariesElement,o.modifiers.flip.padding); return t.setAttribute('x-placement',p),j(t,{position:o.positionFixed?'fixed':'absolute'}),o},gpuAcceleration:void 0}}},ce}); 6 7/*! 8 * Bootstrap v4.3.1 (https://getbootstrap.com/) 9 * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 10 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 11 */ 12!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","jquery","popper.js"],e):e((t=t||self).bootstrap={},t.jQuery,t.Popper)}(this,function(t,g,u){"use strict";function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function s(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function l(o){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},e=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.forEach(function(t){var e,n,i;e=o,i=r[n=t],n in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i})}return o}g=g&&g.hasOwnProperty("default")?g.default:g,u=u&&u.hasOwnProperty("default")?u.default:u;var e="transitionend";function n(t){var e=this,n=!1;return g(this).one(_.TRANSITION_END,function(){n=!0}),setTimeout(function(){n||_.triggerTransitionEnd(e)},t),this}var _={TRANSITION_END:"bsTransitionEnd",getUID:function(t){for(;t+=~~(1e6*Math.random()),document.getElementById(t););return t},getSelectorFromElement:function(t){var e=t.getAttribute("data-target");if(!e||"#"===e){var n=t.getAttribute("href");e=n&&"#"!==n?n.trim():""}try{return document.querySelector(e)?e:null}catch(t){return null}},getTransitionDurationFromElement:function(t){if(!t)return 0;var e=g(t).css("transition-duration"),n=g(t).css("transition-delay"),i=parseFloat(e),o=parseFloat(n);return i||o?(e=e.split(",")[0],n=n.split(",")[0],1e3*(parseFloat(e)+parseFloat(n))):0},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(t){g(t).trigger(e)},supportsTransitionEnd:function(){return Boolean(e)},isElement:function(t){return(t[0]||t).nodeType},typeCheckConfig:function(t,e,n){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var o=n[i],r=e[i],s=r&&_.isElement(r)?"element":(a=r,{}.toString.call(a).match(/\s([a-z]+)/i)[1].toLowerCase());if(!new RegExp(o).test(s))throw new Error(t.toUpperCase()+': Option "'+i+'" provided type "'+s+'" but expected type "'+o+'".')}var a},findShadowRoot:function(t){if(!document.documentElement.attachShadow)return null;if("function"!=typeof t.getRootNode)return t instanceof ShadowRoot?t:t.parentNode?_.findShadowRoot(t.parentNode):null;var e=t.getRootNode();return e instanceof ShadowRoot?e:null}};g.fn.emulateTransitionEnd=n,g.event.special[_.TRANSITION_END]={bindType:e,delegateType:e,handle:function(t){if(g(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}};var o="alert",r="bs.alert",a="."+r,c=g.fn[o],h={CLOSE:"close"+a,CLOSED:"closed"+a,CLICK_DATA_API:"click"+a+".data-api"},f="alert",d="fade",m="show",p=function(){function i(t){this._element=t}var t=i.prototype;return t.close=function(t){var e=this._element;t&&(e=this._getRootElement(t)),this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)}
12,t.dispose=function(){g.removeData(this._element,r),this._element=null},t._getRootElement=function(t){var e=_.getSelectorFromElement(t),n=!1;return e&&(n=document.querySelector(e)),n||(n=g(t).closest("."+f)[0]),n},t._triggerCloseEvent=function(t){var e=g.Event(h.CLOSE);return g(t).trigger(e),e},t._removeElement=function(e){var n=this;if(g(e).removeClass(m),g(e).hasClass(d)){var t=_.getTransitionDurationFromElement(e);g(e).one(_.TRANSITION_END,function(t){return n._destroyElement(e,t)}).emulateTransitionEnd(t)}else this._destroyElement(e)},t._destroyElement=function(t){g(t).detach().trigger(h.CLOSED).remove()},i._jQueryInterface=function(n){return this.each(function(){var t=g(this),e=t.data(r);e||(e=new i(this),t.data(r,e)),"close"===n&&e[n](this)})},i._handleDismiss=function(e){return function(t){t&&t.preventDefault(),e.close(this)}},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}}]),i}();g(document).on(h.CLICK_DATA_API,'[data-dismiss="alert"]',p._handleDismiss(new p)),g.fn[o]=p._jQueryInterface,g.fn[o].Constructor=p,g.fn[o].noConflict=function(){return g.fn[o]=c,p._jQueryInterface};var v="button",y="bs.button",E="."+y,C=".data-api",T=g.fn[v],S="active",b="btn",I="focus",D='[data-toggle^="button"]',w='[data-toggle="buttons"]',A='input:not([type="hidden"])',N=".active",O=".btn",k={CLICK_DATA_API:"click"+E+C,FOCUS_BLUR_DATA_API:"focus"+E+C+" blur"+E+C},P=function(){function n(t){this._element=t}var t=n.prototype;return t.toggle=function(){var t=!0,e=!0,n=g(this._element).closest(w)[0];if(n){var i=this._element.querySelector(A);if(i){if("radio"===i.type)if(i.checked&&this._element.classList.contains(S))t=!1;else{var o=n.querySelector(N);o&&g(o).removeClass(S)}if(t){if(i.hasAttribute("disabled")||n.hasAttribute("disabled")||i.classList.contains("disabled")||n.classList.contains("disabled"))return;i.checked=!this._element.classList.contains(S),g(i).trigger("change")}i.focus(),e=!1}}e&&this._element.setAttribute("aria-pressed",!this._element.classList.contains(S)),t&&g(this._element).toggleClass(S)},t.dispose=function(){g.removeData(this._element,y),this._element=null},n._jQueryInterface=function(e){return this.each(function(){var t=g(this).data(y);t||(t=new n(this),g(this).data(y,t)),"toggle"===e&&t[e]()})},s(n,null,[{key:"VERSION",get:function(){return"4.3.1"}}]),n}();g(document).on(k.CLICK_DATA_API,D,function(t){t.preventDefault();var e=t.target;g(e).hasClass(b)||(e=g(e).closest(O)),P._jQueryInterface.call(g(e),"toggle")}).on(k.FOCUS_BLUR_DATA_API,D,function(t){var e=g(t.target).closest(O)[0];g(e).toggleClass(I,/^focus(in)?$/.test(t.type))}),g.fn[v]=P._jQueryInterface,g.fn[v].Constructor=P,g.fn[v].noConflict=function(){return g.fn[v]=T,P._jQueryInterface};var L="carousel",j="bs.carousel",H="."+j,R=".data-api",x=g.fn[L],F={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0,touch:!0},U={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean",touch:"boolean"},W="next",q="prev",M="left",K="right",Q={SLIDE:"slide"+H,SLID:"slid"+H,KEYDOWN:"keydown"+H,MOUSEENTER:"mouseenter"+H,MOUSELEAVE:"mouseleave"+H,TOUCHSTART:"touchstart"+H,TOUCHMOVE:"touchmove"+H,TOUCHEND:"touchend"+H,POINTERDOWN:"pointerdown"+H,POINTERUP:"pointerup"+H,DRAG_START:"dragstart"+H,LOAD_DATA_API:"load"+H+R,CLICK_DATA_API:"click"+H+R},B="carousel",V="active",Y="slide",z="carousel-item-right",X="carousel-item-left",$="carousel-item-next",G="carousel-item-prev",J="pointer-event",Z=".active",tt=".active.carousel-item",et=".carousel-item",nt=".carousel-item img",it=".carousel-item-next, .carousel-item-prev",ot=".carousel-indicators",rt="[data-slide], [data-slide-to]",st='[data-ride="carousel"]',at={TOUCH:"touch",PEN:"pen"},lt=function(){function r(t,e){this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this.touchStartX=0,this.touchDeltaX=0,this._config=this._getConfig(e),this._element=t,this._indicatorsElement=this._element.querySelector(ot),this._touchSupported="ontouchstart"in document.documentElement||0<navigator.maxTouchPoints,this._pointerEvent=Boolean(window.PointerEvent||window.MSPointerEvent),this._addEventListeners()}var t=r.prototype;return t.next=function(){this._isSliding||this._slide(W)},t.nextWhenVisible=function(){!document.hidden&&g(this._element).is(":visible")&&"hidden"
12!==g(this._element).css("visibility")&&this.next()},t.prev=function(){this._isSliding||this._slide(q)},t.pause=function(t){t||(this._isPaused=!0),this._element.querySelector(it)&&(_.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},t.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},t.to=function(t){var e=this;this._activeElement=this._element.querySelector(tt);var n=this._getItemIndex(this._activeElement);if(!(t>this._items.length-1||t<0))if(this._isSliding)g(this._element).one(Q.SLID,function(){return e.to(t)});else{if(n===t)return this.pause(),void this.cycle();var i=n<t?W:q;this._slide(i,this._items[t])}},t.dispose=function(){g(this._element).off(H),g.removeData(this._element,j),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},t._getConfig=function(t){return t=l({},F,t),_.typeCheckConfig(L,t,U),t},t._handleSwipe=function(){var t=Math.abs(this.touchDeltaX);if(!(t<=40)){var e=t/this.touchDeltaX;0<e&&this.prev(),e<0&&this.next()}},t._addEventListeners=function(){var e=this;this._config.keyboard&&g(this._element).on(Q.KEYDOWN,function(t){return e._keydown(t)}),"hover"===this._config.pause&&g(this._element).on(Q.MOUSEENTER,function(t){return e.pause(t)}).on(Q.MOUSELEAVE,function(t){return e.cycle(t)}),this._config.touch&&this._addTouchEventListeners()},t._addTouchEventListeners=function(){var n=this;if(this._touchSupported){var e=function(t){n._pointerEvent&&at[t.originalEvent.pointerType.toUpperCase()]?n.touchStartX=t.originalEvent.clientX:n._pointerEvent||(n.touchStartX=t.originalEvent.touches[0].clientX)},i=function(t){n._pointerEvent&&at[t.originalEvent.pointerType.toUpperCase()]&&(n.touchDeltaX=t.originalEvent.clientX-n.touchStartX),n._handleSwipe(),"hover"===n._config.pause&&(n.pause(),n.touchTimeout&&clearTimeout(n.touchTimeout),n.touchTimeout=setTimeout(function(t){return n.cycle(t)},500+n._config.interval))};g(this._element.querySelectorAll(nt)).on(Q.DRAG_START,function(t){return t.preventDefault()}),this._pointerEvent?(g(this._element).on(Q.POINTERDOWN,function(t){return e(t)}),g(this._element).on(Q.POINTERUP,function(t){return i(t)}),this._element.classList.add(J)):(g(this._element).on(Q.TOUCHSTART,function(t){return e(t)}),g(this._element).on(Q.TOUCHMOVE,function(t){var e;(e=t).originalEvent.touches&&1<e.originalEvent.touches.length?n.touchDeltaX=0:n.touchDeltaX=e.originalEvent.touches[0].clientX-n.touchStartX}),g(this._element).on(Q.TOUCHEND,function(t){return i(t)}))}},t._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case 37:t.preventDefault(),this.prev();break;case 39:t.preventDefault(),this.next()}},t._getItemIndex=function(t){return this._items=t&&t.parentNode?[].slice.call(t.parentNode.querySelectorAll(et)):[],this._items.indexOf(t)},t._getItemByDirection=function(t,e){var n=t===W,i=t===q,o=this._getItemIndex(e),r=this._items.length-1;if((i&&0===o||n&&o===r)&&!this._config.wrap)return e;var s=(o+(t===q?-1:1))%this._items.length;return-1===s?this._items[this._items.length-1]:this._items[s]},t._triggerSlideEvent=function(t,e){var n=this._getItemIndex(t),i=this._getItemIndex(this._element.querySelector(tt)),o=g.Event(Q.SLIDE,{relatedTarget:t,direction:e,from:i,to:n});return g(this._element).trigger(o),o},t._setActiveIndicatorElement=function(t){if(this._indicatorsElement){var e=[].slice.call(this._indicatorsElement.querySelectorAll(Z));g(e).removeClass(V);var n=this._indicatorsElement.children[this._getItemIndex(t)];n&&g(n).addClass(V)}},t._slide=function(t,e){var n,i,o,r=this,s=this._element.querySelector(tt),a=this._getItemIndex(s),l=e||s&&this._getItemByDirection(t,s),c=this._getItemIndex(l),h=Boolean(this._interval);if(o=t===W?(n=X,i=$,M):(n=z,i=G,K),l&&g(l).hasClass(V))this._isSliding=!1;else if(!this._triggerSlideEvent(l,o).isDefaultPrevented()&&s&&l){this._isSliding=!0,h&&this.pause(),this._setActiveIndicatorElement(l);var u=g.Event(Q.SLID,{relatedTarget:l,direction:o,from:a,to:c});if(g(this._element).hasClass(Y)){g(l).addClass(i),_.reflow(l),g(s).addClass(n),g(l).addClass(n);var f=parseInt(l.getAttribute("data-interval"),10);this._config.interval=f?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,f):this._config.defaultInterval||this._config.interval;var d=_.getTransitionDurationFromElement(s);g(s).one(_.TRANSITION_END,function(){g(l).removeClass(n+" "+i).addClass(V),g(s).removeClass(V+" "+i+" "+n),r._isSliding=!1,setTimeout(function(){return g(r._element).trigger(u)},0)}).emulateTransitionEnd(d)}else g(s).removeClass(V),g(l).addClass(V),this._isSliding=!1,g(this._element).trigger(u);h&&this.cycle()}},r._jQueryInterface=function(i){return this.each(function(){var t=g(this).data(j),e=l({},F,g(this).data());"object"==typeof i&&(e=l({},e,i));var n="string"==typeof i?i:e.slide;if(t||(t=new r(this,e),g(this).data(j,t)),"number"==typeof i)t.to(i);else if("string"==typeof n){if("undefined"==typeof t[n])throw new TypeError('No method n
12amed "'+n+'"');t[n]()}else e.interval&&e.ride&&(t.pause(),t.cycle())})},r._dataApiClickHandler=function(t){var e=_.getSelectorFromElement(this);if(e){var n=g(e)[0];if(n&&g(n).hasClass(B)){var i=l({},g(n).data(),g(this).data()),o=this.getAttribute("data-slide-to");o&&(i.interval=!1),r._jQueryInterface.call(g(n),i),o&&g(n).data(j).to(o),t.preventDefault()}}},s(r,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return F}}]),r}();g(document).on(Q.CLICK_DATA_API,rt,lt._dataApiClickHandler),g(window).on(Q.LOAD_DATA_API,function(){for(var t=[].slice.call(document.querySelectorAll(st)),e=0,n=t.length;e<n;e++){var i=g(t[e]);lt._jQueryInterface.call(i,i.data())}}),g.fn[L]=lt._jQueryInterface,g.fn[L].Constructor=lt,g.fn[L].noConflict=function(){return g.fn[L]=x,lt._jQueryInterface};var ct="collapse",ht="bs.collapse",ut="."+ht,ft=g.fn[ct],dt={toggle:!0,parent:""},gt={toggle:"boolean",parent:"(string|element)"},_t={SHOW:"show"+ut,SHOWN:"shown"+ut,HIDE:"hide"+ut,HIDDEN:"hidden"+ut,CLICK_DATA_API:"click"+ut+".data-api"},mt="show",pt="collapse",vt="collapsing",yt="collapsed",Et="width",Ct="height",Tt=".show, .collapsing",St='[data-toggle="collapse"]',bt=function(){function a(e,t){this._isTransitioning=!1,this._element=e,this._config=this._getConfig(t),this._triggerArray=[].slice.call(document.querySelectorAll('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'));for(var n=[].slice.call(document.querySelectorAll(St)),i=0,o=n.length;i<o;i++){var r=n[i],s=_.getSelectorFromElement(r),a=[].slice.call(document.querySelectorAll(s)).filter(function(t){return t===e});null!==s&&0<a.length&&(this._selector=s,this._triggerArray.push(r))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var t=a.prototype;return t.toggle=function(){g(this._element).hasClass(mt)?this.hide():this.show()},t.show=function(){var t,e,n=this;if(!this._isTransitioning&&!g(this._element).hasClass(mt)&&(this._parent&&0===(t=[].slice.call(this._parent.querySelectorAll(Tt)).filter(function(t){return"string"==typeof n._config.parent?t.getAttribute("data-parent")===n._config.parent:t.classList.contains(pt)})).length&&(t=null),!(t&&(e=g(t).not(this._selector).data(ht))&&e._isTransitioning))){var i=g.Event(_t.SHOW);if(g(this._element).trigger(i),!i.isDefaultPrevented()){t&&(a._jQueryInterface.call(g(t).not(this._selector),"hide"),e||g(t).data(ht,null));var o=this._getDimension();g(this._element).removeClass(pt).addClass(vt),this._element.style[o]=0,this._triggerArray.length&&g(this._triggerArray).removeClass(yt).attr("aria-expanded",!0),this.setTransitioning(!0);var r="scroll"+(o[0].toUpperCase()+o.slice(1)),s=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,function(){g(n._element).removeClass(vt).addClass(pt).addClass(mt),n._element.style[o]="",n.setTransitioning(!1),g(n._element).trigger(_t.SHOWN)}).emulateTransitionEnd(s),this._element.style[o]=this._element[r]+"px"}}},t.hide=function(){var t=this;if(!this._isTransitioning&&g(this._element).hasClass(mt)){var e=g.Event(_t.HIDE);if(g(this._element).trigger(e),!e.isDefaultPrevented()){var n=this._getDimension();this._element.style[n]=this._element.getBoundingClientRect()[n]+"px",_.reflow(this._element),g(this._element).addClass(vt).removeClass(pt).removeClass(mt);var i=this._triggerArray.length;if(0<i)for(var o=0;o<i;o++){var r=this._triggerArray[o],s=_.getSelectorFromElement(r);if(null!==s)g([].slice.call(document.querySelectorAll(s))).hasClass(mt)||g(r).addClass(yt).attr("aria-expanded",!1)}this.setTransitioning(!0);this._element.style[n]="";var a=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,function(){t.setTransitioning(!1),g(t._element).removeClass(vt).addClass(pt).trigger(_t.HIDDEN)}).emulateTransitionEnd(a)}}},t.setTransitioning=function(t){this._isTransitioning=t},t.dispose=function(){g.removeData(this._element,ht),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null},t._getConfig=function(t){return(t=l({},dt,t)).toggle=Boolean(t.toggle),_.typeCheckConfig(ct,t,gt),t},t._getDimension=function(){return g(this._element).hasClass(Et)?Et:Ct},t._getParent=function(){var t,n=this;_.isElement(this._config.parent)?(t=this._config.parent,"undefined"!=typeof this._config.parent.jquery&&(t=this._config.parent[0])):t=document.querySelector(this._config.parent);var e='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]',i=[].slice.call(t.querySelectorAll(e));return g(i).each(function(t,e){n._addAriaAndCollapsedClass(a._getTargetFromElement(e),[e])}),t},t._addAriaAndCollapsedClass=function(t,e){var n=g(t).hasClass(mt);e.length&&g(e).toggleClass(yt,!n).attr("aria-expanded",n)},a._getTargetFromElement=function(t){var e=_.getSelectorFromElement(t);return e?document.querySelector(e):null},a._jQueryInterface=function(i){return this.each(function(){var t=g(this),e=t.data(ht),n=l({},dt,t.data(),"object"==typeof i&&i?i:{});if(!e&&n.toggle&&/show|hide/.test(i)&&(n.toggle=!1),e||(e=new a(this,n),t.data(ht,e)),"string"==typeof i){if("undefined"==typeof e[i])throw new TypeError('No method n
12amed "'+i+'"');e[i]()}})},s(a,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return dt}}]),a}();g(document).on(_t.CLICK_DATA_API,St,function(t){"A"===t.currentTarget.tagName&&t.preventDefault();var n=g(this),e=_.getSelectorFromElement(this),i=[].slice.call(document.querySelectorAll(e));g(i).each(function(){var t=g(this),e=t.data(ht)?"toggle":n.data();bt._jQueryInterface.call(t,e)})}),g.fn[ct]=bt._jQueryInterface,g.fn[ct].Constructor=bt,g.fn[ct].noConflict=function(){return g.fn[ct]=ft,bt._jQueryInterface};var It="dropdown",Dt="bs.dropdown",wt="."+Dt,At=".data-api",Nt=g.fn[It],Ot=new RegExp("38|40|27"),kt={HIDE:"hide"+wt,HIDDEN:"hidden"+wt,SHOW:"show"+wt,SHOWN:"shown"+wt,CLICK:"click"+wt,CLICK_DATA_API:"click"+wt+At,KEYDOWN_DATA_API:"keydown"+wt+At,KEYUP_DATA_API:"keyup"+wt+At},Pt="disabled",Lt="show",jt="dropup",Ht="dropright",Rt="dropleft",xt="dropdown-menu-right",Ft="position-static",Ut='[data-toggle="dropdown"]',Wt=".dropdown form",qt=".dropdown-menu",Mt=".navbar-nav",Kt=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",Qt="top-start",Bt="top-end",Vt="bottom-start",Yt="bottom-end",zt="right-start",Xt="left-start",$t={offset:0,flip:!0,boundary:"scrollParent",reference:"toggle",display:"dynamic"},Gt={offset:"(number|string|function)",flip:"boolean",boundary:"(string|element)",reference:"(string|element)",display:"string"},Jt=function(){function c(t,e){this._element=t,this._popper=null,this._config=this._getConfig(e),this._menu=this._getMenuElement(),this._inNavbar=this._detectNavbar(),this._addEventListeners()}var t=c.prototype;return t.toggle=function(){if(!this._element.disabled&&!g(this._element).hasClass(Pt)){var t=c._getParentFromElement(this._element),e=g(this._menu).hasClass(Lt);if(c._clearMenus(),!e){var n={relatedTarget:this._element},i=g.Event(kt.SHOW,n);if(g(t).trigger(i),!i.isDefaultPrevented()){if(!this._inNavbar){if("undefined"==typeof u)throw new TypeError("Bootstrap's dropdowns require Popper.js (https://popper.js.org/)");var o=this._element;"parent"===this._config.reference?o=t:_.isElement(this._config.reference)&&(o=this._config.reference,"undefined"!=typeof this._config.reference.jquery&&(o=this._config.reference[0])),"scrollParent"!==this._config.boundary&&g(t).addClass(Ft),this._popper=new u(o,this._menu,this._getPopperConfig())}"ontouchstart"in document.documentElement&&0===g(t).closest(Mt).length&&g(document.body).children().on("mouseover",null,g.noop),this._element.focus(),this._element.setAttribute("aria-expanded",!0),g(this._menu).toggleClass(Lt),g(t).toggleClass(Lt).trigger(g.Event(kt.SHOWN,n))}}}},t.show=function(){if(!(this._element.disabled||g(this._element).hasClass(Pt)||g(this._menu).hasClass(Lt))){var t={relatedTarget:this._element},e=g.Event(kt.SHOW,t),n=c._getParentFromElement(this._element);g(n).trigger(e),e.isDefaultPrevented()||(g(this._menu).toggleClass(Lt),g(n).toggleClass(Lt).trigger(g.Event(kt.SHOWN,t)))}},t.hide=function(){if(!this._element.disabled&&!g(this._element).hasClass(Pt)&&g(this._menu).hasClass(Lt)){var t={relatedTarget:this._element},e=g.Event(kt.HIDE,t),n=c._getParentFromElement(this._element);g(n).trigger(e),e.isDefaultPrevented()||(g(this._menu).toggleClass(Lt),g(n).toggleClass(Lt).trigger(g.Event(kt.HIDDEN,t)))}},t.dispose=function(){g.removeData(this._element,Dt),g(this._element).off(wt),this._element=null,(this._menu=null)!==this._popper&&(this._popper.destroy(),this._popper=null)},t.update=function(){this._inNavbar=this._detectNavbar(),null!==this._popper&&this._popper.scheduleUpdate()},t._addEventListeners=function(){var e=this;g(this._element).on(kt.CLICK,function(t){t.preventDefault(),t.stopPropagation(),e.toggle()})},t._getConfig=function(t){return t=l({},this.constructor.Default,g(this._element).data(),t),_.typeCheckConfig(It,t,this.constructor.DefaultType),t},t._getMenuElement=function(){if(!this._menu){var t=c._getParentFromElement(this._element);t&&(this._menu=t.querySelector(qt))}return this._menu},t._getPlacement=function(){var t=g(this._element.parentNode),e=Vt;return t.hasClass(jt)?(e=Qt,g(this._menu).hasClass(xt)&&(e=Bt)):t.hasClass(Ht)?e=zt:t.hasClass(Rt)?e=Xt:g(this._menu).hasClass(xt)&&(e=Yt),e},t._detectNavbar=function(){return 0<g(this._element).closest(".
12navbar").length},t._getOffset=function(){var e=this,t={};return"function"==typeof this._config.offset?t.fn=function(t){return t.offsets=l({},t.offsets,e._config.offset(t.offsets,e._element)||{}),t}:t.offset=this._config.offset,t},t._getPopperConfig=function(){var t={placement:this._getPlacement(),modifiers:{offset:this._getOffset(),flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}};return"static"===this._config.display&&(t.modifiers.applyStyle={enabled:!1}),t},c._jQueryInterface=function(e){return this.each(function(){var t=g(this).data(Dt);if(t||(t=new c(this,"object"==typeof e?e:null),g(this).data(Dt,t)),"string"==typeof e){if("undefined"==typeof t[e])throw new TypeError('No method named "'+e+'"');t[e]()}})},c._clearMenus=function(t){if(!t||3!==t.which&&("keyup"!==t.type||9===t.which))for(var e=[].slice.call(document.querySelectorAll(Ut)),n=0,i=e.length;n<i;n++){var o=c._getParentFromElement(e[n]),r=g(e[n]).data(Dt),s={relatedTarget:e[n]};if(t&&"click"===t.type&&(s.clickEvent=t),r){var a=r._menu;if(g(o).hasClass(Lt)&&!(t&&("click"===t.type&&/input|textarea/i.test(t.target.tagName)||"keyup"===t.type&&9===t.which)&&g.contains(o,t.target))){var l=g.Event(kt.HIDE,s);g(o).trigger(l),l.isDefaultPrevented()||("ontouchstart"in document.documentElement&&g(document.body).children().off("mouseover",null,g.noop),e[n].setAttribute("aria-expanded","false"),g(a).removeClass(Lt),g(o).removeClass(Lt).trigger(g.Event(kt.HIDDEN,s)))}}}},c._getParentFromElement=function(t){var e,n=_.getSelectorFromElement(t);return n&&(e=document.querySelector(n)),e||t.parentNode},c._dataApiKeydownHandler=function(t){if((/input|textarea/i.test(t.target.tagName)?!(32===t.which||27!==t.which&&(40!==t.which&&38!==t.which||g(t.target).closest(qt).length)):Ot.test(t.which))&&(t.preventDefault(),t.stopPropagation(),!this.disabled&&!g(this).hasClass(Pt))){var e=c._getParentFromElement(this),n=g(e).hasClass(Lt);if(n&&(!n||27!==t.which&&32!==t.which)){var i=[].slice.call(e.querySelectorAll(Kt));if(0!==i.length){var o=i.indexOf(t.target);38===t.which&&0<o&&o--,40===t.which&&o<i.length-1&&o++,o<0&&(o=0),i[o].focus()}}else{if(27===t.which){var r=e.querySelector(Ut);g(r).trigger("focus")}g(this).trigger("click")}}},s(c,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return $t}},{key:"DefaultType",get:function(){return Gt}}]),c}();g(document).on(kt.KEYDOWN_DATA_API,Ut,Jt._dataApiKeydownHandler).on(kt.KEYDOWN_DATA_API,qt,Jt._dataApiKeydownHandler).on(kt.CLICK_DATA_API+" "+kt.KEYUP_DATA_API,Jt._clearMenus).on(kt.CLICK_DATA_API,Ut,function(t){t.preventDefault(),t.stopPropagation(),Jt._jQueryInterface.call(g(this),"toggle")}).on(kt.CLICK_DATA_API,Wt,function(t){t.stopPropagation()}),g.fn[It]=Jt._jQueryInterface,g.fn[It].Constructor=Jt,g.fn[It].noConflict=function(){return g.fn[It]=Nt,Jt._jQueryInterface};var Zt="modal",te="bs.modal",ee="."+te,ne=g.fn[Zt],ie={backdrop:!0,keyboard:!0,focus:!0,show:!0},oe={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean",show:"boolean"},re={HIDE:"hide"+ee,HIDDEN:"hidden"+ee,SHOW:"show"+ee,SHOWN:"shown"+ee,FOCUSIN:"focusin"+ee,RESIZE:"resize"+ee,CLICK_DISMISS:"click.dismiss"+ee,KEYDOWN_DISMISS:"keydown.dismiss"+ee,MOUSEUP_DISMISS:"mouseup.dismiss"+ee,MOUSEDOWN_DISMISS:"mousedown.dismiss"+ee,CLICK_DATA_API:"click"+ee+".data-api"},se="modal-dialog-scrollable",ae="modal-scrollbar-measure",le="modal-backdrop",ce="modal-open",he="fade",ue="show",fe=".modal-dialog",de=".modal-body",ge='[data-toggle="modal"]',_e='[data-dismiss="modal"]',me=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",pe=".sticky-top",ve=function(){function o(t,e){this._config=this._getConfig(e),this._element=t,this._dialog=t.querySelector(fe),this._backdrop=null,this._isShown=!1,this._isBodyOverflowing=!1,this._ignoreBackdropClick=!1,this._isTransitioning=!1,this._scrollbarWidth=0}var t=o.prototype;return t.toggle=function(t){return this._isShown?this.hide():this.show(t)},t.show=function(t){var e=this;if(!this._isShown&&!this._isTransitioning){g(this._element).hasClass(he)&&(this._isTransitioning=!0);var n=g.Event(re.SHOW,{relatedTarget:t});g(this._element).trigger(n),this._isShown||n.isDefaultPrevented()||(this._isShown=!0,this._checkScrollbar(),this._setScrollbar(),this._adjustDialog(),this._setEscapeEvent(),this._setResizeEvent(),g(this._element).on(re.CLICK_DISMISS,_e,function(t){return e.hide(t)}),g(this._dialog).on(re.MOUSEDOWN_DISMISS,function(){g(e._element).one(re.MOUSEUP_DISMISS,function(t){g(t.target).is(e._element)&&(e._ignoreBackdropClick=!0)})}),this._showBackdrop(function(){return e._showElement(t)}))}},t.hide=function(t){var e=this;if(t&&t.preventDefault(),this._isShown&&!this._isTransitioning){var n=g.Event(re.HIDE);if(g(this._element).trigger(n),this._isShown&&!n.isDefaultPrevented()){this._isShown=!1;var i=g(this._element).hasClass(he);if(i&&(this._isTransitioning=!0),this._setEscapeEvent(),this._setResizeEvent(),g(document).off(re.FOCUSIN),g(this._element).removeClass(ue),g(this._element).off(re.CLICK_DISMISS),g(this._dialog).off(re.MOUSEDOWN_DISMISS),i){var o=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,function(t){return e._hideModal(t)}).emulateTransitionEnd(o)}else this._hideModal()}}},t.dispose=function(){[window,this._element,this._dialog].forEach(function(t){return g(t).off(ee)}),g(document).off(re.FOCUSIN),g.removeData(this._element,te),this._config=null,this._element=null,this._dialog=null,this._backdrop=null,this._isShown=null,this._isBodyOverflowing=null,this._ignoreBackdropClick=null,this._isTransitioning=null,this._scrollbarWidth=null},t.handleUpdate=function(){this._adjustDialog()},t._getConfig=function(t){return t=l({},ie,t),_.typeCheckConfig(Zt,t,oe),t},t._showElement=function(t){var e=this,n=g(this._element).hasClass(he);this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),g(this._dialog).hasClass(se)?this._dialog.querySelector(de).scrollTop=0:this._element.scrollTop=0,n&&_.reflow(this._element),g(this._element).addClass(ue),this._config.focus&&this._enforceFocus();
12var i=g.Event(re.SHOWN,{relatedTarget:t}),o=function(){e._config.focus&&e._element.focus(),e._isTransitioning=!1,g(e._element).trigger(i)};if(n){var r=_.getTransitionDurationFromElement(this._dialog);g(this._dialog).one(_.TRANSITION_END,o).emulateTransitionEnd(r)}else o()},t._enforceFocus=function(){var e=this;g(document).off(re.FOCUSIN).on(re.FOCUSIN,function(t){document!==t.target&&e._element!==t.target&&0===g(e._element).has(t.target).length&&e._element.focus()})},t._setEscapeEvent=function(){var e=this;this._isShown&&this._config.keyboard?g(this._element).on(re.KEYDOWN_DISMISS,function(t){27===t.which&&(t.preventDefault(),e.hide())}):this._isShown||g(this._element).off(re.KEYDOWN_DISMISS)},t._setResizeEvent=function(){var e=this;this._isShown?g(window).on(re.RESIZE,function(t){return e.handleUpdate(t)}):g(window).off(re.RESIZE)},t._hideModal=function(){var t=this;this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._isTransitioning=!1,this._showBackdrop(function(){g(document.body).removeClass(ce),t._resetAdjustments(),t._resetScrollbar(),g(t._element).trigger(re.HIDDEN)})},t._removeBackdrop=function(){this._backdrop&&(g(this._backdrop).remove(),this._backdrop=null)},t._showBackdrop=function(t){var e=this,n=g(this._element).hasClass(he)?he:"";if(this._isShown&&this._config.backdrop){if(this._backdrop=document.createElement("div"),this._backdrop.className=le,n&&this._backdrop.classList.add(n),g(this._backdrop).appendTo(document.body),g(this._element).on(re.CLICK_DISMISS,function(t){e._ignoreBackdropClick?e._ignoreBackdropClick=!1:t.target===t.currentTarget&&("static"===e._config.backdrop?e._element.focus():e.hide())}),n&&_.reflow(this._backdrop),g(this._backdrop).addClass(ue),!t)return;if(!n)return void t();var i=_.getTransitionDurationFromElement(this._backdrop);g(this._backdrop).one(_.TRANSITION_END,t).emulateTransitionEnd(i)}else if(!this._isShown&&this._backdrop){g(this._backdrop).removeClass(ue);var o=function(){e._removeBackdrop(),t&&t()};if(g(this._element).hasClass(he)){var r=_.getTransitionDurationFromElement(this._backdrop);g(this._backdrop).one(_.TRANSITION_END,o).emulateTransitionEnd(r)}else o()}else t&&t()},t._adjustDialog=function(){var t=this._element.scrollHeight>document.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},t._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},t._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=t.left+t.right<window.innerWidth,this._scrollbarWidth=this._getScrollbarWidth()},t._setScrollbar=function(){var o=this;if(this._isBodyOverflowing){var t=[].slice.call(document.querySelectorAll(me)),e=[].slice.call(document.querySelectorAll(pe));g(t).each(function(t,e){var n=e.style.paddingRight,i=g(e).css("padding-right");g(e).data("padding-right",n).css("padding-right",parseFloat(i)+o._scrollbarWidth+"px")}),g(e).each(function(t,e){var n=e.style.marginRight,i=g(e).css("margin-right");g(e).data("margin-right",n).css("margin-right",parseFloat(i)-o._scrollbarWidth+"px")});var n=document.body.style.paddingRight,i=g(document.body).css("padding-right");g(document.body).data("padding-right",n).css("padding-right",parseFloat(i)+this._scrollbarWidth+"px")}g(document.body).addClass(ce)},t._resetScrollbar=function(){var t=[].slice.call(document.querySelectorAll(me));g(t).each(function(t,e){var n=g(e).data("padding-right");g(e).removeData("padding-right"),e.style.paddingRight=n||""});var e=[].slice.call(document.querySelectorAll(""+pe));g(e).each(function(t,e){var n=g(e).data("margin-right");"undefined"!=typeof n&&g(e).css("margin-right",n).removeData("margin-right")});var n=g(document.body).data("padding-right");g(document.body).removeData("padding-right"),document.body.style.paddingRight=n||""},t._getScrollbarWidth=function(){var t=document.createElement("div");t.className=ae,document.body.appendChild(t);var e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e},o._jQueryInterface=function(n,i){return this.each(function(){var t=g(this).data(te),e=l({},ie,g(this).data(),"object"==typeof n&&n?n:{});if(t||(t=new o(this,e),g(this).data(te,t)),"string"==typeof n){if("undefined"==typeof t[n])throw new TypeError('No method n
12amed "'+n+'"');t[n](i)}else e.show&&t.show(i)})},s(o,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return ie}}]),o}();g(document).on(re.CLICK_DATA_API,ge,function(t){var e,n=this,i=_.getSelectorFromElement(this);i&&(e=document.querySelector(i));var o=g(e).data(te)?"toggle":l({},g(e).data(),g(this).data());"A"!==this.tagName&&"AREA"!==this.tagName||t.preventDefault();var r=g(e).one(re.SHOW,function(t){t.isDefaultPrevented()||r.one(re.HIDDEN,function(){g(n).is(":visible")&&n.focus()})});ve._jQueryInterface.call(g(e),o,this)}),g.fn[Zt]=ve._jQueryInterface,g.fn[Zt].Constructor=ve,g.fn[Zt].noConflict=function(){return g.fn[Zt]=ne,ve._jQueryInterface};var ye=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],Ee={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Ce=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,Te=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function Se(t,s,e){if(0===t.length)return t;if(e&&"function"==typeof e)return e(t);for(var n=(new window.DOMParser).parseFromString(t,"text/html"),a=Object.keys(s),l=[].slice.call(n.body.querySelectorAll("*")),i=function(t,e){var n=l[t],i=n.nodeName.toLowerCase();if(-1===a.indexOf(n.nodeName.toLowerCase()))return n.parentNode.removeChild(n),"continue";var o=[].slice.call(n.attributes),r=[].concat(s["*"]||[],s[i]||[]);o.forEach(function(t){(function(t,e){var n=t.nodeName.toLowerCase();if(-1!==e.indexOf(n))return-1===ye.indexOf(n)||Boolean(t.nodeValue.match(Ce)||t.nodeValue.match(Te));for(var i=e.filter(function(t){return t instanceof RegExp}),o=0,r=i.length;o<r;o++)if(n.match(i[o]))return!0;return!1})(t,r)||n.removeAttribute(t.nodeName)})},o=0,r=l.length;o<r;o++)i(o);return n.body.innerHTML}var be="tooltip",Ie="bs.tooltip",De="."+Ie,we=g.fn[be],Ae="bs-tooltip",Ne=new RegExp("(^|\\s)"+Ae+"\\S+","g"),Oe=["sanitize","whiteList","sanitizeFn"],ke={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(number|string|function)",container:"(string|element|boolean)",fallbackPlacement:"(string|array)",boundary:"(string|element)",sanitize:"boolean",sanitizeFn:"(null|function)",whiteList:"object"},Pe={AUTO:"auto",TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left"},Le={animation:!0,template:'<div class="tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",sanitize:!0,sanitizeFn:null,whiteList:Ee},je="show",He="out",Re={HIDE:"hide"+De,HIDDEN:"hidden"+De,SHOW:"show"+De,SHOWN:"shown"+De,INSERTED:"inserted"+De,CLICK:"click"+De,FOCUSIN:"focusin"+De,FOCUSOUT:"focusout"+De,MOUSEENTER:"mouseenter"+De,MOUSELEAVE:"mouseleave"+De},xe="fade",Fe="show",Ue=".tooltip-inner",We=".arrow",qe="hover",Me="focus",Ke="click",Qe="manual",Be=function(){function i(t,e){if("undefined"==typeof u)throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org/)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var t=i.prototype;return t.enable=function(){this._isEnabled=!0},t.disable=function(){this._isEnabled=!1},t.toggleEnabled=function(){this._isEnabled=!this._isEnabled},t.toggle=function(t){if(this._isEnabled)if(t){var e=this.constructor.DATA_KEY,n=g(t.currentTarget).data(e);n||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(e,n)),n._activeTrigger.click=!n._activeTrigger.click,n._isWithActiveTrigger()?n._enter(null,n):n._leave(null,n)}else{if(g(this.getTipElement()).hasClass(Fe))return void this._leave(null,this);this._enter(null,this)}},t.dispose=function(){clearTimeout(this._timeout),g.removeData(this.element,this.constructor.DATA_KEY),g(this.element).off(this.constructor.EVENT_KEY),g(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&g(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,(this._activeTrigger=null)!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},t.show=function(){var e=this;if("none"===g(this.element).css("display"))throw new Error("Please use show on visible elements");var t=g.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){g(this.element).trigger(t);var n=_.findShadowRoot(this.element),i=g.contains(null!==n?n:this.element.ownerDocument.documentElement,this.element);if(t.isDefaultPrevented()||!i)return;var o=this.getTipElement(),r=_.getUID(this.constructor.NAME);o.setAttribute("id",r),this.element.setAttribute("aria-describedby",r),this.setContent(),this.config.animation&&g(o).addClass(xe);var s="function"==typeof this.config.placement?this.config.placement.call(this,o,this.element):this.config.placement,a=this._getAttachment(s);this.addAttachmentClass(a);var l=this._getContainer();g(o).data(this.constructor.DATA_KEY,this),g.contains(this.element.ownerDocument.documentElement,this.tip)||g(o).appendTo(l),g(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new u(this.element,o,{placement:a,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:We}
12,preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){return e._handlePopperPlacementChange(t)}}),g(o).addClass(Fe),"ontouchstart"in document.documentElement&&g(document.body).children().on("mouseover",null,g.noop);var c=function(){e.config.animation&&e._fixTransition();var t=e._hoverState;e._hoverState=null,g(e.element).trigger(e.constructor.Event.SHOWN),t===He&&e._leave(null,e)};if(g(this.tip).hasClass(xe)){var h=_.getTransitionDurationFromElement(this.tip);g(this.tip).one(_.TRANSITION_END,c).emulateTransitionEnd(h)}else c()}},t.hide=function(t){var e=this,n=this.getTipElement(),i=g.Event(this.constructor.Event.HIDE),o=function(){e._hoverState!==je&&n.parentNode&&n.parentNode.removeChild(n),e._cleanTipClass(),e.element.removeAttribute("aria-describedby"),g(e.element).trigger(e.constructor.Event.HIDDEN),null!==e._popper&&e._popper.destroy(),t&&t()};if(g(this.element).trigger(i),!i.isDefaultPrevented()){if(g(n).removeClass(Fe),"ontouchstart"in document.documentElement&&g(document.body).children().off("mouseover",null,g.noop),this._activeTrigger[Ke]=!1,this._activeTrigger[Me]=!1,this._activeTrigger[qe]=!1,g(this.tip).hasClass(xe)){var r=_.getTransitionDurationFromElement(n);g(n).one(_.TRANSITION_END,o).emulateTransitionEnd(r)}else o();this._hoverState=""}},t.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},t.isWithContent=function(){return Boolean(this.getTitle())},t.addAttachmentClass=function(t){g(this.getTipElement()).addClass(Ae+"-"+t)},t.getTipElement=function(){return this.tip=this.tip||g(this.config.template)[0],this.tip},t.setContent=function(){var t=this.getTipElement();this.setElementContent(g(t.querySelectorAll(Ue)),this.getTitle()),g(t).removeClass(xe+" "+Fe)},t.setElementContent=function(t,e){"object"!=typeof e||!e.nodeType&&!e.jquery?this.config.html?(this.config.sanitize&&(e=Se(e,this.config.whiteList,this.config.sanitizeFn)),t.html(e)):t.text(e):this.config.html?g(e).parent().is(t)||t.empty().append(e):t.text(g(e).text())},t.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},t._getOffset=function(){var e=this,t={};return"function"==typeof this.config.offset?t.fn=function(t){return t.offsets=l({},t.offsets,e.config.offset(t.offsets,e.element)||{}),t}:t.offset=this.config.offset,t},t._getContainer=function(){return!1===this.config.container?document.body:_.isElement(this.config.container)?g(this.config.container):g(document).find(this.config.container)},t._getAttachment=function(t){return Pe[t.toUpperCase()]},t._setListeners=function(){var i=this;this.config.trigger.split(" ").forEach(function(t){if("click"===t)g(i.element).on(i.constructor.Event.CLICK,i.config.selector,function(t){return i.toggle(t)});else if(t!==Qe){var e=t===qe?i.constructor.Event.MOUSEENTER:i.constructor.Event.FOCUSIN,n=t===qe?i.constructor.Event.MOUSELEAVE:i.constructor.Event.FOCUSOUT;g(i.element).on(e,i.config.selector,function(t){return i._enter(t)}).on(n,i.config.selector,function(t){return i._leave(t)})}}),g(this.element).closest(".modal").on("hide.bs.modal",function(){i.element&&i.hide()}),this.config.selector?this.config=l({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},t._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},t._enter=function(t,e){var n=this.constructor.DATA_KEY;(e=e||g(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusin"===t.type?Me:qe]=!0),g(e.getTipElement()).hasClass(Fe)||e._hoverState===je?e._hoverState=je:(clearTimeout(e._timeout),e._hoverState=je,e.config.delay&&e.config.delay.show?e._timeout=setTimeout(function(){e._hoverState===je&&e.show()},e.config.delay.show):e.show())},t._leave=function(t,e){var n=this.constructor.DATA_KEY;(e=e||g(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusout"===t.type?Me:qe]=!1),e._isWithActiveTrigger()||(clearTimeout(e._timeout),e._hoverState=He,e.config.delay&&e.config.delay.hide?e._timeout=setTimeout(function(){e._hoverState===He&&e.hide()},e.config.delay.hide):e.hide())},t._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},t._getConfig=function(t){var e=g(this.element).data();return Object.keys(e).forEach(function(t){-1!==Oe.indexOf(t)&&delete e[t]}),"number"==typeof(t=l({},this.constructor.Default,e,"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),_.typeCheckConfig(be,t,this.constructor.DefaultType),t.sanitize&&(t.template=Se(t.template,t.whiteList,t.sanitizeFn)),t},t._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},t._cleanTipClass=function(){var t=g(this.getTipElement()),e=t.attr("class").match(Ne);null!==e&&e.length&&t.removeClass(e.join(""))},t._handlePopperPlacementChange=function(t){var e=t.instance;this.tip=e.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},t._fixTransition=function(){var t=this.getTipElement(),e=this.config.animation;null===t.getAttribute("x-placement")&&(g(t).removeClass(xe),this.config.animation=!1,this.hide(),this.show(),this.config.animation=e)},i._jQueryInterface=function(n){return this.each(function(){var t=g(this).data(Ie),e="object"==typeof n&&n;if((t||!/dispose|hide/.test(n))&&(t||(t=new i(this,e),g(this).data(Ie,t)),"string"==typeof n)){if("undefined"==typeof t[n])throw new TypeError('No method n
12amed "'+n+'"');t[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return Le}},{key:"NAME",get:function(){return be}},{key:"DATA_KEY",get:function(){return Ie}},{key:"Event",get:function(){return Re}},{key:"EVENT_KEY",get:function(){return De}},{key:"DefaultType",get:function(){return ke}}]),i}();g.fn[be]=Be._jQueryInterface,g.fn[be].Constructor=Be,g.fn[be].noConflict=function(){return g.fn[be]=we,Be._jQueryInterface};var Ve="popover",Ye="bs.popover",ze="."+Ye,Xe=g.fn[Ve],$e="bs-popover",Ge=new RegExp("(^|\\s)"+$e+"\\S+","g"),Je=l({},Be.Default,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>'}),Ze=l({},Be.DefaultType,{content:"(string|element|function)"}),tn="fade",en="show",nn=".popover-header",on=".popover-body",rn={HIDE:"hide"+ze,HIDDEN:"hidden"+ze,SHOW:"show"+ze,SHOWN:"shown"+ze,INSERTED:"inserted"+ze,CLICK:"click"+ze,FOCUSIN:"focusin"+ze,FOCUSOUT:"focusout"+ze,MOUSEENTER:"mouseenter"+ze,MOUSELEAVE:"mouseleave"+ze},sn=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),(e.prototype.constructor=e).__proto__=n;var o=i.prototype;return o.isWithContent=function(){return this.getTitle()||this._getContent()},o.addAttachmentClass=function(t){g(this.getTipElement()).addClass($e+"-"+t)},o.getTipElement=function(){return this.tip=this.tip||g(this.config.template)[0],this.tip},o.setContent=function(){var t=g(this.getTipElement());this.setElementContent(t.find(nn),this.getTitle());var e=this._getContent();"function"==typeof e&&(e=e.call(this.element)),this.setElementContent(t.find(on),e),t.removeClass(tn+" "+en)},o._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},o._cleanTipClass=function(){var t=g(this.getTipElement()),e=t.attr("class").match(Ge);null!==e&&0<e.length&&t.removeClass(e.join(""))},i._jQueryInterface=function(n){return this.each(function(){var t=g(this).data(Ye),e="object"==typeof n?n:null;if((t||!/dispose|hide/.test(n))&&(t||(t=new i(this,e),g(this).data(Ye,t)),"string"==typeof n)){if("undefined"==typeof t[n])throw new TypeError('No method named "'+n+'"');t[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return Je}},{key:"NAME",get:function(){return Ve}},{key:"DATA_KEY",get:function(){return Ye}},{key:"Event",get:function(){return rn}},{key:"EVENT_KEY",get:function(){return ze}},{key:"DefaultType",get:function(){return Ze}}]),i}(Be);g.fn[Ve]=sn._jQueryInterface,g.fn[Ve].Constructor=sn,g.fn[Ve].noConflict=function(){return g.fn[Ve]=Xe,sn._jQueryInterface};var an="scrollspy",ln="bs.scrollspy",cn="."+ln,hn=g.fn[an],un={offset:10,method:"auto",target:""},fn={offset:"number",method:"string",target:"(string|element)"},dn={ACTIVATE:"activate"+cn,SCROLL:"scroll"+cn,LOAD_DATA_API:"load"+cn+".data-api"},gn="dropdown-item",_n="active",mn='[data-spy="scroll"]',pn=".nav, .list-group",vn=".nav-link",yn=".nav-item",En=".list-group-item",Cn=".dropdown",Tn=".dropdown-item",Sn=".dropdown-toggle",bn="offset",In="position",Dn=function(){function n(t,e){var n=this;this._element=t,this._scrollElement="BODY"===t.tagName?window:t,this._config=this._getConfig(e),this._selector=this._config.target+" "+vn+","+this._config.target+" "+En+","+this._config.target+" "+Tn,this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,g(this._scrollElement).on(dn.SCROLL,function(t){return n._process(t)}),this.refresh(),this._process()}var t=n.prototype;return t.refresh=function(){var e=this,t=this._scrollElement===this._scrollElement.window?bn:In,o="auto"===this._config.method?t:this._config.method,r=o===In?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),[].slice.call(document.querySelectorAll(this._selector)).map(function(t){var e,n=_.getSelectorFromElement(t);if(n&&(e=document.querySelector(n)),e){var i=e.getBoundingClientRect();if(i.width||i.height)return[g(e)[o]().top+r,n]}return null}).filter(function(t){return t}).sort(function(t,e){return t[0]-e[0]}
12).forEach(function(t){e._offsets.push(t[0]),e._targets.push(t[1])})},t.dispose=function(){g.removeData(this._element,ln),g(this._scrollElement).off(cn),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},t._getConfig=function(t){if("string"!=typeof(t=l({},un,"object"==typeof t&&t?t:{})).target){var e=g(t.target).attr("id");e||(e=_.getUID(an),g(t.target).attr("id",e)),t.target="#"+e}return _.typeCheckConfig(an,t,fn),t},t._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},t._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},t._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},t._process=function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),n<=t){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&t<this._offsets[0]&&0<this._offsets[0])return this._activeTarget=null,void this._clear();for(var o=this._offsets.length;o--;){this._activeTarget!==this._targets[o]&&t>=this._offsets[o]&&("undefined"==typeof this._offsets[o+1]||t<this._offsets[o+1])&&this._activate(this._targets[o])}}},t._activate=function(e){this._activeTarget=e,this._clear();var t=this._selector.split(",").map(function(t){return t+'[data-target="'+e+'"],'+t+'[href="'+e+'"]'}),n=g([].slice.call(document.querySelectorAll(t.join(","))));n.hasClass(gn)?(n.closest(Cn).find(Sn).addClass(_n),n.addClass(_n)):(n.addClass(_n),n.parents(pn).prev(vn+", "+En).addClass(_n),n.parents(pn).prev(yn).children(vn).addClass(_n)),g(this._scrollElement).trigger(dn.ACTIVATE,{relatedTarget:e})},t._clear=function(){[].slice.call(document.querySelectorAll(this._selector)).filter(function(t){return t.classList.contains(_n)}).forEach(function(t){return t.classList.remove(_n)})},n._jQueryInterface=function(e){return this.each(function(){var t=g(this).data(ln);if(t||(t=new n(this,"object"==typeof e&&e),g(this).data(ln,t)),"string"==typeof e){if("undefined"==typeof t[e])throw new TypeError('No method named "'+e+'"');t[e]()}})},s(n,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return un}}]),n}();g(window).on(dn.LOAD_DATA_API,function(){for(var t=[].slice.call(document.querySelectorAll(mn)),e=t.length;e--;){var n=g(t[e]);Dn._jQueryInterface.call(n,n.data())}}),g.fn[an]=Dn._jQueryInterface,g.fn[an].Constructor=Dn,g.fn[an].noConflict=function(){return g.fn[an]=hn,Dn._jQueryInterface};var wn="bs.tab",An="."+wn,Nn=g.fn.tab,On={HIDE:"hide"+An,HIDDEN:"hidden"+An,SHOW:"show"+An,SHOWN:"shown"+An,CLICK_DATA_API:"click"+An+".data-api"},kn="dropdown-menu",Pn="active",Ln="disabled",jn="fade",Hn="show",Rn=".dropdown",xn=".nav, .list-group",Fn=".active",Un="> li > .active",Wn='[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',qn=".dropdown-toggle",Mn="> .dropdown-menu .active",Kn=function(){function i(t){this._element=t}var t=i.prototype;return t.show=function(){var n=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&g(this._element).hasClass(Pn)||g(this._element).hasClass(Ln))){var t,i,e=g(this._element).closest(xn)[0],o=_.getSelectorFromElement(this._element);if(e){var r="UL"===e.nodeName||"OL"===e.nodeName?Un:Fn;i=(i=g.makeArray(g(e).find(r)))[i.length-1]}var s=g.Event(On.HIDE,{relatedTarget:this._element}),a=g.Event(On.SHOW,{relatedTarget:i});if(i&&g(i).trigger(s),g(this._element).trigger(a),!a.isDefaultPrevented()&&!s.isDefaultPrevented()){o&&(t=document.querySelector(o)),this._activate(this._element,e);var l=function(){var t=g.Event(On.HIDDEN,{relatedTarget:n._element}),e=g.Event(On.SHOWN,{relatedTarget:i});g(i).trigger(t),g(n._element).trigger(e)};t?this._activate(t,t.parentNode,l):l()}}},t.dispose=function(){g.removeData(this._element,wn),this._element=null},t._activate=function(t,e,n){var i=this,o=(!e||"UL"!==e.nodeName&&"OL"!==e.nodeName?g(e).children(Fn):g(e).find(Un))[0],r=n&&o&&g(o).hasClass(jn),s=function(){return i._transitionComplete(t,o,n)};if(o&&r){var a=_.getTransitionDurationFromElement(o);g(o).removeClass(Hn).one(_.TRANSITION_END,s).emulateTransitionEnd(a)}else s()},t._transitionComplete=function(t,e,n){if(e){g(e).removeClass(Pn);var i=g(e.parentNode).find(Mn)[0];i&&g(i).removeClass(Pn),"tab"===e.getAttribute("role")&&e.setAttribute("aria-selected",!1)}if(g(t).addClass(Pn),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!0),_.reflow(t),t.classList.contains(jn)&&t.classList.add(Hn),t.parentNode&&g(t.parentNode).hasClass(kn)){var o=g(t).closest(Rn)[0];if(o){var r=[].slice.call(o.querySelectorAll(qn));g(r).addClass(Pn)}t.setAttribute("aria-expanded",!0)}n&&n()},i._jQueryInterface=function(n){return this.each(function(){var t=g(this),e=t.data(wn);if(e||(e=new i(this),t.data(wn,e)),"string"==typeof n){if("undefined"==typeof e[n])throw new TypeError('No method n
12amed "'+n+'"');e[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}}]),i}();g(document).on(On.CLICK_DATA_API,Wn,function(t){t.preventDefault(),Kn._jQueryInterface.call(g(this),"show")}),g.fn.tab=Kn._jQueryInterface,g.fn.tab.Constructor=Kn,g.fn.tab.noConflict=function(){return g.fn.tab=Nn,Kn._jQueryInterface};var Qn="toast",Bn="bs.toast",Vn="."+Bn,Yn=g.fn[Qn],zn={CLICK_DISMISS:"click.dismiss"+Vn,HIDE:"hide"+Vn,HIDDEN:"hidden"+Vn,SHOW:"show"+Vn,SHOWN:"shown"+Vn},Xn="fade",$n="hide",Gn="show",Jn="showing",Zn={animation:"boolean",autohide:"boolean",delay:"number"},ti={animation:!0,autohide:!0,delay:500},ei='[data-dismiss="toast"]',ni=function(){function i(t,e){this._element=t,this._config=this._getConfig(e),this._timeout=null,this._setListeners()}var t=i.prototype;return t.show=function(){var t=this;g(this._element).trigger(zn.SHOW),this._config.animation&&this._element.classList.add(Xn);var e=function(){t._element.classList.remove(Jn),t._element.classList.add(Gn),g(t._element).trigger(zn.SHOWN),t._config.autohide&&t.hide()};if(this._element.classList.remove($n),this._element.classList.add(Jn),this._config.animation){var n=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,e).emulateTransitionEnd(n)}else e()},t.hide=function(t){var e=this;this._element.classList.contains(Gn)&&(g(this._element).trigger(zn.HIDE),t?this._close():this._timeout=setTimeout(function(){e._close()},this._config.delay))},t.dispose=function(){clearTimeout(this._timeout),this._timeout=null,this._element.classList.contains(Gn)&&this._element.classList.remove(Gn),g(this._element).off(zn.CLICK_DISMISS),g.removeData(this._element,Bn),this._element=null,this._config=null},t._getConfig=function(t){return t=l({},ti,g(this._element).data(),"object"==typeof t&&t?t:{}),_.typeCheckConfig(Qn,t,this.constructor.DefaultType),t},t._setListeners=function(){var t=this;g(this._element).on(zn.CLICK_DISMISS,ei,function(){return t.hide(!0)})},t._close=function(){var t=this,e=function(){t._element.classList.add($n),g(t._element).trigger(zn.HIDDEN)};if(this._element.classList.remove(Gn),this._config.animation){var n=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,e).emulateTransitionEnd(n)}else e()},i._jQueryInterface=function(n){return this.each(function(){var t=g(this),e=t.data(Bn);if(e||(e=new i(this,"object"==typeof n&&n),t.data(Bn,e)),"string"==typeof n){if("undefined"==typeof e[n])throw new TypeError('No method named "'+n+'"');e[n](this)}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"DefaultType",get:function(){return Zn}},{key:"Default",get:function(){return ti}}]),i}();g.fn[Qn]=ni._jQueryInterface,g.fn[Qn].Constructor=ni,g.fn[Qn].noConflict=function(){return g.fn[Qn]=Yn,ni._jQueryInterface},function(){if("undefined"==typeof g)throw new TypeError("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");var t=g.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1===t[0]&&9===t[1]&&t[2]<1||4<=t[0])throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}(),t.Util=_,t.Alert=p,t.Button=P,t.Carousel=lt,t.Collapse=bt,t.Dropdown=Jt,t.Modal=ve,t.Popover=sn,t.Scrollspy=Dn,t.Tab=Kn,t.Toast=ni,t.Tooltip=Be,Object.defineProperty(t,"__esModule",{value:!0})}); 13 14 15/*! 16 * Material Design for Bootstrap 4 17 * Version: MDB Pro 4.8.0 18 * 19 * 20 * Copyright: Material Design for Bootstrap 21 * https://mdbootstrap.com/c 22 * 23 * Read the license: https://mdbootstrap.com/license/ 24 * 25 * 26 * Documentation: https://mdbootstrap.com/ 27 * 28 * Getting started: https://mdbootstrap.com/getting-started/ 29 * 30 * Tutorials: https://mdbootstrap.com/bootstrap-tutorial/ 31 * 32 * Templates: https://mdbootstrap.com/templates/ 33 * 34 * Support: https://mdbootstrap.com/forums/forum/support/ 35 * 36 * Contact: [email protected] 37 * 38 * Attribution: Animate CSS, Twitter Bootstrap, Materialize CSS, Normalize CSS, Waves JS, WOW JS, Toastr, Chart.js , 39 * 40 */ 41 42 43/* 44 45 jquery.easing.js 46 velocity.js 47 chart.js 48 wow.js 49 scrolling-navbar.js 50 waves.js 51 forms-free.js 52 preloading.js 53 cards.js 54 character-counter.js 55 toastr.js 56 smooth-scroll.js 57 dropdown.js 58 buttons.js 59 sidenav.js 60 collapsible.js 61 jquery.easypiechart.js 62 range-input.js 63 file-input.js 64 material-select.js 65 picker.js 66 picker-date.js 67 picker-time.js 68 lightbox.js 69 jquery.sticky.js
vendor: 9,421 bytes, lines 70-286
70 scrollbar.js 71 chips.js 72 ofi.js 73 jarallax.js 74 jarallax-video.js 75 mdb-autocomplete.js 76 enhanced-modals.js 77 treeview.js 78 79*/ 80 81/* 82 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ 83 * 84 * Uses the built in easing capabilities added In jQuery 1.1 85 * to offer multiple easing options 86 * 87 * TERMS OF USE - jQuery Easing 88 * 89 * Open source under the BSD License. 90 * 91 * Copyright © 2008 George McGinley Smith 92 * All rights reserved. 93 * 94 * Redistribution and use in source and binary forms, with or without modification, 95 * are permitted provided that the following conditions are met: 96 * 97 * Redistributions of source code must retain the above copyright notice, this list of 98 * conditions and the following disclaimer. 99 * Redistributions in binary form must reproduce the above copyright notice, this list 100 * of conditions and the following disclaimer in the documentation and/or other materials 101 * provided with the distribution. 102 * 103 * Neither the name of the author nor the names of contributors may be used to endorse 104 * or promote products derived from this software without specific prior written permission. 105 * 106 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 107 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 108 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 109 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 110 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 111 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 112 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 113 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 114 * OF THE POSSIBILITY OF SUCH DAMAGE. 115 * 116*/ 117 118// t: current time, b: begInnIng value, c: change In value, d: duration 119jQuery.easing['jswing'] = jQuery.easing['swing']; 120 121jQuery.extend( jQuery.easing, 122 { 123 def: 'easeOutQuad', 124 swing: function (x, t, b, c, d) { 125 //alert(jQuery.easing.default); 126 return jQuery.easing[jQuery.easing.def](x, t, b, c, d); 127 }, 128 easeInQuad: function (x, t, b, c, d) { 129 return c*(t/=d)*t + b; 130 }, 131 easeOutQuad: function (x, t, b, c, d) { 132 return -c *(t/=d)*(t-2) + b; 133 }, 134 easeInOutQuad: function (x, t, b, c, d) { 135 if ((t/=d/2) < 1) return c/2*t*t + b; 136 return -c/2 * ((--t)*(t-2) - 1) + b; 137 }, 138 easeInCubic: function (x, t, b, c, d) { 139 return c*(t/=d)*t*t + b; 140 }, 141 easeOutCubic: function (x, t, b, c, d) { 142 return c*((t=t/d-1)*t*t + 1) + b; 143 }, 144 easeInOutCubic: function (x, t, b, c, d) { 145 if ((t/=d/2) < 1) return c/2*t*t*t + b; 146 return c/2*((t-=2)*t*t + 2) + b; 147 }, 148 easeInQuart: function (x, t, b, c, d) { 149 return c*(t/=d)*t*t*t + b; 150 }, 151 easeOutQuart: function (x, t, b, c, d) { 152 return -c * ((t=t/d-1)*t*t*t - 1) + b; 153 }, 154 easeInOutQuart: function (x, t, b, c, d) { 155 if ((t/=d/2) < 1) return c/2*t*t*t*t + b; 156 return -c/2 * ((t-=2)*t*t*t - 2) + b; 157 }, 158 easeInQuint: function (x, t, b, c, d) { 159 return c*(t/=d)*t*t*t*t + b; 160 }, 161 easeOutQuint: function (x, t, b, c, d) { 162 return c*((t=t/d-1)*t*t*t*t + 1) + b; 163 }, 164 easeInOutQuint: function (x, t, b, c, d) { 165 if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; 166 return c/2*((t-=2)*t*t*t*t + 2) + b; 167 }, 168 easeInSine: function (x, t, b, c, d) { 169 return -c * Math.cos(t/d * (Math.PI/2)) + c + b; 170 }, 171 easeOutSine: function (x, t, b, c, d) { 172 return c * Math.sin(t/d * (Math.PI/2)) + b; 173 }, 174 easeInOutSine: function (x, t, b, c, d) { 175 return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; 176 }, 177 easeInExpo: function (x, t, b, c, d) { 178 return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; 179 }, 180 easeOutExpo: function (x, t, b, c, d) { 181 return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; 182 }, 183 easeInOutExpo: function (x, t, b, c, d) { 184 if (t==0) return b; 185 if (t==d) return b+c; 186 if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; 187 return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; 188 }, 189 easeInCirc: function (x, t, b, c, d) { 190 return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; 191 }, 192 easeOutCirc: function (x, t, b, c, d) { 193 return c * Math.sqrt(1 - (t=t/d-1)*t) + b; 194 }, 195 easeInOutCirc: function (x, t, b, c, d) { 196 if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; 197 return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; 198 }, 199 easeInElastic: function (x, t, b, c, d) { 200 var s=1.70158;var p=0;var a=c; 201 if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; 202 if (a < Math.abs(c)) { a=c; var s=p/4; } 203 else var s = p/(2*Math.PI) * Math.asin (c/a); 204 return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; 205 }, 206 easeOutElastic: function (x, t, b, c, d) { 207 var s=1.70158;var p=0;var a=c; 208 if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; 209 if (a < Math.abs(c)) { a=c; var s=p/4; } 210 else var s = p/(2*Math.PI) * Math.asin (c/a); 211 return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; 212 }, 213 easeInOutElastic: function (x, t, b, c, d) { 214 var s=1.70158;var p=0;var a=c; 215 if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); 216 if (a < Math.abs(c)) { a=c; var s=p/4; } 217 else var s = p/(2*Math.PI) * Math.asin (c/a); 218 if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; 219 return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; 220 }, 221 easeInBack: function (x, t, b, c, d, s) { 222 if (s == undefined) s = 1.70158; 223 return c*(t/=d)*t*((s+1)*t - s) + b; 224 }, 225 easeOutBack: function (x, t, b, c, d, s) { 226 if (s == undefined) s = 1.70158; 227 return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; 228 }, 229 easeInOutBack: function (x, t, b, c, d, s) { 230 if (s == undefined) s = 1.70158; 231 if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; 232 return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; 233 }, 234 easeInBounce: function (x, t, b, c, d) { 235 return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; 236 }, 237 easeOutBounce: function (x, t, b, c, d) { 238 if ((t/=d) < (1/2.75)) { 239 return c*(7.5625*t*t) + b; 240 } else if (t < (2/2.75)) { 241 return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; 242 } else if (t < (2.5/2.75)) { 243 return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; 244 } else { 245 return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; 246 } 247 }, 248 easeInOutBounce: function (x, t, b, c, d) { 249 if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; 250 return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; 251 } 252 }); 253 254/* 255 * 256 * TERMS OF USE - EASING EQUATIONS 257 * 258 * Open source under the BSD License. 259 * 260 * Copyright © 2001 Robert Penner 261 * All rights reserved. 262 * 263 * Redistribution and use in source and binary forms, with or without modification, 264 * are permitted provided that the following conditions are met: 265 * 266 * Redistributions of source code must retain the above copyright notice, this list of 267 * conditions and the following disclaimer. 268 * Redistributions in binary form must reproduce the above copyright notice, this list 269 * of conditions and the following disclaimer in the documentation and/or other materials 270 * provided with the distribution. 271 * 272 * Neither the name of the author nor the names of contributors may be used to endorse 273 * or promote products derived from this software without specific prior written permission. 274 * 275 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 276 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 277 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 278 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 279 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 280 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 281 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 282 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 283 * OF THE POSSIBILITY OF SUCH DAMAGE. 284 * 285 */ 286/*! VelocityJS.org (1.2.3). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License */
vendor: 34,623 bytes, lines 287-290
287/*! VelocityJS.org jQuery Shim (1.0.1). (C) 2014 The jQuery Foundation. MIT @license: en.wikipedia.org/wiki/MIT_License. */ 288/*! Note that this has been modified by Materialize to confirm that Velocity is not already being imported. */ 289jQuery.Velocity?console.log("Velocity is already loaded. You may be needlessly importing Velocity again; note that Materialize includes Velocity."):(!function(e){function t(e){var t=e.length,a=r.type(e);return"function"===a||r.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===a||0===t||"number"==typeof t&&t>0&&t-1 in e}if(!e.jQuery){var r=function(e,t){return new r.fn.init(e,t)};r.isWindow=function(e){return null!=e&&e==e.window},r.type=function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[i.call(e)]||"object":typeof e},r.isArray=Array.isArray||function(e){return"array"===r.type(e)},r.isPlainObject=function(e){var t;if(!e||"object"!==r.type(e)||e.nodeType||r.isWindow(e))return!1;try{if(e.constructor&&!o.call(e,"constructor")&&!o.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(a){return!1}for(t in e);return void 0===t||o.call(e,t)},r.each=function(e,r,a){var n,o=0,i=e.length,s=t(e);if(a){if(s)for(;i>o&&(n=r.apply(e[o],a),n!==!1);o++);else for(o in e)if(n=r.apply(e[o],a),n===!1)break}else if(s)for(;i>o&&(n=r.call(e[o],o,e[o]),n!==!1);o++);else for(o in e)if(n=r.call(e[o],o,e[o]),n===!1)break;return e},r.data=function(e,t,n){if(void 0===n){var o=e[r.expando],i=o&&a[o];if(void 0===t)return i;if(i&&t in i)return i[t]}else if(void 0!==t){var o=e[r.expando]||(e[r.expando]=++r.uuid);return a[o]=a[o]||{},a[o][t]=n,n}},r.removeData=function(e,t){var n=e[r.expando],o=n&&a[n];o&&r.each(t,function(e,t){delete o[t]})},r.extend=function(){var e,t,a,n,o,i,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[l]||{},l++),"object"!=typeof s&&"function"!==r.type(s)&&(s={}),l===u&&(s=this,l--);u>l;l++)if(null!=(o=arguments[l]))for(n in o)e=s[n],a=o[n],s!==a&&(c&&a&&(r.isPlainObject(a)||(t=r.isArray(a)))?(t?(t=!1,i=e&&r.isArray(e)?e:[]):i=e&&r.isPlainObject(e)?e:{},s[n]=r.extend(c,i,a)):void 0!==a&&(s[n]=a));return s},r.queue=function(e,a,n){function o(e,r){var a=r||[];return null!=e&&(t(Object(e))?!function(e,t){for(var r=+t.length,a=0,n=e.length;r>a;)e[n++]=t[a++];if(r!==r)for(;void 0!==t[a];)e[n++]=t[a++];return e.length=n,e}(a,"string"==typeof e?[e]:e):[].push.call(a,e)),a}if(e){a=(a||"fx")+"queue";var i=r.data(e,a);return n?(!i||r.isArray(n)?i=r.data(e,a,o(n)):i.push(n),i):i||[]}},r.dequeue=function(e,t){r.each(e.nodeType?[e]:e,function(e,a){t=t||"fx";var n=r.queue(a,t),o=n.shift();"inprogress"===o&&(o=n.shift()),o&&("fx"===t&&n.unshift("inprogress"),o.call(a,function(){r.dequeue(a,t)}))})},r.fn=r.prototype={init:function(e){if(e.nodeType)return this[0]=e,this;throw new Error("Not a DOM node.")},offset:function(){var t=this[0].getBoundingClientRect?this[0].getBoundingClientRect():{top:0,left:0};return{top:t.top+(e.pageYOffset||document.scrollTop||0)-(document.clientTop||0),left:t.left+(e.pageXOffset||document.scrollLeft||0)-(document.clientLeft||0)}},position:function(){function e(){for(var e=this.offsetParent||document;e&&"html"===!e.nodeType.toLowerCase&&"static"===e.style.position;)e=e.offsetParent;return e||document}var t=this[0],e=e.apply(t),a=this.offset(),n=/^(?:body|html)$/i.test(e.nodeName)?{top:0,left:0}:r(e).offset();return a.top-=parseFloat(t.style.marginTop)||0,a.left-=parseFloat(t.style.marginLeft)||0,e.style&&(n.top+=parseFloat(e.style.borderTopWidth)||0,n.left+=parseFloat(e.style.borderLeftWidth)||0),{top:a.top-n.top,left:a.left-n.left}}};var a={};r.expando="velocity"+(new Date).getTime(),r.uuid=0;for(var n={},o=n.hasOwnProperty,i=n.toString,s="Boolean Number String Function Array Date RegExp Object Error".split(" "),l=0;l<s.length;l++)n["[object "+s[l]+"]"]=s[l].toLowerCase();r.fn.init.prototype=r.fn,e.Velocity={Utilities:r}}}(window),function(e){"object"==typeof module&&"object"==typeof module.exports?module.exports=e():"function"==typeof define&&define.amd?define(e):e()}(function(){return function(e,t,r,a){function n(e){for(var t=-1,r=e?e.length:0,a=[];++t<r;){var n=e[t];n&&a.push(n)}return a}function o(e){return m.isWrapped(e)?e=[].slice.call(e):m.isNode(e)&&(e=[e]),e}function i(e){var t=f.data(e,"velocity");return null===t?a:t}function s(e){return function(t){return Math.round(t*e)*(1/e)}}function l(e,r,a,n){function o(e,t){return 1-3*t+3*e}function i(e,t){return 3*t-6*e}function s(e){return 3*e}function l(e,t,r){return((o(t,r)*e+i(t,r))*e+s(t))*e}function u(e,t,r){return 3*o(t,r)*e*e+2*i(t,r)*e+s(t)}function c(t,r){for(var n=0;m>n;++n){var o=u(r,e,a);if(0===o)return r;var i=l(r,e,a)-t;r-=i/o}return r}function p(){for(var t=0;b>t;++t)w[t]=l(t*x,e,a)}function f(t,r,n){var o,i,s=0;do i=r+(n-r)/2,o=l(i,e,a)-t,o>0?n=i:r=i;while(Math.abs(o)>h&&++s<v);return i}function d(t){for(var r=0,n=1,o=b-1;n!=o&&w[n]<=t;++n)r+=x;--n;var i=(t-w[n])/(w[n+1]-w[n]),s=r+i*x,l=u(s,e,a);return l>=y?c(t,s):0==l?s:f(t,r,r+x)}function g(){V=!0,(e!=r||a!=n)&&p()}var m=4,y=.001,h=1e-7,v=10,b=11,x=1/(b-1),S="Float32Array"in t;if(4!==arguments.length)return!1;for(var P=0;4>P;++P)if("number"!=typeof arguments[P]||isNaN(arguments[P])||!isFinite(arguments[P]))return!1;e=Math.min(e,1),a=Math.min(a,1),e=Math.max(e,0),a=Math.max(a,0);var w=S?new Float32Array(b):new Array(b),V=!1,C=function(t){return V||g(),e===r&&a===n?t:0===t?0:1===t?1:l(d(t),r,n)};C.getControlPoints=function(){return[{x:e,y:r},{x:a,y:n}]};var T="generateBezier("+[e,r,a,n]+")";return C.toString=function(){return T},C}function u(e,t){var r=e;return m.isString(e)?b.Easings[e]||(r=!1):r=m.isArray(e)&&1===e.length?s.apply(null,e):m.isArray(e)&&2===e.length?x.apply(null,e.concat([t])):m.isArray(e)&&4===e.length?l.apply(null,e):!1,r===!1&&(r=b.Easings[b.defaults.easing]?b.defaults.easing:v),r}function c(e){if(e){var t=(new Date).getTime(),r=b.State.calls.length;r>1e4&&(b.State.calls=n(b.State.calls));for(var o=0;r>o;o++)if(b.State.calls[o]){var s=b.State.calls[o],l=s[0],u=s[2],d=s[3],g=!!d,y=null;d||(d=b.State.calls[o][3]=t-16);for(var h=Math.min((t-d)/u.duration,1),v=0,x=l.length;x>v;v++){var P=l[v],V=P.element;if(i(V)){var C=!1;if(u.display!==a&&null!==u.display&&"none"!==u.display){if("flex"===u.display){var T=["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex"];f.each(T,function(e,t){S.setPropertyValue(V,"display",t)})}S.setPropertyValue(V,"display",u.display)}u.visibility!==a&&"hidden"!==u.visibility&&S.setPropertyValue(V,"visibility",u.visibility);for(var k in P)if("element"!==k){var A,F=P[k],j=m.isString(F.easing)?b.Easings[F.easing]:F.easing;if(1===h)A=F.endValue;else{var E=F.endValue-F.startValue;if(A=F.startValue+E*j(h,u,E),!g&&A===F.currentValue)continue}if(F.currentValue=A,"tween"===k)y=A;else{if(S.Hooks.registered[k]){var H=S.Hooks.getRoot(k),N=i(V).rootPropertyValueCache[H];N&&(F.rootPropertyValue=N)}var L=S.setPropertyValue(V,k,F.currentValue+(0===parseFloat(A)?"":F.unitType),F.rootPropertyValue,F.scrollData);S.Hooks.registered[k]&&(i(V).rootPropertyValueCache[H]=S.Normalizations.registered[H]?S.Normalizations.registered[H]("extract",null,L[1]):L[1]),"transform"===L[0]&&(C=!0)}}u.mobileHA&&i(V).transformCache.translate3d===a&&(i(V).transformCache.translate3d="(0px, 0px, 0px)",C=!0),C&&S.flushTransformCache(V)}}u.display!==a&&"none"!==u.display&&(b.State.calls[o][2].display=!1),u.visibility!==a&&"hidden"!==u.visibility&&(b.State.calls[o][2].visibility=!1),u.progress&&u.progress.call(s[1],s[1],h,Math.max(0,d+u.duration-t),d,y),1===h&&p(o)}}b.State.isTicking&&w(c)}function p(e,t){if(!b.State.calls[e])return!1;for(var r=b.State.calls[e][0],n=b.State.calls[e][1],o=b.State.calls[e][2],s=b.State.calls[e][4],l=!1,u=0,c=r.length;c>u;u++){var p=r[u].element;if(t||o.loop||("none"===o.display&&S.setPropertyValue(p,"display",o.display),"hidden"===o.visibility&&S.setPropertyValue(p,"visibility",o.visibility)),o.loop!==!0&&(f.queue(p)[1]===a||!/\.velocityQueueEntryFlag/i.test(f.queue(p)[1]))&&i(p)){i(p).isAnimating=!1,i(p).rootPropertyValueCache={};var d=!1;f.each(S.Lists.transforms3D,function(e,t){var r=/^scale/.test(t)?1:0,n=i(p).transformCache[t];i(p).transformCache[t]!==a&&new RegExp("^\\("+r+"[^.]").test(n)&&(d=!0,delete i(p).transformCache[t])}),o.mobileHA&&(d=!0,delete i(p).transformCache.translate3d),d&&S.flushTransformCache(p),S.Values.removeClass(p,"velocity-animating")}if(!t&&o.complete&&!o.loop&&u===c-1)try{o.complete.call(n,n)}catch(g){setTimeout(function(){throw g},1)}s&&o.loop!==!0&&s(n),i(p)&&o.loop===!0&&!t&&(f.each(i(p).tweensContainer,function(e,t){/^rotate/.test(e)&&360===parseFloat(t.endValue)&&(t.endValue=0,t.startValue=360),/^backgroundPosition/.test(e)&&100===parseFloat(t.endValue)&&"%"===t.unitType&&(t.endValue=0,t.startValue=100)}),b(p,"reverse",{loop:!0,delay:o.delay})),o.queue!==!1&&f.dequeue(p,o.queue)}b.State.calls[e]=!1;for(var m=0,y=b.State.calls.length;y>m;m++)if(b.State.calls[m]!==!1){l=!0;break}l===!1&&(b.State.isTicking=!1,delete b.State.calls,b.State.calls=[])}var f,d=function(){if(r.documentMode)return r.documentMode;for(var e=7;e>4;e--){var t=r.createElement("div");if(t.innerHTML="<!--[if IE "+e+"]><span></span><![endif]-->",t.getElementsByTagName("span").length)return t=null,e}return a}(),g=function(){var e=0;return t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||function(t){var r,a=(new Date).getTime();return r=Math.max(0,16-(a-e)),e=a+r,setTimeout(function(){t(a+r)},r)}}(),m={isString:function(e){return"string"==typeof e},isArray:Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},isFunction:function(e){return"[object Function]"===Object.prototype.toString.call(e)},isNode:function(e){return e&&e.nodeType},isNodeList:function(e){return"object"==typeof e&&/^\[object (HTMLCollection|NodeList|Object)\]$/.test(Object.prototype.toString.call(e))&&e.length!==a&&(0===e.length||"object"==typeof e[0]&&e[0].nodeType>0)},isWrapped:function(e){return e&&(e.jquery||t.Zepto&&t.Zepto.zepto.isZ(e))},isSVG:function(e){return t.SVGElement&&e instanceof t.SVGElement},isEmptyObject:function(e){for(var t in e)return!1;return!0}},y=!1;if(e.fn&&e.fn.jquery?(f=e,y=!0):f=t.Velocity.Utilities,8>=d&&!y)throw new Error("Velocity: IE8 and below require jQuery to be loaded before Velocity.");if(7>=d)return void(jQuery.fn.velocity=jQuery.fn.animate);var h=400,v="swing",b={State:{isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),isAndroid:/Android/i.test(navigator.userAgent),isGingerbread:/Android 2\.3\.[3-7]/i.test(navigator.userAgent),isChrome:t.chrome,isFirefox:/Firefox/i.test(navigator.userAgent),prefixElement:r.createElement("div"),prefixMatches:{},scrollAnchor:null,scrollPropertyLeft:null,scrollPropertyTop:null,isTicking:!1,calls:[]},CSS:{},Utilities:f,Redirects:{},Easings:{},Promise:t.Promise,defaults:{queue:"",duration:h,easing:v,begin:a,complete:a,progress:a,display:a,visibility:a,loop:!1,delay:!1,mobileHA:!0,_cacheValues:!0},init:function(e){f.data(e,"velocity",{isSVG:m.isSVG(e),isAnimating:!1,computedStyle:null,tweensContainer:null,rootPropertyValueCache:{},transformCache:{}})},hook:null,mock:!1,version:{major:1,minor:2,patch:2},debug:!1};t.pageYOffset!==a?(b.State.scrollAnchor=t,b.State.scrollPropertyLeft="pageXOffset",b.State.scrollPropertyTop="pageYOffset"):(b.State.scrollAnchor=r.documentElement||r.body.parentNode||r.body,b.State.scrollPropertyLeft="scrollLeft",b.State.scrollPropertyTop="scrollTop");var x=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,r,a){var n={x:t.x+a.dx*r,v:t.v+a.dv*r,tension:t.tension,friction:t.friction};return{dx:n.v,dv:e(n)}}function r(r,a){var n={dx:r.v,dv:e(r)},o=t(r,.5*a,n),i=t(r,.5*a,o),s=t(r,a,i),l=1/6*(n.dx+2*(o.dx+i.dx)+s.dx),u=1/6*(n.dv+2*(o.dv+i.dv)+s.dv);return r.x=r.x+l*a,r.v=r.v+u*a,r}return function a(e,t,n){var o,i,s,l={x:-1,v:0,tension:null,friction:null},u=[0],c=0,p=1e-4,f=.016;for(e=parseFloat(e)||500,t=parseFloat(t)||20,n=n||null,l.tension=e,l.friction=t,o=null!==n,o?(c=a(e,t),i=c/n*f):i=f;s=r(s||l,i),u.push(1+s.x),c+=16,Math.abs(s.x)>p&&Math.abs(s.v)>p;);return o?function(e){return u[e*(u.length-1)|0]}:c}}();b.Easings={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},spring:function(e){return 1-Math.cos(4.5*e*Math.PI)*Math.exp(6*-e)}},f.each([["ease",[.25,.1,.25,1]],["ease-in",[.42,0,1,1]],["ease-out",[0,0,.58,1]],["ease-in-out",[.42,0,.58,1]],["easeInSine",[.47,0,.745,.715]],["easeOutSine",[.39,.575,.565,1]],["easeInOutSine",[.445,.05,.55,.95]],["easeInQuad",[.55,.085,.68,.53]],["easeOutQuad",[.25,.46,.45,.94]],["easeInOutQuad",[.455,.03,.515,.955]],["easeInCubic",[.55,.055,.675,.19]],["easeOutCubic",[.215,.61,.355,1]],["easeInOutCubic",[.645,.045,.355,1]],["easeInQuart",[.895,.03,.685,.22]],["easeOutQuart",[.165,.84,.44,1]],["easeInOutQuart",[.77,0,.175,1]],["easeInQuint",[.755,.05,.855,.06]],["easeOutQuint",[.23,1,.32,1]],["easeInOutQuint",[.86,0,.07,1]],["easeInExpo",[.95,.05,.795,.035]],["easeOutExpo",[.19,1,.22,1]],["easeInOutExpo",[1,0,0,1]],["easeInCirc",[.6,.04,.98,.335]],["easeOutCirc",[.075,.82,.165,1]],["easeInOutCirc",[.785,.135,.15,.86]]],function(e,t){b.Easings[t[0]]=l.apply(null,t[1])});var S=b.CSS={RegEx:{isHex:/^#([A-f\d]{3}){1,2}$/i,valueUnwrap:/^[A-z]+\((.*)\)$/i,wrappedValueAlreadyExtracted:/[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,valueSplit:/([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/gi},Lists:{colors:["fill","stroke","stopColor","color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],transformsBase:["translateX","translateY","scale","scaleX","scaleY","skewX","skewY","rotateZ"],transforms3D:["transformPerspective","translateZ","scaleZ","rotateX","rotateY"]},Hooks:{templates:{textShadow:["Color X Y Blur","black 0px 0px 0px"],boxShadow:["Color X Y Blur Spread","black 0px 0px 0px 0px"],clip:["Top Right Bottom Left","0px 0px 0px 0px"],backgroundPosition:["X Y","0% 0%"],transformOrigin:["X Y Z","50% 50% 0px"],perspectiveOrigin:["X Y","50% 50%"]},registered:{},register:function(){for(var e=0;e<S.Lists.colors.length;e++){var t="color"===S.Lists.colors[e]?"0 0 0 1":"255 255 255 1";S.Hooks.templates[S.Lists.colors[e]]=["Red Green Blue Alpha",t]}var r,a,n;if(d)for(r in S.Hooks.templates){a=S.Hooks.templates[r],n=a[0].split(" ");var o=a[1].match(S.RegEx.valueSplit);"Color"===n[0]&&(n.push(n.shift()),o.push(o.shift()),S.Hooks.templates[r]=[n.join(" "),o.join(" ")])}for(r in S.Hooks.templates){a=S.Hooks.templates[r],n=a[0].split(" ");for(var e in n){var i=r+n[e],s=e;S.Hooks.registered[i]=[r,s]}}},getRoot:function(e){var t=S.Hooks.registered[e];return t?t[0]:e},cleanRootPropertyValue:function(e,t){return S.RegEx.valueUnwrap.test(t)&&(t=t.match(S.RegEx.valueUnwrap)[1]),S.Values.isCSSNullValue(t)&&(t=S.Hooks.templates[e][1]),t},extractValue:function(e,t){var r=S.Hooks.registered[e];if(r){var a=r[0],n=r[1];return t=S.Hooks.cleanRootPropertyValue(a,t),t.toString().match(S.RegEx.valueSplit)[n]}return t},injectValue:function(e,t,r){var a=S.Hooks.registered[e];if(a){var n,o,i=a[0],s=a[1];return r=S.Hooks.cleanRootPropertyValue(i,r),n=r.toString().match(S.RegEx.valueSplit),n[s]=t,o=n.join(" ")}return r}},Normalizations:{registered:{clip:function(e,t,r){switch(e){case"name":return"clip";case"extract":var a;return S.RegEx.wrappedValueAlreadyExtracted.test(r)?a=r:(a=r.toString().match(S.RegEx.valueUnwrap),a=a?a[1].replace(/,(\s+)?/g," "):r),a;case"inject":return"rect("+r+")"}},blur:function(e,t,r){switch(e){case"name":return b.State.isFirefox?"filter":"-webkit-filter";case"extract":var a=parseFloat(r);if(!a&&0!==a){var n=r.toString().match(/blur\(([0-9]+[A-z]+)\)/i);a=n?n[1]:0}return a;case"inject":return parseFloat(r)?"blur("+r+")":"none"}},opacity:function(e,t,r){if(8>=d)switch(e){case"name":return"filter";case"extract":var a=r.toString().match(/alpha\(opacity=(.*)\)/i);return r=a?a[1]/100:1;case"inject":return t.style.zoom=1,parseFloat(r)>=1?"":"alpha(opacity="+parseInt(100*parseFloat(r),10)+")"}else switch(e){case"name":return"opacity";case"extract":return r;case"inject":return r}}},register:function(){9>=d||b.State.isGingerbread||(S.Lists.transformsBase=S.Lists.transformsBase.concat(S.Lists.transforms3D));for(var e=0;e<S.Lists.transformsBase.length;e++)!function(){var t=S.Lists.transformsBase[e];S.Normalizations.registered[t]=function(e,r,n){switch(e){case"name":return"transform";case"extract":return i(r)===a||i(r).transformCache[t]===a?/^scale/i.test(t)?1:0:i(r).transformCache[t].replace(/[()]/g,"");case"inject":var o=!1;switch(t.substr(0,t.length-1)){case"translate":o=!/(%|px|em|rem|vw|vh|\d)$/i.test(n);break;case"scal":case"scale":b.State.isAndroid&&i(r).transformCache[t]===a&&1>n&&(n=1),o=!/(\d)$/i.test(n);break;case"skew":o=!/(deg|\d)$/i.test(n);break;case"rotate":o=!/(deg|\d)$/i.test(n)}return o||(i(r).transformCache[t]="("+n+")"),i(r).transformCache[t]}}}();for(var e=0;e<S.Lists.colors.length;e++)!function(){var t=S.Lists.colors[e];S.Normalizations.registered[t]=function(e,r,n){switch(e){case"name":return t;case"extract":var o;if(S.RegEx.wrappedValueAlreadyExtracted.test(n))o=n;else{var i,s={black:"rgb(0, 0, 0)",blue:"rgb(0, 0, 255)",gray:"rgb(128, 128, 128)",green:"rgb(0, 128, 0)",red:"rgb(255, 0, 0)",white:"rgb(255, 255, 255)"};/^[A-z]+$/i.test(n)?i=s[n]!==a?s[n]:s.black:S.RegEx.isHex.test(n)?i="rgb("+S.Values.hexToRgb(n).join(" ")+")":/^rgba?\(/i.test(n)||(i=s.black),o=(i||n).toString().match(S.RegEx.valueUnwrap)[1].replace(/,(\s+)?/g," ")}return 8>=d||3!==o.split(" ").length||(o+=" 1"),o;case"inject":return 8>=d?4===n.split(" ").length&&(n=n.split(/\s+/).slice(0,3).join(" ")):3===n.split(" ").length&&(n+=" 1"),(8>=d?"rgb":"rgba")+"("+n.replace(/\s+/g,",").replace(/\.(\d)+(?=,)/g,"")+")"}}}()}},Names:{camelCase:function(e){return e.replace(/-(\w)/g,function(e,t){return t.toUpperCase()})},SVGAttribute:function(e){var t="width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";return(d||b.State.isAndroid&&!b.State.isChrome)&&(t+="|transform"),new RegExp("^("+t+")$","i").test(e)},prefixCheck:function(e){if(b.State.prefixMatches[e])return[b.State.prefixMatches[e],!0];for(var t=["","Webkit","Moz","ms","O"],r=0,a=t.length;a>r;r++){var n;if(n=0===r?e:t[r]+e.replace(/^\w/,function(e){return e.toUpperCase()}),m.isString(b.State.prefixElement.style[n]))return b.State.prefixMatches[e]=n,[n,!0]}return[e,!1]}},Values:{hexToRgb:function(e){var t,r=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;return e=e.replace(r,function(e,t,r,a){return t+t+r+r+a+a}),t=a.exec(e),t?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]:[0,0,0]},isCSSNullValue:function(e){return 0==e||/^(none|auto|transparent|(rgba\(0, ?0, ?0, ?0\)))$/i.test(e)},getUnitType:function(e){return/^(rotate|skew)/i.test(e)?"deg":/(^(scale|scaleX|scaleY|scaleZ|alpha|flexGrow|flexHeight|zIndex|fontWeight)$)|((opacity|red|green|blue|alpha)$)/i.test(e)?"":"px"},getDisplayType:function(e){var t=e&&e.tagName.toString().toLowerCase();return/^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|var|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i.test(t)?"inline":/^(li)$/i.test(t)?"list-item":/^(tr)$/i.test(t)?"table-row":/^(table)$/i.test(t)?"table":/^(tbody)$/i.test(t)?"table-row-group":"block"},addClass:function(e,t){e.classList?e.classList.add(t):e.className+=(e.className.length?" ":"")+t},removeClass:function(e,t){e.classList?e.classList.remove(t):e.className=e.className.toString().replace(new RegExp("(^|\\s)"+t.split(" ").join("|")+"(\\s|$)","gi")," ")}},getPropertyValue:function(e,r,n,o){function s(e,r){function n(){u&&S.setPropertyValue(e,"display","none")}var l=0;if(8>=d)l=f.css(e,r);else{var u=!1;if(/^(width|height)$/.test(r)&&0===S.getPropertyValue(e,"display")&&(u=!0,S.setPropertyValue(e,"display",S.Values.getDisplayType(e))),!o){if("height"===r&&"border-box"!==S.getPropertyValue(e,"boxSizing").toString().toLowerCase()){var c=e.offsetHeight-(parseFloat(S.getPropertyValue(e,"borderTopWidth"))||0)-(parseFloat(S.getPropertyValue(e,"borderBottomWidth"))||0)-(parseFloat(S.getPropertyValue(e,"paddingTop"))||0)-(parseFloat(S.getPropertyValue(e,"paddingBottom"))||0);return n(),c}if("width"===r&&"border-box"!==S.getPropertyValue(e,"boxSizing").toString().toLowerCase()){var p=e.offsetWidth-(parseFloat(S.getPropertyValue(e,"borderLeftWidth"))||0)-(parseFloat(S.getPropertyValue(e,"borderRightWidth"))||0)-(parseFloat(S.getPropertyValue(e,"paddingLeft"))||0)-(parseFloat(S.getPropertyValue(e,"paddingRight"))||0);return n(),p}}var g;g=i(e)===a?t.getComputedStyle(e,null):i(e).computedStyle?i(e).computedStyle:i(e).computedStyle=t.getComputedStyle(e,null),"borderColor"===r&&(r="borderTopColor"),l=9===d&&"filter"===r?g.getPropertyValue(r):g[r],(""===l||null===l)&&(l=e.style[r]),n()}if("auto"===l&&/^(top|right|bottom|left)$/i.test(r)){var m=s(e,"position");("fixed"===m||"absolute"===m&&/top|left/i.test(r))&&(l=f(e).position()[r]+"px")}return l}var l;if(S.Hooks.registered[r]){var u=r,c=S.Hooks.getRoot(u);n===a&&(n=S.getPropertyValue(e,S.Names.prefixCheck(c)[0])),S.Normalizations.registered[c]&&(n=S.Normalizations.registered[c]("extract",e,n)),l=S.Hooks.extractValue(u,n)}else if(S.Normalizations.registered[r]){var p,g;p=S.Normalizations.registered[r]("name",e),"transform"!==p&&(g=s(e,S.Names.prefixCheck(p)[0]),S.Values.isCSSNullValue(g)&&S.Hooks.templates[r]&&(g=S.Hooks.templates[r][1])),l=S.Normalizations.registered[r]("extract",e,g)}if(!/^[\d-]/.test(l))if(i(e)&&i(e).isSVG&&S.Names.SVGAttribute(r))if(/^(height|width)$/i.test(r))try{l=e.getBBox()[r]}catch(m){l=0}else l=e.getAttribute(r);else l=s(e,S.Names.prefixCheck(r)[0]);return S.Values.isCSSNullValue(l)&&(l=0),b.debug>=2&&console.log("Get "+r+": "+l),l},setPropertyValue:function(e,r,a,n,o){var s=r;if("scroll"===r)o.container?o.container["scroll"+o.direction]=a:"Left"===o.direction?t.scrollTo(a,o.alternateValue):t.scrollTo(o.alternateValue,a);else if(S.Normalizations.registered[r]&&"transform"===S.Normalizations.registered[r]("name",e))S.Normalizations.registered[r]("inject",e,a),s="transform",a=i(e).transformCache[r];else{if(S.Hooks.registered[r]){var l=r,u=S.Hooks.getRoot(r);n=n||S.getPropertyValue(e,u),a=S.Hooks.injectValue(l,a,n),r=u}if(S.Normalizations.registered[r]&&(a=S.Normalizations.registered[r]("inject",e,a),r=S.Normalizations.registered[r]("name",e)),s=S.Names.prefixCheck(r)[0],8>=d)try{e.style[s]=a}catch(c){b.debug&&console.log("Browser does not support ["+a+"] for ["+s+"]")}else i(e)&&i(e).isSVG&&S.Names.SVGAttribute(r)?e.setAttribute(r,a):e.style[s]=a;b.debug>=2&&console.log("Set "+r+" ("+s+"): "+a)}return[s,a]},flushTransformCache:function(e){function t(t){return parseFloat(S.getPropertyValue(e,t))}var r="";if((d||b.State.isAndroid&&!b.State.isChrome)&&i(e).isSVG){var a={translate:[t("translateX"),t("translateY")],skewX:[t("skewX")],skewY:[t("skewY")],scale:1!==t("scale")?[t("scale"),t("scale")]:[t("scaleX"),t("scaleY")],rotate:[t("rotateZ"),0,0]};f.each(i(e).transformCache,function(e){/^translate/i.test(e)?e="translate":/^scale/i.test(e)?e="scale":/^rotate/i.test(e)&&(e="rotate"),a[e]&&(r+=e+"("+a[e].join(" ")+") ",delete a[e])})}else{var n,o;f.each(i(e).transformCache,function(t){return n=i(e).transformCache[t],"transformPerspective"===t?(o=n,!0):(9===d&&"rotateZ"===t&&(t="rotate"),void(r+=t+n+" "))}),o&&(r="perspective"+o+" "+r)}S.setPropertyValue(e,"transform",r)}};S.Hooks.register(),S.Normalizations.register(),b.hook=function(e,t,r){var n=a;return e=o(e),f.each(e,function(e,o){if(i(o)===a&&b.init(o),r===a)n===a&&(n=b.CSS.getPropertyValue(o,t));else{var s=b.CSS.setPropertyValue(o,t,r);"transform"===s[0]&&b.CSS.flushTransformCache(o),n=s}}),n};var P=function(){function e(){return s?k.promise||null:l}function n(){function e(e){function p(e,t){var r=a,n=a,i=a;return m.isArray(e)?(r=e[0],!m.isArray(e[1])&&/^[\d-]/.test(e[1])||m.isFunction(e[1])||S.RegEx.isHex.test(e[1])?i=e[1]:(m.isString(e[1])&&!S.RegEx.isHex.test(e[1])||m.isArray(e[1]))&&(n=t?e[1]:u(e[1],s.duration),e[2]!==a&&(i=e[2]))):r=e,t||(n=n||s.easing),m.isFunction(r)&&(r=r.call(o,V,w)),m.isFunction(i)&&(i=i.call(o,V,w)),[r||0,n,i]}function d(e,t){var r,a;return a=(t||"0").toString().toLowerCase().replace(/[%A-z]+$/,function(e){return r=e,""}),r||(r=S.Values.getUnitType(e)),[a,r]}function h(){var e={myParent:o.parentNode||r.body,position:S.getPropertyValue(o,"position"),fontSize:S.getPropertyValue(o,"fontSize")},a=e.position===L.lastPosition&&e.myParent===L.lastParent,n=e.fontSize===L.lastFontSize;L.lastParent=e.myParent,L.lastPosition=e.position,L.lastFontSize=e.fontSize;var s=100,l={};if(n&&a)l.emToPx=L.lastEmToPx,l.percentToPxWidth=L.lastPercentToPxWidth,l.percentToPxHeight=L.lastPercentToPxHeight;else{var u=i(o).isSVG?r.createElementNS("http://www.w3.org/2000/svg","rect"):r.createElement("div");b.init(u),e.myParent.appendChild(u),f.each(["overflow","overflowX","overflowY"],function(e,t){b.CSS.setPropertyValue(u,t,"hidden")}),b.CSS.setPropertyValue(u,"position",e.position),b.CSS.setPropertyValue(u,"fontSize",e.fontSize),b.CSS.setPropertyValue(u,"boxSizing","content-box"),f.each(["minWidth","maxWidth","width","minHeight","maxHeight","height"],function(e,t){b.CSS.setPropertyValue(u,t,s+"%")}),b.CSS.setPropertyValue(u,"paddingLeft",s+"em"),l.percentToPxWidth=L.lastPercentToPxWidth=(parseFloat(S.getPropertyValue(u,"width",null,!0))||1)/s,l.percentToPxHeight=L.lastPercentToPxHeight=(parseFloat(S.getPropertyValue(u,"height",null,!0))||1)/s,l.emToPx=L.lastEmToPx=(parseFloat(S.getPropertyValue(u,"paddingLeft"))||1)/s,e.myParent.removeChild(u)}return null===L.remToPx&&(L.remToPx=parseFloat(S.getPropertyValue(r.body,"fontSize"))||16),null===L.vwToPx&&(L.vwToPx=parseFloat(t.innerWidth)/100,L.vhToPx=parseFloat(t.innerHeight)/100),l.remToPx=L.remToPx,l.vwToPx=L.vwToPx,l.vhToPx=L.vhToPx,b.debug>=1&&console.log("Unit ratios: "+JSON.stringify(l),o),l}if(s.begin&&0===V)try{s.begin.call(g,g)}catch(x){setTimeout(function(){throw x},1)}if("scroll"===A){var P,C,T,F=/^x$/i.test(s.axis)?"Left":"Top",j=parseFloat(s.offset)||0;s.container?m.isWrapped(s.container)||m.isNode(s.container)?(s.container=s.container[0]||s.container,P=s.container["scroll"+F],T=P+f(o).position()[F.toLowerCase()]+j):s.container=null:(P=b.State.scrollAnchor[b.State["scrollProperty"+F]],C=b.State.scrollAnchor[b.State["scrollProperty"+("Left"===F?"Top":"Left")]],T=f(o).offset()[F.toLowerCase()]+j),l={scroll:{rootPropertyValue:!1,startValue:P,currentValue:P,endValue:T,unitType:"",easing:s.easing,scrollData:{container:s.container,direction:F,alternateValue:C}},element:o},b.debug&&console.log("tweensContainer (scroll): ",l.scroll,o)}else if("reverse"===A){if(!i(o).tweensContainer)return void f.dequeue(o,s.queue);"none"===i(o).opts.display&&(i(o).opts.display="auto"),"hidden"===i(o).opts.visibility&&(i(o).opts.visibility="visible"),i(o).opts.loop=!1,i(o).opts.begin=null,i(o).opts.complete=null,v.easing||delete s.easing,v.duration||delete s.duration,s=f.extend({},i(o).opts,s);var E=f.extend(!0,{},i(o).tweensContainer);for(var H in E)if("element"!==H){var N=E[H].startValue;E[H].startValue=E[H].currentValue=E[H].endValue,E[H].endValue=N,m.isEmptyObject(v)||(E[H].easing=s.easing),b.debug&&console.log("reverse tweensContainer ("+H+"): "+JSON.stringify(E[H]),o)}l=E}else if("start"===A){var E;i(o).tweensContainer&&i(o).isAnimating===!0&&(E=i(o).tweensContainer),f.each(y,function(e,t){if(RegExp("^"+S.Lists.colors.join("$|^")+"$").test(e)){var r=p(t,!0),n=r[0],o=r[1],i=r[2];if(S.RegEx.isHex.test(n)){for(var s=["Red","Green","Blue"],l=S.Values.hexToRgb(n),u=i?S.Values.hexToRgb(i):a,c=0;c<s.length;c++){var f=[l[c]];o&&f.push(o),u!==a&&f.push(u[c]),y[e+s[c]]=f}delete y[e]}}});for(var z in y){var O=p(y[z]),q=O[0],$=O[1],M=O[2];z=S.Names.camelCase(z);var I=S.Hooks.getRoot(z),B=!1;if(i(o).isSVG||"tween"===I||S.Names.prefixCheck(I)[1]!==!1||S.Normalizations.registered[I]!==a){(s.display!==a&&null!==s.display&&"none"!==s.display||s.visibility!==a&&"hidden"!==s.visibility)&&/opacity|filter/.test(z)&&!M&&0!==q&&(M=0),s._cacheValues&&E&&E[z]?(M===a&&(M=E[z].endValue+E[z].unitType),B=i(o).rootPropertyValueCache[I]):S.Hooks.registered[z]?M===a?(B=S.getPropertyValue(o,I),M=S.getPropertyValue(o,z,B)):B=S.Hooks.templates[I][1]:M===a&&(M=S.getPropertyValue(o,z));var W,G,Y,D=!1;if(W=d(z,M),M=W[0],Y=W[1],W=d(z,q),q=W[0].replace(/^([+-\/*])=/,function(e,t){return D=t,""}),G=W[1],M=parseFloat(M)||0,q=parseFloat(q)||0,"%"===G&&(/^(fontSize|lineHeight)$/.test(z)?(q/=100,G="em"):/^scale/.test(z)?(q/=100,G=""):/(Red|Green|Blue)$/i.test(z)&&(q=q/100*255,G="")),/[\/*]/.test(D))G=Y;else if(Y!==G&&0!==M)if(0===q)G=Y;else{n=n||h();var Q=/margin|padding|left|right|width|text|word|letter/i.test(z)||/X$/.test(z)||"x"===z?"x":"y";switch(Y){case"%":M*="x"===Q?n.percentToPxWidth:n.percentToPxHeight;break;case"px":break;default:M*=n[Y+"ToPx"]}switch(G){case"%":M*=1/("x"===Q?n.percentToPxWidth:n.percentToPxHeight);break;case"px":break;default:M*=1/n[G+"ToPx"]}}switch(D){case"+":q=M+q;break;case"-":q=M-q;break;case"*":q=M*q;break;case"/":q=M/q}l[z]={rootPropertyValue:B,startValue:M,currentValue:M,endValue:q,unitType:G,easing:$},b.debug&&console.log("tweensContainer ("+z+"): "+JSON.stringify(l[z]),o)}else b.debug&&console.log("Skipping ["+I+"] due to a lack of browser support.")}l.element=o}l.element&&(S.Values.addClass(o,"velocity-animating"),R.push(l),""===s.queue&&(i(o).tweensContainer=l,i(o).opts=s),i(o).isAnimating=!0,V===w-1?(b.State.calls.push([R,g,s,null,k.resolver]),b.State.isTicking===!1&&(b.State.isTicking=!0,c())):V++)}var n,o=this,s=f.extend({},b.defaults,v),l={};switch(i(o)===a&&b.init(o),parseFloat(s.delay)&&s.queue!==!1&&f.queue(o,s.queue,function(e){b.velocityQueueEntryFlag=!0,i(o).delayTimer={setTimeout:setTimeout(e,parseFloat(s.delay)),next:e}}),s.duration.toString().toLowerCase()){case"fast":s.duration=200;break;case"normal":s.duration=h;break;case"slow":s.duration=600;break;default:s.duration=parseFloat(s.duration)||1}b.mock!==!1&&(b.mock===!0?s.duration=s.delay=1:(s.duration*=parseFloat(b.mock)||1,s.delay*=parseFloat(b.mock)||1)),s.easing=u(s.easing,s.duration),s.begin&&!m.isFunction(s.begin)&&(s.begin=null),s.progress&&!m.isFunction(s.progress)&&(s.progress=null),s.complete&&!m.isFunction(s.complete)&&(s.complete=null),s.display!==a&&null!==s.display&&(s.display=s.display.toString().toLowerCase(),"auto"===s.display&&(s.display=b.CSS.Values.getDisplayType(o))),s.visibility!==a&&null!==s.visibility&&(s.visibility=s.visibility.toString().toLowerCase()),s.mobileHA=s.mobileHA&&b.State.isMobile&&!b.State.isGingerbread,s.queue===!1?s.delay?setTimeout(e,s.delay):e():f.queue(o,s.queue,function(t,r){return r===!0?(k.promise&&k.resolver(g),!0):(b.velocityQueueEntryFlag=!0,void e(t))}),""!==s.queue&&"fx"!==s.queue||"inprogress"===f.queue(o)[0]||f.dequeue(o)}var s,l,d,g,y,v,x=arguments[0]&&(arguments[0].p||f.isPlainObject(arguments[0].properties)&&!arguments[0].properties.names||m.isString(arguments[0].properties));if(m.isWrapped(this)?(s=!1,d=0,g=this,l=this):(s=!0,d=1,g=x?arguments[0].elements||arguments[0].e:arguments[0]),g=o(g)){x?(y=arguments[0].properties||arguments[0].p,v=arguments[0].options||arguments[0].o):(y=arguments[d],v=arguments[d+1]);var w=g.length,V=0;if(!/^(stop|finish)$/i.test(y)&&!f.isPlainObject(v)){var C=d+1;v={};for(var T=C;T<arguments.length;T++)m.isArray(arguments[T])||!/^(fast|normal|slow)$/i.test(arguments[T])&&!/^\d/.test(arguments[T])?m.isString(arguments[T])||m.isArray(arguments[T])?v.easing=arguments[T]:m.isFunction(arguments[T])&&(v.complete=arguments[T]):v.duration=arguments[T]}var k={promise:null,resolver:null,rejecter:null};s&&b.Promise&&(k.promise=new b.Promise(function(e,t){k.resolver=e,k.rejecter=t}));var A;switch(y){case"scroll":A="scroll";break;case"reverse":A="reverse";break;case"finish":case"stop":f.each(g,function(e,t){i(t)&&i(t).delayTimer&&(clearTimeout(i(t).delayTimer.setTimeout),i(t).delayTimer.next&&i(t).delayTimer.next(),delete i(t).delayTimer)});var F=[];return f.each(b.State.calls,function(e,t){t&&f.each(t[1],function(r,n){var o=v===a?"":v;return o===!0||t[2].queue===o||v===a&&t[2].queue===!1?void f.each(g,function(r,a){a===n&&((v===!0||m.isString(v))&&(f.each(f.queue(a,m.isString(v)?v:""),function(e,t){ 290 m.isFunction(t)&&t(null,!0)}),f.queue(a,m.isString(v)?v:"",[])),"stop"===y?(i(a)&&i(a).tweensContainer&&o!==!1&&f.each(i(a).tweensContainer,function(e,t){t.endValue=t.currentValue}),F.push(e)):"finish"===y&&(t[2].duration=1))}):!0})}),"stop"===y&&(f.each(F,function(e,t){p(t,!0)}),k.promise&&k.resolver(g)),e();default:if(!f.isPlainObject(y)||m.isEmptyObject(y)){if(m.isString(y)&&b.Redirects[y]){var j=f.extend({},v),E=j.duration,H=j.delay||0;return j.backwards===!0&&(g=f.extend(!0,[],g).reverse()),f.each(g,function(e,t){parseFloat(j.stagger)?j.delay=H+parseFloat(j.stagger)*e:m.isFunction(j.stagger)&&(j.delay=H+j.stagger.call(t,e,w)),j.drag&&(j.duration=parseFloat(E)||(/^(callout|transition)/.test(y)?1e3:h),j.duration=Math.max(j.duration*(j.backwards?1-e/w:(e+1)/w),.75*j.duration,200)),b.Redirects[y].call(t,t,j||{},e,w,g,k.promise?k:a)}),e()}var N="Velocity: First argument ("+y+") was not a property map, a known action, or a registered redirect. Aborting.";return k.promise?k.rejecter(new Error(N)):console.log(N),e()}A="start"}var L={lastParent:null,lastPosition:null,lastFontSize:null,lastPercentToPxWidth:null,lastPercentToPxHeight:null,lastEmToPx:null,remToPx:null,vwToPx:null,vhToPx:null},R=[];f.each(g,function(e,t){m.isNode(t)&&n.call(t)});var z,j=f.extend({},b.defaults,v);if(j.loop=parseInt(j.loop),z=2*j.loop-1,j.loop)for(var O=0;z>O;O++){var q={delay:j.delay,progress:j.progress};O===z-1&&(q.display=j.display,q.visibility=j.visibility,q.complete=j.complete),P(g,"reverse",q)}return e()}};b=f.extend(P,b),b.animate=P;var w=t.requestAnimationFrame||g;return b.State.isMobile||r.hidden===a||r.addEventListener("visibilitychange",function(){r.hidden?(w=function(e){return setTimeout(function(){e(!0)},16)},c()):w=t.requestAnimationFrame||g}),e.Velocity=b,e!==t&&(e.fn.velocity=P,e.fn.velocity.defaults=b.defaults),f.each(["Down","Up"],function(e,t){b.Redirects["slide"+t]=function(e,r,n,o,i,s){var l=f.extend({},r),u=l.begin,c=l.complete,p={height:"",marginTop:"",marginBottom:"",paddingTop:"",paddingBottom:""},d={};l.display===a&&(l.display="Down"===t?"inline"===b.CSS.Values.getDisplayType(e)?"inline-block":"block":"none"),l.begin=function(){u&&u.call(i,i);for(var r in p){d[r]=e.style[r];var a=b.CSS.getPropertyValue(e,r);p[r]="Down"===t?[a,0]:[0,a]}d.overflow=e.style.overflow,e.style.overflow="hidden"},l.complete=function(){for(var t in d)e.style[t]=d[t];
290c&&c.call(i,i),s&&s.resolver(i)},b(e,p,l)}}),f.each(["In","Out"],function(e,t){b.Redirects["fade"+t]=function(e,r,n,o,i,s){var l=f.extend({},r),u={opacity:"In"===t?1:0},c=l.complete;l.complete=n!==o-1?l.begin=null:function(){c&&c.call(i,i),s&&s.resolver(i)},l.display===a&&(l.display="In"===t?"auto":"none"),b(this,u,l)}}),b}(window.jQuery||window.Zepto||window,window,document)})); 291 292 293'use strict'; 294 295var WOW; 296 297(function ($) { 298 299 WOW = function WOW() { 300 301 return { 302 303 init: function init() { 304 305 var animationName = []; 306 307 var once = 1; 308 309 function mdbWow() { 310 311 var windowHeight = window.innerHeight; 312 var scroll = window.scrollY; 313 314 $('.wow').each(function () { 315 316 if ($(this).css('visibility') == 'visible') { 317 return; 318 } 319 320 if (windowHeight + scroll - 100 > getOffset(this) && scroll < getOffset(this) || windowHeight + scroll - 100 > getOffset(this) + $(this).height() && scroll < getOffset(this) + $(this).height() || windowHeight + scroll == $(document).height() && getOffset(this) + 100 > $(document).height()) { 321 322 var index = $(this).index('.wow'); 323 324 var delay = $(this).attr('data-wow-delay'); 325 326 if (delay) { 327 328 delay = $(this).attr('data-wow-delay').slice(0, -1 329 330 ); 331 var self = this; 332 333 var timeout = parseFloat(delay) * 1000; 334 335 $(self).addClass('animated'); 336 $(self).css({ 337 'visibility': 'visible' 338 }); 339 $(self).css({ 340 'animation-delay': delay 341 }); 342 $(self).css({ 343 'animation-name': animationName[index] 344 }); 345 346 var removeTime = $(this).css('animation-duration').slice(0, -1) * 1000; 347 348 if ($(this).attr('data-wow-delay')) { 349 350 removeTime += $(this).attr('data-wow-delay').slice(0, -1) * 1000; 351 } 352 353 var self = this; 354 355 setTimeout(function () { 356 357 $(self).removeClass('animated'); 358 }, removeTime); 359 } else { 360 361 $(this).addClass('animated'); 362 $(this).css({ 363 'visibility': 'visible' 364 }); 365 $(this).css({ 366 'animation-name': animationName[index] 367 }); 368 369 var removeTime = $(this).css('animation-duration').slice(0, -1) * 1000; 370 371 var self = this; 372 373 setTimeout(function () { 374 375 $(self).removeClass('animated'); 376 }, removeTime); 377 } 378 } 379 }); 380 } 381 382 function appear() { 383 384 $('.wow').each(function () { 385 386 var index = $(this).index('.wow'); 387 388 var delay = $(this).attr('data-wow-delay'); 389 390 if (delay) { 391 392 delay = $(this).attr('data-wow-delay').slice(0, -1); 393 394 var timeout = parseFloat(delay) * 1000; 395 396 $(this).addClass('animated'); 397 $(this).css({ 398 'visibility': 'visible' 399 }); 400 $(this).css({ 401 'animation-delay': delay + 's' 402 }); 403 $(this).css({ 404 'animation-name': animationName[index] 405 }); 406 } else { 407 408 $(this).addClass('animated'); 409 $(this).css({ 410 'visibility': 'visible' 411 }); 412 $(this).css({ 413 'animation-name': animationName[index] 414 }); 415 } 416 }); 417 } 418 419 function hide() { 420 421 var windowHeight = window.innerHeight; 422 var scroll = window.scrollY; 423 424 $('.wow.animated').each(function () { 425 426 if (windowHeight + scroll - 100 > getOffset(this) && scroll > getOffset(this) + 100 || windowHeight + scroll - 100 < getOffset(this) && scroll < getOffset(this) + 100 || getOffset(this) + $(this).height > $(document).height() - 100) { 427 428 $(this).removeClass('animated'); 429 $(this).css({ 430 'animation-name': 'none' 431 }); 432 $(this).css({ 433 'visibility': 'hidden' 434 }); 435 } else { 436 437 var removeTime = $(this).css('animation-duration').slice(0, -1) * 1000; 438 439 if ($(this).attr('data-wow-delay')) { 440 441 removeTime += $(this).attr('data-wow-delay').slice(0, -1) * 1000; 442 } 443 444 var self = this; 445 446 setTimeout(function () { 447 448 $(self).removeClass('animated'); 449 }, removeTime); 450 } 451 }); 452 453 mdbWow(); 454 455 once--; 456 } 457 458 function getOffset(elem) { 459 460 var box = elem.getBoundingClientRect(); 461 462 var body = document.body; 463 var docEl = document.documentElement; 464 465 var scrollTop = window.pageYOffset || docEl.scrollTop || body.scrollTop; 466 467 var clientTop = docEl.clientTop || body.clientTop || 0; 468 469 var top = box.top + scrollTop - clientTop; 470 471 return Math.round(top); 472 } 473 474 $('.wow').each(function () { 475 476 $(this).css({ 477 'visibility': 'hidden' 478 }); 479 animationName[$(this).index('.wow')] = $(this).css('animation-name'); 480 $(this).css({ 481 'animation-name': 'none' 482 }); 483 }); 484 485 $(window).scroll(function () { 486 487 if (once) { 488 489 hide(); 490 } else { 491 492 mdbWow(); 493 } 494 }); 495 496 appear(); 497 } 498 }; 499 }; 500})(jQuery); 501 502"use strict"; 503 504(function ($) { 505 var SCROLLING_NAVBAR_OFFSET_TOP = 50; 506 $(window).on('scroll', function () {
vendor: 3,460 bytes, lines 507-628
507 var $navbar = $('.navbar'); 508 509 if ($navbar.length) { 510 if ($navbar.offset().top > SCROLLING_NAVBAR_OFFSET_TOP) { 511 $('.scrolling-navbar').addClass('top-nav-collapse'); 512 } else { 513 $('.scrolling-navbar').removeClass('top-nav-collapse'); 514 } 515 } 516 }); 517})(jQuery); 518/*! 519 * Waves v0.8.0 520 * http://fian.my.id/Waves 521 * 522 * Copyright 2014-2017 Alfiana E. Sibuea and other contributors 523 * Released under the MIT license 524 * https://github.com/fians/Waves/blob/master/LICENSE 525 */ 526 527;(function(window, factory) { 528 'use strict'; 529 530 // AMD. Register as an anonymous module. Wrap in function so we have access 531 // to root via `this`. 532 if (typeof define === 'function' && define.amd) { 533 define([], function() { 534 return factory.apply(window); 535 }); 536 } 537 538 // Node. Does not work with strict CommonJS, but only CommonJS-like 539 // environments that support module.exports, like Node. 540 else if (typeof exports === 'object') { 541 module.exports = factory.call(window); 542 } 543 544 // Browser globals. 545 else { 546 window.Waves = factory.call(window); 547 } 548})(typeof global === 'object' ? global : this, function() { 549 'use strict'; 550 551 var Waves = Waves || {}; 552 var $$ = document.querySelectorAll.bind(document); 553 var toString = Object.prototype.toString; 554 var isTouchAvailable = 'ontouchstart' in window; 555 556 557 // Find exact position of element 558 function isWindow(obj) { 559 return obj !== null && obj === obj.window; 560 } 561 562 function getWindow(elem) { 563 return isWindow(elem) ? elem : elem.nodeType === 9 && elem.defaultView; 564 } 565 566 function isObject(value) { 567 var type = typeof value; 568 return type === 'function' || type === 'object' && !!value; 569 } 570 571 function isDOMNode(obj) { 572 return isObject(obj) && obj.nodeType > 0; 573 } 574 575 function getWavesElements(nodes) { 576 var stringRepr = toString.call(nodes); 577 578 if (stringRepr === '[object String]') { 579 return $$(nodes); 580 } else if (isObject(nodes) && /^\[object (Array|HTMLCollection|NodeList|Object)\]$/.test(stringRepr) && nodes.hasOwnProperty('length')) { 581 return nodes; 582 } else if (isDOMNode(nodes)) { 583 return [nodes]; 584 } 585 586 return []; 587 } 588 589 function offset(elem) { 590 var docElem, win, 591 box = { top: 0, left: 0 }, 592 doc = elem && elem.ownerDocument; 593 594 docElem = doc.documentElement; 595 596 if (typeof elem.getBoundingClientRect !== typeof undefined) { 597 box = elem.getBoundingClientRect(); 598 } 599 win = getWindow(doc); 600 return { 601 top: box.top + win.pageYOffset - docElem.clientTop, 602 left: box.left + win.pageXOffset - docElem.clientLeft 603 }; 604 } 605 606 function convertStyle(styleObj) { 607 var style = ''; 608 609 for (var prop in styleObj) { 610 if (styleObj.hasOwnProperty(prop)) { 611 style += (prop + ':' + styleObj[prop] + ';'); 612 } 613 } 614 615 return style; 616 } 617 618 var Effect = { 619 620 // Effect duration 621 duration: 750, 622 623 // Effect delay (check for scroll before showing effect) 624 delay: 200, 625 626 // Selector to find element to apply effect to. 627 // Can contain multiple classes (like ".btn, .nav a") 628 elementSelector: ".waves-effect"
vendor: 8,477 bytes, lines 628-880
628, 629 630 show: function(e, element, velocity) { 631 632 // Disable right click 633 if (e.button === 2) { 634 return false; 635 } 636 637 element = element || this; 638 639 // Create ripple 640 var ripple = document.createElement('div'); 641 ripple.className = 'waves-ripple waves-rippling'; 642 element.appendChild(ripple); 643 644 // Get click coordinate and element width 645 var pos = offset(element); 646 var relativeY = 0; 647 var relativeX = 0; 648 // Support for touch devices 649 if('touches' in e && e.touches.length) { 650 relativeY = (e.touches[0].pageY - pos.top); 651 relativeX = (e.touches[0].pageX - pos.left); 652 } 653 //Normal case 654 else { 655 relativeY = (e.pageY - pos.top); 656 relativeX = (e.pageX - pos.left); 657 } 658 // Support for synthetic events 659 relativeX = relativeX >= 0 ? relativeX : 0; 660 relativeY = relativeY >= 0 ? relativeY : 0; 661 662 var scale = 'scale(' + ((element.clientWidth / 100) * 3) + ')'; 663 var translate = 'translate(0,0)'; 664 665 if (velocity) { 666 translate = 'translate(' + (velocity.x) + 'px, ' + (velocity.y) + 'px)'; 667 } 668 669 // Attach data to element 670 ripple.setAttribute('data-hold', Date.now()); 671 ripple.setAttribute('data-x', relativeX); 672 ripple.setAttribute('data-y', relativeY); 673 ripple.setAttribute('data-scale', scale); 674 ripple.setAttribute('data-translate', translate); 675 676 // Set ripple position 677 var rippleStyle = { 678 top: relativeY + 'px', 679 left: relativeX + 'px' 680 }; 681 682 ripple.classList.add('waves-notransition'); 683 ripple.setAttribute('style', convertStyle(rippleStyle)); 684 ripple.classList.remove('waves-notransition'); 685 686 // Scale the ripple 687 rippleStyle['-webkit-transform'] = scale + ' ' + translate; 688 rippleStyle['-moz-transform'] = scale + ' ' + translate; 689 rippleStyle['-ms-transform'] = scale + ' ' + translate; 690 rippleStyle['-o-transform'] = scale + ' ' + translate; 691 rippleStyle.transform = scale + ' ' + translate; 692 rippleStyle.opacity = '1'; 693 694 var duration = e.type === 'mousemove' ? 2500 : Effect.duration; 695 rippleStyle['-webkit-transition-duration'] = duration + 'ms'; 696 rippleStyle['-moz-transition-duration'] = duration + 'ms'; 697 rippleStyle['-o-transition-duration'] = duration + 'ms'; 698 rippleStyle['transition-duration'] = duration + 'ms'; 699 700 ripple.setAttribute('style', convertStyle(rippleStyle)); 701 }, 702 703 hide: function(e, element) { 704 element = element || this; 705 706 var ripples = element.getElementsByClassName('waves-rippling'); 707 708 for (var i = 0, len = ripples.length; i < len; i++) { 709 removeRipple(e, element, ripples[i]); 710 } 711 712 if (isTouchAvailable) { 713 element.removeEventListener('touchend', Effect.hide); 714 element.removeEventListener('touchcancel', Effect.hide); 715 } 716 717 element.removeEventListener('mouseup', Effect.hide); 718 element.removeEventListener('mouseleave', Effect.hide); 719 } 720 }; 721 722 /** 723 * Collection of wrapper for HTML element that only have single tag 724 * like <input> and <img> 725 */ 726 var TagWrapper = { 727 728 // Wrap <input> tag so it can perform the effect 729 input: function(element) { 730 731 var parent = element.parentNode; 732 733 // If input already have parent just pass through 734 if (parent.tagName.toLowerCase() === 'i' && parent.classList.contains('waves-effect')) { 735 return; 736 } 737 738 // Put element class and style to the specified parent 739 var wrapper = document.createElement('i'); 740 wrapper.className = element.className + ' waves-input-wrapper'; 741 element.className = 'waves-button-input'; 742 743 // Put element as child 744 parent.replaceChild(wrapper, element); 745 wrapper.appendChild(element); 746 747 // Apply element color and background color to wrapper 748 var elementStyle = window.getComputedStyle(element, null); 749 var color = elementStyle.color; 750 var backgroundColor = elementStyle.backgroundColor; 751 752 wrapper.setAttribute('style', 'color:' + color + ';background:' + backgroundColor); 753 element.setAttribute('style', 'background-color:rgba(0,0,0,0);'); 754 755 }, 756 757 // Wrap <img> tag so it can perform the effect 758 img: function(element) { 759 760 var parent = element.parentNode; 761 762 // If input already have parent just pass through 763 if (parent.tagName.toLowerCase() === 'i' && parent.classList.contains('waves-effect')) { 764 return; 765 } 766 767 // Put element as child 768 var wrapper = document.createElement('i'); 769 parent.replaceChild(wrapper, element); 770 wrapper.appendChild(element); 771 772 } 773 }; 774 775 /** 776 * Hide the effect and remove the ripple. Must be 777 * a separate function to pass the JSLint... 778 */ 779 function removeRipple(e, el, ripple) { 780 781 // Check if the ripple still exist 782 if (!ripple) { 783 return; 784 } 785 786 ripple.classList.remove('waves-rippling'); 787 788 var relativeX = ripple.getAttribute('data-x'); 789 var relativeY = ripple.getAttribute('data-y'); 790 var scale = ripple.getAttribute('data-scale'); 791 var translate = ripple.getAttribute('data-translate'); 792 793 // Get delay beetween mousedown and mouse leave 794 var diff = Date.now() - Number(ripple.getAttribute('data-hold')); 795 var delay = 350 - diff; 796 797 if (delay < 0) { 798 delay = 0; 799 } 800 801 if (e.type === 'mousemove') { 802 delay = 150; 803 } 804 805 // Fade out ripple after delay 806 var duration = e.type === 'mousemove' ? 2500 : Effect.duration; 807 808 setTimeout(function() { 809 810 var style = { 811 top: relativeY + 'px', 812 left: relativeX + 'px', 813 opacity: '0', 814 815 // Duration 816 '-webkit-transition-duration': duration + 'ms', 817 '-moz-transition-duration': duration + 'ms', 818 '-o-transition-duration': duration + 'ms', 819 'transition-duration': duration + 'ms', 820 '-webkit-transform': scale + ' ' + translate, 821 '-moz-transform': scale + ' ' + translate, 822 '-ms-transform': scale + ' ' + translate, 823 '-o-transform': scale + ' ' + translate, 824 'transform': scale + ' ' + translate 825 }; 826 827 ripple.setAttribute('style', convertStyle(style)); 828 829 setTimeout(function() { 830 try { 831 el.removeChild(ripple); 832 } catch (e) { 833 return false; 834 } 835 }, duration); 836 837 }, delay); 838 } 839 840 841 /** 842 * Disable mousedown event for 500ms during and after touch 843 */ 844 var TouchHandler = { 845 846 /* uses an integer rather than bool so there's no issues with 847 * needing to clear timeouts if another touch event occurred 848 * within the 500ms. Cannot mouseup between touchstart and 849 * touchend, nor in the 500ms after touchend. */ 850 touches: 0, 851 852 allowEvent: function(e) { 853 854 var allow = true; 855 856 if (/^(mousedown|mousemove)$/.test(e.type) && TouchHandler.touches) { 857 allow = false; 858 } 859 860 return allow; 861 }, 862 registerEvent: function(e) { 863 var eType = e.type; 864 865 if (eType === 'touchstart') { 866 867 TouchHandler.touches += 1; // push 868 869 } else if (/^(touchend|touchcancel)$/.test(eType)) { 870 871 setTimeout(function() { 872 if (TouchHandler.touches) { 873 TouchHandler.touches -= 1; // pop after 500ms 874 } 875 }, 500); 876 877 } 878 } 879 }; 880
881 /** 882 * Browser-compatible version of Element.matches(). 883 */ 884 function matches(element, selector) { 885 var match = document.documentElement.matches || 886 document.documentElement.matchesSelector || 887 document.documentElement.webkitMatchesSelector || 888 document.documentElement.mozMatchesSelector || 889 document.documentElement.msMatchesSelector || 890 document.documentElement.oMatchesSelector; 891 return match.call(element, selector); 892 } 893 894 /** 895 * Delegated click handler for .waves-effect element. 896 * returns null when .waves-effect element not in "click tree" 897 */ 898 function getWavesEffectElement(e) { 899 900 if (TouchHandler.allowEvent(e) === false) { 901 return null; 902 } 903 904 var element = null; 905 var target = e.target || e.srcElement; 906 907 while (target.parentNode) { 908 if ( (!(target instanceof SVGElement)) && matches(target, Effect.elementSelector)) { 909 element = target; 910 break; 911 } 912 target = target.parentNode; 913 } 914 915 return element; 916 } 917 918 /** 919 * Bubble the click and show effect if .waves-effect elem was found 920 */ 921 function showEffect(e) {
vendor: 2,774 bytes, lines 921-1006
921 922 923 var element = getWavesEffectElement(e); 924 925 if (element !== null) { 926 927 // Make it sure the element has either disabled property, disabled attribute or 'disabled' class 928 if (element.disabled || element.getAttribute('disabled') || element.classList.contains('disabled')) { 929 return; 930 } 931 932 TouchHandler.registerEvent(e); 933 934 if (e.type === 'touchstart' && Effect.delay) { 935 936 var hidden = false; 937 938 var timer = setTimeout(function () { 939 timer = null; 940 Effect.show(e, element); 941 }, Effect.delay); 942 943 var hideEffect = function(hideEvent) { 944 945 // if touch hasn't moved, and effect not yet started: start effect now 946 if (timer) { 947 clearTimeout(timer); 948 timer = null; 949 Effect.show(e, element); 950 } 951 if (!hidden) { 952 hidden = true; 953 Effect.hide(hideEvent, element); 954 } 955 956 removeListeners(); 957 }; 958 959 var touchMove = function(moveEvent) { 960 if (timer) { 961 clearTimeout(timer); 962 timer = null; 963 } 964 hideEffect(moveEvent); 965 966 removeListeners(); 967 }; 968 969 element.addEventListener('touchmove', touchMove, false); 970 element.addEventListener('touchend', hideEffect, false); 971 element.addEventListener('touchcancel', hideEffect, false); 972 973 var removeListeners = function() { 974 element.removeEventListener('touchmove', touchMove); 975 element.removeEventListener('touchend', hideEffect); 976 element.removeEventListener('touchcancel', hideEffect); 977 }; 978 } else { 979 980 Effect.show(e, element); 981 982 if (isTouchAvailable) { 983 element.addEventListener('touchend', Effect.hide, false); 984 element.addEventListener('touchcancel', Effect.hide, false); 985 } 986 987 element.addEventListener('mouseup', Effect.hide, false); 988 element.addEventListener('mouseleave', Effect.hide, false); 989 } 990 } 991 } 992 993 Waves.init = function(options) { 994 var body = document.body; 995 996 options = options || {}; 997 998 if ('duration' in options) { 999 Effect.duration = options.duration; 1000 } 1001 1002 if ('delay' in options) { 1003 Effect.delay = options.delay; 1004 } 1005 1006 if (
1006'elementSelector' in options) { 1007 Effect.elementSelector = options.elementSelector; 1008 } 1009 1010 if (isTouchAvailable) { 1011 body.addEventListener('touchstart', showEffect, false); 1012 body.addEventListener('touchcancel', TouchHandler.registerEvent, false); 1013 body.addEventListener('touchend', TouchHandler.registerEvent, false); 1014 } 1015 1016 body.addEventListener('mousedown', showEffect, false); 1017 }; 1018 1019 Waves.destroy = function() { 1020 1021 var body = document.body; 1022 1023 if (isTouchAvailable) { 1024 body.removeEventListener('touchstart', showEffect, false); 1025 body.removeEventListener('touchcancel', TouchHandler.registerEvent, false); 1026 body.removeEventListener('touchend', TouchHandler.registerEvent, false); 1027 } 1028 1029 body.removeEventListener('mousedown', showEffect, false); 1030 1031 }; 1032 1033 1034 /** 1035 * Toggle (Attach/Detach) Waves to dynamically loaded inputs, or add .waves-effect and other 1036 * waves classes to a set of elements. Set drag to true if the ripple mouseover 1037 * or skimming effect should be applied to the elements. 1038 */ 1039 function toggleWaves(elements, classes, type) { 1040 1041 elements = getWavesElements(elements); 1042 1043 if (toString.call(classes) === '[object Array]') { 1044 classes = classes.join(' '); 1045 } 1046 1047 classes = classes ? ' ' + classes : ''; 1048 1049 var element, tagName; 1050 1051 for (var i = 0, len = elements.length; i < len; i++) { 1052 1053 element = elements[i]; 1054 tagName = element.tagName.toLowerCase(); 1055 1056 if (['input', 'img'].indexOf(tagName) !== -1) { 1057 TagWrapper[tagName](element); 1058 element = element.parentNode; 1059 } 1060 1061 if (type === 'attach') { 1062 1063 if (element.className.indexOf(classes) === -1) { 1064 element.className += ' '+classes; 1065 } 1066 1067 if (!element.classList.contains('waves-effect')) { 1068 element.classList.add('waves-effect'); 1069 } 1070 1071 } 1072 1073 if (type === 'detach') { 1074 1075 if (element.className.indexOf(classes) !== -1) { 1076 element.className = element.className.replace(new RegExp(classes, 'g'), ''); 1077 } 1078 1079 if (element.classList.contains('waves-effect')) { 1080 element.classList.remove('waves-effect'); 1081 } 1082 1083 } 1084 1085 } 1086 1087 } 1088 1089 Waves.attach = function(elements, classes) { 1090 return toggleWaves(elements, classes, 'attach'); 1091 }; 1092 1093 Waves.detach = function(elements, classes) { 1094 return toggleWaves(elements, classes, 'detach'); 1095 }; 1096 1097 1098 /** 1099 * Cause a ripple to appear in an element via code. 1100 */ 1101 Waves.ripple = function(elements, options) { 1102 elements = getWavesElements(elements); 1103 var elementsLen = elements.length; 1104 1105 options = options || {}; 1106 options.wait = options.wait || 0; 1107 options.position = options.position || null; // default = centre of element 1108 1109 1110 if (elementsLen) { 1111 var element, pos, off, centre = {}, i = 0; 1112 var mousedown = { 1113 type: 'mousedown', 1114 button: 1 1115 }; 1116 var hideRipple = function(mouseup, element) { 1117 return function() {
vendor: 1,342 bytes, lines 1118-1164
1118 Effect.hide(mouseup, element); 1119 }; 1120 }; 1121 1122 for (; i < elementsLen; i++) { 1123 element = elements[i]; 1124 pos = options.position || { 1125 x: element.clientWidth / 2, 1126 y: element.clientHeight / 2 1127 }; 1128 1129 off = offset(element); 1130 centre.x = off.left + pos.x; 1131 centre.y = off.top + pos.y; 1132 1133 mousedown.pageX = centre.x; 1134 mousedown.pageY = centre.y; 1135 1136 if ('duration' in options) { 1137 Effect.duration = options.duration; 1138 } 1139 1140 Effect.show(mousedown, element); 1141 1142 if (options.wait >= 0 && options.wait !== null) { 1143 var mouseup = { 1144 type: 'mouseup', 1145 button: 1 1146 }; 1147 1148 setTimeout(hideRipple(mouseup, element), options.wait); 1149 } 1150 } 1151 } 1152 }; 1153 1154 /** 1155 * Remove all ripples from an element. 1156 */ 1157 Waves.calm = function(elements) { 1158 elements = getWavesElements(elements); 1159 var mouseup = { 1160 type: 'mouseup', 1161 button: 1 1162 }; 1163 1164 for (var i = 0, len = elements.length; i < len; i++) {
1165 Effect.hide(mouseup, elements[i]); 1166 } 1167 }; 1168 1169 /** 1170 * Deprecated API fallback 1171 */ 1172 Waves.displayEffect = function(options) { 1173 console.error('Waves.displayEffect() has been deprecated and will be removed in future version. Please use Waves.init() to initialize Waves effect'); 1174 Waves.init(options); 1175 }; 1176 1177 return Waves; 1178}); 1179 1180 1181 1182//Initialization 1183"use strict"; 1184 1185var _this = void 0; 1186 1187(function ($) { 1188 var inputSelector = "".concat(['text', 'password', 'email', 'url', 'tel', 'number', 'search', 'search-md'].map(function (selector) { 1189 return "input[type=".concat(selector, "]"); 1190 }).join(', '), ", textarea"); 1191 var textAreaSelector = '.materialize-textarea'; 1192 1193 var updateTextFields = function updateTextFields($input) { 1194 var $labelAndIcon = $input.siblings('label, i'); 1195 var hasValue = $input.val().length; 1196 var hasPlaceholder = $input.attr('placeholder'); 1197 var addOrRemove = "".concat(hasValue || hasPlaceholder ? 'add' : 'remove', "Class"); 1198 $labelAndIcon[addOrRemove]('active'); 1199 }; 1200 1201 var validateField = function validateField($input) { 1202 if ($input.hasClass('validate')) { 1203 var value = $input.val(); 1204 var noValue = !value.length; 1205 var isValid = !$input[0].validity.badInput; 1206 1207 if (noValue && isValid) { 1208 $input.removeClass('valid').removeClass('invalid'); 1209 } else { 1210 var valid = $input.is(':valid'); 1211 var length = Number($input.attr('length')) || 0; 1212 1213 if (valid && (!length || length > value.length)) { 1214 $input.removeClass('invalid').addClass('valid'); 1215 } else { 1216 $input.removeClass('valid').addClass('invalid'); 1217 } 1218 } 1219 } 1220 }; 1221 1222 var textAreaAutoResize = function textAreaAutoResize() { 1223 var $textarea = $(_this); 1224 1225 if ($textarea.val().length) { 1226 var $hiddenDiv = $('.hiddendiv'); 1227 var fontFamily = $textarea.css('font-family'); 1228 var fontSize = $textarea.css('font-size'); 1229 1230 if (fontSize) { 1231 $hiddenDiv.css('font-size', fontSize); 1232 } 1233 1234 if (fontFamily) { 1235 $hiddenDiv.css('font-family', fontFamily); 1236 } 1237 1238 if ($textarea.attr('wrap') === 'off') { 1239 $hiddenDiv.css('overflow-wrap', 'normal').css('white-space', 'pre'); 1240 } 1241 1242 $hiddenDiv.text("".concat($textarea.val(), "\n")); 1243 var content = $hiddenDiv.html().replace(/\n/g, '<br>'); 1244 $hiddenDiv.html(content); // When textarea is hidden, width goes crazy. 1245 // Approximate with half of window size 1246 1247 $hiddenDiv.css('width', $textarea.is(':visible') ? $textarea.width() : $(window).width() / 2); 1248 $textarea.css('height', $hiddenDiv.height()); 1249 } 1250 }; 1251 1252 $(inputSelector).each(function (index, input) { 1253 var $this = $(input); 1254 var $labelAndIcon = $this.siblings('label, i'); 1255 updateTextFields($this); 1256 var isValid = input.validity.badInput; 1257 1258 if (isValid) { 1259 $labelAndIcon.addClass('active'); 1260 } 1261 }); 1262 $(document).on('focus', inputSelector, function (e) { 1263 $(e.target).siblings('label, i').addClass('active'); 1264 }); 1265 $(document).on('blur', inputSelector, function (e) { 1266 var $this = $(e.target); 1267 var noValue = !$this.val(); 1268 var invalid = !e.target.validity.badInput; 1269 var noPlaceholder = $this.attr('placeholder') === undefined; 1270 1271 if (noValue && invalid && noPlaceholder) { 1272 $this.siblings('label, i').removeClass('active'); 1273 } 1274 1275 validateField($this); 1276 }); 1277 $(document).on('change', inputSelector, function (e) { 1278 var $this = $(e.target); 1279 updateTextFields($this); 1280 validateField($this); 1281 }); 1282 $('input[autofocus]').siblings('label, i').addClass('active'); 1283 $(document).on('reset', function (e) { 1284 var $formReset = $(e.target); 1285 1286 if ($formReset.is('form')) { 1287 var $formInputs = $formReset.find(inputSelector); 1288 $formInputs.removeClass('valid').removeClass('invalid').each(function (index, input) { 1289 var $this = $(input); 1290 var noDefaultValue = !$this.val(); 1291 var noPlaceholder = !$this.attr('placeholder'); 1292 1293 if (noDefaultValue && noPlaceholder) { 1294 $this.siblings('label, i').removeClass('active'); 1295 } 1296 }); 1297 $formReset.find('select.initialized').each(function (index, select) { 1298 var $select = $(select); 1299 var $visibleInput = $select.siblings('input.select-dropdown'); 1300 var defaultValue = $select.children('[selected]').val(); 1301 $select.val(defaultValue); 1302 $visibleInput.val(defaultValue); 1303 }); 1304 } 1305 }); 1306
1307 function init() { 1308 var $text = $('.md-textarea-auto'); 1309 1310 if ($text.length) { 1311 var observe; 1312 1313 if (window.attachEvent) { 1314 observe = function observe(element, event, handler) { 1315 element.attachEvent("on".concat(event), handler); 1316 }; 1317 } else { 1318 observe = function observe(element, event, handler) { 1319 element.addEventListener(event, handler, false); 1320 }; 1321 } 1322 1323 $text.each(function () { 1324 var self = this; 1325 1326 function resize() { 1327 self.style.height = 'auto'; 1328 self.style.height = "".concat(self.scrollHeight, "px"); 1329 } 1330 1331 function delayedResize() { 1332 window.setTimeout(resize, 0); 1333 } 1334 1335 observe(self, 'change', resize); 1336 observe(self, 'cut', delayedResize); 1337 observe(self, 'paste', delayedResize); 1338 observe(self, 'drop', delayedResize); 1339 observe(self, 'keydown', delayedResize); 1340 resize(); 1341 }); 1342 } 1343 } 1344 1345 init(); 1346 var $body = $('body'); 1347 1348 if (!$('.hiddendiv').first().length) { 1349 var $hiddenDiv = $('<div class="hiddendiv common"></div>'); 1350 $body.append($hiddenDiv); 1351 } 1352 1353 $(textAreaSelector).each(textAreaAutoResize); 1354 $body.on('keyup keydown', textAreaSelector, textAreaAutoResize); 1355})(jQuery); 1356"use strict"; 1357 1358$(document).ready(function () { 1359 $('body').attr('aria-busy', true); 1360 $('#preloader-markup').load('mdb-addons/preloader.html', function () { 1361 $(window).on('load', function () { 1362 $('#mdb-preloader').fadeOut('slow'); 1363 $('body').removeAttr('aria-busy'); 1364 }); 1365 }); 1366}); 1367"use strict"; 1368 1369(function ($) { 1370 $(document).on('click.card', '.card', function (e) { 1371 var $reveal = $(this).find('.card-reveal'); 1372 1373 if ($reveal.length) { 1374 var $clicked = $(e.target); 1375 var isTitle = $clicked.is('.card-reveal .card-title'); 1376 var isTitleIcon = $clicked.is('.card-reveal .card-title i'); 1377 var isActivator = $clicked.is('.card .activator'); 1378 var isActivatorIcon = $clicked.is('.card .activator i'); 1379 1380 if (isTitle || isTitleIcon) { 1381 // down 1382 $(this).find('.card-reveal').velocity({ 1383 translateY: 0 1384 }, { 1385 duration: 225, 1386 queue: false, 1387 easing: 'easeInOutQuad', 1388 complete: function complete() { 1389 $(this).css({ 1390 display: 'none' 1391 }); 1392 } 1393 }); 1394 } else if (isActivator || isActivatorIcon) { 1395 // up 1396 $(this).find('.card-reveal').css({ 1397 display: 'block' 1398 }).velocity('stop', false).velocity({ 1399 translateY: '-100%' 1400 }, { 1401 duration: 300, 1402 queue: false, 1403 easing: 'easeInOutQuad' 1404 }); 1405 } 1406 } 1407 }); 1408 $('.rotate-btn').on('click', function () { 1409 var cardId = $(this).attr('data-card'); 1410 $("#".concat(cardId)).toggleClass('flipped'); 1411 }); 1412 $(window).on('load', function () { 1413 var frontHeight = $('.front').outerHeight(); 1414 var backHeight = $('.back').outerHeight(); 1415 1416 if (frontHeight > backHeight) { 1417 $('.card-wrapper, .back').height(frontHeight); 1418 } else if (frontHeight > backHeight) { 1419 $('.card-wrapper, .front').height(backHeight); 1420 } else { 1421 $('.card-wrapper').height(backHeight); 1422 } 1423 }); 1424 $('.card-share > a').on('click', function (e) { 1425 e.preventDefault(); 1426 $(this).toggleClass('share-expanded').parent().find('div').toggleClass('social-reveal-active'); 1427 }); 1428})(jQuery); 1429 1430$('.map-card').click(function () { 1431 $('.card-body').toggleClass('closed'); 1432}); 1433"use strict"; 1434 1435(function ($) { 1436 $.fn.characterCounter = function () { 1437 return this.each(function () { 1438 var itHasLengthAttribute = $(this).attr('length') !== undefined; 1439 1440 if (itHasLengthAttribute) { 1441 $(this).on('input', updateCounter); 1442 $(this).on('focus', updateCounter); 1443 $(this).on('blur', removeCounterElement); 1444 addCounterElement($(this)); 1445 } 1446 }); 1447 }; 1448 1449 function updateCounter() { 1450 var maxLength = Number($(this).attr('length')); 1451 var actualLength = Number($(this).val().length); 1452 var isValidLength = actualLength <= maxLength; 1453 $(this).parent().find('span[class="character-counter"]').html("".concat(actualLength, "/").concat(maxLength)); 1454 addInputStyle(isValidLength, $(this)); 1455 } 1456 1457 function addCounterElement($input) { 1458 var $counterElement = $('<span/>').addClass('character-counter').css('float', 'right').css('font-size', '12px').css('height', 1); 1459 $input.parent().append($counterElement); 1460 } 1461 1462 function removeCounterElement() { 1463 $(this).parent().find('span[class="character-counter"]').html(''); 1464 } 1465 1466 function addInputStyle(isValidLength, $input) { 1467 var inputHasInvalidClass = $input.hasClass('invalid'); 1468 1469 if (isValidLength && inputHasInvalidClass) { 1470 $input.removeClass('invalid'); 1471 } else if (!isValidLength && !inputHasInvalidClass) { 1472 $input.removeClass('valid'); 1473 $input.addClass('invalid'); 1474 } 1475 } 1476 1477 $(document).ready(function () { 1478 $('input, textarea').characterCounter(); 1479 }); 1480})(jQuery); 1481/* 1482 * Toastr 1483 * Copyright 2012-2015 1484 * Authors: John Papa, Hans Fjällemark, and Tim Ferrell. 1485 * All Rights Reserved. 1486 * Use, reproduction, distribution, and modification of this code is subject to the terms and 1487 * conditions of the MIT license, available at http://www.opensource.org/licenses/mit-license.php 1488 * 1489 * ARIA Support: Greta Krafsig 1490 * 1491 * Project: https://github.com/CodeSeven/toastr 1492 */ 1493/* global define */ 1494;
vendor: 11,347 bytes, lines 1494-1805
1494 (function (define) { 1495 define(['jquery'], function ($) { 1496 return (function () { 1497 var $container; 1498 var listener; 1499 var toastId = 0; 1500 var toastType = { 1501 error: 'error', 1502 info: 'info', 1503 success: 'success', 1504 warning: 'warning' 1505 }; 1506 1507 var toastr = { 1508 clear: clear, 1509 remove: remove, 1510 error: error, 1511 getContainer: getContainer, 1512 info: info, 1513 options: {}, 1514 subscribe: subscribe, 1515 success: success, 1516 version: '2.1.1', 1517 warning: warning 1518 }; 1519 1520 var previousToast; 1521 1522 return toastr; 1523 1524 //////////////// 1525 1526 function error(message, title, optionsOverride) { 1527 return notify({ 1528 type: toastType.error, 1529 iconClass: getOptions().iconClasses.error, 1530 message: message, 1531 optionsOverride: optionsOverride, 1532 title: title 1533 }); 1534 } 1535 1536 function getContainer(options, create) { 1537 if (!options) { options = getOptions(); } 1538 $container = $('#' + options.containerId); 1539 if ($container.length) { 1540 return $container; 1541 } 1542 if (create) { 1543 $container = createContainer(options); 1544 } 1545 return $container; 1546 } 1547 1548 function info(message, title, optionsOverride) { 1549 return notify({ 1550 type: toastType.info, 1551 iconClass: getOptions().iconClasses.info, 1552 message: message, 1553 optionsOverride: optionsOverride, 1554 title: title 1555 }); 1556 } 1557 1558 function subscribe(callback) { 1559 listener = callback; 1560 } 1561 1562 function success(message, title, optionsOverride) { 1563 return notify({ 1564 type: toastType.success, 1565 iconClass: getOptions().iconClasses.success, 1566 message: message, 1567 optionsOverride: optionsOverride, 1568 title: title 1569 }); 1570 } 1571 1572 function warning(message, title, optionsOverride) { 1573 return notify({ 1574 type: toastType.warning, 1575 iconClass: getOptions().iconClasses.warning, 1576 message: message, 1577 optionsOverride: optionsOverride, 1578 title: title 1579 }); 1580 } 1581 1582 function clear($toastElement, clearOptions) { 1583 var options = getOptions(); 1584 if (!$container) { getContainer(options); } 1585 if (!clearToast($toastElement, options, clearOptions)) { 1586 clearContainer(options); 1587 } 1588 } 1589 1590 function remove($toastElement) { 1591 var options = getOptions(); 1592 if (!$container) { getContainer(options); } 1593 if ($toastElement && $(':focus', $toastElement).length === 0) { 1594 removeToast($toastElement); 1595 return; 1596 } 1597 if ($container.children().length) { 1598 $container.remove(); 1599 } 1600 } 1601 1602 // internal functions 1603 1604 function clearContainer (options) { 1605 var toastsToClear = $container.children(); 1606 for (var i = toastsToClear.length - 1; i >= 0; i--) { 1607 clearToast($(toastsToClear[i]), options); 1608 } 1609 } 1610 1611 function clearToast ($toastElement, options, clearOptions) { 1612 var force = clearOptions && clearOptions.force ? clearOptions.force : false; 1613 if ($toastElement && (force || $(':focus', $toastElement).length === 0)) { 1614 $toastElement[options.hideMethod]({ 1615 duration: options.hideDuration, 1616 easing: options.hideEasing, 1617 complete: function () { removeToast($toastElement); } 1618 }); 1619 return true; 1620 } 1621 return false; 1622 } 1623 1624 function createContainer(options) { 1625 $container = $('<div/>') 1626 .attr('id', options.containerId) 1627 .addClass(options.positionClass) 1628 .attr('aria-live', 'polite') 1629 .attr('role', 'alert'); 1630 1631 $container.appendTo($(options.target)); 1632 return $container; 1633 } 1634 1635 function getDefaults() { 1636 return { 1637 tapToDismiss: true, 1638 toastClass: 'md-toast', 1639 containerId: 'toast-container', 1640 debug: false, 1641 1642 showMethod: 'fadeIn', //fadeIn, slideDown, and show are built into jQuery 1643 showDuration: 300, 1644 showEasing: 'swing', //swing and linear are built into jQuery 1645 onShown: undefined, 1646 hideMethod: 'fadeOut', 1647 hideDuration: 1000, 1648 hideEasing: 'swing', 1649 onHidden: undefined, 1650 1651 extendedTimeOut: 1000, 1652 iconClasses: { 1653 error: 'md-toast-error', 1654 info: 'md-toast-info', 1655 success: 'md-toast-success', 1656 warning: 'md-toast-warning' 1657 }, 1658 iconClass: 'md-toast-info', 1659 positionClass: 'md-toast-top-right', 1660 timeOut: 5000, // Set timeOut and extendedTimeOut to 0 to make it sticky 1661 titleClass: 'md-toast-title', 1662 messageClass: 'md-toast-message', 1663 target: 'body', 1664 closeHtml: '<button type="button">×</button>', 1665 newestOnTop: true, 1666 preventDuplicates: false, 1667 progressBar: false 1668 }; 1669 } 1670 1671 function publish(args) { 1672 if (!listener) { return; } 1673 listener(args); 1674 } 1675 1676 function notify(map) { 1677 var options = getOptions(); 1678 var iconClass = map.iconClass || options.iconClass; 1679 1680 if (typeof (map.optionsOverride) !== 'undefined') { 1681 options = $.extend(options, map.optionsOverride); 1682 iconClass = map.optionsOverride.iconClass || iconClass; 1683 } 1684 1685 if (shouldExit(options, map)) { return; } 1686 1687 toastId++; 1688 1689 $container = getContainer(options, true); 1690 1691 var intervalId = null; 1692 var $toastElement = $('<div/>'); 1693 var $titleElement = $('<div/>'); 1694 var $messageElement = $('<div/>'); 1695 var $progressElement = $('<div/>'); 1696 var $closeElement = $(options.closeHtml); 1697 var progressBar = { 1698 intervalId: null, 1699 hideEta: null, 1700 maxHideTime: null 1701 }; 1702 var response = { 1703 toastId: toastId, 1704 state: 'visible', 1705 startTime: new Date(), 1706 options: options, 1707 map: map 1708 }; 1709 1710 personalizeToast(); 1711 1712 displayToast(); 1713 1714 handleEvents(); 1715 1716 publish(response); 1717 1718 if (options.debug && console) { 1719 console.log(response); 1720 } 1721 1722 return $toastElement; 1723 1724 function personalizeToast() { 1725 setIcon(); 1726 setTitle(); 1727 setMessage(); 1728 setCloseButton(); 1729 setProgressBar(); 1730 setSequence(); 1731 } 1732 1733 function handleEvents() { 1734 $toastElement.hover(stickAround, delayedHideToast); 1735 if (!options.onclick && options.tapToDismiss) { 1736 $toastElement.click(hideToast); 1737 } 1738 1739 if (options.closeButton && $closeElement) { 1740 $closeElement.click(function (event) { 1741 if (event.stopPropagation) { 1742 event.stopPropagation(); 1743 } else if (event.cancelBubble !== undefined && event.cancelBubble !== true) { 1744 event.cancelBubble = true; 1745 } 1746 hideToast(true); 1747 }); 1748 } 1749 1750 if (options.onclick) { 1751 $toastElement.click(function () { 1752 options.onclick(); 1753 hideToast(); 1754 }); 1755 } 1756 } 1757 1758 function displayToast() { 1759 $toastElement.hide(); 1760 1761 $toastElement[options.showMethod]( 1762 {duration: options.showDuration, easing: options.showEasing, complete: options.onShown} 1763 ); 1764 1765 if (options.timeOut > 0) { 1766 intervalId = setTimeout(hideToast, options.timeOut); 1767 progressBar.maxHideTime = parseFloat(options.timeOut); 1768 progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime; 1769 if (options.progressBar) { 1770 progressBar.intervalId = setInterval(updateProgress, 10); 1771 } 1772 } 1773 } 1774 1775 function setIcon() { 1776 if (map.iconClass) { 1777 $toastElement.addClass(options.toastClass).addClass(iconClass); 1778 } 1779 } 1780 1781 function setSequence() { 1782 if (options.newestOnTop) { 1783 $container.prepend($toastElement); 1784 } else { 1785 $container.append($toastElement); 1786 } 1787 } 1788 1789 function setTitle() { 1790 if (map.title) { 1791 $titleElement.append(map.title).addClass(options.titleClass); 1792 $toastElement.append($titleElement); 1793 } 1794 } 1795 1796 function setMessage() { 1797 if (map.message) { 1798 $messageElement.append(map.message).addClass(options.messageClass); 1799 $toastElement.append($messageElement); 1800 } 1801 } 1802 1803 function setCloseButton() { 1804 if (options.closeButton) { 1805 $closeElement.addClass('md-toast-close-button').attr('role', 'button');
1806 $toastElement.prepend($closeElement); 1807 } 1808 } 1809 1810 function setProgressBar() { 1811 if (options.progressBar) { 1812 $progressElement.addClass('md-toast-progress'); 1813 $toastElement.prepend($progressElement); 1814 } 1815 } 1816 1817 function shouldExit(options, map) { 1818 if (options.preventDuplicates) { 1819 if (map.message === previousToast) { 1820 return true; 1821 } else { 1822 previousToast = map.message; 1823 } 1824 } 1825 return false; 1826 } 1827 1828 function hideToast(override) { 1829 if ($(':focus', $toastElement).length && !override) { 1830 return; 1831 } 1832 clearTimeout(progressBar.intervalId); 1833 return $toastElement[options.hideMethod]({ 1834 duration: options.hideDuration, 1835 easing: options.hideEasing, 1836 complete: function () { 1837 removeToast($toastElement); 1838 if (options.onHidden && response.state !== 'hidden') { 1839 options.onHidden(); 1840 } 1841 response.state = 'hidden'; 1842 response.endTime = new Date(); 1843 publish(response); 1844 } 1845 }); 1846 } 1847 1848 function delayedHideToast() { 1849 if (options.timeOut > 0 || options.extendedTimeOut > 0) { 1850 intervalId = setTimeout(hideToast, options.extendedTimeOut); 1851 progressBar.maxHideTime = parseFloat(options.extendedTimeOut); 1852 progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime; 1853 } 1854 } 1855 1856 function stickAround() { 1857 clearTimeout(intervalId); 1858 progressBar.hideEta = 0; 1859 $toastElement.stop(true, true)[options.showMethod]( 1860 {duration: options.showDuration, easing: options.showEasing} 1861 ); 1862 } 1863 1864 function updateProgress() { 1865 var percentage = ((progressBar.hideEta - (new Date().getTime())) / progressBar.maxHideTime) * 100; 1866 $progressElement.width(percentage + '%'); 1867 } 1868 } 1869 1870 function getOptions() { 1871 return $.extend({}, getDefaults(), toastr.options); 1872 } 1873 1874 function removeToast($toastElement) { 1875 if (!$container) { $container = getContainer(); } 1876 if ($toastElement.is(':visible')) { 1877 return; 1878 } 1879 $toastElement.remove(); 1880 $toastElement = null; 1881 if ($container.children().length === 0) { 1882 $container.remove(); 1883 previousToast = undefined; 1884 } 1885 } 1886 1887 })(); 1888 }); 1889}(typeof define === 'function' && define.amd ? define : function (deps, factory) { 1890 if (typeof module !== 'undefined' && module.exports) { //Node 1891 module.exports = factory(require('jquery')); 1892 } else { 1893 window['toastr'] = factory(window['jQuery']); 1894 } 1895})); 1896 1897"use strict"; 1898 1899var SMOOTH_SCROLL_DURATION = 700; 1900$('.smooth-scroll').on('click', 'a', function () { 1901 var elAttr = $(this).attr('href'); 1902 1903 if (typeof elAttr !== typeof undefined && elAttr.indexOf('#') === 0) { 1904 var offset = $(this).attr('data-offset') ? $(this).attr('data-offset') : 0; 1905 var setHash = $(this).parentsUntil('.smooth-scroll').last().parent().attr('data-allow-hashes'); 1906 $('body,html').animate({ 1907 scrollTop: $(elAttr).offset().top - offset 1908 }, SMOOTH_SCROLL_DURATION); 1909 1910 if (typeof setHash !== typeof undefined && setHash !== false) { 1911 history.replaceState(null, null, elAttr); 1912 } 1913 1914 return false;
1915 } 1916}); 1917"use strict"; 1918 1919(function ($) { 1920 $.fn.scrollTo = function (elem) { 1921 $(this).scrollTop($(this).scrollTop() - $(this).offset().top + $(elem).offset().top); 1922 return this; 1923 }; 1924 1925 $.fn.dropdown = function (option) { 1926 this.each(function () { 1927 var origin = $(this); 1928 var options = $.extend({}, $.fn.dropdown.defaults, option); 1929 var isFocused = false; // Dropdown menu 1930 1931 var activates = $("#".concat(origin.attr('data-activates'))); 1932 1933 function updateOptions() { 1934 if (origin.data('induration') !== undefined) { 1935 options.inDuration = origin.data('inDuration'); 1936 } 1937 1938 if (origin.data('outduration') !== undefined) { 1939 options.outDuration = origin.data('outDuration'); 1940 } 1941 1942 if (origin.data('constrainwidth') !== undefined) { 1943 options.constrain_width = origin.data('constrainwidth'); 1944 } 1945 1946 if (origin.data('hover') !== undefined) { 1947 options.hover = origin.data('hover'); 1948 } 1949 1950 if (origin.data('gutter') !== undefined) { 1951 options.gutter = origin.data('gutter'); 1952 } 1953 1954 if (origin.data('beloworigin') !== undefined) { 1955 options.belowOrigin = origin.data('beloworigin'); 1956 } 1957 1958 if (origin.data('alignment') !== undefined) { 1959 options.alignment = origin.data('alignment'); 1960 } 1961 } 1962 1963 updateOptions(); // Attach dropdown to its activator 1964 1965 origin.after(activates); 1966 /* 1967 Helper function to position and resize dropdown. 1968 Used in hover and click handler. 1969 */ 1970 1971 function placeDropdown(eventType) { 1972 // Check for simultaneous focus and click events. 1973 if (eventType === 'focus') { 1974 isFocused = true; 1975 } // Check html data attributes 1976 1977 1978 updateOptions(); // Set Dropdown state 1979 1980 activates.addClass('active'); 1981 origin.addClass('active'); // Constrain width 1982 1983 if (options.constrain_width === true) { 1984 activates.css('width', origin.outerWidth()); 1985 } else { 1986 activates.css('white-space', 'nowrap'); 1987 } // Offscreen detection 1988 1989 1990 var windowHeight = window.innerHeight; 1991 var originHeight = origin.innerHeight(); 1992 var offsetLeft = origin.offset().left; 1993 var offsetTop = origin.offset().top - $(window).scrollTop(); 1994 var currAlignment = options.alignment; 1995 var gutterSpacing = 0; 1996 var leftPosition = 0; // Below Origin 1997 1998 var verticalOffset = 0; 1999 2000 if (options.belowOrigin === true) { 2001 verticalOffset = originHeight; 2002 } // Check for scrolling positioned container. 2003 2004 2005 var scrollOffset = 0; 2006 var wrapper = origin.parent(); 2007 2008 if (!wrapper.is('body') && wrapper[0].scrollHeight > wrapper[0].clientHeight) { 2009 scrollOffset = wrapper[0].scrollTop; 2010 } 2011 2012 if (offsetLeft + activates.innerWidth() > $(window).width()) { 2013 // Dropdown goes past screen on right, force right alignment 2014 currAlignment = 'right'; 2015 } else if (offsetLeft - activates.innerWidth() + origin.innerWidth() < 0) { 2016 // Dropdown goes past screen on left, force left alignment 2017 currAlignment = 'left'; 2018 } // Vertical bottom offscreen detection 2019 2020 2021 if (offsetTop + activates.innerHeight() > windowHeight) { 2022 // If going upwards still goes offscreen, just crop height of dropdown. 2023 if (offsetTop + originHeight - activates.innerHeight() < 0) { 2024 var adjustedHeight = windowHeight - offsetTop - verticalOffset; 2025 activates.css('max-height', adjustedHeight); 2026 } else { 2027 // Flow upwards. 2028 if (!verticalOffset) { 2029 verticalOffset += originHeight; 2030 } 2031 2032 verticalOffset -= activates.innerHeight(); 2033 } 2034 } // Handle edge alignment 2035 2036 2037 if (currAlignment === 'left') { 2038 gutterSpacing = options.gutter; 2039 leftPosition = origin.position().left + gutterSpacing; 2040 } else if (currAlignment === 'right') { 2041 var offsetRight = origin.position().left + origin.outerWidth() - activates.outerWidth(); 2042 gutterSpacing = -options.gutter; 2043 leftPosition = offsetRight + gutterSpacing; 2044 } // Position dropdown 2045 2046 2047 activates.css({ 2048 position: 'absolute', 2049 top: origin.position().top + verticalOffset + scrollOffset, 2050 left: leftPosition 2051 }); // Show dropdown 2052 2053 activates.stop(true, true).css('opacity', 0).slideDown({ 2054 queue: false, 2055 duration: options.inDuration, 2056 easing: 'easeOutCubic', 2057 complete: function complete() { 2058 $(this).css('height', ''); 2059 } 2060 }).animate({ 2061 opacity: 1, 2062 scrollTop: 0 2063 }, { 2064 queue: false, 2065 duration: options.inDuration, 2066 easing: 'easeOutSine' 2067 }); 2068 } 2069 2070 function hideDropdown() { 2071 // Check for simultaneous focus and click events. 2072 isFocused = false;
2073 activates.fadeOut(options.outDuration); 2074 activates.removeClass('active'); 2075 origin.removeClass('active'); 2076 setTimeout(function () { 2077 activates.css('max-height', ''); 2078 }, options.outDuration); 2079 } // Hover 2080 2081 2082 if (options.hover) { 2083 var open = false; 2084 origin.unbind("click.".concat(origin.attr('id'))); // Hover handler to show dropdown 2085 2086 origin.on('mouseenter', function () { 2087 // Mouse over 2088 if (open === false) { 2089 placeDropdown(); 2090 open = true; 2091 } 2092 }); 2093 origin.on('mouseleave', function (e) { 2094 // If hover on origin then to something other than dropdown content, then close 2095 var toEl = e.toElement || e.relatedTarget; // added browser compatibility for target element 2096 2097 if (!$(toEl).closest('.dropdown-content').is(activates)) { 2098 activates.stop(true, true); 2099 hideDropdown(); 2100 open = false; 2101 } 2102 }); 2103 activates.on('mouseleave', function (e) { 2104 // Mouse out 2105 var toEl = e.toElement || e.relatedTarget; 2106 2107 if (!$(toEl).closest('.dropdown-button').is(origin)) { 2108 activates.stop(true, true); 2109 hideDropdown(); 2110 open = false; 2111 } 2112 }); // Click 2113 } else { 2114 // Click handler to show dropdown 2115 origin.unbind("click.".concat(origin.attr('id'))); 2116 origin.bind("click.".concat(origin.attr('id')), function (e) { 2117 if (!isFocused) { 2118 if (origin[0] === e.currentTarget && !origin.hasClass('active') && $(e.target).closest('.dropdown-content').length === 0) { 2119 e.preventDefault(); // Prevents button click from moving window 2120 2121 placeDropdown('click'); 2122 } else if (origin.hasClass('active')) { 2123 // If origin is clicked and menu is open, close menu 2124 hideDropdown(); 2125 $(document).unbind("click.".concat(activates.attr('id'), " touchstart.").concat(activates.attr('id'))); 2126 } // If menu open, add click close handler to document 2127 2128 2129 if (activates.hasClass('active')) { 2130 $(document).bind("click.".concat(activates.attr('id'), " touchstart.").concat(activates.attr('id')), function (e) { 2131 if (!activates.is(e.target) && !origin.is(e.target) && !origin.find(e.target).length) { 2132 hideDropdown(); 2133 $(document).unbind("click.".concat(activates.attr('id'), " touchstart.").concat(activates.attr('id'))); 2134 } 2135 }); 2136 } 2137 } 2138 }); 2139 } 2140 2141 origin.on('open', function (e, eventType) { 2142 placeDropdown(eventType); 2143 }); 2144 origin.on('close', hideDropdown); 2145 }); 2146 }; 2147 2148 $.fn.dropdown.defaults = { 2149 inDuration: 300, 2150 outDuration: 225, 2151 constrain_width: true, 2152 hover: false, 2153 gutter: 0, 2154 belowOrigin: false, 2155 alignment: 'left' 2156 }; 2157 $('.dropdown-button').dropdown(); 2158 2159 $.fn.mdbDropSearch = function (options) { 2160 var $mdbInput = $(this).find('input'); 2161 this.filter(function (value, index) { 2162 $(index).on('keyup', function () { 2163 var $linksInDropMenu = $mdbInput.closest('div[id]').find('a, li'); 2164 2165 for (var i = 0; i < $linksInDropMenu.length; i++) { 2166 if ($linksInDropMenu.eq(i).html().toUpperCase().indexOf($mdbInput.val().toUpperCase()) > -1) { 2167 $linksInDropMenu.eq(i).css({ 2168 display: '' 2169 }); 2170 } else { 2171 $linksInDropMenu.eq(i).css({ 2172 display: 'none' 2173 }); 2174 } 2175 } 2176 }); 2177 }); 2178 var settings = $.extend({ 2179 color: '#000', 2180 backgroundColor: '', 2181 fontSize: '.9rem', 2182 fontWeight: '400', 2183 borderRadius: '', 2184 borderColor: '' 2185 }, options); 2186 return this.css({ 2187 color: settings.color, 2188 backgroundColor: settings.backgroundColor, 2189 fontSize: settings.fontSize, 2190 fontWeight: settings.fontWeight, 2191 borderRadius: settings.borderRadius, 2192 border: settings.border, 2193 margin: settings.margin 2194 }); 2195 }; 2196})(jQuery); 2197 2198var dropdownSelectors = $('.dropdown, .dropup'); // Custom function to read dropdown data 2199 2200function dropdownEffectData(target) { 2201 // TODO - page level global? 2202 var effectInDefault = 'fadeIn'; 2203 var effectOutDefault = 'fadeOut'; 2204 var dropdown = $(target); 2205 var dropdownMenu = $('.dropdown-menu', target); 2206 var parentUl = dropdown.parents('ul.nav'); // If parent is ul.nav allow global effect settings 2207 2208 if (parentUl.height > 0) { 2209 effectInDefault = parentUl.data('dropdown-in') || null; 2210 effectOutDefault = parentUl.data('dropdown-out') || null; 2211 } 2212 2213 return { 2214 target: target, 2215 dropdown: dropdown, 2216 dropdownMenu: dropdownMenu, 2217 effectIn: dropdownMenu.data('dropdown-in') || effectInDefault, 2218 effectOut: dropdownMenu.data('dropdown-out') || effectOutDefault 2219 }; 2220} // Custom function to start effect (in or out) 2221 2222 2223function dropdownEffectStart(data, effectToStart) { 2224 if (effectToStart) { 2225 data.dropdown.addClass('dropdown-animating'); 2226 data.dropdownMenu.addClass(['animated', effectToStart].join(' ')); 2227 } 2228} // Custom function to read when animation is over 2229 2230 2231function dropdownEffectEnd(data, callbackFunc) { 2232 var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend'; 2233 data.dropdown.one(animationEnd, function () { 2234 data.dropdown.removeClass('dropdown-animating'); 2235 data.dropdownMenu.removeClass(['animated', data.effectIn, data.effectOut].join(' ')); // Custom callback option, used to remove open class in out effect
2236 2237 if (typeof callbackFunc === 'function') { 2238 callbackFunc(); 2239 } 2240 }); 2241} // Bootstrap API hooks 2242 2243 2244dropdownSelectors.on({ 2245 'show.bs.dropdown': function showBsDropdown() { 2246 // On show, start in effect 2247 var dropdown = dropdownEffectData(this); 2248 dropdownEffectStart(dropdown, dropdown.effectIn); 2249 }, 2250 'shown.bs.dropdown': function shownBsDropdown() { 2251 // On shown, remove in effect once complete 2252 var dropdown = dropdownEffectData(this); 2253 2254 if (dropdown.effectIn && dropdown.effectOut) { 2255 dropdownEffectEnd(dropdown); 2256 } 2257 }, 2258 'hide.bs.dropdown': function hideBsDropdown(e) { 2259 // On hide, start out effect 2260 var dropdown = dropdownEffectData(this); 2261 2262 if (dropdown.effectOut) { 2263 e.preventDefault(); 2264 dropdownEffectStart(dropdown, dropdown.effectOut); 2265 dropdownEffectEnd(dropdown, function () { 2266 dropdown.dropdown.removeClass('show'); 2267 dropdown.dropdownMenu.removeClass('show'); 2268 }); 2269 } 2270 } 2271}); 2272"use strict"; 2273 2274(function ($) { 2275 var _this = this; 2276 2277 $(document).ready(function () { 2278 $(document).on('mouseenter', '.fixed-action-btn', function () { 2279 var $this = $(this); 2280 openFABMenu($this); 2281 }); 2282 $(document).on('mouseleave', '.fixed-action-btn', function () { 2283 var $this = $(this); 2284 closeFABMenu($this); 2285 }); 2286 $(document).on('click', '.fixed-action-btn > a', function () { 2287 var $this = $(this); 2288 var $menu = $this.parent(); 2289 $menu.hasClass('active') ? openFABMenu($menu) : closeFABMenu($menu); 2290 2291 if ($menu.hasClass('active')) { 2292 closeFABMenu($menu); 2293 } else { 2294 openFABMenu($menu); 2295 } 2296 }); 2297 }); 2298 $.fn.extend({ 2299 openFAB: function openFAB() { 2300 openFABMenu($(this)); 2301 }, 2302 closeFAB: function closeFAB() { 2303 closeFABMenu($(this)); 2304 } 2305 }); 2306 2307 var openFABMenu = function openFABMenu(btn) { 2308 var fab = btn; 2309 2310 if (!fab.hasClass('active')) { 2311 fab.addClass('active'); 2312 var btnList = document.querySelectorAll('ul .btn-floating'); 2313 btnList.forEach(function (el) { 2314 el.classList.add('shown'); 2315 }); 2316 } 2317 }; 2318 2319 var closeFABMenu = function closeFABMenu(btn) { 2320 var fab = btn; 2321 fab.removeClass('active'); 2322 var btnList = document.querySelectorAll('ul .btn-floating'); 2323 btnList.forEach(function (el) { 2324 el.classList.remove('shown'); 2325 }); 2326 }; 2327 2328 $('.fixed-action-btn:not(.smooth-scroll) > .btn-floating').on('click', function (e) { 2329 if (!$(_this).hasClass('smooth-scroll')) { 2330 e.preventDefault(); 2331 toggleFABMenu($('.fixed-action-btn')); 2332 return false; 2333 } 2334 }); 2335 2336 function toggleFABMenu(btn) { 2337 var elem = btn; 2338 2339 if (elem.hasClass('active')) { 2340 closeFABMenu(elem); 2341 } else { 2342 openFABMenu(elem); 2343 } 2344 } 2345})(jQuery); 2346"use strict"; 2347 2348function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 2349 2350function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 2351 2352function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 2353 2354(function ($) { 2355 var MENU_WIDTH = 240; 2356 var SN_BREAKPOINT = 1440; 2357 var MENU_WIDTH_HALF = 2; 2358 var MENU_LEFT_MIN_BORDER = 0.3; 2359 var MENU_LEFT_MAX_BORDER = -0.5; 2360 var MENU_RIGHT_MIN_BORDER = -0.3; 2361 var MENU_RIGHT_MAX_BORDER = 0.5; 2362 var MENU_VELOCITY_OFFSET = 10; 2363 var MENU_TIME_DURATION_OPEN = 300; 2364 var MENU_TIME_DURATION_CLOSE = 200; 2365 var MENU_TIME_DURATION_OVERLAY_OPEN = 50; 2366 var MENU_TIME_DURATION_OVERLAY_CLOSE = 200; 2367 var MENU_EASING_OPEN = 'easeOutQuad'; 2368 var MENU_EASING_CLOSE = 'easeOutCubic'; 2369 var SHOW_OVERLAY = true; 2370 var SHOW_CLOSE_BUTTON = false;
2371 2372 var SideNav = 2373 /*#__PURE__*/ 2374 function () { 2375 function SideNav(element, options) { 2376 _classCallCheck(this, SideNav); 2377 2378 this.defaults = { 2379 MENU_WIDTH: MENU_WIDTH, 2380 edge: 'left', 2381 closeOnClick: false, 2382 breakpoint: SN_BREAKPOINT, 2383 timeDurationOpen: MENU_TIME_DURATION_OPEN, 2384 timeDurationClose: MENU_TIME_DURATION_CLOSE, 2385 timeDurationOverlayOpen: MENU_TIME_DURATION_OVERLAY_OPEN, 2386 timeDurationOverlayClose: MENU_TIME_DURATION_OVERLAY_CLOSE, 2387 easingOpen: MENU_EASING_OPEN, 2388 easingClose: MENU_EASING_CLOSE, 2389 showOverlay: SHOW_OVERLAY, 2390 showCloseButton: SHOW_CLOSE_BUTTON 2391 }; 2392 this.$element = element; 2393 this.$elementCloned = element.clone().css({ 2394 display: 'inline-block', 2395 lineHeight: '24px' 2396 }); 2397 this.options = this.assignOptions(options); 2398 this.menuOut = false;
2399 this.lastTouchVelocity = { 2400 x: { 2401 startPosition: 0, 2402 startTime: 0, 2403 endPosition: 0, 2404 endTime: 0 2405 } 2406 }; 2407 this.$body = $('body'); 2408 this.$menu = $("#".concat(this.$element.attr('data-activates'))); 2409 this.$sidenavOverlay = $('#sidenav-overlay'); 2410 this.$dragTarget = $('<div class="drag-target"></div>'); 2411 this.$body.append(this.$dragTarget); 2412 this.init(); 2413 } 2414 2415 _createClass(SideNav, [{ 2416 key: "init", 2417 value: function init() { 2418 this.setMENU_WIDTH(); 2419 this.setMenuTranslation(); 2420 this.closeOnClick(); 2421 this.openOnClick(); 2422 this.bindTouchEvents(); 2423 this.showCloseButton(); 2424 this.inputOnClick(); 2425 } 2426 }, { 2427 key: "bindTouchEvents", 2428 value: function bindTouchEvents() { 2429 var _this = this; 2430 2431 this.$dragTarget.on('click', function () { 2432 _this.removeMenu(); 2433 }); 2434 this.$elementCloned.on('click', function () { 2435 _this.removeMenu(); 2436 }); 2437 this.$dragTarget.on('touchstart', function (e) { 2438 _this.lastTouchVelocity.x.startPosition = e.touches[0].clientX; 2439 _this.lastTouchVelocity.x.startTime = Date.now(); 2440 }); 2441 this.$dragTarget.on('touchmove', this.touchmoveEventHandler.bind(this)); 2442 this.$dragTarget.on('touchend', this.touchendEventHandler.bind(this)); 2443 } 2444 }, { 2445 key: "touchmoveEventHandler", 2446 value: function touchmoveEventHandler(e) { 2447 if (e.type !== 'touchmove') { 2448 return; 2449 } 2450 2451 var touch = e.touches[0]; 2452 var touchX = touch.clientX; // calculate velocity every 20ms 2453 2454 if (Date.now() - this.lastTouchVelocity.x.startTime > 20) { 2455 this.lastTouchVelocity.x.startPosition = touch.clientX; 2456 this.lastTouchVelocity.x.startTime = Date.now(); 2457 } 2458 2459 this.disableScrolling(); 2460 var overlayExists = this.$sidenavOverlay.length !== 0; 2461 2462 if (!overlayExists) { 2463 this.buildSidenavOverlay(); 2464 } // Keep within boundaries 2465 2466 2467 if (this.options.edge === 'left') { 2468 if (touchX > this.options.MENU_WIDTH) { 2469 touchX = this.options.MENU_WIDTH; 2470 } else if (touchX < 0) { 2471 touchX = 0; 2472 } 2473 } 2474 2475 this.translateSidenavX(touchX); 2476 this.updateOverlayOpacity(touchX); 2477 } 2478 }, { 2479 key: "panEventHandler", 2480 value: function panEventHandler(e) { 2481 if (e.gesture.pointerType !== 'touch') { 2482 return; 2483 } 2484 2485 var touchX = e.gesture.center.x; 2486 this.disableScrolling(); 2487 var overlayExists = this.$sidenavOverlay.length !== 0; 2488 2489 if (!overlayExists) { 2490 this.buildSidenavOverlay(); 2491 } // Keep within boundaries 2492 2493 2494 if (this.options.edge === 'left') { 2495 if (touchX > this.options.MENU_WIDTH) { 2496 touchX = this.options.MENU_WIDTH; 2497 } else if (touchX < 0) { 2498 touchX = 0; 2499 } 2500 } 2501 2502 this.translateSidenavX(touchX); 2503 this.updateOverlayOpacity(touchX); 2504 } 2505 }, { 2506 key: "translateSidenavX", 2507 value: function translateSidenavX(touchX) { 2508 if (this.options.edge === 'left') { 2509 var isRightDirection = touchX >= this.options.MENU_WIDTH / MENU_WIDTH_HALF; 2510 this.menuOut = isRightDirection; 2511 this.$menu.css('transform', "translateX(".concat(touchX - this.options.MENU_WIDTH, "px)")); 2512 } else { 2513 var isLeftDirection = touchX < window.innerWidth - this.options.MENU_WIDTH / MENU_WIDTH_HALF; 2514 this.menuOut = isLeftDirection;
2515 var rightPos = touchX - this.options.MENU_WIDTH / MENU_WIDTH_HALF; 2516 2517 if (rightPos < 0) { 2518 rightPos = 0; 2519 } 2520 2521 this.$menu.css('transform', "translateX(".concat(rightPos, "px)")); 2522 } 2523 } 2524 }, { 2525 key: "updateOverlayOpacity", 2526 value: function updateOverlayOpacity(touchX) { 2527 var overlayPercentage; 2528 2529 if (this.options.edge === 'left') { 2530 overlayPercentage = touchX / this.options.MENU_WIDTH; 2531 } else { 2532 overlayPercentage = Math.abs((touchX - window.innerWidth) / this.options.MENU_WIDTH); 2533 } 2534 2535 this.$sidenavOverlay.velocity({ 2536 opacity: overlayPercentage 2537 }, { 2538 duration: 10, 2539 queue: false, 2540 easing: this.options.easingOpen 2541 }); 2542 } 2543 }, { 2544 key: "buildSidenavOverlay", 2545 value: function buildSidenavOverlay() { 2546 var _this2 = this; 2547 2548 if (this.options.showOverlay === true) { 2549 this.$sidenavOverlay = $('<div id="sidenav-overlay"></div>'); 2550 this.$sidenavOverlay.css('opacity', 0).on('click', function () { 2551 _this2.removeMenu(); 2552 }); 2553 this.$body.append(this.$sidenavOverlay); 2554 } 2555 } 2556 }, { 2557 key: "disableScrolling", 2558 value: function disableScrolling() { 2559 var oldWidth = this.$body.innerWidth(); 2560 this.$body.css('overflow', 'hidden'); 2561 this.$body.width(oldWidth); 2562 } 2563 }, { 2564 key: "touchendEventHandler", 2565 value: function touchendEventHandler(e) { 2566 if (e.type !== 'touchend') { 2567 return; 2568 } 2569 2570 var touch = e.changedTouches[0]; 2571 this.lastTouchVelocity.x.endTime = Date.now(); 2572 this.lastTouchVelocity.x.endPosition = touch.clientX; 2573 var velocityX = this.calculateTouchVelocityX(); 2574 var touchX = touch.clientX; 2575 var leftPos = touchX - this.options.MENU_WIDTH; 2576 var rightPos = touchX - this.options.MENU_WIDTH / MENU_WIDTH_HALF; 2577 2578 if (leftPos > 0) { 2579 leftPos = 0; 2580 } 2581 2582 if (rightPos < 0) { 2583 rightPos = 0; 2584 } 2585 2586 if (this.options.edge === 'left') { 2587 // If velocityX <= 0.3 then the user is flinging the menu closed so ignore this.menuOut 2588 if (this.menuOut && velocityX <= MENU_LEFT_MIN_BORDER || velocityX < MENU_LEFT_MAX_BORDER) { 2589 if (leftPos !== 0) { 2590 this.translateMenuX([0, leftPos], '300'); 2591 } 2592 2593 this.showSidenavOverlay(); 2594 } else if (!this.menuOut || velocityX > MENU_LEFT_MIN_BORDER) { 2595 this.enableScrolling(); 2596 this.translateMenuX([-1 * this.options.MENU_WIDTH - MENU_VELOCITY_OFFSET, leftPos], '200'); 2597 this.hideSidenavOverlay(); 2598 } 2599 2600 this.$dragTarget.css({ 2601 width: '10px', 2602 right: '', 2603 left: 0 2604 }); 2605 } else if (this.menuOut && velocityX >= MENU_RIGHT_MIN_BORDER || velocityX > MENU_RIGHT_MAX_BORDER) { 2606 this.translateMenuX([0, rightPos], '300'); 2607 this.showSidenavOverlay(); 2608 this.$dragTarget.css({ 2609 width: '50%', 2610 right: '', 2611 left: 0 2612 }); 2613 } else if (!this.menuOut || velocityX < MENU_RIGHT_MIN_BORDER) { 2614 this.enableScrolling(); 2615 this.translateMenuX([this.options.MENU_WIDTH + MENU_VELOCITY_OFFSET, rightPos], '200'); 2616 this.hideSidenavOverlay(); 2617 this.$dragTarget.css({ 2618 width: '10px', 2619 right: 0, 2620 left: '' 2621 }); 2622 } 2623 } 2624 }, { 2625 key: "calculateTouchVelocityX", 2626 value: function calculateTouchVelocityX() { 2627 var distance = Math.abs(this.lastTouchVelocity.x.endPosition - this.lastTouchVelocity.x.startPosition); 2628 var time = Math.abs(this.lastTouchVelocity.x.endTime - this.lastTouchVelocity.x.startTime); 2629 return distance / time; 2630 } 2631 }, { 2632 key: "panendEventHandler", 2633 value: function panendEventHandler(e) { 2634 if (e.gesture.pointerType !== 'touch') { 2635 return; 2636 } 2637 2638 var velocityX = e.gesture.velocityX; 2639 var touchX = e.gesture.center.x; 2640 var leftPos = touchX - this.options.MENU_WIDTH;
2641 var rightPos = touchX - this.options.MENU_WIDTH / MENU_WIDTH_HALF; 2642 2643 if (leftPos > 0) { 2644 leftPos = 0; 2645 } 2646 2647 if (rightPos < 0) { 2648 rightPos = 0; 2649 } 2650 2651 if (this.options.edge === 'left') { 2652 // If velocityX <= 0.3 then the user is flinging the menu closed so ignore this.menuOut 2653 if (this.menuOut && velocityX <= MENU_LEFT_MIN_BORDER || velocityX < MENU_LEFT_MAX_BORDER) { 2654 if (leftPos !== 0) { 2655 this.translateMenuX([0, leftPos], '300'); 2656 } 2657 2658 this.showSidenavOverlay(); 2659 } else if (!this.menuOut || velocityX > MENU_LEFT_MIN_BORDER) { 2660 this.enableScrolling(); 2661 this.translateMenuX([-1 * this.options.MENU_WIDTH - MENU_VELOCITY_OFFSET, leftPos], '200'); 2662 this.hideSidenavOverlay(); 2663 } 2664 2665 this.$dragTarget.css({ 2666 width: '10px', 2667 right: '', 2668 left: 0 2669 }); 2670 } else if (this.menuOut && velocityX >= MENU_RIGHT_MIN_BORDER || velocityX > MENU_RIGHT_MAX_BORDER) { 2671 this.translateMenuX([0, rightPos], '300'); 2672 this.showSidenavOverlay(); 2673 this.$dragTarget.css({ 2674 width: '50%', 2675 right: '', 2676 left: 0 2677 }); 2678 } else if (!this.menuOut || velocityX < MENU_RIGHT_MIN_BORDER) { 2679 this.enableScrolling(); 2680 this.translateMenuX([this.options.MENU_WIDTH + MENU_VELOCITY_OFFSET, rightPos], '200'); 2681 this.hideSidenavOverlay(); 2682 this.$dragTarget.css({ 2683 width: '10px', 2684 right: 0, 2685 left: '' 2686 }); 2687 } 2688 } 2689 }, { 2690 key: "translateMenuX", 2691 value: function translateMenuX(fromTo, duration) { 2692 this.$menu.velocity({ 2693 translateX: fromTo 2694 }, { 2695 duration: typeof duration === 'string' ? Number(duration) : duration, 2696 queue: false, 2697 easing: this.options.easingOpen 2698 }); 2699 } 2700 }, { 2701 key: "hideSidenavOverlay", 2702 value: function hideSidenavOverlay() { 2703 2704 2705 this.$sidenavOverlay.velocity({ 2706 opacity: 0 2707 }, { 2708 duration: this.options.timeDurationOverlayClose, 2709 queue: false, 2710 easing: this.options.easingOpen, 2711 complete: function complete() { 2712 $(this).remove(); 2713 } 2714 }); 2715 this.$sidenavOverlay = $(); 2716 } 2717 }, { 2718 key: "showSidenavOverlay", 2719 value: function showSidenavOverlay() { 2720 2721 this.$sidenavOverlay.velocity({ 2722 opacity: 1 2723 }, { 2724 duration: this.options.timeDurationOverlayOpen, 2725 queue: false, 2726 easing: this.options.easingOpen 2727 }); 2728 } 2729 }, { 2730 key: "enableScrolling", 2731 value: function enableScrolling() { 2732 this.$body.css({ 2733 overflow: '', 2734 width: '' 2735 }); 2736 } 2737 }, { 2738 key: "openOnClick", 2739 value: function openOnClick() { 2740 var _this3 = this; 2741 2742 this.$element.on('click', function (e) { 2743 e.preventDefault(); 2744 2745 if (_this3.menuOut === true) { 2746 _this3.menuOut = false;
2747 2748 _this3.removeMenu(); 2749 } else { 2750 if (_this3.options.showOverlay === true) { 2751 _this3.$sidenavOverlay = $('<div id="sidenav-overlay"></div>'); 2752 2753 _this3.$body.append(_this3.$sidenavOverlay); 2754 } else { 2755 _this3.showCloseButton(); 2756 } 2757 2758 var translateX = []; 2759 2760 if (_this3.options.edge === 'left') { 2761 translateX = [0, -1 * _this3.options.MENU_WIDTH]; 2762 } else { 2763 translateX = [0, _this3.options.MENU_WIDTH]; 2764 } 2765 2766 _this3.$menu.velocity({ 2767 translateX: translateX 2768 }, { 2769 duration: _this3.options.timeDurationOpen, 2770 queue: false, 2771 easing: _this3.options.easingOpen 2772 }); 2773 2774 _this3.$sidenavOverlay.on('click', function () { 2775 _this3.removeMenu(); 2776 }); 2777 2778 _this3.$sidenavOverlay.on('touchmove', _this3.touchmoveEventHandler.bind(_this3)); 2779 2780 _this3.$menu.on('touchmove', function (e) { 2781 e.preventDefault(); 2782 2783 _this3.$menu.find('.custom-scrollbar').css('padding-bottom', '30px'); 2784 }); 2785 } 2786 }); 2787 2788 2789 2790 } 2791 }, { 2792 key: "closeOnClick", 2793 value: function closeOnClick() { 2794 var _this4 = this; 2795 2796 if (this.options.closeOnClick === true) { 2797 this.$menu.on('click', 'a:not(.collapsible-header)', function () { 2798 _this4.removeMenu(); 2799 }); 2800 } 2801 } 2802 }, { 2803 key: "showCloseButton", 2804 value: function showCloseButton() { 2805 if (this.options.showCloseButton === true) { 2806 this.$menu.prepend(this.$elementCloned); 2807 this.$menu.find('.logo-wrapper').css({ 2808 borderTop: '1px solid rgba(153,153,153,.3)' 2809 }); 2810 } 2811 } 2812 }, { 2813 key: "setMenuTranslation", 2814 value: function setMenuTranslation() { 2815 var _this5 = this; 2816 2817 if (this.options.edge === 'left') { 2818 this.$menu.css('transform', 'translateX(-100%)'); 2819 this.$dragTarget.css({ 2820 left: 0 2821 }); 2822 } else { 2823 this.$menu.addClass('right-aligned').css('transform', 'translateX(100%)'); 2824 this.$dragTarget.css({ 2825 right: 0 2826 }); 2827 } 2828 2829 if (this.$menu.hasClass('fixed')) { 2830 if (window.innerWidth > this.options.breakpoint) { 2831 this.$menu.css('transform', 'translateX(0)'); 2832 } 2833 2834 this.$menu.find('input[type=text]').on('touchstart', function (e) { 2835 _this5.$menu.addClass('transform-fix-input'); 2836 }); 2837 $(window).resize(function () { 2838 if (window.innerWidth > _this5.options.breakpoint) { 2839 if (_this5.$sidenavOverlay.length) { 2840 _this5.removeMenu(true); 2841 } else { 2842 _this5.$menu.css('transform', 'translateX(0%)'); 2843 } 2844 } else if (_this5.menuOut === false) { 2845 var xValue = _this5.options.edge === 'left' ? '-100' : '100'; 2846 2847 _this5.$menu.css('transform', "translateX(".concat(xValue, "%)")); 2848 } 2849 }); 2850 } 2851 } 2852 }, { 2853 key: "setMENU_WIDTH", 2854 value: function setMENU_WIDTH() { 2855 var $sidenavBg = $("#".concat(this.$menu.attr('id'))).find('> .sidenav-bg'); 2856 2857 if (this.options.MENU_WIDTH !== MENU_WIDTH) { 2858 this.$menu.css('width', this.options.MENU_WIDTH); 2859 $sidenavBg.css('width', this.options.MENU_WIDTH); 2860 } 2861 } 2862 }, { 2863 key: "inputOnClick", 2864 value: function inputOnClick() { 2865 var _this6 = this; 2866 2867 this.$menu.find('input[type=text]').on('touchstart', function (e) { 2868 _this6.$menu.css('transform', 'translateX(0)'); 2869 }); 2870 } 2871 }, { 2872 key: "assignOptions", 2873 value: function assignOptions(newOptions) { 2874 return $.extend({}, this.defaults, newOptions); 2875 } 2876 }, { 2877 key: "removeMenu", 2878 value: function removeMenu(restoreMenu) { 2879 var _this7 = this; 2880 2881 this.$body.css({ 2882 overflow: '', 2883 width: '' 2884 }); 2885 this.$menu.velocity({ 2886 translateX: this.options.edge === 'left' ? '-100%' : '100%' 2887 }, { 2888 duration: this.options.timeDurationClose, 2889 queue: false, 2890 easing: this.options.easingClose, 2891 complete: function complete() { 2892 if (restoreMenu === true) { 2893 _this7.$menu.removeAttr('style'); 2894 2895 _this7.$menu.css('width', _this7.options.MENU_WIDTH); 2896 } 2897 } 2898 }); 2899 2900 if (this.$menu.hasClass('transform-fix-input')) { 2901 this.$menu.removeClass('transform-fix-input'); 2902 } 2903 2904 this.hideSidenavOverlay(); 2905 2906 } 2907 }, { 2908 key: "show", 2909 value: function show() { 2910 this.trigger('click'); 2911 } 2912 }, { 2913 key: "hide", 2914 value: function hide() { 2915 this.trigger('click'); 2916 } 2917 }]); 2918 2919 return SideNav; 2920 }(); 2921 2922 $.fn.sideNav = function (options) { 2923 return this.each(function () { 2924 new SideNav($(this), options); 2925 }); 2926 }; 2927})(jQuery); 2928 2929$(function () {
2930 $("#toggle").click(function () { 2931 if ($("#slide-out").hasClass('slim')) { 2932 $("#slide-out").removeClass('slim'); 2933 $(".sv-slim-icon").removeClass('fa-angle-double-right').addClass('fa-angle-double-left'); 2934 } else { 2935 $("#slide-out").addClass('slim'); 2936 $(".sv-slim-icon").removeClass('fa-angle-double-left').addClass('fa-angle-double-right'); 2937 } 2938 }); 2939}); 2940"use strict"; 2941 2942(function ($) { 2943 $.fn.collapsible = function (options) { 2944 var defaults = { 2945 accordion: undefined 2946 }; 2947 options = $.extend(defaults, options); 2948 2949 function accordionOpen($collapsible, object) { 2950 $panelHeaders = $collapsible.find('> li > .collapsible-header'); 2951 2952 if (object.hasClass('active')) { 2953 object.parent().addClass('active'); 2954 } else { 2955 object.parent().removeClass('active'); 2956 } 2957 2958 if (object.parent().hasClass('active')) { 2959 object.siblings('.collapsible-body').stop(true, false).slideDown({ 2960 duration: 350, 2961 easing: 'easeOutQuart', 2962 queue: false, 2963 complete: function complete() { 2964 $(this).css('height', ''); 2965 } 2966 }); 2967 } else { 2968 object.siblings('.collapsible-body').stop(true, false).slideUp({ 2969 duration: 350, 2970 easing: 'easeOutQuart', 2971 queue: false, 2972 complete: function complete() { 2973 $(this).css('height', ''); 2974 } 2975 }); 2976 } 2977 2978 $panelHeaders.not(object).removeClass('active').parent().removeClass('active'); 2979 $panelHeaders.not(object).parent().children('.collapsible-body').stop(true, false).slideUp({ 2980 duration: 350, 2981 easing: 'easeOutQuart', 2982 queue: false, 2983 complete: function complete() { 2984 $(this).css('height', ''); 2985 } 2986 }); 2987 } 2988 2989 function expandableOpen(object) { 2990 if (object.hasClass('active')) { 2991 object.parent().addClass('active'); 2992 } else { 2993 object.parent().removeClass('active'); 2994 } 2995 2996 if (object.parent().hasClass('active')) { 2997 object.siblings('.collapsible-body').stop(true, false).slideDown({ 2998 duration: 350, 2999 easing: 'easeOutQuart', 3000 queue: false, 3001 complete: function complete() { 3002 $(this).css('height', ''); 3003 } 3004 }); 3005 } else { 3006 object.siblings('.collapsible-body').stop(true, false).slideUp({ 3007 duration: 350, 3008 easing: 'easeOutQuart', 3009 queue: false, 3010 complete: function complete() { 3011 $(this).css('height', ''); 3012 } 3013 }); 3014 } 3015 } 3016 3017 function isChildrenOfPanelHeader(object) { 3018 var panelHeader = getPanelHeader(object); 3019 return panelHeader.length > 0; 3020 } 3021 3022 function getPanelHeader(object) { 3023 return object.closest('li > .collapsible-header'); 3024 } 3025 3026 return this.each(function () { 3027 var $this = $(this); 3028 var $panelHeaders = $(this).find('> li > .collapsible-header'); 3029 var collapsibleType = $this.data('collapsible'); // Turn off any existing event handlers 3030 3031 $this.off('click.collapse', '.collapsible-header'); 3032 $panelHeaders.off('click.collapse'); 3033 3034 if (options.accordion || collapsibleType === 'accordion' || collapsibleType === undefined) { 3035 $panelHeaders = $this.find('> li > .collapsible-header'); 3036 $panelHeaders.on('click.collapse', function (e) { 3037 var element = $(e.target); 3038 3039 if (isChildrenOfPanelHeader(element)) { 3040 element = getPanelHeader(element); 3041 } 3042 3043 element.toggleClass('active'); 3044 accordionOpen($this, element); 3045 }); 3046 accordionOpen($this, $panelHeaders.filter('.active').first()); 3047 } else { 3048 $panelHeaders.each(function () { 3049 $(this).on('click.collapse', function (e) { 3050 var element = $(e.target); 3051 3052 if (isChildrenOfPanelHeader(element)) { 3053 element = getPanelHeader(element); 3054 } 3055 3056 element.toggleClass('active'); 3057 expandableOpen(element); 3058 }); 3059 3060 if ($(this).hasClass('active')) { 3061 expandableOpen($(this)); 3062 } 3063 }); 3064 } 3065 }); 3066 }; 3067 3068 $('.collapsible').collapsible(); 3069})(jQuery); 3070 3071 3072"use strict"; 3073 3074(function ($) { 3075 var rangeWrapper = '.range-field'; 3076 var rangeType = 'input[type=range]:not(.custom-range):not(.multi-range)'; 3077 var thumbHtml = '<span class="thumb"><span class="value"></span></span>'; 3078 var rangeMousedown = false;
3079 var left; 3080 3081 var addThumb = function addThumb() { 3082 var $thumb = $(thumbHtml); 3083 $(rangeType).after($thumb); 3084 }; 3085 3086 $(document).on('change', rangeType, function () { 3087 var $thumb = $(this); 3088 var $thumbValue = $thumb.siblings('.thumb').find('.value'); 3089 $thumbValue.html($thumb.val()); 3090 }); 3091 $(document).on('input mousedown touchstart', rangeType, function (e) { 3092 var $this = $(this); 3093 var $thumb = $this.siblings('.thumb'); 3094 var width = $this.outerWidth(); 3095 var noThumb = !$thumb.length; 3096 3097 if (noThumb) { 3098 addThumb(); 3099 } // Set indicator value 3100 3101 3102 $thumb.find('.value').html($this.val()); 3103 rangeMousedown = true; 3104 $this.addClass('active'); 3105 3106 if (!$thumb.hasClass('active')) { 3107 $thumb.velocity({ 3108 height: '30px', 3109 width: '30px', 3110 top: '-20px', 3111 marginLeft: '-15px' 3112 }, { 3113 duration: 300, 3114 easing: 'easeOutExpo' 3115 }); 3116 } 3117 3118 if (e.type !== 'input') { 3119 var isMobile = e.pageX === undefined || e.pageX === null; 3120 3121 if (isMobile) { 3122 left = e.originalEvent.touches[0].pageX - $(this).offset().left; 3123 } else { 3124 left = e.pageX - $(this).offset().left; 3125 } 3126 3127 if (left < 0) { 3128 left = 0; 3129 } else if (left > width) { 3130 left = width; 3131 } 3132 3133 $thumb.addClass('active').css('left', left); 3134 } 3135 3136 $thumb.find('.value').html($this.val()); 3137 }); 3138 $(document).on('mouseup touchend', rangeWrapper, function () { 3139 rangeMousedown = false; 3140 $(this).removeClass('active'); 3141 }); 3142 $(document).on('mousemove touchmove', rangeWrapper, function (e) { 3143 var $thumb = $(this).children('.thumb'); 3144 var left; 3145 3146 if (rangeMousedown) { 3147 if (!$thumb.hasClass('active')) { 3148 $thumb.velocity({ 3149 height: '30px', 3150 width: '30px', 3151 top: '-20px', 3152 marginLeft: '-15px' 3153 }, { 3154 duration: 300, 3155 easing: 'easeOutExpo' 3156 }); 3157 } 3158 3159 var isMobile = e.pageX === undefined || e.pageX === null; 3160 3161 if (isMobile) { 3162 left = e.originalEvent.touches[0].pageX - $(this).offset().left; 3163 } else { 3164 left = e.pageX - $(this).offset().left; 3165 } 3166 3167 var width = $(this).outerWidth(); 3168 3169 if (left < 0) { 3170 left = 0; 3171 } else if (left > width) { 3172 left = width; 3173 } 3174 3175 $thumb.addClass('active').css('left', left); 3176 $thumb.find('.value').html($thumb.siblings(rangeType).val()); 3177 } 3178 }); 3179 $(document).on('mouseout touchleave', rangeWrapper, function () { 3180 if (!rangeMousedown) { 3181 var $thumb = $(this).children('.thumb'); 3182 3183 if ($thumb.hasClass('active')) { 3184 $thumb.velocity({ 3185 height: '0', 3186 width: '0', 3187 top: '10px', 3188 marginLeft: '-6px' 3189 }, { 3190 duration: 100 3191 }); 3192 } 3193 3194 $thumb.removeClass('active'); 3195 } 3196 }); 3197})(jQuery); 3198"use strict"; 3199 3200(function ($) { 3201 $(document).on('change', '.file-field input[type="file"]', function (e) { 3202 var $this = $(e.target); 3203 var $fileField = $this.closest('.file-field'); 3204 var $pathInput = $fileField.find('input.file-path'); 3205 var files = $this[0].files; 3206 var fileNames = []; // files.forEach((file) => fileNames.push(file.name)); 3207 3208 if (Array.isArray(files)) { 3209 files.forEach(function (file) { 3210 return fileNames.push(file.name); 3211 }); 3212 } else { 3213 Object.keys(files).forEach(function (key) { 3214 fileNames.push(files[key].name); 3215 }); 3216 } 3217 3218 $pathInput.val(fileNames.join(', ')); 3219 $pathInput.trigger('change'); 3220 }); 3221})(jQuery); 3222"use strict"; 3223 3224function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 3225 3226function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 3227 3228function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 3229 3230(function ($) { 3231 var MaterialSelect = 3232 /*#__PURE__*/ 3233 function () { 3234 function MaterialSelect($nativeSelect, options) { 3235 _classCallCheck(this, MaterialSelect); 3236 3237 this.$nativeSelect = $nativeSelect; 3238 this.defaults = { 3239 destroy: false, 3240 nativeID: null, 3241 BSsearchIn: false, 3242 BSinputText: false,
3243 fasClasses: '', 3244 farClasses: '', 3245 fabClasses: '', 3246 copyClassesOption: false, 3247 language: { 3248 active: false, 3249 pl: { 3250 selectAll: 'Wybierz wszystko', 3251 optionsSelected: 'wybranych opcji' 3252 }, 3253 in: { 3254 selectAll: 'Pilih semuanya', 3255 optionsSelected: 'opsi yang dipilih' 3256 }, 3257 fr: { 3258 selectAll: 'Tout choisir', 3259 optionsSelected: 'options sélectionnées' 3260 }, 3261 ge: { 3262 selectAll: 'Wähle alles aus', 3263 optionsSelected: 'ausgewählte Optionen' 3264 }, 3265 ar: { 3266 selectAll: 'اختر ÙÙ Ø´ÙØ¡', 3267 optionsSelected: 'Ø§ÙØ®Ùارات اÙÙ ØØ¯Ø¯Ø©' 3268 } 3269 } 3270 }; 3271 this.options = this.assignOptions(options); 3272 this.isMultiple = Boolean(this.$nativeSelect.attr('multiple')); 3273 this.isSearchable = Boolean(this.$nativeSelect.attr('searchable')); 3274 this.isRequired = Boolean(this.$nativeSelect.attr('required')); 3275 this.uuid = this.options.nativeID !== null && this.options.nativeID !== '' && this.options.nativeID !== undefined && typeof this.options.nativeID === 'string' ? this.options.nativeID : this._randomUUID(); 3276 this.$selectWrapper = $('<div class="select-wrapper"></div>'); 3277 this.$materialOptionsList = $("<ul id=\"select-options-".concat(this.uuid, "\" class=\"dropdown-content select-dropdown w-100 ").concat(this.isMultiple ? 'multiple-select-dropdown' : '', "\"></ul>")); 3278 this.$materialSelectInitialOption = $nativeSelect.find('option:selected').text() || $nativeSelect.find('option:first').text() || ''; 3279 this.$nativeSelectChildren = this.$nativeSelect.children('option, optgroup'); 3280 this.$materialSelect = $("<input type=\"text\" class=\"".concat(this.options.BSinputText ? 'browser-default custom-select multi-bs-select select-dropdown' : 'select-dropdown', "\" readonly=\"true\" ").concat(this.$nativeSelect.is(':disabled') ? 'disabled' : '', " data-activates=\"select-options-").concat(this.uuid, "\" value=\"\"/>")); 3281 this.$dropdownIcon = this.options.BSinputText ? '' : $('<span class="caret">▼</span>'); 3282 this.$searchInput = null; 3283 this.$toggleAll = $("<li class=\"select-toggle-all\"><span><input type=\"checkbox\" class=\"form-check-input\"><label>Select all</label></span></li>"); 3284 this.mainLabel = this.$nativeSelect.next('.mdb-main-label'); 3285 this.valuesSelected = []; 3286 this.keyCodes = { 3287 tab: 9, 3288 esc: 27, 3289 enter: 13, 3290 arrowUp: 38, 3291 arrowDown: 40 3292 }; 3293 MaterialSelect.mutationObservers = []; 3294 } 3295 3296 _createClass(MaterialSelect, [{ 3297 key: "assignOptions", 3298 value: function assignOptions(newOptions) { 3299 return $.extend({}, this.defaults, newOptions); 3300 } 3301 }, { 3302 key: "init", 3303 value: function init() { 3304 var alreadyInitialized = Boolean(this.$nativeSelect.data('select-id')); 3305 3306 if (alreadyInitialized) { 3307 this._removeMaterialWrapper(); 3308 } 3309 3310 if (this.options.destroy) { 3311 this.$nativeSelect.data('select-id', null).removeClass('initialized'); 3312 return; 3313 } 3314 3315 if (this.options.BSsearchIn || this.options.BSinputText) { 3316 this.$selectWrapper.addClass(this.$nativeSelect.attr('class').split(' ').filter(function (el) { 3317 return el !== 'md-form'; 3318 }).join(' ')).css({ 3319 marginTop: '1.5rem', 3320 marginBottom: '1.5rem' 3321 }); 3322 } else { 3323 this.$selectWrapper.addClass(this.$nativeSelect.attr('class')); 3324 } 3325 3326 this.$nativeSelect.data('select-id', this.uuid); 3327 var sanitizedLabelHtml = this.$materialSelectInitialOption.replace(/"/g, '"').replace(/ +/g, ' ').trim(); 3328 this.mainLabel.length === 0 ? this.$materialSelect.val(sanitizedLabelHtml) : this.mainLabel.text(); 3329 this.renderMaterialSelect(); 3330 this.bindEvents(); 3331 3332 if (this.isRequired) { 3333 this.enableValidation(); 3334 } 3335 3336 if (this.options.language.active && this.$toggleAll) { 3337 if (this.options.language.pl) { 3338 this.$toggleAll.find('label').text(this.options.language.pl.selectAll ? this.options.language.pl.selectAll : this.defaults.language.pl.selectAll); 3339 } 3340 3341 if (this.options.language.fr) { 3342 this.$toggleAll.find('label').text(this.options.language.fr.selectAll ? this.options.language.fr.selectAll : this.defaults.language.fr.selectAll); 3343 } 3344 3345 if (this.options.language.ge) { 3346 this.$toggleAll.find('label').text(this.options.language.ge.selectAll ? this.options.language.ge.selectAll : this.defaults.language.ge.selectAll); 3347 } 3348 3349 if (this.options.language.ar) { 3350 this.$toggleAll.find('label').text(this.options.language.ar.selectAll ? this.options.language.ar.selectAll : this.defaults.language.ar.selectAll); 3351 } 3352 3353 if (this.options.language.in) { 3354 this.$toggleAll.find('label').text(this.options.language.in.selectAll ? this.options.language.in.selectAll : this.defaults.language.in.selectAll); 3355 } 3356 } 3357 3358 if (this.$materialSelect.hasClass('custom-select') && this.$materialSelect.hasClass('select-dropdown')) { 3359 this.$materialSelect.css({ 3360 'display': 'inline-block', 3361 'width': '100%', 3362 'height': 'calc(1.5em + .75rem + 2px)', 3363 'padding': '.375rem 1.75rem .375rem .75rem', 3364 'font-size': '1rem', 3365 'line-height': '1.5', 3366 'background-color': '#fff', 3367 'border': '1px solid #ced4da' 3368 }); 3369 } 3370 } 3371 }, { 3372 key: "_removeMaterialWrapper", 3373 value: function _removeMaterialWrapper() { 3374 var currentUuid = this.$nativeSelect.data('select-id'); 3375 this.$nativeSelect.parent().find('span.caret').remove(); 3376 this.$nativeSelect.parent().find('input').remove(); 3377 this.$nativeSelect.unwrap(); 3378 $("ul#select-options-".concat(currentUuid)).remove(); 3379 } 3380 }, { 3381 key: "renderMaterialSelect", 3382 value: function renderMaterialSelect() { 3383 var _this = this; 3384 3385 this.$nativeSelect.before(this.$selectWrapper); 3386 this.appendDropdownIcon(); 3387 this.appendMaterialSelect(); 3388 this.appendMaterialOptionsList(); 3389 this.appendNativeSelect(); 3390 this.appendSaveSelectButton(); 3391 3392 if (!this.$nativeSelect.is(':disabled')) { 3393 this.$materialSelect.dropdown({ 3394 hover: false, 3395 closeOnClick: false 3396 }); 3397 } 3398 3399 if (this.$nativeSelect.data('inherit-tabindex') !== false) { 3400 this.$materialSelect.attr('tabindex', this.$nativeSelect.attr('tabindex')); 3401 } 3402 3403 if (this.isMultiple) { 3404 this.$nativeSelect.find('option:selected:not(:disabled)').each(function (i, element) { 3405 var index = element.index; 3406 3407 _this._toggleSelectedValue(index); 3408 3409 _this.$materialOptionsList.find('li:not(.optgroup):not(.select-toggle-all)').eq(index).find(':checkbox').prop('checked', true); 3410 }); 3411 } else { 3412 var index = this.$nativeSelect.find('option:selected').index(); 3413 this.$materialOptionsList.find('li').eq(index).addClass('active'); 3414 } 3415 3416 this.$nativeSelect.addClass('initialized'); 3417 3418 if (this.options.BSinputText) { 3419 this.mainLabel.css('top', '-7px'); 3420 } 3421 } 3422 }, { 3423 key: "appendDropdownIcon", 3424 value: function appendDropdownIcon() { 3425 if (this.$nativeSelect.is(':disabled')) { 3426 this.$dropdownIcon.addClass('disabled'); 3427 } 3428 3429 this.$selectWrapper.append(this.$dropdownIcon); 3430 } 3431 }, { 3432 key: "appendMaterialSelect", 3433 value: function appendMaterialSelect() { 3434 this.$selectWrapper.append(this.$materialSelect); 3435 } 3436 }, { 3437 key: "appendMaterialOptionsList", 3438 value: function appendMaterialOptionsList() { 3439 if (this.isSearchable) { 3440 this.appendSearchInputOption(); 3441 } 3442 3443 this.buildMaterialOptions(); 3444 3445 if (this.isMultiple) { 3446 this.appendToggleAllCheckbox(); 3447 } 3448 3449 this.$selectWrapper.append(this.$materialOptionsList); 3450 } 3451 }, { 3452 key: "appendNativeSelect", 3453 value: function appendNativeSelect() { 3454 this.$nativeSelect.appendTo(this.$selectWrapper); 3455 } 3456 }, { 3457 key: "appendSearchInputOption", 3458 value: function appendSearchInputOption() { 3459 var placeholder = this.$nativeSelect.attr('searchable'); 3460 3461 if (this.options.BSsearchIn) { 3462 this.$searchInput = $("<span class=\"search-wrap ml-2\"><div class=\"mt-0\"><input type=\"text\" class=\"search form-control mb-2 w-100 d-block select-default\" placeholder=\"".concat(placeholder, "\"></div></span>")); 3463 } else { 3464 this.$searchInput = $("<span class=\"search-wrap ml-2\"><div class=\"md-form mt-0\"><input type=\"text\" class=\"search form-control w-100 d-block\" placeholder=\"".concat(placeholder, "\"></div></span>")); 3465 } 3466 3467 this.$materialOptionsList.append(this.$searchInput); 3468 this.$searchInput.on("click", function (e) { 3469 e.stopPropagation(); 3470 }); 3471 } 3472 }, { 3473 key: "appendToggleAllCheckbox", 3474 value: function appendToggleAllCheckbox() { 3475 this.$materialOptionsList.find('li.disabled').first().after(this.$toggleAll); 3476 } 3477 }, { 3478 key: "appendSaveSelectButton", 3479 value: function appendSaveSelectButton() { 3480 this.$selectWrapper.parent().find('button.btn-save').appendTo(this.$materialOptionsList); 3481 } 3482 }, { 3483 key: "buildMaterialOptions", 3484 value: function buildMaterialOptions() { 3485 var _this2 = this; 3486 3487 this.$nativeSelectChildren.each(function (index, option) { 3488 var $this = $(option); 3489 3490 if ($this.is('option')) { 3491 _this2.buildSingleOption($this, _this2.isMultiple ? 'multiple' : ''); 3492 } else if ($this.is('optgroup')) { 3493 var $materialOptgroup = $("<li class=\"optgroup\"><span>".concat($this.attr('label'), "</span></li>")); 3494 3495 _this2.$materialOptionsList.append($materialOptgroup); 3496 3497 var $optgroupOptions = $this.children('option'); 3498 $optgroupOptions.each(function (index, optgroupOption) { 3499 _this2.buildSingleOption($(optgroupOption), 'optgroup-option'); 3500 }); 3501 } 3502 }); 3503 } 3504 }, { 3505 key: "buildSingleOption", 3506 value: function buildSingleOption($nativeSelectChild, type) { 3507 var disabled = $nativeSelectChild.is(':disabled') ? 'disabled' : ''; 3508 var optgroupClass = type === 'optgroup-option' ? 'optgroup-option' : ''; 3509 var iconUrl = $nativeSelectChild.data('icon'); 3510 var fas = $nativeSelectChild.data('fas') ? "<i class=\"fa-pull-right m-2 fas fa-".concat($nativeSelectChild.data('fas'), " ").concat([this.options.fasClasse
3510s].join(''), "\"></i> ") : ''; 3511 var far = $nativeSelectChild.data('far') ? "<i class=\"fa-pull-right m-2 far fa-".concat($nativeSelectChild.data('far'), " ").concat([this.options.farClasses].join(''), "\"></i> ") : ''; 3512 var fab = $nativeSelectChild.data('fab') ? "<i class=\"fa-pull-right m-2 fab fa-".concat($nativeSelectChild.data('fab'), " ").concat([this.options.fabClasses].join(''), "\"></i> ") : ''; 3513 var classes = $nativeSelectChild.attr('class'); 3514 var iconHtml = iconUrl ? "<img alt=\"\" src=\"".concat(iconUrl, "\" class=\"").concat(classes, "\">") : ''; 3515 var checkboxHtml = this.isMultiple ? "<input type=\"checkbox\" class=\"form-check-input\" ".concat(disabled, "/><label></label>") : ''; 3516 this.$materialOptionsList.append($("<li class=\"".concat(disabled, " ").concat(optgroupClass, " ").concat(this.options.copyClassesOption ? classes : '', " \">").concat(iconHtml, "<span class=\"filtrable\">").concat(checkboxHtml, " ").concat($nativeSelectChild.html(), " ").concat(fas, " ").concat(far, " ").concat(fab, "</span></li>"))); 3517 } 3518 }, { 3519 key: "enableValidation", 3520 value: function enableValidation() { 3521 this.$nativeSelect.css({ 3522 position: 'absolute', 3523 top: '1rem', 3524 left: '0', 3525 height: '0', 3526 width: '0', 3527 opacity: '0', 3528 padding: '0', 3529 'pointer-events': 'none' 3530 }); 3531 3532 if (this.$nativeSelect.attr('style').indexOf('inline!important') === -1) { 3533 this.$nativeSelect.attr('style', "".concat(this.$nativeSelect.attr('style'), " display: inline!important;")); 3534 } 3535 3536 this.$nativeSelect.attr('tabindex', -1); 3537 this.$nativeSelect.data('inherit-tabindex', false); 3538 } 3539 }, { 3540 key: "bindEvents", 3541 value: function bindEvents() { 3542 var _this3 = this; 3543 3544 var config = { 3545 attributes: true, 3546 childList: true, 3547 characterData: true, 3548 subtree: true 3549 }; 3550 var observer = new MutationObserver(this._onMutationObserverChange.bind(this)); 3551 observer.observe(this.$nativeSelect.get(0), config); 3552 observer.customId = this.uuid; 3553 observer.customStatus = 'observing'; 3554 MaterialSelect.clearMutationObservers(); 3555 MaterialSelect.mutationObservers.push(observer); 3556 var $saveSelectBtn = this.$nativeSelect.parent().find('button.btn-save'); 3557 $saveSelectBtn.on('click', this._onSaveSelectBtnClick.bind(this)); 3558 this.$materialSelect.on('focus', this._onMaterialSelectFocus.bind(this)); 3559 this.$materialSelect.on('click', this._onMaterialSelectClick.bind(this)); 3560 this.$materialSelect.on('blur', this._onMaterialSelectBlur.bind(this)); 3561 this.$materialSelect.on('keydown', this._onMaterialSelectKeydown.bind(this)); 3562 this.$toggleAll.on('click', this._onToggleAllClick.bind(this)); 3563 this.$materialOptionsList.on('mousedown', this._onEachMaterialOptionMousedown.bind(this)); 3564 this.$materialOptionsList.find('li:not(.optgroup)').not(this.$toggleAll).each(function (materialOptionIndex, materialOption) { 3565 $(materialOption).on('click', _this3._onEachMaterialOptionClick.bind(_this3, materialOptionIndex, materialOption)); 3566 }); 3567 3568 if (!this.isMultiple && this.isSearchable) { 3569 this.$materialOptionsList.find('li').on('click', this._onSingleMaterialOptionClick.bind(this)); 3570 } 3571 3572 if (this.isSearchable) { 3573 this.$searchInput.find('.search').on('keyup', this._onSearchInputKeyup); 3574 } 3575 3576 $('html').on('click', this._onHTMLClick.bind(this)); 3577 } 3578 }, { 3579 key: "_onMutationObserverChange", 3580 value: function _onMutationObserverChange(mutationsList) { 3581 mutationsList.forEach(function (mutation) { 3582 var $select = $(mutation.target).closest('select'); 3583 3584 if ($select.data('stop-refresh') !== true && (mutation.type === 'childList' || mutation.type === 'attributes' && $(mutation.target).is('option'))) { 3585 MaterialSelect.clearMutationObservers(); 3586 $select.materialSelect({ 3587 'destroy': true 3588 }); 3589 $select.materialSelect(); 3590 } 3591 }); 3592 } 3593 }, { 3594 key: "_onSaveSelectBtnClick", 3595 value: function _onSaveSelectBtnClick(e) { 3596 $('input.multi-bs-select').trigger('close'); 3597 this.$materialOptionsList.hide(); 3598 this.$materialSelect.removeClass('active'); 3599 } 3600 }, { 3601 key: "_onEachMaterialOptionClick", 3602 value: function _onEachMaterialOptionClick(materialOptionIndex, materialOption, e) { 3603 e.stopPropagation(); 3604 var $this = $(materialOption); 3605 3606 if ($this.hasClass('disabled') || $this.hasClass('optgroup')) { 3607 return; 3608 } 3609 3610 var selected = true; 3611 3612 if (this.isMultiple) { 3613 $this.find('input[type="checkbox"]').prop('checked', function (index, oldPropertyValue) { 3614 return !oldPropertyValue; 3615 }); 3616 var hasOptgroup = Boolean(this.$nativeSelect.find('optgroup').length); 3617 var thisIndex = this._isToggleAllPresent() ? $this.index() - 1 : $this.index(); 3618 3619 if (this.isSearchable && hasOptgroup) { 3620 selected = this._toggleSelectedValue(thisIndex - $this.prevAll('.optgroup').length - 1); 3621 } else if (this.isSearchable) { 3622 selected = this._toggleSelectedValue(thisIndex - 1); 3623 } else if (hasOptgroup) { 3624 selected = this._toggleSelectedValue(thisIndex - $this.prevAll('.optgroup').length); 3625 } else { 3626 selected = this._toggleSelectedValue(thisIndex); 3627 } 3628 3629 if (this._isToggleAllPresent()) { 3630 this._updateToggleAllOption(); 3631 } 3632 3633 this.$materialSelect.trigger('focus'); 3634 } else { 3635 this.$materialOptionsList.find('li').removeClass('active'); 3636 $this.toggleClass('active'); 3637 this.$materialSelect.val($this.text().replace(/ +/g, ' ').trim()); 3638 this.$materialSelect.trigger('close'); 3639 } 3640 3641 this._selectSingleOption($this); 3642 3643 this.$nativeSelect.data('stop-refresh', true); 3644 this.$nativeSelect.find('option').eq(materialOptionIndex).prop('selected', selected); 3645 this.$nativeSelect.removeData('stop-refresh'); 3646 3647 this._triggerChangeOnNativeSelect(); 3648 3649 if (this.mainLabel.prev().find('input').hasClass('select-dropdown')) { 3650 if (this.mainLabel.prev().find('input.select-dropdown').val().length > 0) { 3651 this.mainLabel.addClass('active'); 3652 } 3653 } 3654 3655 if (typeof this.options === 'function') { 3656 this.options(); 3657 } 3658 3659 if ($this.hasClass('li-added')) { 3660 this.$materialOptionsList.append(this.buildSingleOption($this, '')); 3661 } 3662 } 3663 }, { 3664 key: "_triggerChangeOnNativeSelect", 3665 value: function _triggerChangeOnNativeSelect() { 3666 var keyboardEvt = new KeyboardEvent('change', { 3667 bubbles: true, 3668 cancelable: true 3669 }); 3670 this.$nativeSelect.get(0).dispatchEvent(keyboardEvt); 3671 } 3672 }, { 3673 key: "_onMaterialSelectFocus", 3674 value: function _onMaterialSelectFocus(e) { 3675 var $this = $(e.target); 3676 3677 if ($('ul.select-dropdown').not(this.$materialOptionsList.get(0)).is(':visible')) { 3678 $("input.select-dropdown").trigger('close'); 3679 } 3680 3681 if (!this.$materialOptionsList.is(':visible')) { 3682 $this.trigger('open', ['focus']); 3683 var label = $this.val(); 3684 var $selectedOption = this.$materialOptionsList.find('li').filter(function () { 3685 return $(this).text().toLowerCase() === label.toLowerCase(); 3686 })[0]; 3687 3688 this._selectSingleOption($selectedOption); 3689 } 3690 3691 if (!this.isMultiple) { 3692 this.mainLabel.addClass('active active-check'); 3693 } 3694 } 3695 }, { 3696 key: "_onMaterialSelectClick", 3697 value: function _onMaterialSelectClick(e) { 3698 this.mainLabel.addClass('active-check'); 3699 e.stopPropagation(); 3700 } 3701 }, { 3702 key: "_onMaterialSelectBlur", 3703 value: function _onMaterialSelectBlur(e) { 3704 var $this = $(e); 3705 3706 if (!this.isMultiple && !this.isSearchable) { 3707 $this.trigger('close'); 3708 } 3709 3710 this.$materialOptionsList.find('li.selected').removeClass('selected'); 3711 this.mainLabel.removeClass('active-check'); 3712 3713 if (this.mainLabel.prev().find('input').hasClass('select-dropdown')) { 3714 if (this.mainLabel.prev().find('input.select-dropdown').val() === '') { 3715 this.mainLabel.removeClass('active'); 3716 } 3717 } 3718 } 3719 }, { 3720 key: "_onSingleMaterialOptionClick", 3721 value: function _onSingleMaterialOptionClick() { 3722 this.$materialSelect.trigger('close'); 3723 } 3724 }, { 3725 key: "_onEachMaterialOptionMousedown", 3726 value: function _onEachMaterialOptionMousedown(e) { 3727 var option = e.target; 3728 3729 if ($('.modal-content').find(this.$materialOptionsList).length) { 3730 if (option.scrollHeight > option.offsetHeight) { 3731 e.preventDefault(); 3732 } 3733 } 3734 3735 this.mainLabel.removeClass('active-check'); 3736 } 3737 }, { 3738 key: "_onHTMLClick", 3739 value: function _onHTMLClick(e) { 3740 if (!$(e.target).closest("#select-options-".concat(this.uuid)).length && !$(e.target).hasClass('mdb-select') && $("#select-options-".concat(this.uuid)).hasClass('active')) { 3741 this.$materialSelect.trigger('close'); 3742 this.mainLabel.removeClass('active-check'); 3743 } 3744 3745 if (this.isSearchable && this.$searchInput !== null && this.$materialOptionsList.hasClass('active')) { 3746 this.$materialOptionsList.find('.search-wrap input.search').focus(); 3747 } 3748 } 3749 }, { 3750 key: "_onToggleAllClick", 3751 value: function _onToggleAllClick(e) { 3752 var _this4 = this; 3753 3754 var checkbox = $(this.$toggleAll).find('input[type="checkbox"]').first(); 3755 var state = !$(checkbox).prop('checked'); 3756 $(checkbox).prop('checked', state); 3757 this.$materialOptionsList.find('li:not(.optgroup):not(.disabled):not(.select-toggle-all)').each(function (materialOptionIndex, materialOption) { 3758 var $optionCheckbox = $(materialOption).find('input[type="checkbox"]'); 3759 3760 if (state && $optionCheckbox.is(':checked') || !state && !$optionCheckbox.is(':checked')) { 3761 return; 3762 } 3763 3764 if (_this4._isToggleAllPresent()) { 3765 materialOptionIndex++; 3766 } 3767 3768 $optionCheckbox.prop('checked', state); 3769 3770 _this4.$nativeSelect.find('option').eq(materialOptionIndex).prop('selected', state); 3771 3772 if (state) { 3773 $(materialOption).removeClass('active'); 3774 } else { 3775 $(materialOption).addClass('active'); 3776 } 3777 3778 _this4._toggleSelectedValue(materialOptionIndex); 3779 3780 _this4._selectOption(materialOption); 3781 3782 _this4._setValueToMaterialSelect(); 3783 }); 3784 this.$nativeSelect.data('stop-refresh', true); 3785 3786 this._triggerChangeOnNativeSelect(); 3787 3788 this.$nativeSelect.removeData('stop-refresh'); 3789 e.stopPropagation(); 3790 } 3791 }, { 3792 key: "_onMaterialSelectKeydown", 3793 value: function _onMaterialSelectKeydown(e) { 3794 var $this = $(e.target); 3795 var isTab = e.which === this.keyCodes.tab; 3796 var isEsc = e.which === this.keyCodes.esc; 3797 var isEnter = e.which === this.keyCodes.enter; 3798 var isArrowUp = e.which === this.keyCodes.arrowUp; 3799 var isArrowDown = e.which === this.keyCodes.arrowDown; 3800 var isMaterialSelectVisible = this.$materialOptionsList.is(':visible'); 3801 3802 if (isTab) { 3803 this._handleTabKey($this); 3804 3805 return; 3806 } else if (isArrowDown && !isMaterialSelectVisible) { 3807 $this.trigger('open'); 3808 return; 3809 } else if (isEnter && !isMaterialSelectVisible) { 3810 return; 3811 } 3812 3813 e.preventDefault(); 3814 3815 if (isEnter) { 3816 this._handleEnterKey($this); 3817 } else if (isArrowDown) { 3818 this._handleArrowDownKey(); 3819 } else if (isArrowUp) { 3820 this._handleArrowUpKey(); 3821 } else if (isEsc) { 3822 this._handleEscKey($this); 3823 } else { 3824 this._handleLetterKey(e); 3825 } 3826 } 3827 }, { 3828 key: "_handleTabKey", 3829 value: function _handleTabKey(materialSelect) { 3830 this._handleEscKey(materialSelect); 3831 } 3832 }, { 3833 key: "_handleEnterKey", 3834 value: function _handleEnterKey(materialSelect) { 3835 var $activeOption = this.$materialOptionsList.find('li.selected:not(.disabled)'); 3836 $activeOption.trigger('click').addClass('active'); 3837 3838 if (!this.isMultiple) { 3839 $(materialSelect).trigger('close'); 3840 } 3841 } 3842 }, { 3843
3843 key: "_handleArrowDownKey", 3844 value: function _handleArrowDownKey() { 3845 var $firstOption = this.$materialOptionsList.find('li').not('.disabled').first(); 3846 var $lastOption = this.$materialOptionsList.find('li').not('.disabled').last(); 3847 var anySelected = this.$materialOptionsList.find('li.selected').length > 0; 3848 var $currentOption = anySelected ? this.$materialOptionsList.find('li.selected') : $firstOption; 3849 var $matchedMaterialOption = $currentOption.is($lastOption) || !anySelected ? $currentOption : $currentOption.next('li:not(.disabled)'); 3850 3851 this._selectSingleOption($matchedMaterialOption); 3852 3853 if (!$matchedMaterialOption.find('input').is(':checked')) { 3854 $matchedMaterialOption.removeClass('active'); 3855 } 3856 3857 if (!$matchedMaterialOption.prev().hasClass('selected') && !$matchedMaterialOption.prev().find('input').is(':checked')) { 3858 $matchedMaterialOption.prev().removeClass('active'); 3859 } 3860 3861 $matchedMaterialOption.addClass('active'); 3862 } 3863 }, { 3864 key: "_handleArrowUpKey", 3865 value: function _handleArrowUpKey() { 3866 var $firstOption = this.$materialOptionsList.find('li').not('.disabled').first(); 3867 var $lastOption = this.$materialOptionsList.find('li').not('.disabled').last(); 3868 var anySelected = this.$materialOptionsList.find('li.selected').length > 0; 3869 var $currentOption = anySelected ? this.$materialOptionsList.find('li.selected') : $lastOption; 3870 var $matchedMaterialOption = $currentOption.is($firstOption) || !anySelected ? $currentOption : $currentOption.prev('li:not(.disabled)'); 3871 3872 this._selectSingleOption($matchedMaterialOption); 3873 3874 if (!$matchedMaterialOption.find('input').is(':checked')) { 3875 $matchedMaterialOption.removeClass('active'); 3876 } 3877 3878 if (!$matchedMaterialOption.next().hasClass('selected') && !$matchedMaterialOption.next().find('input').is(':checked')) { 3879 $matchedMaterialOption.next().removeClass('active'); 3880 } 3881 3882 $matchedMaterialOption.addClass('active'); 3883 } 3884 }, { 3885 key: "_handleEscKey", 3886 value: function _handleEscKey(materialSelect) { 3887 $(materialSelect).trigger('close'); 3888 } 3889 }, { 3890 key: "_handleLetterKey", 3891 value: function _handleLetterKey(e) { 3892 var _this5 = this; 3893 3894 var filterQueryString = ''; 3895 var letter = String.fromCharCode(e.which).toLowerCase(); 3896 var nonLetters = Object.keys(this.keyCodes).map(function (key) { 3897 return _this5.keyCodes[key]; 3898 }); 3899 var isLetterSearchable = letter && nonLetters.indexOf(e.which) === -1; 3900 3901 if (isLetterSearchable) { 3902 filterQueryString += letter; 3903 var $matchedMaterialOption = this.$materialOptionsList.find('li').filter(function (index, element) { 3904 return $(element).text().toLowerCase().includes(filterQueryString); 3905 }).first(); 3906 3907 if (!this.isMultiple) { 3908 this.$materialOptionsList.find('li').removeClass('active'); 3909 } 3910 3911 $matchedMaterialOption.addClass('active'); 3912 3913 this._selectSingleOption($matchedMaterialOption); 3914 } 3915 } 3916 }, { 3917 key: "_onSearchInputKeyup", 3918 value: function _onSearchInputKeyup(e) { 3919 var $this = $(e.target); 3920 var $ul = $this.closest('ul'); 3921 var searchValue = $this.val(); 3922 var $options = $ul.find('li span.filtrable'); 3923 $options.each(function () { 3924 var $option = $(this); 3925 3926 if (typeof this.outerHTML === 'string') { 3927 var liValue = this.textContent.toLowerCase(); 3928 3929 if (liValue.includes(searchValue.toLowerCase())) { 3930 $option.show().parent().show(); 3931 } else { 3932 $option.hide().parent().hide(); 3933 } 3934 } 3935 }); 3936 } 3937 }, { 3938 key: "_isToggleAllPresent", 3939 value: function _isToggleAllPresent() { 3940 return this.$materialOptionsList.find(this.$toggleAll).length; 3941 } 3942 }, { 3943 key: "_updateToggleAllOption", 3944 value: function _updateToggleAllOption() { 3945 var $allOptionsButToggleAll = this.$materialOptionsList.find('li').not('.select-toggle-all, .disabled').find('[type=checkbox]'); 3946 var $checkedOptionsButToggleAll = $allOptionsButToggleAll.filter(':checked'); 3947 var isToggleAllChecked = this.$toggleAll.find('[type=checkbox]').is(':checked'); 3948 3949 if ($checkedOptionsButToggleAll.length === $allOptionsButToggleAll.length && !isToggleAllChecked) { 3950 this.$toggleAll.find('[type=checkbox]').prop('checked', true); 3951 } else if ($checkedOptionsButToggleAll.length < $allOptionsButToggleAll.length && isToggleAllChecked) { 3952 this.$toggleAll.find('[type=checkbox]').prop('checked', false); 3953 } 3954 } 3955 }, { 3956 key: "_toggleSelectedValue", 3957 value: function _toggleSelectedValue(optionIndex) { 3958 var selectedValueIndex = this.valuesSelected.indexOf(optionIndex); 3959 var isSelected = selectedValueIndex !== -1; 3960 3961 if (!isSelected) { 3962 this.valuesSelected.push(optionIndex); 3963 } else { 3964 this.valuesSelected.splice(selectedValueIndex, 1); 3965 } 3966 3967 this.$materialOptionsList.find('li:not(.optgroup):not(.select-toggle-all)').eq(optionIndex).toggleClass('active'); 3968 this.$nativeSelect.find('option').eq(optionIndex).prop('selected', !isSelected); 3969 3970 this._setValueToMaterialSelect(); 3971 3972 return !isSelected; 3973 } 3974 }, { 3975 key: "_selectSingleOption", 3976 value: function _selectSingleOption(newOption) { 3977 this.$materialOptionsList.find('li.selected').removeClass('selected'); 3978 3979 this._selectOption(newOption); 3980 } 3981 }, { 3982 key: "_selectOption", 3983 value: function _selectOption(newOption) { 3984 var option = $(newOption); 3985 option.addClass('selected'); 3986 } 3987 }, { 3988 key: "_setValueToMaterialSelect", 3989 value: function _setValueToMaterialSelect() { 3990 var _this6 = this; 3991 3992 var value = ''; 3993 var optionsSelected = 'options selected'; 3994 var itemsCount = this.valuesSelected.length; 3995 3996 if (this.options.language.active && this.$toggleAll) { 3997 if (this.options.language.pl) { 3998 optionsSelected = this.options.language.pl.optionsSelected ? this.options.language.pl.optionsSelected : this.defaults.language.pl.optionsSelected; 3999 } else if (this.options.language.fr) { 4000 optionsSelected = this.options.language.fr.optionsSelected ? this.options.language.fr.optionsSelected : this.defaults.language.fr.optionsSelected; 4001 } else if (this.options.language.ge) { 4002 optionsSelected = this.options.language.ge.optionsSelected ? this.options.language.ge.optionsSelected : this.defaults.language.ge.optionsSelected; 4003 } else if (this.options.language.ar) { 4004 optionsSelected = this.options.language.ar.optionsSelected ? this.options.language.ar.optionsSelected : this.defaults.language.ar.optionsSelected; 4005 } else if (this.options.language.in) { 4006 optionsSelected = this.options.language.in.optionsSelected ? this.options.language.in.optionsSelected : this.defaults.language.in.optionsSelected; 4007 } 4008 } 4009 4010 this.valuesSelected.map(function (el) { 4011 return value += ", ".concat(_this6.$nativeSelect.find('option').eq(el).text().replace(/ +/g, ' ').trim()); 4012 }); 4013 itemsCount >= 5 ? value = "".concat(itemsCount, " ").concat(optionsSelected) : value = value.substring(2); 4014 value.length === 0 && this.mainLabel.length === 0 ? value = this.$nativeSelect.find('option:disabled').eq(0).text() : null; 4015 value.length > 0 && !this.options.BSinputText ? this.mainLabel.addClass('active active-check') : this.mainLabel.removeClass('active'); 4016 this.options.BSinputText ? this.mainLabel.css('top', '-7px') : null; 4017 this.$nativeSelect.siblings("".concat(this.options.BSinputText ? "input.multi-bs-select" : "input.select-dropdown")).val(value); 4018 } 4019 }, { 4020 key: "_randomUUID", 4021 value: function _randomUUID() { 4022 var d = new Date().getTime(); 4023 return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { 4024 var r = (d + Math.random() * 16) % 16 | 0; 4025 d = Math.floor(d / 16); 4026 return (c === 'x' ? r : r & 0x3 | 0x8).toString(16); 4027 }); 4028 } 4029 }], [{ 4030 key: "clearMutationObservers", 4031 value: function clearMutationObservers() {
4032 MaterialSelect.mutationObservers.forEach(function (observer) { 4033 observer.disconnect(); 4034 observer.customStatus = 'stopped'; 4035 }); 4036 } 4037 }]); 4038 4039 return MaterialSelect; 4040 }(); 4041 4042 $.fn.materialSelect = function (callback) { 4043 $(this).not('.browser-default').not('.custom-select').each(function () { 4044 var materialSelect = new MaterialSelect($(this), callback); 4045 materialSelect.init(); 4046 }); 4047 }; 4048 4049 $.fn.material_select = $.fn.materialSelect; 4050 4051 (function (originalVal) { 4052 $.fn.val = function (value) { 4053 if (!arguments.length) { 4054 return originalVal.call(this); 4055 } 4056 4057 if (this.data('stop-refresh') !== true && this.hasClass('mdb-select') && this.hasClass('initialized')) { 4058 MaterialSelect.clearMutationObservers(); 4059 this.materialSelect({ 4060 'destroy': true 4061 }); 4062 var ret = originalVal.call(this, value); 4063 this.materialSelect(); 4064 return ret; 4065 } 4066 4067 return originalVal.call(this, value); 4068 }; 4069 })($.fn.val); 4070})(jQuery); 4071 4072jQuery('select').siblings('input.select-dropdown', 'input.multi-bs-select').on('mousedown', function (e) { 4073 if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 4074 if (e.clientX >= e.target.clientWidth || e.clientY >= e.target.clientHeight) { 4075 e.preventDefault(); 4076 } 4077 } 4078}); 4079/*! 4080 * pickadate.js v3.6.3, 2019/04/03 4081 * By Amsul, http://amsul.ca 4082 * Hosted on http://amsul.github.io/pickadate.js 4083 * Licensed under MIT 4084 */ 4085 4086(function ( factory ) { 4087 4088 // AMD. 4089 if ( typeof define == 'function' && define.amd ) 4090 define( 'picker', ['jquery'], factory ) 4091 4092 // Node.js/browserify. 4093 else if ( typeof exports == 'object' ) 4094 module.exports = factory( require('jquery') ) 4095 4096 // Browser globals. 4097 else this.Picker = factory( jQuery ) 4098 4099}(function( $ ) { 4100 4101 var $window = $( window ) 4102 var $document = $( document ) 4103 var $html = $( document.documentElement ) 4104 var supportsTransitions = document.documentElement.style.transition != null 4105 4106 4107 /** 4108 * The picker constructor that creates a blank picker. 4109 */ 4110 function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) { 4111 4112 // If thereâs no element, return the picker constructor. 4113 if ( !ELEMENT ) return PickerConstructor 4114 4115 4116 var 4117 IS_DEFAULT_THEME = false, 4118 4119 4120 // The state of the picker. 4121 STATE = { 4122 id: ELEMENT.id || 'P' + Math.abs( ~~(Math.random() * new Date()) ), 4123 handlingOpen: false, 4124 }, 4125 4126 4127 // Merge the defaults and options passed. 4128 SETTINGS = COMPONENT ? $.extend( true, {}, COMPONENT.defaults, OPTIONS ) : OPTIONS || {}, 4129 4130 4131 // Merge the default classes with the settings classes. 4132 CLASSES = $.extend( {}, PickerConstructor.klasses(), SETTINGS.klass ), 4133 4134 4135 // The element node wrapper into a jQuery object. 4136 $ELEMENT = $( ELEMENT ), 4137 4138 4139 // Pseudo picker constructor. 4140 PickerInstance = function() { 4141 return this.start() 4142 }, 4143 4144 4145 // The picker prototype. 4146 P = PickerInstance.prototype = { 4147 4148 constructor: PickerInstance, 4149 4150 $node: $ELEMENT, 4151 4152 4153 /** 4154 * Initialize everything 4155 */ 4156 start: function() { 4157 4158 // If itâs already started, do nothing. 4159 if ( STATE && STATE.start ) return P 4160 4161 4162 // Update the picker states. 4163 STATE.methods = {} 4164 STATE.start = true 4165 STATE.open = false 4166 STATE.type = ELEMENT.type 4167 4168 4169 // Confirm focus state, convert into text input to remove UA stylings, 4170 // and set as readonly to prevent keyboard popup. 4171 ELEMENT.autofocus = ELEMENT == getActiveElement() 4172 ELEMENT.readOnly = !SETTINGS.editable 4173 ELEMENT.id = ELEMENT.id || STATE.id 4174 if ( ELEMENT.type != 'text' ) { 4175 ELEMENT.type = 'text' 4176 } 4177 4178 4179 // Create a new picker component with the settings. 4180 P.component = new COMPONENT(P, SETTINGS) 4181 4182 4183 // Create the picker root and then prepare it. 4184 P.$root = $( '<div class="' + CLASSES.picker + '" id="' + ELEMENT.id + '_root" />' ) 4185 prepareElementRoot() 4186 4187 4188 // Create the picker holder and then prepare it. 4189 P.$holder = $( createWrappedComponent() ).appendTo( P.$root ) 4190 prepareElementHolder() 4191 4192 4193 // If thereâs a format for the hidden input element, create the element. 4194 if ( SETTINGS.formatSubmit ) { 4195 prepareElementHidden() 4196 } 4197 4198 4199 // Prepare the input element. 4200 prepareElement() 4201 4202 4203 // Insert the hidden input as specified in the settings. 4204 if ( SETTINGS.containerHidden ) $( SETTINGS.containerHidden ).append( P._hidden ) 4205 else $ELEMENT.after( P._hidden ) 4206 4207 4208 // Insert the root as specified in the settings. 4209 if ( SETTINGS.container ) $( SETTINGS.container ).append( P.$root ) 4210 else $ELEMENT.after( P.$root ) 4211 4212 4213 // Bind the default component and settings events. 4214 P.on({ 4215 start: P.component.onStart, 4216 render: P.component.onRender, 4217 stop: P.component.onStop, 4218 open: P.component.onOpen, 4219 close: P.component.onClose, 4220 set: P.component.onSet 4221 }).on({ 4222 start: SETTINGS.onStart, 4223 render: SETTINGS.onRender, 4224 stop: SETTINGS.onStop, 4225 open: SETTINGS.onOpen, 4226 close: SETTINGS.onClose, 4227 set: SETTINGS.onSet 4228 }) 4229 4230 4231 // Once weâre all set, check the theme in use. 4232 IS_DEFAULT_THEME = isUsingDefaultTheme( P.$holder[0] ) 4233 4234 4235 // If the element has autofocus, open the picker. 4236 if ( ELEMENT.autofocus ) { 4237 P.open() 4238 } 4239 4240 4241 // Trigger queued the âstartâ and ârenderâ events. 4242 return P.trigger( 'start' ).trigger( 'render' ) 4243 }, //start 4244 4245 4246 /**
4247 * Render a new picker 4248 */ 4249 render: function( entireComponent ) { 4250 4251 // Insert a new component holder in the root or box. 4252 if ( entireComponent ) { 4253 P.$holder = $( createWrappedComponent() ) 4254 prepareElementHolder() 4255 P.$root.html( P.$holder ) 4256 } 4257 else P.$root.find( '.' + CLASSES.box ).html( P.component.nodes( STATE.open ) ) 4258 4259 // Trigger the queued ârenderâ events. 4260 return P.trigger( 'render' ) 4261 }, //render 4262 4263 4264 /** 4265 * Destroy everything 4266 */ 4267 stop: function() { 4268 4269 // If itâs already stopped, do nothing. 4270 if ( !STATE.start ) return P 4271 4272 // Then close the picker. 4273 P.close() 4274 4275 // Remove the hidden field. 4276 if ( P._hidden ) { 4277 P._hidden.parentNode.removeChild( P._hidden ) 4278 } 4279 4280 // Remove the root. 4281 P.$root.remove() 4282 4283 // Remove the input class, remove the stored data, and unbind 4284 // the events (after a tick for IE - see `P.close`). 4285 $ELEMENT.removeClass( CLASSES.input ).removeData( NAME ) 4286 setTimeout( function() { 4287 $ELEMENT.off( '.' + STATE.id ) 4288 }, 0) 4289 4290 // Restore the element state 4291 ELEMENT.type = STATE.type 4292 ELEMENT.readOnly = false 4293 4294 // Trigger the queued âstopâ events. 4295 P.trigger( 'stop' ) 4296 4297 // Reset the picker states. 4298 STATE.methods = {} 4299 STATE.start = false 4300 4301 return P 4302 }, //stop 4303 4304 4305 /** 4306 * Open up the picker 4307 */ 4308 open: function( dontGiveFocus ) { 4309 4310 // If itâs already open, do nothing. 4311 if ( STATE.open ) return P 4312 4313 // Add the âactiveâ class. 4314 $ELEMENT.addClass( CLASSES.active ) 4315 aria( ELEMENT, 'expanded', true ) 4316 4317 // * A Firefox bug, when `html` has `overflow:hidden`, results in 4318 // killing transitions :(. So add the âopenedâ state on the next tick. 4319 // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289 4320 setTimeout( function() { 4321 4322 // Add the âopenedâ class to the picker root. 4323 P.$root.addClass( CLASSES.opened ) 4324 aria( P.$root[0], 'hidden', false ) 4325 4326 }, 0 ) 4327 4328 // If we have to give focus, bind the element and doc events. 4329 if ( dontGiveFocus !== false ) { 4330 4331 // Set it as open. 4332 STATE.open = true 4333 4334 // Prevent the page from scrolling. 4335 if ( IS_DEFAULT_THEME ) { 4336 $('body'). 4337 css( 'overflow', 'hidden' ). 4338 css( 'padding-right', '+=' + getScrollbarWidth() ) 4339 } 4340 4341 // Pass focus to the root elementâs jQuery object. 4342 focusPickerOnceOpened() 4343 4344 // Bind the document events. 4345 $document.on( 'click.' + STATE.id + ' focusin.' + STATE.id, function( event ) { 4346 // If the picker is currently midway through processing 4347 // the opening sequence of events then don't handle clicks 4348 // on any part of the DOM. This is caused by a bug in Chrome 73 4349 // where a click event is being generated with the incorrect 4350 // path in it. 4351 // In short, if someone does a click that finishes after the 4352 // new element is created then the path contains only the 4353 // parent element and not the input element itself. 4354 if (STATE.handlingOpen) { 4355 return; 4356 } 4357 4358 var target = getRealEventTarget( event, ELEMENT ) 4359 4360 // If the target of the event is not the element, close the picker picker. 4361 // * Donât worry about clicks or focusins on the root because those donât bubble up. 4362 // Also, for Firefox, a click on an `option` element bubbles up directly 4363 // to the doc. So make sure the target wasn't the doc. 4364 // * In Firefox stopPropagation() doesnât prevent right-click events from bubbling, 4365 // which causes the picker to unexpectedly close when right-clicking it. So make 4366 // sure the event wasnât a right-click. 4367 // * In Chrome 62 and up, password autofill causes a simulated focusin event which 4368 // closes the picker. 4369 if ( ! event.isSimulated && target != ELEMENT && target != document && event.which != 3 ) { 4370 4371 // If the target was the holder that c
4371overs the screen, 4372 // keep the element focused to maintain tabindex. 4373 P.close( target === P.$holder[0] ) 4374 } 4375 4376 }).on( 'keydown.' + STATE.id, function( event ) { 4377 4378 var 4379 // Get the keycode. 4380 keycode = event.keyCode, 4381 4382 // Translate that to a selection change. 4383 keycodeToMove = P.component.key[ keycode ], 4384 4385 // Grab the target. 4386 target = getRealEventTarget( event, ELEMENT ) 4387 4388 4389 // On escape, close the picker and give focus. 4390 if ( keycode == 27 ) { 4391 P.close( true ) 4392 } 4393 4394 4395 // Check if there is a key movement or âenterâ keypress on the element. 4396 else if ( target == P.$holder[0] && ( keycodeToMove || keycode == 13 ) ) { 4397 4398 // Prevent the default action to stop page movement. 4399 event.preventDefault() 4400 4401 // Trigger the key movement action. 4402 if ( keycodeToMove ) { 4403 PickerConstructor._.trigger( P.component.key.go, P, [ PickerConstructor._.trigger( keycodeToMove ) ] ) 4404 } 4405 4406 // On âenterâ, if the highlighted item isnât disabled, set the value and close. 4407 else if ( !P.$root.find( '.' + CLASSES.highlighted ).hasClass( CLASSES.disabled ) ) { 4408 P.set( 'select', P.component.item.highlight ) 4409 if ( SETTINGS.closeOnSelect ) { 4410 P.close( true ) 4411 } 4412 } 4413 } 4414 4415 4416 // If the target is within the root and âenterâ is pressed, 4417 // prevent the default action and trigger a click on the target instead. 4418 else if ( $.contains( P.$root[0], target ) && keycode == 13 ) { 4419 event.preventDefault() 4420 target.click() 4421 } 4422 }) 4423 } 4424 4425 // Trigger the queued âopenâ events. 4426 return P.trigger( 'open' ) 4427 }, //open 4428 4429 4430 /** 4431 * Close the picker 4432 */ 4433 close: function( giveFocus ) { 4434 4435 // If we need to give focus, do it before changing states. 4436 if ( giveFocus ) { 4437 if ( SETTINGS.editable ) { 4438 ELEMENT.focus() 4439 } 4440 else { 4441 // ....ah yes! It wouldâve been incomplete without a crazy workaround for IE :| 4442 // The focus is triggered *after* the close has completed - causing it 4443 // to open again. So unbind and rebind the event at the next tick. 4444 P.$holder.off( 'focus.toOpen' ).focus() 4445 setTimeout( function() { 4446 P.$holder.on( 'focus.toOpen', handleFocusToOpenEvent ) 4447 }, 0 ) 4448 } 4449 } 4450 4451 // Remove the âactiveâ class. 4452 $ELEMENT.removeClass( CLASSES.active ) 4453 aria( ELEMENT, 'expanded', false ) 4454 4455 // * A Firefox bug, when `html` has `overflow:hidden`, results in 4456 // killing transitions :(. So remove the âopenedâ state on the next tick. 4457 // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289 4458 setTimeout( function() { 4459 4460 // Remove the âopenedâ and âfocusedâ class from the picker root. 4461 P.$root.removeClass( CLASSES.opened + ' ' + CLASSES.focused ) 4462 aria( P.$root[0], 'hidden', true ) 4463 4464 }, 0 ) 4465 4466 // If itâs already closed, do nothing more. 4467 if ( !STATE.open ) return P 4468 4469 // Set it as closed. 4470 STATE.open = false 4471 4472 // Allow the page to scroll. 4473 if ( IS_DEFAULT_THEME ) { 4474 $('body'). 4475 css( 'overflow', '' ). 4476 css( 'padding-right', '-=' + getScrollbarWidth() ) 4477 } 4478 4479 // Unbind the document events. 4480 $document.off( '.' + STATE.id ) 4481 4482 // Trigger the queued âcloseâ events. 4483 return P.trigger( 'close' ) 4484 }, //close 4485 4486 4487 /** 4488 * Clear the values 4489 */ 4490 clear: function( options ) { 4491 return P.set( 'clear', null, options ) 4492 }, //clear 4493 4494 4495 /** 4496 * Set something 4497 */ 4498 set: function( thing, value, options ) { 4499 4500 var thingItem, thingValue, 4501 thingIsObject = $.isPlainObject( thing ), 4502 thingObject = thingIsObject ? thing : {} 4503 4504 // Make sure we have usable options. 4505 options = thingIsObject && $.isPlainObject( value ) ? value : options || {} 4506 4507 if ( thing ) { 4508 4509 // If the thing isnât an object, make it one. 4510 if ( !thingIsObject ) { 4511 thingObject[ thing ] = value 4512 } 4513 4514 // Go through the things of items to set. 4515 for ( thingItem in thingObject ) { 4516 4517 // Grab the value of the thing. 4518 thingValue = thingObject[ thingItem ] 4519 4520 // First, if the item exists and thereâs a value, set it. 4521 if ( thingItem in P.component.item ) { 4522 if ( thingValue === undefined ) thingValue = null 4523 P.component.set( thingItem, thingValue, options ) 4524 } 4525 4526 // Then, check to update the element value and broadcast a change. 4527 if ( ( thingItem == 'select' || thingItem == 'clear' ) && SETTINGS.updateInput ) { 4528 $ELEMENT. 4529 val( thingItem == 'clear' ? '' : P.get( thingItem, SETTINGS.format ) ). 4530 trigger( 'change' ) 4531 } 4532 } 4533 4534 // Render a new picker. 4535 P.render() 4536 } 4537 4538 // When the method isnât muted, trigger queued âsetâ events and pass the `thingObject`. 4539 return options.muted ? P : P.trigger( 'set', thingObject ) 4540 }, //set 4541 4542 4543 /** 4544 * Get something 4545 */ 4546 get: function( thing, format ) { 4547 4548 // Make sure thereâs something to get. 4549 thing = thing || 'value' 4550 4551 // If a picker state exists, return that. 4552 if ( STATE[ thing ] != null ) { 4553 return STATE[ thing ] 4554 } 4555 4556 // Return the submission value, if that. 4557 if ( thing == 'valueSubmit' ) { 4558 if ( P._hidden ) { 4559 return P._hidden.value 4560 } 4561 thing = 'value' 4562 } 4563 4564 // Return the value, if that. 4565 if ( thing == 'value' ) { 4566 return ELEMENT.value 4567 } 4568 4569 // Check if a component item exists, return that. 4570 if ( thing in P.component.item ) { 4571 if ( typeof format == 'string' ) { 4572 var thingValue = P.component.get( thing ) 4573 return thingValue ? 4574 PickerConstructor._.trigger( 4575 P.component.formats.toString, 4576 P.component, 4577 [ format, thingValue ] 4578 ) : '' 4579 } 4580 return P.component.get( thing ) 4581 } 4582 }, //get 4583 4584 4585 4586 /** 4587 * Bind events on the things. 4588 */ 4589 on: function( thing, method, internal ) { 4590 4591 var thingName, thingMethod, 4592 thingIsObject = $.isPlainObject( thing ), 4593 thingObject = thingIsObject ? thing : {} 4594 4595 if ( thing ) { 4596 4597 // If the thing isnât an object, make it one. 4598 if ( !thingIsObject ) { 4599 thingObject[ thing ] = method 4600 } 4601 4602 // Go through the things to bind to. 4603 for ( thingName in thingObject ) { 4604 4605 // Grab the method of the thing. 4606 thingMethod = thingObject[ thingName ] 4607 4608 // If it was an internal binding, prefix it. 4609 if ( internal ) { 4610 thingName = '_' + thingName 4611 } 4612 4613 // Make sure the thing methods collection exists. 4614 STATE.methods[ thingName ] = STATE.methods[ thingName ] || [] 4615 4616 // Add the method to the relative method collection. 4617 STATE.methods[ thingName ].push( thingMethod ) 4618 } 4619 } 4620 4621 return P 4622 }, //on 4623 4624 4625 4626 /** 4627 * Unbind events on the things. 4628 */ 4629 off: function() { 4630 var i, thingName, 4631 names = arguments; 4632 for ( i = 0, namesCount = names.length; i < namesCount; i += 1 ) { 4633 thingName = names[i] 4634 if ( thingName in STATE.methods ) { 4635 delete STATE.methods[thingName] 4636 } 4637 } 4638 return P 4639 }, 4640 4641 4642 /** 4643 * Fire off method events. 4644 */ 4645 trigger: function( name, data ) { 4646 var _trigger = function( name ) { 4647 var methodList = STATE.methods[ name ] 4648 if ( methodList ) { 4649 methodList.map( function( method ) { 4650 PickerConstructor._.trigger( method, P, [ data ] ) 4651 }) 4652 } 4653 } 4654 _trigger( '_' + name ) 4655 _trigger( name ) 4656 return P 4657 }
4657 //trigger 4658 } //PickerInstance.prototype 4659 4660 4661 /** 4662 * Wrap the picker holder components together. 4663 */ 4664 function createWrappedComponent() { 4665 4666 // Create a picker wrapper holder 4667 return PickerConstructor._.node( 'div', 4668 4669 // Create a picker wrapper node 4670 PickerConstructor._.node( 'div', 4671 4672 // Create a picker frame 4673 PickerConstructor._.node( 'div', 4674 4675 // Create a picker box node 4676 PickerConstructor._.node( 'div', 4677 4678 // Create the components nodes. 4679 P.component.nodes( STATE.open ), 4680 4681 // The picker box class 4682 CLASSES.box 4683 ), 4684 4685 // Picker wrap class 4686 CLASSES.wrap 4687 ), 4688 4689 // Picker frame class 4690 CLASSES.frame 4691 ), 4692 4693 // Picker holder class 4694 CLASSES.holder, 4695 4696 'tabindex="-1"' 4697 ) //endreturn 4698 } //createWrappedComponent 4699 4700 /** 4701 * Prepare the input element with all bindings. 4702 */ 4703 function prepareElement() { 4704 4705 $ELEMENT. 4706 4707 // Store the picker data by component name. 4708 data(NAME, P). 4709 4710 // Add the âinputâ class name. 4711 addClass(CLASSES.input). 4712 4713 // If thereâs a `data-value`, update the value of the element. 4714 val( $ELEMENT.data('value') ? 4715 P.get('select', SETTINGS.format) : 4716 ELEMENT.value 4717 ). 4718 4719 // On focus/click, open the picker. 4720 on( 'focus.' + STATE.id + ' click.' + STATE.id, 4721 debounce(function(event) { 4722 event.preventDefault() 4723 P.open() 4724 }, 100)) 4725 4726 // Mousedown handler to capture when the user starts interacting 4727 // with the picker. This is used in working around a bug in Chrome 73. 4728 .on('mousedown', function() { 4729 STATE.handlingOpen = true; 4730 var handler = function() { 4731 // By default mouseup events are fired before a click event. 4732 // By using a timeout we can force the mouseup to be handled 4733 // after the corresponding click event is handled. 4734 setTimeout(function() { 4735 $(document).off('mouseup', handler); 4736 STATE.handlingOpen = false; 4737 }, 0); 4738 }; 4739 $(document).on('mouseup', handler); 4740 }); 4741 4742 4743 // Only bind keydown events if the element isnât editable. 4744 if ( !SETTINGS.editable ) { 4745 4746 $ELEMENT. 4747 4748 // Handle keyboard event based on the picker being opened or not. 4749 on( 'keydown.' + STATE.id, handleKeydownEvent ) 4750 } 4751 4752 4753 // Update the aria attributes. 4754 aria(ELEMENT, { 4755 haspopup: true, 4756 expanded: false, 4757 readonly: false, 4758 owns: ELEMENT.id + '_root' 4759 }) 4760 } 4761 4762 4763 /** 4764 * Prepare the root picker element with all bindings. 4765 */ 4766 function prepareElementRoot() { 4767 aria( P.$root[0], 'hidden', true ) 4768 } 4769 4770 4771 /** 4772 * Prepare the holder picker element with all bindings. 4773 */ 4774 function prepareElementHolder() { 4775 4776 P.$holder. 4777 4778 on({ 4779 4780 // For iOS8. 4781 keydown: handleKeydownEvent, 4782 4783 'focus.toOpen': handleFocusToOpenEvent, 4784 4785 blur: function() { 4786 // Remove the âtargetâ class. 4787 $ELEMENT.removeClass( CLASSES.target ) 4788 }, 4789 4790 // When something within the holder is focused, stop from bubbling 4791 // to the doc and remove the âfocusedâ state from the root. 4792 focusin: function( event ) { 4793 P.$root.removeClass( CLASSES.focused ) 4794 event.stopPropagation() 4795 }, 4796 4797 // When something within the holder is clicked, stop it 4798 // from bubbling to the doc. 4799 'mousedown click': function( event ) { 4800 4801 var target = getRealEventTarget( event, ELEMENT ) 4802 4803 // Make sure the target isnât the root holder so it can bubble up. 4804 if ( target != P.$holder[0] ) { 4805 4806 event.stopPropagation() 4807 4808 // * For mousedown events, cancel the default action in order to 4809 // prevent cases where focus is shifted onto external elements 4810 // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120). 4811 // Also, for Firefox, donât prevent action on the `option` element. 4812 if ( event.type == 'mousedown' && !$( target ).is( 'input, select, textarea, button, option' )) { 4813 4814 event.preventDefault() 4815 4816 // Re-focus onto the holder so that users can click away 4817 // from elements focused within the picker. 4818 P.$holder.eq(0).focus() 4819 } 4820 } 4821 } 4822 4823 }). 4824 4825 // If thereâs a click on an actionable element, carry out the actions.
4826 on( 'click', '[data-pick], [data-nav], [data-clear], [data-close]', function() { 4827 4828 var $target = $( this ), 4829 targetData = $target.data(), 4830 targetDisabled = $target.hasClass( CLASSES.navDisabled ) || $target.hasClass( CLASSES.disabled ), 4831 4832 // * For IE, non-focusable elements can be active elements as well 4833 // (http://stackoverflow.com/a/2684561). 4834 activeElement = getActiveElement() 4835 activeElement = activeElement && ( (activeElement.type || activeElement.href ) ? activeElement : null); 4836 4837 // If itâs disabled or nothing inside is actively focused, re-focus the element. 4838 if ( targetDisabled || activeElement && !$.contains( P.$root[0], activeElement ) ) { 4839 P.$holder.eq(0).focus() 4840 } 4841 4842 // If something is superficially changed, update the `highlight` based on the `nav`. 4843 if ( !targetDisabled && targetData.nav ) { 4844 P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } ) 4845 } 4846 4847 // If something is picked, set `select` then close with focus. 4848 else if ( !targetDisabled && 'pick' in targetData ) { 4849 P.set( 'select', targetData.pick ) 4850 if ( SETTINGS.closeOnSelect ) { 4851 P.close( true ) 4852 } 4853 } 4854 4855 // If a âclearâ button is pressed, empty the values and close with focus. 4856 else if ( targetData.clear ) { 4857 P.clear() 4858 if ( SETTINGS.closeOnClear ) { 4859 P.close( true ) 4860 } 4861 } 4862 4863 else if ( targetData.close ) { 4864 P.close( true ) 4865 } 4866 4867 }) //P.$holder 4868 4869 } 4870 4871 4872 /** 4873 * Prepare the hidden input element along with all bindings. 4874 */ 4875 function prepareElementHidden() { 4876 4877 var name 4878 4879 if ( SETTINGS.hiddenName === true ) { 4880 name = ELEMENT.name 4881 ELEMENT.name = '' 4882 } 4883 else { 4884 name = [ 4885 typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '', 4886 typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit' 4887 ] 4888 name = name[0] + ELEMENT.name + name[1] 4889 } 4890 4891 P._hidden = $( 4892 '<input ' + 4893 'type=hidden ' + 4894 4895 // Create the name using the original inputâs with a prefix and suffix. 4896 'name="' + name + '"' + 4897 4898 // If the element has a value, set the hidden value as well. 4899 ( 4900 $ELEMENT.data('value') || ELEMENT.value ? 4901 ' value="' + P.get('select', SETTINGS.formatSubmit) + '"' : 4902 '' 4903 ) + 4904 '>' 4905 )[0] 4906 4907 $ELEMENT. 4908 4909 // If the value changes, update the hidden input with the correct format. 4910 on('change.' + STATE.id, function() { 4911 P._hidden.value = ELEMENT.value ? 4912 P.get('select', SETTINGS.formatSubmit) : 4913 '' 4914 }) 4915 } 4916 4917 4918 // Wait for transitions to end before focusing the holder. Otherwise, while 4919 // using the `container` option, the view jumps to the container. 4920 function focusPickerOnceOpened() { 4921 4922 if (IS_DEFAULT_THEME && supportsTransitions) { 4923 P.$holder.find('.' + CLASSES.frame).one('transitionend', function() { 4924 P.$holder.eq(0).focus() 4925 }) 4926 } 4927 else { 4928 setTimeout(function() { 4929 P.$holder.eq(0).focus() 4930 }, 0) 4931 } 4932 } 4933 4934 4935 function handleFocusToOpenEvent(event) { 4936 4937 // Stop the event from propagating to the doc. 4938 event.stopPropagation() 4939 4940 // Add the âtargetâ class. 4941 $ELEMENT.addClass( CLASSES.target ) 4942 4943 // Add the âfocusedâ class to the root. 4944 P.$root.addClass( CLASSES.focused ) 4945 4946 // And then finally open the picker. 4947 P.open() 4948 } 4949 4950 4951 // For iOS8. 4952 function handleKeydownEvent( event ) { 4953 4954 var keycode = event.keyCode, 4955 4956 // Check if one of the delete keys was pressed. 4957 isKeycodeDelete = /^(8|46)$/.test(keycode) 4958 4959 // For some reason IE clears the input value on âescapeâ. 4960 if ( keycode == 27 ) { 4961 P.close( true ) 4962 return false 4963 } 4964 4965 // Check if `space` or `delete` was pressed or the picker is closed with a key movement. 4966 if ( keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode] ) { 4967
4968 // Prevent it from moving the page and bubbling to doc. 4969 event.preventDefault() 4970 event.stopPropagation() 4971 4972 // If `delete` was pressed, clear the values and close the picker. 4973 // Otherwise open the picker. 4974 if ( isKeycodeDelete ) { P.clear().close() } 4975 else { P.open() } 4976 } 4977 } 4978 4979 4980 // Return a new picker instance. 4981 return new PickerInstance() 4982 } //PickerConstructor 4983 4984 4985 4986 /** 4987 * The default classes and prefix to use for the HTML classes. 4988 */ 4989 PickerConstructor.klasses = function( prefix ) { 4990 prefix = prefix || 'picker' 4991 return { 4992 4993 picker: prefix, 4994 opened: prefix + '--opened', 4995 focused: prefix + '--focused', 4996 4997 input: prefix + '__input', 4998 active: prefix + '__input--active', 4999 target: prefix + '__input--target', 5000 5001 holder: prefix + '__holder', 5002 5003 frame: prefix + '__frame', 5004 wrap: prefix + '__wrap', 5005 5006 box: prefix + '__box' 5007 } 5008 } //PickerConstructor.klasses 5009 5010 5011 5012 /** 5013 * Check if the default theme is being used. 5014 */ 5015 function isUsingDefaultTheme( element ) { 5016 5017 var theme, 5018 prop = 'position' 5019 5020 // For IE. 5021 if ( element.currentStyle ) { 5022 theme = element.currentStyle[prop] 5023 } 5024 5025 // For normal browsers. 5026 else if ( window.getComputedStyle ) { 5027 theme = getComputedStyle( element )[prop] 5028 } 5029 5030 return theme == 'fixed' 5031 } 5032 5033 5034 5035 /** 5036 * Get the width of the browserâs scrollbar. 5037 * Taken from: https://github.com/VodkaBears/Remodal/blob/master/src/jquery.remodal.js 5038 */ 5039 function getScrollbarWidth() { 5040 5041 if ( $html.height() <= $window.height() ) { 5042 return 0 5043 } 5044 5045 var $outer = $( '<div style="visibility:hidden;width:100px" />' ). 5046 appendTo( 'body' ) 5047 5048 // Get the width without scrollbars. 5049 var widthWithoutScroll = $outer[0].offsetWidth 5050 5051 // Force adding scrollbars. 5052 $outer.css( 'overflow', 'scroll' ) 5053 5054 // Add the inner div. 5055 var $inner = $( '<div style="width:100%" />' ).appendTo( $outer ) 5056 5057 // Get the width with scrollbars. 5058 var widthWithScroll = $inner[0].offsetWidth 5059 5060 // Remove the divs. 5061 $outer.remove() 5062 5063 // Return the difference between the widths. 5064 return widthWithoutScroll - widthWithScroll 5065 } 5066 5067 5068 5069 /** 5070 * Get the target element from the event. 5071 * If ELEMENT is supplied and present in the event path (ELEMENT is ancestor of the target), 5072 * returns ELEMENT instead 5073 */ 5074 function getRealEventTarget( event, ELEMENT ) { 5075 5076 var path = [] 5077 5078 if ( event.path ) { 5079 path = event.path 5080 } 5081 5082 if ( event.originalEvent && event.originalEvent.path ) { 5083 path = event.originalEvent.path 5084 } 5085 5086 if ( path && path.length > 0 ) { 5087 if ( ELEMENT && path.indexOf( ELEMENT ) >= 0 ) { 5088 return ELEMENT 5089 } else { 5090 return path[0] 5091 } 5092 } 5093 5094 return event.target 5095 } 5096 5097// taken from https://davidwalsh.name/javascript-debounce-function 5098 function debounce(func, wait, immediate) { 5099 var timeout; 5100 return function() { 5101 var context = this, args = arguments; 5102 var later = function() { 5103 timeout = null; 5104 if (!immediate) func.apply(context, args); 5105 }; 5106 var callNow = immediate && !timeout; 5107 clearTimeout(timeout); 5108 timeout = setTimeout(later, wait); 5109 if (callNow) func.apply(context, args); 5110 }; 5111 } 5112 5113 /** 5114 * PickerConstructor helper methods. 5115 */ 5116 PickerConstructor._ = { 5117 5118 /** 5119 * Create a group of nodes. Expects: 5120 * ` 5121 { 5122 min: {Integer}, 5123 max: {Integer}, 5124 i: {Integer}, 5125 node: {String}, 5126 item: {Function} 5127 } 5128 * ` 5129 */ 5130 group: function( groupObject ) { 5131 5132 var 5133 // Scope for the looped object 5134 loopObjectScope, 5135 5136 // Create the nodes list 5137 nodesList = '', 5138 5139 // The counter starts from the `min` 5140 counter = PickerConstructor._.trigger( groupObject.min, groupObject ) 5141 5142 5143 // Loop from the `min` to `max`, incrementing by `i` 5144 for ( ; counter <= PickerConstructor._.trigger( groupObject.max, groupObject, [ counter ] ); counter += groupObject.i ) { 5145 5146 // Trigger the `item` function within scope of the object 5147 loopObjectScope = PickerConstructor._.trigger( groupObject.item, groupObject, [ counter ] ) 5148 5149 // Splice the subgroup and create nodes out of the sub nodes 5150 nodesList += PickerConstructor._.node( 5151 groupObject.node, 5152 loopObjectScope[ 0 ], // the node 5153 loopObjectScope[ 1 ], // the classes 5154 loopObjectScope[ 2 ] // the attributes 5155 ) 5156 } 5157 5158 // Return the list of nodes 5159 return nodesList 5160 }, //group 5161 5162 5163 /** 5164 * Create a dom node string 5165 */ 5166 node: function( wrapper, item, klass, attribute ) { 5167 5168 // If the item is false-y, just return an empty string 5169 if ( !item ) return '' 5170 5171 // If the item is an array, do a join 5172 item = $.isArray( item ) ? item.join( '' ) : item 5173 5174 // Check for the class 5175 klass = klass ? ' class="' + klass + '"' : '' 5176 5177 // Check for any attributes 5178 attribute = attribute ? ' ' + attribute : '' 5179 5180 // Return the wrapped item 5181 return '<' + wrapper + klass + attribute + '>' + item + '</' + wrapper + '>' 5182 }, //node 5183 5184 5185 /** 5186 * Lead numbers below 10 with a zero. 5187 */ 5188 lead: function( number ) { 5189 return ( number < 10 ? '0': '' ) + number 5190 }, 5191 5192 5193 /** 5194 * Trigger a function otherwise return the value. 5195 */ 5196 trigger: function( callback, scope, args ) { 5197 return typeof callback == 'function' ? callback.apply( scope, args || [] ) : callback 5198 }, 5199 5200 5201 /** 5202 * If the second character is a digit, length is 2 otherwise 1. 5203 */ 5204 digits: function( string ) { 5205 return ( /\d/ ).test( string[ 1 ] ) ? 2 : 1 5206 }, 5207 5208 5209 /** 5210 * Tell if something is a date object. 5211 */ 5212 isDate: function( value ) { 5213 return {}.toString.call( value ).indexOf( 'Date' ) > -1 && this.isInteger( value.getDate() ) 5214 }, 5215 5216 5217 /** 5218 * Tell if something is an integer. 5219 */ 5220 isInteger: function( value ) { 5221 return {}.toString.call( value ).indexOf( 'Number' ) > -1 && value % 1 === 0 5222 }, 5223 5224 5225 /** 5226 * Create ARIA attribute strings. 5227 */ 5228 ariaAttr: ariaAttr 5229 } //PickerConstructor._ 5230 5231 5232 5233 /** 5234 * Extend the picker with a component and defaults. 5235 */ 5236 PickerConstructor.extend = function( name, Component ) { 5237 5238 // Extend jQuery. 5239 $.fn[ name ] = function( options, action ) { 5240 5241 // Grab the component data. 5242 var componentData = this.data( name ) 5243 5244 // If the picker is requested, return the data object. 5245 if ( options == 'picker' ) { 5246 return componentData 5247 } 5248 5249 // If the component data exists and `options` is a string, carry out the action. 5250 if ( componentData && typeof options == 'string' ) { 5251 return PickerConstructor._.trigger( componentData[ options ], componentData, [ action ] ) 5252 } 5253 5254 // Otherwise go through each matched element and if the component 5255 // doesnât exist, create a new picker using `this` element 5256 // and merging the defaults and options with a deep copy. 5257 return this.each( function() { 5258 var $this = $( this ) 5259 if ( !$this.data( name ) ) { 5260 new PickerConstructor( this, name, Component, options ) 5261 } 5262 }) 5263 } 5264 5265 // Set the defaults. 5266 $.fn[ name ].defaults = Component.defaults 5267 } //PickerConstructor.extend 5268 5269 5270 5271 function aria(element, attribute, value) { 5272 if ( $.isPlainObject(attribute) ) { 5273 for ( var key in attribute ) { 5274 ariaSet(element, key, attribute[key]) 5275 } 5276 } 5277 else { 5278 ariaSet(element, attribute, value) 5279 } 5280 } 5281 function ariaSet(element, attribute, value) { 5282 element.setAttribute( 5283 (attribute == 'role' ? '' : 'aria-') + attribute, 5284 value 5285 ) 5286 } 5287 function ariaAttr(attribute, data) { 5288 if ( !$.isPlainObject(attribute) ) { 5289 attribute = { attribute: data } 5290 } 5291 data = '' 5292 for ( var key in attribute ) { 5293 var attr = (key == 'role' ? '' : 'aria-') + key, 5294 attrVal = attribute[key] 5295 data += attrVal == null ? '' : attr + '="' + attribute[key] + '"' 5296 } 5297 return data 5298 } 5299 5300// IE8 bug throws an error for activeElements within iframes. 5301 function getActiveElement() { 5302 try { 5303 return document.activeElement 5304 } catch ( err ) { } 5305 } 5306 5307 5308 5309// Expose the picker constructor. 5310 return PickerConstructor 5311 5312 5313})); 5314 5315/*! 5316 * Date picker for pickadate.js v3.6.3 5317 * http://amsul.github.io/pickadate.js/date.htm 5318 */ 5319 5320(function (factory) { 5321 5322 // AMD. 5323 if (typeof define == 'function' && define.amd) 5324 define(['./picker', 'jquery'], factory) 5325 5326 // Node.js/browserify. 5327 else if (typeof exports == 'object') 5328 module.exports = factory(require('./picker.js'), require('jquery')) 5329 5330 // Browser globals. 5331 else factory(Picker, jQuery) 5332 5333}(function (Picker, $) { 5334 5335 5336 /** 5337 * Globals and constants 5338 */ 5339 var DAYS_IN_WEEK = 7, 5340 WEEKS_IN_CALENDAR = 6, 5341 _ = Picker._ 5342 5343 5344 5345 /** 5346 * The date picker constructor 5347 */ 5348 function DatePicker(picker, settings) { 5349 5350 var calendar = this, 5351 element = picker.$node[0], 5352 elementValue = element.value, 5353 elementDataValue = picker.$node.data('value'), 5354 valueString = elementDataValue || elementValue, 5355 formatString = elementDataValue ? settings.formatSubmit : settings.format, 5356 isRTL = function () { 5357 5358 return element.currentStyle ? 5359 5360 // For IE. 5361 element.currentStyle.direction == 'rtl' : 5362 5363 // For normal browsers. 5364 getComputedStyle(picker.$root[0]).direction == 'rtl' 5365 } 5366 5367 calendar.settings = settings 5368 calendar.$node = picker.$node 5369 5370 // The queue of methods that will be used to build item objects. 5371 calendar.queue = { 5372 min: 'measure create', 5373 max: 'measure create', 5374 now: 'now create', 5375 select: 'parse create validate', 5376 highlight: 'parse navigate create validate', 5377 view: 'parse create validate viewset', 5378 disable: 'deactivate', 5379 enable: 'activate' 5380 } 5381 5382 // The component's item object. 5383 calendar.item = {} 5384 5385 calendar.item.clear = null 5386 calendar.item.disable = (settings.disable || []).slice(0) 5387 calendar.item.enable = -(function (collectionDisabled) { 5388 return collectionDisabled[0] === true ? collectionDisabled.shift() : -1 5389 })(calendar.item.disable) 5390 5391 calendar. 5392 set('min', settings.min). 5393 set('max', settings.max). 5394 set('now') 5395 5396 // When thereâs a value, set the `select`, which in turn 5397 // also sets the `highlight` and `view`. 5398 if (valueString) { 5399 calendar.set('select', valueString, { 5400 format: formatString, 5401 defaultValue: true 5402 }) 5403 } 5404 5405 // If thereâs no value, default to highlighting âtodayâ. 5406 else { 5407 calendar. 5408 set('select', null). 5409 set('highlight', calendar.item.now) 5410 } 5411 5412 5413 // The keycode to movement mapping. 5414 calendar.key = { 5415 40: 7, // Down 5416 38: -7, // Up 5417 39: function () { 5418 return isRTL() ? -1 : 1 5419 }, // Right 5420 37: function () { 5421 return isRTL() ? 1 : -1 5422 }, // Left 5423 go: function (timeChange) { 5424 var highlightedObject = calendar.item.highlight, 5425 targetDate = new Date(highlightedObject.year, highlightedObject.month, highlightedObject.date + timeChange) 5426 calendar.set( 5427 'highlight', 5428 targetDate, { 5429 interval: timeChange 5430 } 5431 ) 5432 this.render() 5433 } 5434 } 5435 5436 5437 // Bind some picker events. 5438 picker. 5439 on('render', function () { 5440 picker.$root.find('.' + settings.klass.selectMonth).on('change', function () { 5441 var value = this.value 5442 if (value) { 5443 picker.set('highlight', [picker.get('view').year, value, picker.get('highlight').date]) 5444 picker.$root.find('.' + settings.klass.selectMonth).trigger('focus') 5445 } 5446 }) 5447 picker.$root.find('.' + settings.klass.selectYear).on('change', function () { 5448 var value = this.value 5449 if (value) { 5450 picker.set('highlight', [value, picker.get('view').month, picker.get('highlight').date]) 5451 picker.$root.find('.' + settings.klass.selectYear).trigger('focus') 5452 } 5453 }) 5454 }, 1). 5455 on('open', function () { 5456 var includeToday = '' 5457 if (calendar.disabled(calendar.get('now'))) { 5458 includeToday = ':not(.' + settings.klass.buttonToday + ')' 5459 } 5460 picker.$root.find('button' + includeToday + ', select').attr('disabled', false) 5461 }, 1). 5462 on('close', function () { 5463 picker.$root.find('button, select').attr('disabled', true) 5464 }, 1) 5465 5466 } //DatePicker 5467 5468 5469 /** 5470 * Set a datepicker item object. 5471 */ 5472 DatePicker.prototype.set = function (type, value, options) { 5473 5474 var calendar = this, 5475 calendarItem = calendar.item 5476 5477 // If the value is `null` just set it immediately. 5478 if (value === null) { 5479 if (type == 'clear') type = 'select' 5480 calendarItem[type] = value 5481 return calendar 5482 } 5483 5484 // Otherwise go through the queue of methods, and invoke the functions. 5485 // Update this as the time unit, and set the final value as this item. 5486 // * In the case of `enable`, keep the queue but set `disable` instead. 5487 // And in the case of `flip`, keep the queue but set `enable` instead. 5488 calendarItem[(type == 'enable' ? 'disable' : type == 'flip' ? 'enable' : type)] = calendar.queue[type].split(' ').map(function (method) { 5489 value = calendar[method](type, value, options) 5490 return value 5491 }).pop() 5492 5493 // Check if we need to cascade through more updates. 5494 if (type == 'select') { 5495 calendar.set('highlight', calendarItem.select, options) 5496 } else if (type == 'highlight') { 5497 calendar.set('view', calendarItem.highlight, options) 5498 } else if (type.match(/^(flip|min|max|disable|enable)$/)) { 5499 if (calendarItem.select && calendar.disabled(calendarItem.select)) { 5500 calendar.set('select', calendarItem.select, options) 5501 } 5502 if (calendarItem.highlight && calendar.disabled(calendarItem.highlight)) { 5503 calendar.set('highlight', calendarItem.highlight, options) 5504 } 5505 } 5506 5507 return calendar 5508 } //DatePicker.prototype.set 5509 5510 5511 /** 5512 * Get a datepicker item object. 5513 */ 5514 DatePicker.prototype.get = function (type) { 5515
5515 return this.item[type] 5516 } //DatePicker.prototype.get 5517 5518 5519 /** 5520 * Create a picker date object. 5521 */ 5522 DatePicker.prototype.create = function (type, value, options) { 5523 5524 var isInfiniteValue, 5525 calendar = this 5526 5527 // If thereâs no value, use the type as the value. 5528 value = value === undefined ? type : value 5529 5530 5531 // If itâs infinity, update the value. 5532 if (value == -Infinity || value == Infinity) { 5533 isInfiniteValue = value 5534 } 5535 5536 // If itâs an object, use the native date object. 5537 else if ($.isPlainObject(value) && _.isInteger(value.pick)) { 5538 value = value.obj 5539 } 5540 5541 // If itâs an array, convert it into a date and make sure 5542 // that itâs a valid date â otherwise default to today. 5543 else if ($.isArray(value)) { 5544 value = new Date(value[0], value[1], value[2]) 5545 value = _.isDate(value) ? value : calendar.create().obj 5546 } 5547 5548 // If itâs a number or date object, make a normalized date. 5549 else if (_.isInteger(value) || _.isDate(value)) { 5550 value = calendar.normalize(new Date(value), options) 5551 } 5552 5553 // If itâs a literal true or any other case, set it to now. 5554 else /*if ( value === true )*/ { 5555 value = calendar.now(type, value, options) 5556 } 5557 5558 // Return the compiled object. 5559 return { 5560 year: isInfiniteValue || value.getFullYear(), 5561 month: isInfiniteValue || value.getMonth(), 5562 date: isInfiniteValue || value.getDate(), 5563 day: isInfiniteValue || value.getDay(), 5564 obj: isInfiniteValue || value, 5565 pick: isInfiniteValue || value.getTime() 5566 } 5567 } //DatePicker.prototype.create 5568 5569 5570 /** 5571 * Create a range limit object using an array, date object, 5572 * literal âtrueâ, or integer relative to another time. 5573 */ 5574 DatePicker.prototype.createRange = function (from, to) { 5575 5576 var calendar = this, 5577 createDate = function (date) { 5578 if (date === true || $.isArray(date) || _.isDate(date)) { 5579 return calendar.create(date) 5580 } 5581 return date 5582 } 5583 5584 // Create objects if possible. 5585 if (!_.isInteger(from)) { 5586 from = createDate(from) 5587 } 5588 if (!_.isInteger(to)) { 5589 to = createDate(to) 5590 } 5591 5592 // Create relative dates. 5593 if (_.isInteger(from) && $.isPlainObject(to)) { 5594 from = [to.year, to.month, to.date + from]; 5595 } else if (_.isInteger(to) && $.isPlainObject(from)) { 5596 to = [from.year, from.month, from.date + to]; 5597 } 5598 5599 return { 5600 from: createDate(from), 5601 to: createDate(to) 5602 } 5603 } //DatePicker.prototype.createRange 5604 5605 5606 /** 5607 * Check if a date unit falls within a date range object. 5608 */ 5609 DatePicker.prototype.withinRange = function (range, dateUnit) { 5610 range = this.createRange(range.from, range.to) 5611 return dateUnit.pick >= range.from.pick && dateUnit.pick <= range.to.pick 5612 } 5613 5614 5615 /** 5616 * Check if two date range objects overlap. 5617 */ 5618 DatePicker.prototype.overlapRanges = function (one, two) { 5619 5620 var calendar = this 5621 5622 // Convert the ranges into comparable dates. 5623 one = calendar.createRange(one.from, one.to) 5624 two = calendar.createRange(two.from, two.to) 5625 5626 return calendar.withinRange(one, two.from) || calendar.withinRange(one, two.to) || 5627 calendar.withinRange(two, one.from) || calendar.withinRange(two, one.to) 5628 } 5629 5630 5631 /** 5632 * Get the date today. 5633 */ 5634 DatePicker.prototype.now = function (type, value, options) { 5635 value = new Date() 5636 if (options && options.rel) { 5637 value.setDate(value.getDate() + options.rel) 5638 } 5639 return this.normalize(value, options) 5640 } 5641 5642 5643 /** 5644 * Navigate to next/prev month. 5645 */ 5646 DatePicker.prototype.navigate = function (type, value, options) { 5647 5648 var targetDateObject, 5649 targetYear, 5650 targetMonth, 5651 targetDate, 5652 isTargetArray = $.isArray(value),
5653 isTargetObject = $.isPlainObject(value), 5654 viewsetObject = this.item.view 5655 /*, 5656 safety = 100*/ 5657 5658 5659 if (isTargetArray || isTargetObject) { 5660 5661 if (isTargetObject) { 5662 targetYear = value.year 5663 targetMonth = value.month 5664 targetDate = value.date 5665 } else { 5666 targetYear = +value[0] 5667 targetMonth = +value[1] 5668 targetDate = +value[2] 5669 } 5670 5671 // If weâre navigating months but the view is in a different 5672 // month, navigate to the viewâs year and month. 5673 if (options && options.nav && viewsetObject && viewsetObject.month !== targetMonth) { 5674 targetYear = viewsetObject.year 5675 targetMonth = viewsetObject.month 5676 } 5677 5678 // Figure out the expected target year and month. 5679 targetDateObject = new Date(targetYear, targetMonth + (options && options.nav ? options.nav : 0), 1) 5680 targetYear = targetDateObject.getFullYear() 5681 targetMonth = targetDateObject.getMonth() 5682 5683 // If the month weâre going to doesnât have enough days, 5684 // keep decreasing the date until we reach the monthâs last date. 5685 while ( /*safety &&*/ new Date(targetYear, targetMonth, targetDate).getMonth() !== targetMonth) { 5686 targetDate -= 1 5687 /*safety -= 1 5688 if ( !safety ) { 5689 throw 'Fell into an infinite loop while navigating to ' + new Date( targetYear, targetMonth, targetDate ) + '.' 5690 }*/ 5691 } 5692 5693 value = [targetYear, targetMonth, targetDate] 5694 } 5695 5696 return value 5697 } //DatePicker.prototype.navigate 5698 5699 5700 /** 5701 * Normalize a date by setting the hours to midnight. 5702 */ 5703 DatePicker.prototype.normalize = function (value /*, options*/ ) { 5704 value.setHours(0, 0, 0, 0) 5705 return value 5706 } 5707 5708 5709 /** 5710 * Measure the range of dates. 5711 */ 5712 DatePicker.prototype.measure = function (type, value /*, options*/ ) { 5713 5714 var calendar = this 5715 5716 // If it's an integer, get a date relative to today. 5717 if (_.isInteger(value)) { 5718 value = calendar.now(type, value, { 5719 rel: value 5720 }) 5721 } 5722 5723 // If itâs anything false-y, remove the limits. 5724 else if (!value) { 5725 value = type == 'min' ? -Infinity : Infinity 5726 } 5727 5728 // If itâs a string, parse it. 5729 else if (typeof value == 'string') { 5730 value = calendar.parse(type, value) 5731 } 5732 5733 return value 5734 } ///DatePicker.prototype.measure 5735 5736 5737 /** 5738 * Create a viewset object based on navigation. 5739 */ 5740 DatePicker.prototype.viewset = function (type, dateObject /*, options*/ ) { 5741 return this.create([dateObject.year, dateObject.month, 1]) 5742 } 5743 5744 5745 /** 5746 * Validate a date as enabled and shift if needed. 5747 */ 5748 DatePicker.prototype.validate = function (type, dateObject, options) { 5749 5750 var calendar = this, 5751 5752 // Keep a reference to the original date. 5753 originalDateObject = dateObject, 5754 5755 // Make sure we have an interval. 5756 interval = options && options.interval ? options.interval : 1, 5757 5758 // Check if the calendar enabled dates are inverted. 5759 isFlippedBase = calendar.item.enable === -1, 5760 5761 // Check if we have any enabled dates after/before now. 5762 hasEnabledBeforeTarget, hasEnabledAfterTarget, 5763 5764 // The min & max limits. 5765 minLimitObject = calendar.item.min, 5766 maxLimitObject = calendar.item.max, 5767 5768 // Check if weâve reached the limit during shifting. 5769 reachedMin, reachedMax, 5770 5771 // Check if the calendar is inverted and at least one weekday is enabled. 5772 hasEnabledWeekdays = isFlippedBase && calendar.item.disable.filter(function (value) { 5773 5774 // If thereâs a date, check where it is relative to the target. 5775 if ($.isArray(value)) { 5776 var dateTime = calendar.create(value).pick 5777 if (dateTime < dateObject.pick) hasEnabledBeforeTarget = true 5778 else if (dateTime > dateObject.pick) hasEnabledAfterTarget = true 5779 } 5780 5781 // Return only integers for enabled weekdays. 5782 return _.isInteger(value) 5783 }).length 5784 /*, 5785 5786 safety = 100*/ 5787 5788 5789 5790 // Cases to validate for: 5791 // [1] Not inverted and date disabled. 5792 // [2] Inverted and some dates enabled. 5793 // [3] Not inverted and out of range. 5794 // 5795 // Cases to **not** validate for: 5796 // ⢠Navigating months. 5797 // ⢠Not inverted and date enabled. 5798 // ⢠Inverted and all dates disabled. 5799 // ⢠..and anything else.
5800 if (!options || (!options.nav && !options.defaultValue)) 5801 if ( 5802 /* 1 */ 5803 (!isFlippedBase && calendar.disabled(dateObject)) || 5804 /* 2 */ 5805 (isFlippedBase && calendar.disabled(dateObject) && (hasEnabledWeekdays || hasEnabledBeforeTarget || hasEnabledAfterTarget)) || 5806 /* 3 */ 5807 (!isFlippedBase && (dateObject.pick <= minLimitObject.pick || dateObject.pick >= maxLimitObject.pick)) 5808 ) { 5809 5810 5811 // When inverted, flip the direction if there arenât any enabled weekdays 5812 // and there are no enabled dates in the direction of the interval. 5813 if (isFlippedBase && !hasEnabledWeekdays && ((!hasEnabledAfterTarget && interval > 0) || (!hasEnabledBeforeTarget && interval < 0))) { 5814 interval *= -1 5815 } 5816 5817 5818 // Keep looping until we reach an enabled date. 5819 while ( /*safety &&*/ calendar.disabled(dateObject)) { 5820 5821 /*safety -= 1 5822 if ( !safety ) { 5823 throw 'Fell into an infinite loop while validating ' + dateObject.obj + '.' 5824 }*/ 5825 5826 5827 // If weâve looped into the next/prev month with a large interval, return to the original date and flatten the interval. 5828 if (Math.abs(interval) > 1 && (dateObject.month < originalDateObject.month || dateObject.month > originalDateObject.month)) { 5829 dateObject = originalDateObject 5830 interval = interval > 0 ? 1 : -1 5831 } 5832 5833 5834 // If weâve reached the min/max limit, reverse the direction, flatten the interval and set it to the limit. 5835 if (dateObject.pick <= minLimitObject.pick) { 5836 reachedMin = true 5837 interval = 1 5838 dateObject = calendar.create([ 5839 minLimitObject.year, 5840 minLimitObject.month, 5841 minLimitObject.date + (dateObject.pick === minLimitObject.pick ? 0 : -1) 5842 ]) 5843 } else if (dateObject.pick >= maxLimitObject.pick) { 5844 reachedMax = true 5845 interval = -1 5846 dateObject = calendar.create([ 5847 maxLimitObject.year, 5848 maxLimitObject.month, 5849 maxLimitObject.date + (dateObject.pick === maxLimitObject.pick ? 0 : 1) 5850 ]) 5851 } 5852 5853 5854 // If weâve reached both limits, just break out of the loop. 5855 if (reachedMin && reachedMax) { 5856 break 5857 } 5858 5859 5860 // Finally, create the shifted date using the interval and keep looping. 5861 dateObject = calendar.create([dateObject.year, dateObject.month, dateObject.date + interval]) 5862 } 5863 5864 } //endif 5865 5866 5867 // Return the date object settled on. 5868 return dateObject 5869 } //DatePicker.prototype.validate 5870 5871 5872 /** 5873 * Check if a date is disabled. 5874 */ 5875 DatePicker.prototype.disabled = function (dateToVerify) { 5876 5877 var 5878 calendar = this, 5879 5880 // Filter through the disabled dates to check if this is one. 5881 isDisabledMatch = calendar.item.disable.filter(function (dateToDisable) { 5882 5883 // If the date is a number, match the weekday with 0index and `firstDay` check. 5884 if (_.isInteger(dateToDisable)) { 5885 return dateToVerify.day === (calendar.settings.firstDay ? dateToDisable : dateToDisable - 1) % 7 5886 } 5887 5888 // If itâs an array or a native JS date, create and match the exact date. 5889 if ($.isArray(dateToDisable) || _.isDate(dateToDisable)) { 5890 return dateToVerify.pick === calendar.create(dateToDisable).pick 5891 } 5892 5893 // If itâs an object, match a date within the âfromâ and âtoâ range. 5894 if ($.isPlainObject(dateToDisable)) { 5895 return calendar.withinRange(dateToDisable, dateToVerify) 5896 } 5897 }) 5898 5899 // If this date matches a disabled date, confirm itâs not inverted. 5900 isDisabledMatch = isDisabledMatch.length && !isDisabledMatch.filter(function (dateToDisable) { 5901 return $.isArray(dateToDisable) && dateToDisable[3] == 'inverted' || 5902 $.isPlainObject(dateToDisable) && dateToDisable.inverted 5903 }).length 5904 5905 // Check the calendar âenabledâ flag and respectively flip the 5906 // disabled state. Then also check if itâs beyond the min/max limits. 5907 return calendar.item.enable === -1 ? !isDisabledMatch : isDisabledMatch || 5908 dateToVerify.pick < calendar.item.min.pick || 5909 dateToVerify.pick > calendar.item.max.pick 5910 5911 } //DatePicker.prototype.disabled 5912 5913 5914 /** 5915 * Parse a string into a usable type. 5916 */ 5917 DatePicker.prototype.parse = function (type, value, options) { 5918 5919 var calendar = this, 5920 parsingObject = {} 5921 5922 // If itâs already parsed, weâre good. 5923 if (!value || typeof value != 'string') { 5924 return value 5925 } 5926 5927 // We need a `.format` to parse the value with. 5928 if (!(options && options.format)) { 5929 options = options || {} 5930 options.format = calendar.settings.format 5931 } 5932 5933 // Convert the format into an array and then map through it. 5934 calendar.formats.toArray(options.format).map(function (label) { 5935 5936 var 5937 // Grab the formatting label. 5938 formattingLabel = calendar.formats[label], 5939 5940 // The format length is from the formatting label function or the 5941 // label length without the escaping exclamation (!) mark. 5942 formatLength = formattingLabel ? _.trigger(formattingLabel, calendar, [value, parsingObject]) : label.replace(/^!/, '').length 5943 5944 // If there's a format label, split the value up to the format length. 5945 // Then add it to the parsing object with appropriate label. 5946 if (formattingLabel) { 5947 parsingObject[label] = value.substr(0, formatLength) 5948 } 5949 5950 // Update the value as the substring from format length to end. 5951 value = value.substr(formatLength) 5952 }) 5953 5954 // Compensate for month 0index. 5955 return [ 5956 parsingObject.yyyy || parsingObject.yy, 5957 +(parsingObject.mm || parsingObject.m) - 1, 5958 parsingObject.dd || parsingObject.d 5959 ] 5960 } //DatePicker.prototype.parse 5961 5962 5963 /** 5964 * Various formats to display the object in. 5965 */ 5966 DatePicker.prototype.formats = (function () { 5967 5968 // Return the length of the first word in a collection. 5969 function getWordLengthFromCollection(string, collection, dateObject) { 5970 5971 // Grab the first word from the string. 5972 // Regex pattern from http://stackoverflow.com/q/150033 5973 var word = string.match(/[^\x00-\x7F]+|\w+/)[0] 5974 5975 // If there's no month index, add it to the date object 5976 if (!dateObject.mm && !dateObject.m) { 5977 dateObject.m = collection.indexOf(word) + 1 5978 } 5979 5980 // Return the length of the word. 5981 return word.length 5982 } 5983 5984 // Get the length of the first word in a string. 5985 function getFirstWordLength(string) { 5986 return string.match(/\w+/)[0].length 5987 } 5988 5989 return { 5990 5991 d: function (string, dateObject) { 5992 5993 // If there's string, then get the digits length. 5994 // Otherwise return the selected date. 5995 return string ? _.digits(string) : dateObject.date 5996 }, 5997 dd: function (string, dateObject) { 5998 5999 // If there's a string, then the length is always 2. 6000 // Otherwise return the selected date with a leading zero. 6001 return string ? 2 : _.lead(dateObject.date) 6002 }, 6003 ddd: function (string, dateObject) { 6004 6005 // If there's a string, then get the length of the first word. 6006 // Otherwise return the short selected weekday. 6007 return string ? getFirstWordLength(string) : this.settings.weekdaysShort[dateObject.day] 6008 }, 6009 dddd: function (string, dateObject) { 6010 6011 // If there's a string, then get the length of the first word. 6012 // Otherwise return the full selected weekday. 6013 return string ? getFirstWordLength(string) : this.settings.weekdaysFull[dateObject.day] 6014 }, 6015 m: function (string, dateObject) { 6016 6017 // If there's a string, then get the length of the digits 6018 // Otherwise return the selected month with 0index compensation. 6019 return string ? _.digits(string) : dateObject.month + 1 6020 }, 6021 mm: function (string, dateObject) { 6022 6023 // If there's a string, then the length is always 2. 6024 // Otherwise return the selected month with 0index and leading zero. 6025 return string ? 2 : _.lead(dateObject.month + 1) 6026 }, 6027 mmm: function (string, dateObject) { 6028 6029 var collection = this.settings.monthsShort 6030 6031 // If there's a string, get length of the relevant month from the short 6032 // months collection. Otherwise return the selected month from that c
6032ollection. 6033 return string ? getWordLengthFromCollection(string, collection, dateObject) : collection[dateObject.month] 6034 }, 6035 mmmm: function (string, dateObject) { 6036 6037 var collection = this.settings.monthsFull 6038 6039 // If there's a string, get length of the relevant month from the full 6040 // months collection. Otherwise return the selected month from that collection. 6041 return string ? getWordLengthFromCollection(string, collection, dateObject) : collection[dateObject.month] 6042 }, 6043 yy: function (string, dateObject) { 6044 6045 // If there's a string, then the length is always 2. 6046 // Otherwise return the selected year by slicing out the first 2 digits. 6047 return string ? 2 : ('' + dateObject.year).slice(2) 6048 }, 6049 yyyy: function (string, dateObject) { 6050 6051 // If there's a string, then the length is always 4. 6052 // Otherwise return the selected year. 6053 return string ? 4 : dateObject.year 6054 }, 6055 6056 // Create an array by splitting the formatting string passed. 6057 toArray: function (formatString) { 6058 return formatString.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g) 6059 }, 6060 6061 // Format an object into a string using the formatting options. 6062 toString: function (formatString, itemObject) { 6063 var calendar = this 6064 return calendar.formats.toArray(formatString).map(function (label) { 6065 return _.trigger(calendar.formats[label], calendar, [0, itemObject]) || label.replace(/^!/, '') 6066 }).join('') 6067 } 6068 } 6069 })() //DatePicker.prototype.formats 6070 6071 6072 6073 6074 /** 6075 * Check if two date units are the exact. 6076 */ 6077 DatePicker.prototype.isDateExact = function (one, two) { 6078 6079 var calendar = this 6080 6081 // When weâre working with weekdays, do a direct comparison. 6082 if ( 6083 (_.isInteger(one) && _.isInteger(two)) || 6084 (typeof one == 'boolean' && typeof two == 'boolean') 6085 ) { 6086 return one === two 6087 } 6088 6089 // When weâre working with date representations, compare the âpickâ value. 6090 if ( 6091 (_.isDate(one) || $.isArray(one)) && 6092 (_.isDate(two) || $.isArray(two)) 6093 ) { 6094 return calendar.create(one).pick === calendar.create(two).pick 6095 } 6096 6097 // When weâre working with range objects, compare the âfromâ and âtoâ. 6098 if ($.isPlainObject(one) && $.isPlainObject(two)) { 6099 return calendar.isDateExact(one.from, two.from) && calendar.isDateExact(one.to, two.to) 6100 } 6101 6102 return false 6103 } 6104 6105 6106 /** 6107 * Check if two date units overlap. 6108 */ 6109 DatePicker.prototype.isDateOverlap = function (one, two) { 6110 6111 var calendar = this, 6112 firstDay = calendar.settings.firstDay ? 1 : 0 6113 6114 // When weâre working with a weekday index, compare the days. 6115 if (_.isInteger(one) && (_.isDate(two) || $.isArray(two))) { 6116 one = one % 7 + firstDay 6117 return one === calendar.create(two).day + 1 6118 } 6119 if (_.isInteger(two) && (_.isDate(one) || $.isArray(one))) { 6120 two = two % 7 + firstDay 6121 return two === calendar.create(one).day + 1 6122 } 6123 6124 // When weâre working with range objects, check if the ranges overlap. 6125 if ($.isPlainObject(one) && $.isPlainObject(two)) { 6126 return calendar.overlapRanges(one, two) 6127 } 6128 6129 return false 6130 } 6131 6132 6133 /** 6134 * Flip the âenabledâ state. 6135 */ 6136 DatePicker.prototype.flipEnable = function (val) { 6137 var itemObject = this.item 6138 itemObject.enable = val || (itemObject.enable == -1 ? 1 : -1) 6139 } 6140 6141 6142 /** 6143 * Mark a collection of dates as âdisabledâ. 6144 */ 6145 DatePicker.prototype.deactivate = function (type, datesToDisable) { 6146 6147 var calendar = this, 6148 disabledItems = calendar.item.disable.slice(0) 6149 6150 6151 // If weâre flipping, thatâs all we need to do. 6152 if (datesToDisable == 'flip') { 6153 calendar.flipEnable() 6154 } else if (datesToDisable === false) { 6155 calendar.flipEnable(1) 6156 disabledItems = [] 6157 } else if (datesToDisable === true) { 6158 calendar.flipEnable(-1) 6159 disabledItems = [] 6160 } 6161 6162 // Otherwise go through the dates to disable. 6163 else { 6164 6165 datesToDisable.map(function (unitToDisable) { 6166 6167 var matchFound 6168 6169 // When we have disabled items, check for matches. 6170 // If something is matched, immediately break out. 6171 for (var index = 0; index < disabledItems.length; index += 1) { 6172 if (calendar.isDateExact(unitToDisable, disabledItems[index])) { 6173 matchFound = true 6174 break 6175 } 6176 } 6177 6178 // If nothing was found, add the validated unit to the collection. 6179 if (!matchFound) { 6180 if ( 6181 _.isInteger(unitToDisable) || 6182 _.isDate(unitToDisable) || 6183 $.isArray(unitToDisable) || 6184 ($.isPlainObject(unitToDisable) && unitToDisable.from && unitToDisable.to) 6185 ) { 6186 disabledItems.push(unitToDisable) 6187 } 6188 } 6189 }) 6190 } 6191 6192 // Return the updated collection. 6193 return disabledItems 6194 } //DatePicker.prototype.deactivate 6195 6196 6197 /** 6198 * Mark a collection of dates as âenabledâ. 6199 */ 6200 DatePicker.prototype.activate = function (type, datesToEnable) { 6201 6202 var calendar = this, 6203 disabledItems = calendar.item.disable, 6204 disabledItemsCount = disabledItems.length 6205 6206 // If weâre flipping, thatâs all we need to do. 6207 if (datesToEnable == 'flip') { 6208 calendar.flipEnable() 6209 } else if (datesToEnable === true) { 6210 calendar.flipEnable(1) 6211 disabledItems = [] 6212 } else if (datesToEnable === false) { 6213 calendar.flipEnable(-1) 6214 disabledItems = [] 6215 } 6216 6217 // Otherwise go through the disabled dates. 6218 else { 6219 6220 datesToEnable.map(function (unitToEnable) { 6221 6222 var matchFound, 6223 disabledUnit, 6224 index, 6225 isExactRange 6226 6227 // Go through the disabled items and try to find a match. 6228 for (index = 0; index < disabledItemsCount; index += 1) { 6229 6230 disabledUnit = disabledItems[index] 6231 6232 // When an exact match is found, remove it from the collection. 6233 if (calendar.isDateExact(disabledUnit, unitToEnable)) { 6234 matchFound = disabledItems[index] = null 6235 isExactRange = true 6236 break 6237 } 6238 6239 // When an overlapped match is found, add the âinvertedâ state to it. 6240 else if (calendar.isDateOverlap(disabledUnit, unitToEnable)) { 6241 if ($.isPlainObject(unitToEnable)) { 6242 unitToEnable.inverted = true 6243 matchFound = unitToEnable 6244 } else if ($.isArray(unitToEnable)) { 6245 matchFound = unitToEnable 6246 if (!matchFound[3]) matchFound.push('inverted') 6247 } else if (_.isDate(unitToEnable)) { 6248 matchFound = [unitToEnable.getFullYear(), unitToEnable.getMonth(), unitToEnable.getDate(), 'inverted'] 6249 } 6250 break 6251 } 6252 } 6253 6254 // If a match was found, remove a previous duplicate entry. 6255 if (matchFound) 6256 for (index = 0; index < disabledItemsCount; index += 1) { 6257 if (calendar.isDateExact(disabledItems[index], unitToEnable)) { 6258 disabledItems[index] = null 6259 break 6260 } 6261 } 6262 6263 // In the event that weâre dealing with an exact range of dates, 6264 // make sure there are no âinvertedâ dates because of it. 6265 if (isExactRange) 6266 for (index = 0; index < disabledItemsCount; index += 1) { 6267 if (calendar.isDateOverlap(disabledItems[index], unitToEnable)) { 6268 disabledItems[index] = null 6269 break 6270 } 6271 } 6272 6273 // If something is still matched, add it into the collection. 6274 if (matchFound) { 6275 disabledItems.push(matchFound) 6276 } 6277 }) 6278 } 6279 6280 // Return the updated collection. 6281 return disabledItems.filter(function (val) { 6282 return val != null 6283 }) 6284 } //DatePicker.prototype.activate 6285 6286 6287 /** 6288 * Create a string for the nodes in the picker. 6289 */ 6290 DatePicker.prototype.nodes = function (isOpen) { 6291 6292 var 6293 calendar = this, 6294 settings = calendar.settings, 6295 calendarItem = calendar.item, 6296 nowObject = calendarItem.now, 6297 selectedObject = calendarItem.select, 6298 highlightedObject = calendarItem.highlight, 6299 viewsetObject = calendarItem.view, 6300 disabledCollection = calendarItem.disable, 6301 minLimitObject = calendarItem.min, 6302 maxLimitObject = calendarItem.max, 6303 6304 6305 // Create the calendar table head using a copy of weekday labels collection. 6306 // * We do a copy so we don't mutate the original array. 6307 tableHead = (function (collection, fullCollection) { 6308 6309 // If the first day should be Monday, move Sunday to the end. 6310 if (settings.firstDay) { 6311 collection.push(collection.shift()) 6312 fullCollection.push(fullCollection.shift()) 6313 } 6314 6315 // Create and return the table head group.
6316 return _.node( 6317 'thead', 6318 _.node( 6319 'tr', 6320 _.group({ 6321 min: 0, 6322 max: DAYS_IN_WEEK - 1, 6323 i: 1, 6324 node: 'th', 6325 item: function (counter) { 6326 return [ 6327 collection[counter], 6328 settings.klass.weekdays, 6329 'scope=col title="' + fullCollection[counter] + '"' 6330 ] 6331 } 6332 }) 6333 ) 6334 ) //endreturn 6335 })((settings.showWeekdaysFull ? settings.weekdaysFull : settings.weekdaysShort).slice(0), settings.weekdaysFull.slice(0)), //tableHead 6336 6337 6338 // Create the nav for next/prev month. 6339 createMonthNav = function (next) { 6340 6341 // Otherwise, return the created month tag. 6342 return _.node( 6343 'button', 6344 ' ', 6345 settings.klass['nav' + (next ? 'Next' : 'Prev')] + ( 6346 6347 // If the focused month is outside the range, disabled the button. 6348 (next && viewsetObject.year >= maxLimitObject.year && viewsetObject.month >= maxLimitObject.month) || 6349 (!next && viewsetObject.year <= minLimitObject.year && viewsetObject.month <= minLimitObject.month) ? 6350 ' ' + settings.klass.navDisabled : '' 6351 ), 6352 'data-nav=' + (next || -1) + ' ' + 6353 _.ariaAttr({ 6354 role: 'button', 6355 6356 controls: calendar.$node[0].id + '_table' 6357 }) + ' ' + 6358 'title="' + (next ? settings.labelMonthNext : settings.labelMonthPrev) + '"' 6359 ) //endreturn 6360 }, //createMonthNav 6361 6362 6363 // Create the month label. 6364 createMonthLabel = function () { 6365 6366 var monthsCollection = settings.showMonthsShort ? settings.monthsShort : settings.monthsFull 6367 6368 // If there are months to select, add a dropdown menu. 6369 if (settings.selectMonths) { 6370 6371 return _.node('select', 6372 _.group({ 6373 min: 0, 6374 max: 11, 6375 i: 1, 6376 node: 'option', 6377 item: function (loopedMonth) { 6378 6379 return [ 6380 6381 // The looped month and no classes. 6382 monthsCollection[loopedMonth], 0, 6383 6384 // Set the value and selected index. 6385 'value=' + loopedMonth + 6386 (viewsetObject.month == loopedMonth ? ' selected' : '') + 6387 ( 6388 ( 6389 (viewsetObject.year == minLimitObject.year && loopedMonth < minLimitObject.month) || 6390 (viewsetObject.year == maxLimitObject.year && loopedMonth > maxLimitObject.month) 6391 ) ? 6392 ' disabled' : '' 6393 ) 6394 ] 6395 } 6396 }), 6397 settings.klass.selectMonth, 6398 (isOpen ? '' : 'disabled') + ' ' + 6399 _.ariaAttr({ 6400 controls: calendar.$node[0].id + '_table' 6401 }) + ' ' + 6402 'title="' + settings.labelMonthSelect + '"' 6403 ) 6404 } 6405 6406 // If there's a need for a month selector 6407 return _.node('div', monthsCollection[viewsetObject.month], settings.klass.month) 6408 }, //createMonthLabel 6409 6410 6411 // Create the year label. 6412 createYearLabel = function () { 6413 6414 var focusedYear = viewsetObject.year, 6415 6416 // If years selector is set to a literal "true", set it to 5. Otherwise 6417 // divide in half to get half before and half after focused year. 6418 numberYears = settings.selectYears === true ? 5 : ~~(settings.selectYears / 2) 6419 6420 // If there are years to select, add a dropdown menu. 6421 if (numberYears) { 6422 6423 var 6424 minYear = minLimitObject.year, 6425 maxYear = maxLimitObject.year, 6426 lowestYear = focusedYear - numberYears,
6427 highestYear = focusedYear + numberYears 6428 6429 // If the min year is greater than the lowest year, increase the highest year 6430 // by the difference and set the lowest year to the min year. 6431 if (minYear > lowestYear) { 6432 highestYear += minYear - lowestYear 6433 lowestYear = minYear 6434 } 6435 6436 // If the max year is less than the highest year, decrease the lowest year 6437 // by the lower of the two: available and needed years. Then set the 6438 // highest year to the max year. 6439 if (maxYear < highestYear) { 6440 6441 var availableYears = lowestYear - minYear, 6442 neededYears = highestYear - maxYear 6443 6444 lowestYear -= availableYears > neededYears ? neededYears : availableYears 6445 highestYear = maxYear 6446 } 6447 6448 return _.node('select', 6449 _.group({ 6450 min: lowestYear, 6451 max: highestYear, 6452 i: 1, 6453 node: 'option', 6454 item: function (loopedYear) { 6455 return [ 6456 6457 // The looped year and no classes. 6458 loopedYear, 0, 6459 6460 // Set the value and selected index. 6461 'value=' + loopedYear + (focusedYear == loopedYear ? ' selected' : '') 6462 ] 6463 } 6464 }), 6465 settings.klass.selectYear, 6466 (isOpen ? '' : 'disabled') + ' ' + _.ariaAttr({ 6467 controls: calendar.$node[0].id + '_table' 6468 }) + ' ' + 6469 'title="' + settings.labelYearSelect + '"' 6470 ) 6471 } 6472 6473 // Otherwise just return the year focused 6474 return _.node('div', focusedYear, settings.klass.year) 6475 } //createYearLabel 6476 6477 6478 // Create and return the entire calendar. 6479 return _.node( 6480 'div', 6481 (settings.selectYears ? createYearLabel() + createMonthLabel() : createMonthLabel() + createYearLabel()) + 6482 createMonthNav() + createMonthNav(1), 6483 settings.klass.header 6484 ) + _.node( 6485 'table', 6486 tableHead + 6487 _.node( 6488 'tbody', 6489 _.group({ 6490 min: 0, 6491 max: WEEKS_IN_CALENDAR - 1, 6492 i: 1, 6493 node: 'tr', 6494 item: function (rowCounter) { 6495 6496 // If Monday is the first day and the month starts on Sunday, shift the date back a week. 6497 var shiftDateBy = settings.firstDay && calendar.create([viewsetObject.year, viewsetObject.month, 1]).day === 0 ? -7 : 0 6498 6499 return [ 6500 _.group({ 6501 min: DAYS_IN_WEEK * rowCounter - viewsetObject.day + shiftDateBy + 1, // Add 1 for weekday 0index 6502 max: function () { 6503 return this.min + DAYS_IN_WEEK - 1 6504 }, 6505 i: 1, 6506 node: 'td', 6507 item: function (targetDate) { 6508 6509 // Convert the time date from a relative date to a target date. 6510 targetDate = calendar.create([viewsetObject.year, viewsetObject.month, targetDate + (settings.firstDay ? 1 : 0)]) 6511 6512 var isSelected = selectedObject && selectedObject.pick == targetDate.pick, 6513 isHighlighted = highlightedObject && highlightedObject.pick == targetDate.pick, 6514 isDisabled = disabledCollection && calendar.disabled(targetDate) || targetDate.pick < minLimitObject.pick || targetDate.pick > maxLimitObject.pick, 6515 formattedDate = _.trigger(calendar.formats.toString, calendar, [settings.format, targetDate]) 6516 6517 return [ 6518 _.node( 6519 'div', 6520 targetDate.date, 6521 (function (klasses) { 6522 6523 // Add the `infocus` or `outfocus` classes based on month in view. 6524 klasses.push(viewsetObject.month == targetDate.month ? settings.klass.infocus : settings.klass.outfocus) 6525 6526 // Add the `today` class if needed. 6527 if (nowObject.pick == targetDate.pick) { 6528 klasses.push(settings.klass.now) 6529 } 6530 6531 // Add the `selected` class if something's selected and the time matches. 6532 if (isSelected) { 6533 klasses.push(settings.klass.selected) 6534 } 6535 6536 // Add the `highlighted` class if something's highlighted and the time matches. 6537 if (isHighlighted) { 6538 klasses.push(settings.klass.highlighted) 6539 } 6540 6541 // Add the `disabled` class if something's disabled and the object matches. 6542 if (isDisabled) { 6543 klasses.push(settings.klass.disabled) 6544 } 6545 6546 return klasses.join(' ') 6547 })([settings.klass.day]), 6548 'data-pick=' + targetDate.pick + ' ' + _.ariaAttr({ 6549 role: 'gridcell', 6550 label: formattedDate, 6551 selected: isSelected && calendar.$node.val() === formattedDate ? true : null, 6552 activedescendant: isHighlighted ? true : null, 6553 disabled: isDisabled ? true : null 6554 }) 6555 ), 6556 '', 6557 _.ariaAttr({ 6558 role: 'presentation' 6559 }) 6560 ] //endreturn 6561 } 6562 }) 6563 ] //endreturn 6564 } 6565 }) 6566 ), 6567 settings.klass.table, 6568 'id="' + calendar.$node[0].id + '_table' + '" ' + _.ariaAttr({ 6569 role: 'grid', 6570 controls: calendar.$node[0].id, 6571 readonly: true 6572 }) 6573 ) + 6574 6575 // * For Firefox forms to submit, make sure to set the buttonsâ `type` attributes as âbuttonâ. 6576 _.node( 6577 'div', 6578 _.node('button', settings.today, settings.klass.buttonToday,
6579 'type=button data-pick=' + nowObject.pick + 6580 (isOpen && !calendar.disabled(nowObject) ? '' : ' disabled') + ' ' + 6581 _.ariaAttr({ 6582 controls: calendar.$node[0].id 6583 })) + 6584 _.node('button', settings.clear, settings.klass.buttonClear, 6585 'type=button data-clear=1' + 6586 (isOpen ? '' : ' disabled') + ' ' + 6587 _.ariaAttr({ 6588 controls: calendar.$node[0].id 6589 })) + 6590 _.node('button', settings.close, settings.klass.buttonClose, 6591 'type=button data-close=true ' + 6592 (isOpen ? '' : ' disabled') + ' ' + 6593 _.ariaAttr({ 6594 controls: calendar.$node[0].id 6595 })), 6596 settings.klass.footer 6597 ) //endreturn 6598 } //DatePicker.prototype.nodes 6599 6600 6601 6602 6603 /** 6604 * The date picker defaults. 6605 */ 6606 DatePicker.defaults = (function (prefix) { 6607 6608 return { 6609 6610 // The title label to use for the month nav buttons 6611 labelMonthNext: 'Next month', 6612 labelMonthPrev: 'Previous month', 6613 6614 // The title label to use for the dropdown selectors 6615 labelMonthSelect: 'Select a month', 6616 labelYearSelect: 'Select a year', 6617 6618 // Months and weekdays 6619 monthsFull: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], 6620 monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], 6621 weekdaysFull: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], 6622 weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], 6623 6624 // Today and clear 6625 today: 'Today', 6626 clear: 'Clear', 6627 close: 'Close', 6628 6629 // Picker close behavior 6630 closeOnSelect: true, 6631 closeOnClear: true, 6632 6633 // Update input value on select/clear 6634 updateInput: true, 6635 6636 // The format to show on the `input` element 6637 format: 'd mmmm, yyyy', 6638 6639 // Classes 6640 klass: { 6641 6642 table: prefix + 'table', 6643 6644 header: prefix + 'header', 6645 6646 navPrev: prefix + 'nav--prev btn btn-flat', 6647 navNext: prefix + 'nav--next btn btn-flat', 6648 navDisabled: prefix + 'nav--disabled', 6649 6650 month: prefix + 'month', 6651 year: prefix + 'year', 6652 6653 selectMonth: prefix + 'select--month', 6654 selectYear: prefix + 'select--year', 6655 6656 weekdays: prefix + 'weekday', 6657 6658 day: prefix + 'day', 6659 disabled: prefix + 'day--disabled', 6660 selected: prefix + 'day--selected', 6661 highlighted: prefix + 'day--highlighted', 6662 now: prefix + 'day--today', 6663 infocus: prefix + 'day--infocus', 6664 outfocus: prefix + 'day--outfocus', 6665 6666 footer: prefix + 'footer', 6667 6668 buttonClear: prefix + 'button--clear', 6669 buttonToday: prefix + 'button--today', 6670 buttonClose: prefix + 'button--close' 6671 } 6672 } 6673 })(Picker.klasses().picker + '__') 6674 6675 6676 6677 6678 6679 /** 6680 * Extend the picker to add the date picker. 6681 */ 6682 Picker.extend('pickadate', DatePicker) 6683 6684 6685})); 6686 6687$.extend($.fn.pickadate.defaults, { 6688 selectMonths: true, // Creates a dropdown to control month 6689 selectYears: 15, // Creates a dropdown of 15 years to control year, 6690 6691 onRender: function () { 6692 var $pickerInstance = this.$root; 6693 6694 var year = this.get('highlight', 'yyyy'); 6695 var day = this.get('highlight', 'dd'); 6696 var month = this.get('highlight', 'mmm'); 6697 var labeldayFirstThreeLetters = this.get('highlight', 'dddd').slice(0, 3); 6698 var monthFirstUC = month.charAt(0).toUpperCase() + month.slice(1) 6699 6700 $pickerInstance.find('.picker__header').prepend('<div class="picker__date-display"><div class="picker__weekday-display">
vendor: 5,131 bytes, lines 6700-6843
6700' + labeldayFirstThreeLetters + ', </div><div class="picker__month-display"><div>' + monthFirstUC + '</div></div><div class="picker__day-display"><div>' + day + '</div></div><div class="picker__year-display"><div>' + year + '</div></div></div>'); 6701 } 6702}); 6703 6704/*! 6705 * ClockPicker v0.0.7 (http://weareoutman.github.io/clockpicker/) 6706 * Copyright 2014 Wang Shenwei. 6707 * Licensed under MIT (https://github.com/weareoutman/clockpicker/blob/gh-pages/LICENSE) 6708 * 6709 * Further modified 6710 * Copyright 2015 Ching Yaw Hao. 6711 */ 6712 6713;(function(){ 6714 var $ = window.jQuery, 6715 $win = $(window), 6716 $doc = $(document); 6717 6718 // Can I use inline svg ? 6719 var svgNS = 'http://www.w3.org/2000/svg', 6720 svgSupported = 'SVGAngle' in window && (function() { 6721 var supported, 6722 el = document.createElement('div'); 6723 el.innerHTML = '<svg/>'; 6724 supported = (el.firstChild && el.firstChild.namespaceURI) == svgNS; 6725 el.innerHTML = ''; 6726 return supported; 6727 })(); 6728 6729 // Can I use transition ? 6730 var transitionSupported = (function() { 6731 var style = document.createElement('div').style; 6732 return 'transition' in style || 6733 'WebkitTransition' in style || 6734 'MozTransition' in style || 6735 'msTransition' in style || 6736 'OTransition' in style; 6737 })(); 6738 6739 // Listen touch events in touch screen device, instead of mouse events in desktop. 6740 var touchSupported = 'ontouchstart' in window, 6741 mousedownEvent = 'mousedown' + ( touchSupported ? ' touchstart' : ''), 6742 mousemoveEvent = 'mousemove.clockpicker' + ( touchSupported ? ' touchmove.clockpicker' : ''), 6743 mouseupEvent = 'mouseup.clockpicker' + ( touchSupported ? ' touchend.clockpicker' : ''); 6744 6745 // Vibrate the device if supported 6746 var vibrate = navigator.vibrate ? 'vibrate' : navigator.webkitVibrate ? 'webkitVibrate' : null; 6747 6748 function createSvgElement(name) { 6749 return document.createElementNS(svgNS, name); 6750 } 6751 6752 function debounce(func, wait, immediate) { 6753 var timeout; 6754 return function() { 6755 var context = this, args = arguments; 6756 var later = function() { 6757 timeout = null; 6758 if (!immediate) func.apply(context, args); 6759 }; 6760 var callNow = immediate && !timeout; 6761 clearTimeout(timeout); 6762 timeout = setTimeout(later, wait); 6763 if (callNow) func.apply(context, args); 6764 }; 6765 } 6766 6767 function leadingZero(num) { 6768 return (num < 10 ? '0' : '') + num; 6769 } 6770 6771 // Get a unique id 6772 var idCounter = 0; 6773 function uniqueId(prefix) { 6774 var id = ++idCounter + ''; 6775 return prefix ? prefix + id : id; 6776 } 6777 6778 // Clock size 6779 var dialRadius = 135, 6780 outerRadius = 110, 6781 // innerRadius = 80 on 12 hour clock 6782 innerRadius = 80, 6783 tickRadius = 20, 6784 diameter = dialRadius * 2, 6785 duration = transitionSupported ? 350 : 1; 6786 6787 // Popover template 6788 var tpl = [ 6789 '<div class="clockpicker picker">', 6790 '<div class="picker__holder">', 6791 '<div class="picker__frame">', 6792 '<div class="picker__wrap">', 6793 '<div class="picker__box">', 6794 '<div class="picker__date-display">', 6795 '<div class="clockpicker-display">', 6796 '<div class="clockpicker-display-column">', 6797 '<span class="clockpicker-span-hours text-primary"></span>', 6798 ':', 6799 '<span class="clockpicker-span-minutes"></span>', 6800 '</div>', 6801 '<div class="clockpicker-display-column clockpicker-display-am-pm">', 6802 '<div class="clockpicker-span-am-pm"></div>', 6803 '</div>', 6804 '</div>', 6805 '</div>', 6806 '<div class="picker__calendar-container">', 6807 '<div class="clockpicker-plate">', 6808 '<div class="clockpicker-canvas"></div>', 6809 '<div class="clockpicker-dial clockpicker-hours"></div>', 6810 '<div class="clockpicker-dial clockpicker-minutes clockpicker-dial-out"></div>', 6811 '</div>', 6812 '<div class="clockpicker-am-pm-block">', 6813 '</div>', 6814 '</div>', 6815 '<div class="picker__footer">', 6816 '</div>', 6817 '</div>', 6818 '</div>', 6819 '</div>', 6820 '</div>', 6821 '</div>' 6822 ].join(''); 6823 6824 // ClockPicker 6825 function ClockPicker(element, options) { 6826 var popover = $(tpl), 6827 plate = popover.find('.clockpicker-plate'), 6828 holder = popover.find('.picker__holder'), 6829 hoursView = popover.find('.clockpicker-hours'), 6830 minutesView = popover.find('.clockpicker-minutes'), 6831 amPmBlock = popover.find('.clockpicker-am-pm-block'), 6832 isInput = element.prop('tagName') === 'INPUT', 6833 input = isInput ? element : element.find('input'), 6834 isHTML5 = input.prop('type') === 'time', 6835 label = $("label[for=" + input.attr("id") + "]"), 6836 self = this, 6837 timer; 6838 6839 this.id = uniqueId('cp'); 6840 this.element = element; 6841 this.holder = holder; 6842 this.options = options; 6843 this.isAppended = false;
6844 this.isShown = false; 6845 this.currentView = 'hours'; 6846 this.isInput = isInput; 6847 this.input = input; 6848 this.label = label; 6849 this.popover = popover; 6850 this.plate = plate; 6851 this.hoursView = hoursView; 6852 this.minutesView = minutesView; 6853 this.amPmBlock = amPmBlock; 6854 this.spanHours = popover.find('.clockpicker-span-hours'); 6855 this.spanMinutes = popover.find('.clockpicker-span-minutes'); 6856 this.spanAmPm = popover.find('.clockpicker-span-am-pm'); 6857 this.footer = popover.find('.picker__footer'); 6858 this.amOrPm = ""; 6859 6860 // Setup for for 12 hour clock if option is selected 6861 if (options.twelvehour) { 6862 var amPmButtonsTemplate = [ 6863 '<div class="clockpicker-am-pm-block">', 6864 '<button type="button" class="btn-floating btn-flat clockpicker-button clockpicker-am-button">', 6865 'AM', 6866 '</button>', 6867 '<button type="button" class="btn-floating btn-flat clockpicker-button clockpicker-pm-button">', 6868 'PM', 6869 '</button>', 6870 '</div>' 6871 ].join(''); 6872 6873 var amPmButtons = $(amPmButtonsTemplate); 6874 6875 if (!options.ampmclickable) { 6876 $('<button type="button" class="btn-floating btn-flat clockpicker-button am-button" tabindex="1">' + "AM" + '</button>').on("click", function() { 6877 self.amOrPm = "AM"; 6878 self.amPmBlock.children('.pm-button').removeClass('active'); 6879 self.amPmBlock.children('.am-button').addClass('active'); 6880 self.spanAmPm.empty().append('AM'); 6881 }).appendTo(this.amPmBlock); 6882 $('<button type="button" class="btn-floating btn-flat clockpicker-button pm-button" tabindex="2">' + "PM" + '</button>').on("click", function() { 6883 self.amOrPm = 'PM'; 6884 self.amPmBlock.children('.am-button').removeClass('active'); 6885 self.amPmBlock.children('.pm-button').addClass('active'); 6886 self.spanAmPm.empty().append('PM'); 6887 }).appendTo(this.amPmBlock); 6888 } 6889 else { 6890 this.spanAmPm.empty(); 6891 $('<div id="click-am">AM</div>').on("click", function() { 6892 self.spanAmPm.children('#click-am').addClass("text-primary"); 6893 self.spanAmPm.children('#click-pm').removeClass("text-primary"); 6894 self.amOrPm = "AM"; 6895 }).appendTo(this.spanAmPm); 6896 $('<div id="click-pm">PM</div>').on("click", function() { 6897 self.spanAmPm.children('#click-pm').addClass("text-primary"); 6898 self.spanAmPm.children('#click-am').removeClass("text-primary"); 6899 self.amOrPm = 'PM'; 6900 }).appendTo(this.spanAmPm); 6901 } 6902 } 6903 6904 if(options.darktheme) 6905 popover.addClass('darktheme'); 6906 6907 // If autoclose is not setted, append a button 6908 $('<button type="button" class="btn btn-flat clockpicker-button" tabindex="' + (options.twelvehour? '3' : '1') + '">' + options.donetext + '</button>').click($.proxy(this.done, this)).appendTo(this.footer); 6909 6910 $('<button type="button" class="btn btn-flat clockpicker-button" tabindex="' + (options.twelvehour? '4' : '2') + '">' + options.cleartext + '</button>').click($.proxy(this.clearInput, this)).appendTo(this.footer); 6911 this.spanHours.click($.proxy(this.toggleView, this, 'hours')); 6912 this.spanMinutes.click($.proxy(this.toggleView, this, 'minutes')); 6913 6914 // Show or toggle 6915 input.on('focus.clockpicker click.clockpicker', debounce( $.proxy(this.show, this), 100)); 6916 6917 // Build ticks 6918 var tickTpl = $('<div class="clockpicker-tick"></div>'), 6919 i, tick, radian, radius; 6920 6921 // Hours view 6922 if (options.twelvehour) { 6923 for (i = 0; i < 12; i += options.hourstep) { 6924 tick = tickTpl.clone(); 6925 radian = i / 6 * Math.PI; 6926 radius = outerRadius; 6927 tick.css('font-size', '140%'); 6928 tick.css({ 6929 left: dialRadius + Math.sin(radian) * radius - tickRadius, 6930 top: dialRadius - Math.cos(radian) * radius - tickRadius 6931 }); 6932 tick.html(i === 0 ? 12 : i); 6933 hoursView.append(tick); 6934 tick.on(mousedownEvent, mousedown); 6935 } 6936 } else { 6937 for (i = 0; i < 24;
6937 i += options.hourstep) { 6938 tick = tickTpl.clone(); 6939 radian = i / 6 * Math.PI; 6940 var inner = i > 0 && i < 13; 6941 radius = inner ? innerRadius : outerRadius; 6942 tick.css({ 6943 left: dialRadius + Math.sin(radian) * radius - tickRadius, 6944 top: dialRadius - Math.cos(radian) * radius - tickRadius 6945 }); 6946 if (inner) { 6947 tick.css('font-size', '120%'); 6948 } 6949 tick.html(i === 0 ? '00' : i); 6950 hoursView.append(tick); 6951 tick.on(mousedownEvent, mousedown); 6952 } 6953 } 6954 6955 // Minutes view 6956 var incrementValue = Math.max(options.minutestep, 5); 6957 for (i = 0; i < 60; i += incrementValue) { 6958 for (i = 0; i < 60; i += 5) { 6959 tick = tickTpl.clone(); 6960 radian = i / 30 * Math.PI; 6961 tick.css({ 6962 left: dialRadius + Math.sin(radian) * outerRadius - tickRadius, 6963 top: dialRadius - Math.cos(radian) * outerRadius - tickRadius 6964 }); 6965 tick.css('font-size', '140%'); 6966 tick.html(leadingZero(i)); 6967 minutesView.append(tick); 6968 tick.on(mousedownEvent, mousedown); 6969 } 6970 } 6971 6972 // Clicking on minutes view space 6973 plate.on(mousedownEvent, function(e) { 6974 if ($(e.target).closest('.clockpicker-tick').length === 0) 6975 mousedown(e, true); 6976 }); 6977 6978 // Mousedown or touchstart 6979 function mousedown(e, space) { 6980 var offset = plate.offset(), 6981 isTouch = /^touch/.test(e.type), 6982 x0 = offset.left + dialRadius, 6983 y0 = offset.top + dialRadius, 6984 dx = (isTouch ? e.originalEvent.touches[0] : e).pageX - x0, 6985 dy = (isTouch ? e.originalEvent.touches[0] : e).pageY - y0, 6986 z = Math.sqrt(dx * dx + dy * dy), 6987 moved = false; 6988 6989 // When clicking on minutes view space, check the mouse position 6990 if (space && (z < outerRadius - tickRadius || z > outerRadius + tickRadius)) 6991 return; 6992 e.preventDefault(); 6993 6994 // Set cursor style of body after 200ms 6995 var movingTimer = setTimeout(function(){ 6996 self.popover.addClass('clockpicker-moving'); 6997 }, 200); 6998 6999 // Place the canvas to top 7000 if (svgSupported) 7001 plate.append(self.canvas); 7002 7003 // Clock 7004 self.setHand(dx, dy, !space, true); 7005 7006 // Mousemove on document 7007 $doc.off(mousemoveEvent).on(mousemoveEvent, function(e){ 7008 e.preventDefault(); 7009 var isTouch = /^touch/.test(e.type), 7010 x = (isTouch ? e.originalEvent.touches[0] : e).pageX - x0, 7011 y = (isTouch ? e.originalEvent.touches[0] : e).pageY - y0; 7012 if (! moved && x === dx && y === dy) 7013 // Clicking in chrome on windows will trigger a mousemove event 7014 return; 7015 moved = true; 7016 self.setHand(x, y, false, true); 7017 }); 7018 7019 // Mouseup on document 7020 $doc.off(mouseupEvent).on(mouseupEvent, function(e) { 7021 $doc.off(mouseupEvent); 7022 e.preventDefault(); 7023 var isTouch = /^touch/.test(e.type), 7024 x = (isTouch ? e.originalEvent.changedTouches[0] : e).pageX - x0, 7025 y = (isTouch ? e.originalEvent.changedTouches[0] : e).pageY - y0; 7026 if ((space || moved) && x === dx && y === dy) 7027 self.setHand(x, y); 7028 if (self.currentView === 'hours') 7029 self.toggleView('minutes', duration / 2); 7030 else 7031 if (options.autoclose) { 7032 self.minutesView.addClass('clockpicker-dial-out'); 7033 setTimeout(function(){ 7034 self.done(); 7035 }, duration / 2); 7036 } 7037 plate.prepend(canvas); 7038 7039 // Reset cursor style of body 7040 clearTimeout(movingTimer); 7041 self.popover.removeClass('clockpicker-moving'); 7042 7043 // Unbind mousemove event 7044 $doc.off(mousemoveEvent); 7045 }); 7046 } 7047 7048 if (svgSupported) { 7049 // Draw clock hands and others 7050 var canvas = popover.find('.clockpicker-canvas'),
7051 svg = createSvgElement('svg'); 7052 svg.setAttribute('class', 'clockpicker-svg'); 7053 svg.setAttribute('width', diameter); 7054 svg.setAttribute('height', diameter); 7055 var g = createSvgElement('g'); 7056 g.setAttribute('transform', 'translate(' + dialRadius + ',' + dialRadius + ')'); 7057 var bearing = createSvgElement('circle'); 7058 bearing.setAttribute('class', 'clockpicker-canvas-bearing'); 7059 bearing.setAttribute('cx', 0); 7060 bearing.setAttribute('cy', 0); 7061 bearing.setAttribute('r', 2); 7062 var hand = createSvgElement('line'); 7063 hand.setAttribute('x1', 0); 7064 hand.setAttribute('y1', 0); 7065 var bg = createSvgElement('circle'); 7066 bg.setAttribute('class', 'clockpicker-canvas-bg'); 7067 bg.setAttribute('r', tickRadius); 7068 var fg = createSvgElement('circle'); 7069 fg.setAttribute('class', 'clockpicker-canvas-fg'); 7070 fg.setAttribute('r', 5); 7071 g.appendChild(hand); 7072 g.appendChild(bg); 7073 g.appendChild(fg); 7074 g.appendChild(bearing); 7075 svg.appendChild(g); 7076 canvas.append(svg); 7077 7078 this.hand = hand; 7079 this.bg = bg; 7080 this.fg = fg; 7081 this.bearing = bearing; 7082 this.g = g; 7083 this.canvas = canvas; 7084 } 7085 7086 raiseCallback(this.options.init); 7087 } 7088 7089 function raiseCallback(callbackFunction) { 7090 if(callbackFunction && typeof callbackFunction === "function") 7091 callbackFunction(); 7092 } 7093 7094 // Default options 7095 ClockPicker.DEFAULTS = { 7096 'default': '', // default time, 'now' or '13:14' e.g. 7097 fromnow: 0, // set default time to * milliseconds from now (using with default = 'now') 7098 donetext: 'Done', // done button text 7099 cleartext: 'Clear', // clear button text 7100 autoclose: false, // auto close when minute is selected 7101 ampmclickable: false, // set am/pm button on itself 7102 darktheme: false, // set to dark theme 7103 twelvehour: false, // change to 12 hour AM/PM clock from 24 hour 7104 vibrate: true, // vibrate the device when dragging clock hand 7105 hourstep: 1, // allow to multi increment the hour 7106 minutestep: 1, // allow to multi increment the minute 7107 ampmSubmit: false, // allow submit with AM and PM buttons instead of the minute selection/picker 7108 }; 7109 7110 // Show or hide popover 7111 ClockPicker.prototype.toggle = function() { 7112 this[this.isShown ? 'hide' : 'show'](); 7113 }; 7114 7115 // Set popover position 7116 ClockPicker.prototype.locate = function() { 7117 var element = this.element, 7118 popover = this.popover, 7119 offset = element.offset(), 7120 width = element.outerWidth(), 7121 height = element.outerHeight(), 7122 align = this.options.align, 7123 self = this; 7124 7125 popover.show(); 7126 }; 7127 7128 // The input can be changed by the user 7129 // So before we can use this.hours/this.minutes we must update it 7130 ClockPicker.prototype.parseInputValue = function(){ 7131 var value = this.input.prop('value') || this.options['default'] || ''; 7132 7133 if (value === 'now') { 7134 value = new Date(+ new Date() + this.options.fromnow); 7135 } 7136 if (value instanceof Date) { 7137 value = value.getHours() + ':' + value.getMinutes(); 7138 } 7139 7140 value = value.split(':'); 7141 7142 // Minutes can have AM/PM that needs to be removed 7143 this.hours = + value[0] || 0; 7144 this.minutes = + (value[1] + '').replace(/\D/g, '') || 0; 7145 7146 this.hours = Math.round(this.hours / this.options.hourstep) * this.options.hourstep; 7147 this.minutes = Math.round(this.minutes / this.options.minutestep) * this.options.minutestep; 7148 7149 if (this.options.twelvehour) { 7150 var period = (value[1] + '').replace(/\d+/g, '').toLowerCase(); 7151 this.amOrPm = this.hours > 12 || period === 'pm' ? 'PM' : 'AM'; 7152 } 7153 }; 7154 7155 // Show popover 7156 ClockPicker.prototype.show = function(e){ 7157 // Not show again 7158 if (this.isShown) { 7159 return; 7160 } 7161 raiseCallback(this.options.beforeShow); 7162 $(':input').each(function() { 7163 $(this).attr('tabindex', -1); 7164 }) 7165 var self = this; 7166 // Initialize 7167 this.input.blur(); 7168 this.popover.addClass('picker--opened'); 7169 this.input.addClass('picker__input picker__input--active'); 7170 $(document.body).css('overflow', 'hidden'); 7171 if (!this.isAppended) { 7172 // Append popover to body 7173 this.popover.insertAfter(this.input); 7174 if(this.options.twelvehour) { 7175 this.amOrPm = 'PM'; 7176 if(!this.options.ampmclickable) { 7177 this.amPmBlock.children('.am-button').removeClass('active'); 7178 this.amPmBlock.children('.pm-button').addClass('active'); 7179 this.spanAmPm.empty().append('PM'); 7180 } 7181 else { 7182 this.spanAmPm.children('#click-pm').addClass("text-primary"); 7183 this.spanAmPm.children('#click-am').removeClass("text-primary"); 7184 } 7185 } 7186 // Reset position when resize 7187 $win.on('resize.clockpicker' + this.id, function() { 7188 if (self.isShown) { 7189 self.locate(); 7190 } 7191 }); 7192 this.isAppended = true; 7193 } 7194 // Get the time 7195 this.parseInputValue(); 7196 this.spanHours.html(leadingZero(this.hours)); 7197 this.spanMinutes.html(leadingZero(this.minutes)); 7198 7199 if (this.options.twelvehour) { 7200 this.spanAmPm.empty().append(this.amOrPm); 7201 } 7202 7203 // Toggle to hours view 7204 this.toggleView('hours'); 7205 // Set position 7206 this.locate(); 7207 this.isShown = true; 7208 // Hide when clicking or tabbing on any element except the clock and input 7209 $doc.on('click.clockpicker.' + this.id + ' focusin.clockpicker.' + this.id, debounce(function(e) { 7210 var target = $(e.target); 7211 if (target.closest(self.popover.find('.picker__wrap')).length === 0 && target.closest(self.input).length === 0) 7212 self.hide(); 7213 }, 100)); 7214 // Hide when ESC is pressed 7215 $doc.on('keyup.clockpicker.' + this.id, debounce( function(e){ 7216 if (e.keyCode === 27) 7217 self.hide(); 7218 },100)); 7219 raiseCallback(this.options.afterShow); 7220 }; 7221 // Hide popover 7222 ClockPicker.prototype.hide = function() { 7223 raiseCallback(this.options.beforeHide); 7224 this.input.removeClass('picker__input picker__input--active'); 7225 this.popover.removeClass('picker--opened'); 7226 $(document.body).css('overflow', 'visible'); 7227 this.isShown = false;
7228 $(':input').each(function(index) { 7229 $(this).attr('tabindex', index + 1); 7230 }); 7231 // Unbinding events on document 7232 $doc.off('click.clockpicker.' + this.id + ' focusin.clockpicker.' + this.id); 7233 $doc.off('keyup.clockpicker.' + this.id); 7234 this.popover.hide(); 7235 raiseCallback(this.options.afterHide); 7236 }; 7237 // Toggle to hours or minutes view 7238 ClockPicker.prototype.toggleView = function(view, delay) { 7239 var raiseAfterHourSelect = false; 7240 if (view === 'minutes' && $(this.hoursView).css("visibility") === "visible") { 7241 raiseCallback(this.options.beforeHourSelect); 7242 raiseAfterHourSelect = true; 7243 } 7244 var isHours = view === 'hours', 7245 nextView = isHours ? this.hoursView : this.minutesView, 7246 hideView = isHours ? this.minutesView : this.hoursView; 7247 this.currentView = view; 7248 7249 this.spanHours.toggleClass('text-primary', isHours); 7250 this.spanMinutes.toggleClass('text-primary', ! isHours); 7251 7252 // Let's make transitions 7253 hideView.addClass('clockpicker-dial-out'); 7254 nextView.css('visibility', 'visible').removeClass('clockpicker-dial-out'); 7255 7256 // Reset clock hand 7257 this.resetClock(delay); 7258 7259 // After transitions ended 7260 clearTimeout(this.toggleViewTimer); 7261 this.toggleViewTimer = setTimeout(function() { 7262 hideView.css('visibility', 'hidden'); 7263 }, duration); 7264 7265 if (raiseAfterHourSelect) 7266 raiseCallback(this.options.afterHourSelect); 7267 }; 7268 7269 // Reset clock hand 7270 ClockPicker.prototype.resetClock = function(delay) { 7271 var view = this.currentView, 7272 value = this[view], 7273 isHours = view === 'hours', 7274 unit = Math.PI / (isHours ? 6 : 30), 7275 radian = value * unit, 7276 radius = isHours && value > 0 && value < 13 ? innerRadius : outerRadius, 7277 x = Math.sin(radian) * radius, 7278 y = - Math.cos(radian) * radius, 7279 self = this; 7280 7281 if(svgSupported && delay) { 7282 self.canvas.addClass('clockpicker-canvas-out'); 7283 setTimeout(function(){ 7284 self.canvas.removeClass('clockpicker-canvas-out'); 7285 self.setHand(x, y); 7286 }, delay); 7287 } else 7288 this.setHand(x, y); 7289 }; 7290 7291 // Set clock hand to (x, y) 7292 ClockPicker.prototype.setHand = function(x, y, roundBy5, dragging) { 7293 var radian = Math.atan2(x, - y), 7294 isHours = this.currentView === 'hours', 7295 z = Math.sqrt(x * x + y * y), 7296 options = this.options, 7297 inner = isHours && z < (outerRadius + innerRadius) / 2, 7298 radius = inner ? innerRadius : outerRadius, 7299 unit, 7300 value; 7301 7302 // Calculate the unit 7303 if (isHours) { 7304 unit = options.hourstep / 6 * Math.PI 7305 } else { 7306 unit = options.minutestep / 30 * Math.PI 7307 } 7308 7309 if (options.twelvehour) 7310 radius = outerRadius; 7311 7312 // Radian should in range [0, 2PI] 7313 if (radian < 0) 7314 radian = Math.PI * 2 + radian; 7315 7316 // Get the round value 7317 value = Math.round(radian / unit); 7318 7319 // Get the round radian 7320 radian = value * unit; 7321 7322 // Correct the hours or minutes 7323 if (isHours) { 7324 value *= options.hourstep; 7325 if (! options.twelvehour && (!inner)==(value>0)) { 7326 value += 12; 7327 } 7328 if (options.twelvehour && value === 0) { 7329 value = 12; 7330 } 7331 if (value === 24) { 7332 value = 0; 7333 } 7334 } else { 7335 value *= options.minutestep; 7336 if (value === 60) { 7337 value = 0; 7338 } 7339 } 7340 if (isHours) 7341 this.fg.setAttribute('class', 'clockpicker-canvas-fg'); 7342 else { 7343 if(value % 5 == 0) 7344 this.fg.setAttribute('class', 'clockpicker-canvas-fg'); 7345 else 7346 this.fg.setAttribute('class', 'clockpicker-canvas-fg active'); 7347 } 7348 7349 // Once hours or minutes changed, vibrate the device 7350 if (this[this.currentView] !== value) 7351 if (vibrate && this.options.vibrate)
7352 // Do not vibrate too frequently 7353 if (! this.vibrateTimer) { 7354 navigator[vibrate](10); 7355 this.vibrateTimer = setTimeout($.proxy(function(){ 7356 this.vibrateTimer = null; 7357 }, this), 100); 7358 } 7359 7360 this[this.currentView] = value; 7361 this[isHours ? 'spanHours' : 'spanMinutes'].html(leadingZero(value)); 7362 7363 // If svg is not supported, just add an active class to the tick 7364 if (! svgSupported) { 7365 this[isHours ? 'hoursView' : 'minutesView'].find('.clockpicker-tick').each(function(){ 7366 var tick = $(this); 7367 tick.toggleClass('active', value === + tick.html()); 7368 }); 7369 return; 7370 } 7371 7372 // Place clock hand at the top when dragging 7373 if (dragging || (! isHours && value % 5)) { 7374 this.g.insertBefore(this.hand, this.bearing); 7375 this.g.insertBefore(this.bg, this.fg); 7376 this.bg.setAttribute('class', 'clockpicker-canvas-bg clockpicker-canvas-bg-trans'); 7377 } else { 7378 // Or place it at the bottom 7379 this.g.insertBefore(this.hand, this.bg); 7380 this.g.insertBefore(this.fg, this.bg); 7381 this.bg.setAttribute('class', 'clockpicker-canvas-bg'); 7382 } 7383 7384 // Set clock hand and others' position 7385 var cx = Math.sin(radian) * radius, 7386 cy = - Math.cos(radian) * radius; 7387 this.hand.setAttribute('x2', cx); 7388 this.hand.setAttribute('y2', cy); 7389 this.bg.setAttribute('cx', cx); 7390 this.bg.setAttribute('cy', cy); 7391 this.fg.setAttribute('cx', cx); 7392 this.fg.setAttribute('cy', cy); 7393 }; 7394 7395 // Clear clock text 7396 ClockPicker.prototype.clearInput = function() { 7397 this.input.val(''); 7398 this.hide(); 7399 7400 if(this.options.afterDone && typeof this.options.afterDone === 'function') 7401 this.options.afterDone(this.input, null); 7402 }; 7403 7404 // Allow user to get time as Date object 7405 ClockPicker.prototype.getTime = function(callback) { 7406 this.parseInputValue(); 7407 7408 var hours = this.hours; 7409 if (this.options.twelvehour && hours < 12 && this.amOrPm === 'PM') { 7410 hours += 12; 7411 } 7412 7413 var selectedTime = new Date(); 7414 selectedTime.setMinutes(this.minutes) 7415 selectedTime.setHours(hours); 7416 selectedTime.setSeconds(0); 7417 7418 return callback && callback.apply(this.element, selectedTime) || selectedTime; 7419 } 7420 7421 // Hours and minutes are selected 7422 ClockPicker.prototype.done = function() { 7423 raiseCallback(this.options.beforeDone); 7424 this.hide(); 7425 this.label.addClass('active'); 7426 7427 var last = this.input.prop('value'), 7428 outHours = this.hours, 7429 value = ':' + leadingZero(this.minutes); 7430 7431 if (this.isHTML5 && this.options.twelvehour) { 7432 if (this.hours < 12 && this.amOrPm === 'PM') { 7433 outHours += 12; 7434 } 7435 if (this.hours === 12 && this.amOrPm === 'AM') { 7436 outHours = 0; 7437 } 7438 } 7439 7440 value = leadingZero(outHours) + value; 7441 7442 if (!this.isHTML5 && this.options.twelvehour) { 7443 value = value + this.amOrPm; 7444 } 7445 7446 this.input.prop('value', value); 7447 if(value !== last) { 7448 this.input.trigger('change'); 7449 if(!this.isInput) 7450 this.element.trigger('change'); 7451 } 7452 7453 if(this.options.autoclose) 7454 this.input.trigger('blur'); 7455 7456 raiseCallback(this.options.afterDone); 7457 }; 7458 7459 // Remove clockpicker from input 7460 ClockPicker.prototype.remove = function() { 7461 this.element.removeData('clockpicker'); 7462 this.input.off('focus.clockpicker click.clockpicker'); 7463 if (this.isShown) 7464 this.hide(); 7465 if (this.isAppended) { 7466 $win.off('resize.clockpicker' + this.id); 7467 this.popover.remove(); 7468 } 7469 }; 7470 7471 // Extends $.fn.clockpicker 7472 $.fn.pickatime = function(option){ 7473 var args = Array.prototype.slice.call(arguments, 1);
7474 function handleClockPickerRequest(){ 7475 var $this = $(this), 7476 data = $this.data('clockpicker'); 7477 if (!data) { 7478 var options = $.extend({}, ClockPicker.DEFAULTS, $this.data(), typeof option == 'object' && option); 7479 $this.data('clockpicker', new ClockPicker($this, options)); 7480 } else { 7481 // Manual operations. show, hide, remove, e.g. 7482 if (typeof data[option] === 'function') 7483 data[option].apply(data, args); 7484 } 7485 } 7486 // If we explicitly do a call on a single element then we can return the value (if needed) 7487 // This allows us, for example, to return the value of getTime 7488 if (this.length == 1) { 7489 var returnValue = handleClockPickerRequest.apply(this[0]); 7490 7491 // If we do not have any return value then return the object itself so you can chain 7492 return returnValue !== undefined ? returnValue : this; 7493 } 7494 7495 // If we do have a list then we do not care about return values 7496 return this.each(handleClockPickerRequest); 7497 }; 7498}()); 7499 7500/*! PhotoSwipe - v4.1.1 - 2015-12-24 7501 * http://photoswipe.com 7502 * Copyright (c) 2015 Dmitry Semenov; */ 7503! function (a, b) { 7504 "function" == typeof define && define.amd ? define(b) : "object" == typeof exports ? module.exports = b() : a.PhotoSwipe = b() 7505}(this, function () { 7506 "use strict"; 7507 var a = function (a, b, c, d) { 7508 var e = { 7509 features: null, 7510 bind: function (a, b, c, d) { 7511 var e = (d ? "remove" : "add") + "EventListener"; 7512 b = b.split(" "); 7513 for (var f = 0; f < b.length; f++) b[f] && a[e](b[f], c, !1) 7514 }, 7515 isArray: function (a) { 7516 return a instanceof Array 7517 }, 7518 createEl: function (a, b) { 7519 var c = document.createElement(b || "div"); 7520 return a && (c.className = a), c 7521 }, 7522 getScrollY: function () { 7523 var a = window.pageYOffset; 7524 return void 0 !== a ? a : document.documentElement.scrollTop 7525 }, 7526 unbind: function (a, b, c) { 7527 e.bind(a, b, c, !0) 7528 }, 7529 removeClass: function (a, b) { 7530 var c = new RegExp("(\\s|^)" + b + "(\\s|$)"); 7531 a.className = a.className.replace(c, " ").replace(/^\s\s*/, "").replace(/\s\s*$/, "") 7532 }, 7533 addClass: function (a, b) { 7534 e.hasClass(a, b) || (a.className += (a.className ? " " : "") + b) 7535 }, 7536 hasClass: function (a, b) { 7537 return a.className && new RegExp("(^|\\s)" + b + "(\\s|$)").test(a.className) 7538 }, 7539 getChildByClass: function (a, b) { 7540 for (var c = a.firstChild; c;) { 7541 if (e.hasClass(c, b)) return c; 7542 c = c.nextSibling 7543 } 7544 }, 7545 arraySearch: function (a, b, c) { 7546 for (var d = a.length; d--;) 7547 if (a[d][c] === b) return d; 7548 return -1 7549 }, 7550 extend: function (a, b, c) { 7551 for (var d in b) 7552 if (b.hasOwnProperty(d)) { 7553 if (c && a.hasOwnProperty(d)) continue; 7554 a[d] = b[d] 7555 } 7556 }, 7557 easing: { 7558 sine: { 7559 out: function (a) { 7560 return Math.sin(a * (Math.PI / 2)) 7561 }, 7562 inOut: function (a) { 7563 return -(Math.cos(Math.PI * a) - 1) / 2 7564 } 7565 }, 7566 cubic: { 7567 out: function (a) { 7568 return --a * a * a + 1 7569 } 7570 } 7571 }, 7572 detectFeatures: function () { 7573 if (e.features) return e.features; 7574 var a = e.createEl(), 7575 b = a.style, 7576 c = "", 7577 d = {}; 7578 if (d.oldIE = document.all && !document.addEventListener, d.touch = "ontouchstart" in window, window.requestAnimationFrame && (d.raf = window.requestAnimationFrame, d.caf = window.cancelAnimationFrame), d.pointerEvent = navigator.pointerEnabled || navigator.msPointerEnabled, !d.pointerEvent) { 7579 var f = navigator.userAgent; 7580 if (/iP(hone|od)/.test(navigator.platform)) { 7581 var g = navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/); 7582 g && g.length > 0 && (g = parseInt(g[1], 10), g >= 1 && 8 > g && (d.isOldIOSPhone = !0)) 7583 } 7584 var h = f.match(/Android\s([0-9\.]*)/), 7585 i = h ? h[1] : 0; 7586 i = parseFloat(i), i >= 1 && (4.4 > i && (d.isOldAndroid = !0), d.androidVersion = i), d.isMobileOpera = /opera mini|o
7586pera mobi/i.test(f) 7587 } 7588 for (var j, k, l = ["transform", "perspective", "animationName"], m = ["", "webkit", "Moz", "ms", "O"], n = 0; 4 > n; n++) { 7589 c = m[n]; 7590 for (var o = 0; 3 > o; o++) j = l[o], k = c + (c ? j.charAt(0).toUpperCase() + j.slice(1) : j), !d[j] && k in b && (d[j] = k); 7591 c && !d.raf && (c = c.toLowerCase(), d.raf = window[c + "RequestAnimationFrame"], d.raf && (d.caf = window[c + "CancelAnimationFrame"] || window[c + "CancelRequestAnimationFrame"])) 7592 } 7593 if (!d.raf) { 7594 var p = 0; 7595 d.raf = function (a) { 7596 var b = (new Date).getTime(), 7597 c = Math.max(0, 16 - (b - p)), 7598 d = window.setTimeout(function () { 7599 a(b + c) 7600 }, c); 7601 return p = b + c, d 7602 }, d.caf = function (a) { 7603 clearTimeout(a) 7604 } 7605 } 7606 return d.svg = !!document.createElementNS && !!document.createElementNS("http://www.w3.org/2000/svg", "svg").createSVGRect, e.features = d, d 7607 } 7608 }; 7609 e.detectFeatures(), e.features.oldIE && (e.bind = function (a, b, c, d) { 7610 b = b.split(" "); 7611 for (var e, f = (d ? "detach" : "attach") + "Event", g = function () { 7612 c.handleEvent.call(c) 7613 }, h = 0; h < b.length; h++) 7614 if (e = b[h]) 7615 if ("object" == typeof c && c.handleEvent) { 7616 if (d) { 7617 if (!c["oldIE" + e]) return !1 7618 } else c["oldIE" + e] = g; 7619 a[f]("on" + e, c["oldIE" + e]) 7620 } else a[f]("on" + e, c) 7621 }); 7622 var f = this, 7623 g = 25, 7624 h = 3, 7625 i = { 7626 allowPanToNext: !0, 7627 spacing: .12, 7628 bgOpacity: 1, 7629 mouseUsed: !1, 7630 loop: !0, 7631 pinchToClose: !0, 7632 closeOnScroll: !0, 7633 closeOnVerticalDrag: !0, 7634 verticalDragRange: .75, 7635 hideAnimationDuration: 333, 7636 showAnimationDuration: 333, 7637 showHideOpacity: !1, 7638 focus: !0, 7639 escKey: !0, 7640 arrowKeys: !0, 7641 mainScrollEndFriction: .35, 7642 panEndFriction: .35, 7643 isClickableElement: function (a) { 7644 return "A" === a.tagName 7645 }, 7646 getDoubleTapZoom: function (a, b) { 7647 return a ? 1 : b.initialZoomLevel < .7 ? 1 : 1.33 7648 }, 7649 maxSpreadZoom: 1.33, 7650 modal: !0, 7651 scaleMode: "fit" 7652 }; 7653 e.extend(i, d); 7654 var j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, $, _, aa, ba, ca, da, ea, fa, ga, ha, ia, ja, ka, la = function () { 7655 return { 7656 x: 0, 7657 y: 0 7658 } 7659 }, 7660 ma = la(), 7661 na = la(), 7662 oa = la(), 7663 pa = {}, 7664 qa = 0, 7665 ra = {}, 7666 sa = la(), 7667 ta = 0, 7668 ua = !0, 7669 va = [], 7670 wa = {}, 7671 xa = !1, 7672 ya = function (a, b) { 7673 e.extend(f, b.publicMethods), va.push(a) 7674 }, 7675 za = function (a) { 7676 var b = _b(); 7677 return a > b - 1 ? a - b : 0 > a ? b + a : a 7678 }, 7679 Aa = {}, 7680 Ba = function (a, b) { 7681 return Aa[a] || (Aa[a] = []), Aa[a].push(b) 7682 }, 7683 Ca = function (a) { 7684 var b = Aa[a]; 7685 if (b) { 7686 var c = Array.prototype.slice.call(arguments); 7687 c.shift(); 7688 for (var d = 0; d < b.length; d++) b[d].apply(f, c) 7689 } 7690 }, 7691 Da = function () { 7692 return (new Date).getTime() 7693 }, 7694 Ea = function (a) { 7695 ia = a, f.bg.style.opacity = a * i.bgOpacity 7696 }, 7697 Fa = function (a, b, c, d, e) { 7698 (!xa || e && e !== f.currItem) && (d /= e ? e.fitRatio : f.currItem.fitRatio), a[E] = u + b + "px, " + c + "px" + v + " scale(" + d + ")" 7699 }, 7700 Ga = function (a) { 7701 da && (a && (s > f.currItem.fitRatio ? xa || (lc(f.currItem, !1, !0), xa = !0) : xa && (lc(f.currItem), xa = !1)), Fa(da, oa.x, oa.y, s)) 7702 }, 7703 Ha = function (a) { 7704 a.container && Fa(a.container.style, a.initialPosition.x, a.initialPosition.y, a.initialZoomLevel, a) 7705 }, 7706 Ia = function (a, b) { 7707 b[E] = u + a + "px, 0px" + v 7708 }, 7709 Ja = function (a, b) { 7710 if (!i.loop && b) { 7711 var c = m + (sa.x * qa - a) / sa.x, 7712 d = Math.round(a - sb.x); 7713 (0 > c && d > 0 || c >
7713= _b() - 1 && 0 > d) && (a = sb.x + d * i.mainScrollEndFriction) 7714 } 7715 sb.x = a, Ia(a, n) 7716 }, 7717 Ka = function (a, b) { 7718 var c = tb[a] - ra[a]; 7719 return na[a] + ma[a] + c - c * (b / t) 7720 }, 7721 La = function (a, b) { 7722 a.x = b.x, a.y = b.y, b.id && (a.id = b.id) 7723 }, 7724 Ma = function (a) { 7725 a.x = Math.round(a.x), a.y = Math.round(a.y) 7726 }, 7727 Na = null, 7728 Oa = function () { 7729 Na && (e.unbind(document, "mousemove", Oa), e.addClass(a, "pswp--has_mouse"), i.mouseUsed = !0, Ca("mouseUsed")), Na = setTimeout(function () { 7730 Na = null 7731 }, 100) 7732 }, 7733 Pa = function () { 7734 e.bind(document, "keydown", f), N.transform && e.bind(f.scrollWrap, "click", f), i.mouseUsed || e.bind(document, "mousemove", Oa), e.bind(window, "resize scroll", f), Ca("bindEvents") 7735 }, 7736 Qa = function () { 7737 e.unbind(window, "resize", f), e.unbind(window, "scroll", r.scroll), e.unbind(document, "keydown", f), e.unbind(document, "mousemove", Oa), N.transform && e.unbind(f.scrollWrap, "click", f), U && e.unbind(window, p, f), Ca("unbindEvents") 7738 }, 7739 Ra = function (a, b) { 7740 var c = hc(f.currItem, pa, a); 7741 return b && (ca = c), c 7742 }, 7743 Sa = function (a) { 7744 return a || (a = f.currItem), a.initialZoomLevel 7745 }, 7746 Ta = function (a) { 7747 return a || (a = f.currItem), a.w > 0 ? i.maxSpreadZoom : 1 7748 }, 7749 Ua = function (a, b, c, d) { 7750 return d === f.currItem.initialZoomLevel ? (c[a] = f.currItem.initialPosition[a], !0) : (c[a] = Ka(a, d), c[a] > b.min[a] ? (c[a] = b.min[a], !0) : c[a] < b.max[a] ? (c[a] = b.max[a], !0) : !1) 7751 }, 7752 Va = function () { 7753 if (E) { 7754 var b = N.perspective && !G; 7755 return u = "translate" + (b ? "3d(" : "("), void(v = N.perspective ? ", 0px)" : ")") 7756 } 7757 E = "left", e.addClass(a, "pswp--ie"), Ia = function (a, b) { 7758 b.left = a + "px" 7759 }, Ha = function (a) { 7760 var b = a.fitRatio > 1 ? 1 : a.fitRatio, 7761 c = a.container.style, 7762 d = b * a.w, 7763 e = b * a.h; 7764 c.width = d + "px", c.height = e + "px", c.left = a.initialPosition.x + "px", c.top = a.initialPosition.y + "px" 7765 }, Ga = function () { 7766 if (da) { 7767 var a = da, 7768 b = f.currItem, 7769 c = b.fitRatio > 1 ? 1 : b.fitRatio, 7770 d = c * b.w, 7771 e = c * b.h; 7772 a.width = d + "px", a.height = e + "px", a.left = oa.x + "px", a.top = oa.y + "px" 7773 } 7774 } 7775 }, 7776 Wa = function (a) { 7777 var b = ""; 7778 i.escKey && 27 === a.keyCode ? b = "close" : i.arrowKeys && (37 === a.keyCode ? b = "prev" : 39 === a.keyCode && (b = "next")), b && (a.ctrlKey || a.altKey || a.shiftKey || a.metaKey || (a.preventDefault ? a.preventDefault() : a.returnValue = !1, f[b]())) 7779 }, 7780 Xa = function (a) { 7781 a && (X || W || ea || S) && (a.preventDefault(), a.stopPropagation()) 7782 }, 7783 Ya = function () { 7784 f.setScrollOffset(0, e.getScrollY()) 7785 }, 7786 Za = {}, 7787 $a = 0, 7788 _a = function (a) { 7789 Za[a] && (Za[a].raf && I(Za[a].raf), $a--, delete Za[a]) 7790 }, 7791 ab = function (a) { 7792 Za[a] && _a(a), Za[a] || ($a++, Za[a] = {}) 7793 }, 7794 bb = function () { 7795 for (var a in Za) Za.hasOwnProperty(a) && _a(a) 7796 }, 7797 cb = function (a, b, c, d, e, f, g) { 7798 var h, i = Da(); 7799 ab(a); 7800 var j = function () { 7801 if (Za[a]) { 7802 if (h = Da() - i, h >= d) return _a(a), f(c), void(g && g()); 7803 f((c - b) * e(h / d) + b), Za[a].raf = H(j) 7804 } 7805 }; 7806 j() 7807 }, 7808 db = { 7809 shout: Ca, 7810 listen: Ba, 7811 viewportSize: pa, 7812 options: i, 7813 isMainScrollAnimating: function () { 7814 return ea 7815 }, 7816 getZoomLevel: function () { 7817 return s 7818 }, 7819 getCurrentIndex: function () { 7820 return m 7821 }, 7822 isDragging: function () { 7823 return U 7824 }, 7825 isZooming: function () { 7826 return _ 7827 }, 7828 setScrollOffset: function (a, b) {
7829 ra.x = a, M = ra.y = b, Ca("updateScrollOffset", ra) 7830 }, 7831 applyZoomPan: function (a, b, c, d) { 7832 oa.x = b, oa.y = c, s = a, Ga(d) 7833 }, 7834 init: function () { 7835 if (!j && !k) { 7836 var c; 7837 f.framework = e, f.template = a, f.bg = e.getChildByClass(a, "pswp__bg"), J = a.className, j = !0, N = e.detectFeatures(), H = N.raf, I = N.caf, E = N.transform, L = N.oldIE, f.scrollWrap = e.getChildByClass(a, "pswp__scroll-wrap"), f.container = e.getChildByClass(f.scrollWrap, "pswp__container"), n = f.container.style, f.itemHolders = y = [{ 7838 el: f.container.children[0], 7839 wrap: 0, 7840 index: -1 7841 }, { 7842 el: f.container.children[1], 7843 wrap: 0, 7844 index: -1 7845 }, { 7846 el: f.container.children[2], 7847 wrap: 0, 7848 index: -1 7849 }], y[0].el.style.display = y[2].el.style.display = "none", Va(), r = { 7850 resize: f.updateSize, 7851 scroll: Ya, 7852 keydown: Wa, 7853 click: Xa 7854 }; 7855 var d = N.isOldIOSPhone || N.isOldAndroid || N.isMobileOpera; 7856 for (N.animationName && N.transform && !d || (i.showAnimationDuration = i.hideAnimationDuration = 0), c = 0; c < va.length; c++) f["init" + va[c]](); 7857 if (b) { 7858 var g = f.ui = new b(f, e); 7859 g.init() 7860 } 7861 Ca("firstUpdate"), m = m || i.index || 0, (isNaN(m) || 0 > m || m >= _b()) && (m = 0), f.currItem = $b(m), (N.isOldIOSPhone || N.isOldAndroid) && (ua = !1), a.setAttribute("aria-hidden", "false"), i.modal && (ua ? a.style.position = "fixed" : (a.style.position = "absolute", a.style.top = e.getScrollY() + "px")), void 0 === M && (Ca("initialLayout"), M = K = e.getScrollY()); 7862 var l = "pswp--open "; 7863 for (i.mainClass && (l += i.mainClass + " "), i.showHideOpacity && (l += "pswp--animate_opacity "), l += G ? "pswp--touch" : "pswp--notouch", l += N.animationName ? " pswp--css_animation" : "", l += N.svg ? " pswp--svg" : "", e.addClass(a, l), f.updateSize(), o = -1, ta = null, c = 0; h > c; c++) Ia((c + o) * sa.x, y[c].el.style); 7864 L || e.bind(f.scrollWrap, q, f), Ba("initialZoomInEnd", function () { 7865 f.setContent(y[0], m - 1), f.setContent(y[2], m + 1), y[0].el.style.display = y[2].el.style.display = "block", i.focus && a.focus(), Pa() 7866 }), f.setContent(y[1], m), f.updateCurrItem(), Ca("afterInit"), ua || (w = setInterval(function () { 7867 $a || U || _ || s !== f.currItem.initialZoomLevel || f.updateSize() 7868 }, 1e3)), e.addClass(a, "pswp--visible") 7869 } 7870 }, 7871 close: function () { 7872 j && (j = !1, k = !0, Ca("close"), Qa(), bc(f.currItem, null, !0, f.destroy)) 7873 }, 7874 destroy: function () { 7875 Ca("destroy"), Wb && clearTimeout(Wb), a.setAttribute("aria-hidden", "true"), a.className = J, w && clearInterval(w), e.unbind(f.scrollWrap, q, f), e.unbind(window, "scroll", f), yb(), bb(), Aa = null 7876 }, 7877 panTo: function (a, b, c) { 7878 c || (a > ca.min.x ? a = ca.min.x : a < ca.max.x && (a = ca.max.x), b > ca.min.y ? b = ca.min.y : b < ca.max.y && (b = ca.max.y)), oa.x = a, oa.y = b, Ga() 7879 }, 7880 handleEvent: function (a) { 7881 a = a || window.event, r[a.type] && r[a.type](a) 7882 }, 7883 goTo: function (a) { 7884 a = za(a); 7885 var b = a - m; 7886 ta = b, m = a, f.currItem = $b(m), qa -= b, Ja(sa.x * qa), bb(), ea = !1, f.updateCurrItem() 7887 }, 7888 next: function () { 7889 f.goTo(m + 1) 7890 }, 7891 prev: function () { 7892 f.goTo(m - 1) 7893 }, 7894 updateCurrZoomItem: function (a) { 7895 if (a && Ca("beforeChange", 0), y[1].el.children.length) { 7896 var b = y[1].el.children[0]; 7897 da = e.hasClass(b, "pswp__zoom-wrap") ? b.style : null 7898 } else da = null; 7899 ca = f.currItem.bounds, t = s = f.currItem.initialZoomLevel, oa.x = ca.center.x, oa.y = ca.center.y, a && Ca("afterChange") 7900 }, 7901 invalidateCurrItems: function () { 7902 x = !0; 7903 for (var a = 0; h > a; a++) y[a].item && (y[a].item.needsUpdate = !0) 7904 }, 7905 updateCurrItem: function (a) { 7906 if (0 !== ta) { 7907 var b, c = Math.abs(ta); 7908 if (!(a && 2 > c)) { 7909 f.currItem = $b(m), xa = !1, Ca("beforeChange", ta), c >
7909= h && (o += ta + (ta > 0 ? -h : h), c = h); 7910 for (var d = 0; c > d; d++) ta > 0 ? (b = y.shift(), y[h - 1] = b, o++, Ia((o + 2) * sa.x, b.el.style), f.setContent(b, m - c + d + 1 + 1)) : (b = y.pop(), y.unshift(b), o--, Ia(o * sa.x, b.el.style), f.setContent(b, m + c - d - 1 - 1)); 7911 if (da && 1 === Math.abs(ta)) { 7912 var e = $b(z); 7913 e.initialZoomLevel !== s && (hc(e, pa), lc(e), Ha(e)) 7914 } 7915 ta = 0, f.updateCurrZoomItem(), z = m, Ca("afterChange") 7916 } 7917 } 7918 }, 7919 updateSize: function (b) { 7920 if (!ua && i.modal) { 7921 var c = e.getScrollY(); 7922 if (M !== c && (a.style.top = c + "px", M = c), !b && wa.x === window.innerWidth && wa.y === window.innerHeight) return; 7923 wa.x = window.innerWidth, wa.y = window.innerHeight, a.style.height = wa.y + "px" 7924 } 7925 if (pa.x = f.scrollWrap.clientWidth, pa.y = f.scrollWrap.clientHeight, Ya(), sa.x = pa.x + Math.round(pa.x * i.spacing), sa.y = pa.y, Ja(sa.x * qa), Ca("beforeResize"), void 0 !== o) { 7926 for (var d, g, j, k = 0; h > k; k++) d = y[k], Ia((k + o) * sa.x, d.el.style), j = m + k - 1, i.loop && _b() > 2 && (j = za(j)), g = $b(j), g && (x || g.needsUpdate || !g.bounds) ? (f.cleanSlide(g), f.setContent(d, j), 1 === k && (f.currItem = g, f.updateCurrZoomItem(!0)), g.needsUpdate = !1) : -1 === d.index && j >= 0 && f.setContent(d, j), g && g.container && (hc(g, pa), lc(g), Ha(g)); 7927 x = !1 7928 } 7929 t = s = f.currItem.initialZoomLevel, ca = f.currItem.bounds, ca && (oa.x = ca.center.x, oa.y = ca.center.y, Ga(!0)), Ca("resize") 7930 }, 7931 zoomTo: function (a, b, c, d, f) { 7932 b && (t = s, tb.x = Math.abs(b.x) - oa.x, tb.y = Math.abs(b.y) - oa.y, La(na, oa)); 7933 var g = Ra(a, !1), 7934 h = {}; 7935 Ua("x", g, h, a), Ua("y", g, h, a); 7936 var i = s, 7937 j = { 7938 x: oa.x, 7939 y: oa.y 7940 }; 7941 Ma(h); 7942 var k = function (b) { 7943 1 === b ? (s = a, oa.x = h.x, oa.y = h.y) : (s = (a - i) * b + i, oa.x = (h.x - j.x) * b + j.x, oa.y = (h.y - j.y) * b + j.y), f && f(b), Ga(1 === b) 7944 }; 7945 c ? cb("customZoomTo", 0, 1, c, d || e.easing.sine.inOut, k) : k(1) 7946 } 7947 }, 7948 eb = 30, 7949 fb = 10, 7950 gb = {}, 7951 hb = {}, 7952 ib = {}, 7953 jb = {}, 7954 kb = {}, 7955 lb = [], 7956 mb = {}, 7957 nb = [], 7958 ob = {}, 7959 pb = 0, 7960 qb = la(), 7961 rb = 0, 7962 sb = la(), 7963 tb = la(), 7964 ub = la(), 7965 vb = function (a, b) { 7966 return a.x === b.x && a.y === b.y 7967 }, 7968 wb = function (a, b) { 7969 return Math.abs(a.x - b.x) < g && Math.abs(a.y - b.y) < g 7970 }, 7971 xb = function (a, b) { 7972 return ob.x = Math.abs(a.x - b.x), ob.y = Math.abs(a.y - b.y), Math.sqrt(ob.x * ob.x + ob.y * ob.y) 7973 }, 7974 yb = function () { 7975 Y && (I(Y), Y = null) 7976 }, 7977 zb = function () { 7978 U && (Y = H(zb), Pb()) 7979 }, 7980 Ab = function () { 7981 return !("fit" === i.scaleMode && s === f.currItem.initialZoomLevel) 7982 }, 7983 Bb = function (a, b) { 7984 return a && a !== document ? a.getAttribute("class") && a.getAttribute("class").indexOf("pswp__scroll-wrap") > -1 ? !1 : b(a) ? a : Bb(a.parentNode, b) : !1 7985 }, 7986 Cb = {}, 7987 Db = function (a, b) { 7988 return Cb.prevent = !Bb(a.target, i.isClickableElement), Ca("preventDragEvent", a, b, Cb), Cb.prevent 7989 }, 7990 Eb = function (a, b) { 7991 return b.x = a.pageX, b.y = a.pageY, b.id = a.identifier, b 7992 }, 7993 Fb = function (a, b, c) { 7994 c.x = .5 * (a.x + b.x), c.y = .5 * (a.y + b.y) 7995 }, 7996 Gb = function (a, b, c) { 7997 if (a - P > 50) { 7998 var d = nb.length > 2 ? nb.shift() : {}; 7999 d.x = b, d.y = c, nb.push(d), P = a 8000 } 8001 }, 8002 Hb = function () { 8003 var a = oa.y - f.currItem.initialPosition.y; 8004 return 1 - Math.abs(a / (pa.y / 2)) 8005 }, 8006 Ib = {}, 8007 Jb = {}, 8008 Kb = [], 8009 Lb = function (a) { 8010 for (; Kb.length > 0;) Kb.pop(); 8011 return F ? (ka = 0, lb.forEach(function (a) { 8012 0 === ka ? Kb[0] = a : 1 === ka && (Kb[1] = a), ka++ 8013 })) : a.type.indexOf("touch") > -1 ? a.touches && a.touches.length > 0 && (Kb[0] = Eb(a.touches[0], Ib), a.touches.length > 1 && (Kb[1] = Eb(a.touches[1], Jb))) : (Ib.x = a.pageX, Ib.y = a.pageY, Ib.id = "", Kb[0] = Ib), Kb
8014 }, 8015 Mb = function (a, b) { 8016 var c, d, e, g, h = 0, 8017 j = oa[a] + b[a], 8018 k = b[a] > 0, 8019 l = sb.x + b.x, 8020 m = sb.x - mb.x; 8021 return c = j > ca.min[a] || j < ca.max[a] ? i.panEndFriction : 1, j = oa[a] + b[a] * c, !i.allowPanToNext && s !== f.currItem.initialZoomLevel || (da ? "h" !== fa || "x" !== a || W || (k ? (j > ca.min[a] && (c = i.panEndFriction, h = ca.min[a] - j, d = ca.min[a] - na[a]), (0 >= d || 0 > m) && _b() > 1 ? (g = l, 0 > m && l > mb.x && (g = mb.x)) : ca.min.x !== ca.max.x && (e = j)) : (j < ca.max[a] && (c = i.panEndFriction, h = j - ca.max[a], d = na[a] - ca.max[a]), (0 >= d || m > 0) && _b() > 1 ? (g = l, m > 0 && l < mb.x && (g = mb.x)) : ca.min.x !== ca.max.x && (e = j))) : g = l, "x" !== a) ? void(ea || Z || s > f.currItem.fitRatio && (oa[a] += b[a] * c)) : (void 0 !== g && (Ja(g, !0), Z = g === mb.x ? !1 : !0), ca.min.x !== ca.max.x && (void 0 !== e ? oa.x = e : Z || (oa.x += b.x * c)), void 0 !== g) 8022 }, 8023 Nb = function (a) { 8024 if (!("mousedown" === a.type && a.button > 0)) { 8025 if (Zb) return void a.preventDefault(); 8026 if (!T || "mousedown" !== a.type) { 8027 if (Db(a, !0) && a.preventDefault(), Ca("pointerDown"), F) { 8028 var b = e.arraySearch(lb, a.pointerId, "id"); 8029 0 > b && (b = lb.length), lb[b] = { 8030 x: a.pageX, 8031 y: a.pageY, 8032 id: a.pointerId 8033 } 8034 } 8035 var c = Lb(a), 8036 d = c.length; 8037 $ = null, bb(), U && 1 !== d || (U = ga = !0, e.bind(window, p, f), R = ja = ha = S = Z = X = V = W = !1, fa = null, Ca("firstTouchStart", c), La(na, oa), ma.x = ma.y = 0, La(jb, c[0]), La(kb, jb), mb.x = sa.x * qa, nb = [{ 8038 x: jb.x, 8039 y: jb.y 8040 }], P = O = Da(), Ra(s, !0), yb(), zb()), !_ && d > 1 && !ea && !Z && (t = s, W = !1, _ = V = !0, ma.y = ma.x = 0, La(na, oa), La(gb, c[0]), La(hb, c[1]), Fb(gb, hb, ub), tb.x = Math.abs(ub.x) - oa.x, tb.y = Math.abs(ub.y) - oa.y, aa = ba = xb(gb, hb)) 8041 } 8042 } 8043 }, 8044 Ob = function (a) { 8045 if (a.preventDefault(), F) { 8046 var b = e.arraySearch(lb, a.pointerId, "id"); 8047 if (b > -1) { 8048 var c = lb[b]; 8049 c.x = a.pageX, c.y = a.pageY 8050 } 8051 } 8052 if (U) { 8053 var d = Lb(a); 8054 if (fa || X || _) $ = d; 8055 else if (sb.x !== sa.x * qa) fa = "h"; 8056 else { 8057 var f = Math.abs(d[0].x - jb.x) - Math.abs(d[0].y - jb.y); 8058 Math.abs(f) >= fb && (fa = f > 0 ? "h" : "v", $ = d) 8059 } 8060 } 8061 }, 8062 Pb = function () { 8063 if ($) { 8064 var a = $.length; 8065 if (0 !== a) 8066 if (La(gb, $[0]), ib.x = gb.x - jb.x, ib.y = gb.y - jb.y, _ && a > 1) { 8067 if (jb.x = gb.x, jb.y = gb.y, !ib.x && !ib.y && vb($[1], hb)) return; 8068 La(hb, $[1]), W || (W = !0, Ca("zoomGestureStarted")); 8069 var b = xb(gb, hb), 8070 c = Ub(b); 8071 c > f.currItem.initialZoomLevel + f.currItem.initialZoomLevel / 15 && (ja = !0); 8072 var d = 1, 8073 e = Sa(), 8074 g = Ta(); 8075 if (e > c) 8076 if (i.pinchToClose && !ja && t <= f.currItem.initialZoomLevel) { 8077 var h = e - c, 8078 j = 1 - h / (e / 1.2); 8079 Ea(j), Ca("onPinchClose", j), ha = !0 8080 } else d = (e - c) / e, d > 1 && (d = 1), c = e - d * (e / 3); 8081 else c > g && (d = (c - g) / (6 * e), d > 1 && (d = 1), c = g + d * e); 8082 0 > d && (d = 0), aa = b, Fb(gb, hb, qb), ma.x += qb.x - ub.x, ma.y += qb.y - ub.y, La(ub, qb), oa.x = Ka("x", c), oa.y = Ka("y", c), R = c > s, s = c, Ga() 8083 } else { 8084 if (!fa) return; 8085 if (ga && (ga = !1, Math.abs(ib.x) >= fb && (ib.x -= $[0].x - kb.x), Math.abs(ib.y) >= fb && (ib.y -= $[0].y - kb.y)), jb.x = gb.x, jb.y = gb.y, 0 === ib.x && 0 === ib.y) return; 8086 if ("v" === fa && i.closeOnVerticalDrag && !Ab()) { 8087 ma.y += ib.y, oa.y += ib.y; 8088 var k = Hb(); 8089 return S = !0, Ca("onVerticalDrag", k), Ea(k), void Ga() 8090 } 8091 Gb(Da(), gb.x, gb.y), X = !0, ca = f.currItem.bounds; 8092 var l = Mb("x", ib); 8093 l || (Mb("y", ib), Ma(oa), Ga()) 8094 } 8095 } 8096 }, 8097 Qb = function (a) { 8098 if (N.isOldAndroid) { 8099 if (T && "mouseup" === a.type) return; 8100 a.type.indexOf("touch") > -1 && (clearTimeout(T), T = setTimeout(function () { 8101 T = 0 8102 }, 600)) 8103 } 8104 Ca("pointerUp"), Db(a, !1) && a.preventDefault(); 8105 var b; 8106 if (F) { 8107 var c = e.arraySearch(lb, a.pointerId, "id"); 8108 if (c > -1) 8109 if (b = lb.splice(c, 1)[0], navigator.pointerEnabled) b.type = a.pointerType || "mouse"; 8110 else { 8111 var d = { 8112 4: "mouse", 8113 2: "touch", 8114 3: "pen" 8115 }; 8116 b.type = d[a.pointerType], b.type || (b.type = a.pointerType || "mouse") 8117 } 8118 } 8119 var g, h = Lb(a), 8120 j = h.length; 8121 if ("mouseup" === a.type && (j = 0), 2 === j) return $ = null, !0; 8122 1 === j && La(kb, h[0]), 0 !== j || fa || ea || (b || ("mouseup" === a.type ? b = { 8123 x: a.pageX, 8124 y: a.pageY, 8125 type: "mouse" 8126 } : a.changedTouches && a.changedTouches[0] && (b = { 8127 x: a.changedTouches[0].pageX, 8128 y: a.changedTouches[0].pageY, 8129 type: "touch" 8130 })), Ca("touchRelease", a, b)); 8131 var k = -1; 8132 if (0 === j && (U = !1, e.unbind(window, p, f), yb(), _ ? k = 0 : -1 !== rb && (k = Da() - rb)), rb = 1 === j ? Da() :
8132-1, g = -1 !== k && 150 > k ? "zoom" : "swipe", _ && 2 > j && (_ = !1, 1 === j && (g = "zoomPointerUp"), Ca("zoomGestureEnded")), $ = null, X || W || ea || S) 8133 if (bb(), Q || (Q = Rb()), Q.calculateSwipeSpeed("x"), S) { 8134 var l = Hb(); 8135 if (l < i.verticalDragRange) f.close(); 8136 else { 8137 var m = oa.y, 8138 n = ia; 8139 cb("verticalDrag", 0, 1, 300, e.easing.cubic.out, function (a) { 8140 oa.y = (f.currItem.initialPosition.y - m) * a + m, Ea((1 - n) * a + n), Ga() 8141 }), Ca("onVerticalDrag", 1) 8142 } 8143 } else { 8144 if ((Z || ea) && 0 === j) { 8145 var o = Tb(g, Q); 8146 if (o) return; 8147 g = "zoomPointerUp" 8148 } 8149 if (!ea) return "swipe" !== g ? void Vb() : void(!Z && s > f.currItem.fitRatio && Sb(Q)) 8150 } 8151 }, 8152 Rb = function () { 8153 var a, b, c = { 8154 lastFlickOffset: {}, 8155 lastFlickDist: {}, 8156 lastFlickSpeed: {}, 8157 slowDownRatio: {}, 8158 slowDownRatioReverse: {}, 8159 speedDecelerationRatio: {}, 8160 speedDecelerationRatioAbs: {}, 8161 distanceOffset: {}, 8162 backAnimDestination: {}, 8163 backAnimStarted: {}, 8164 calculateSwipeSpeed: function (d) { 8165 nb.length > 1 ? (a = Da() - P + 50, b = nb[nb.length - 2][d]) : (a = Da() - O, b = kb[d]), c.lastFlickOffset[d] = jb[d] - b, c.lastFlickDist[d] = Math.abs(c.lastFlickOffset[d]), c.lastFlickDist[d] > 20 ? c.lastFlickSpeed[d] = c.lastFlickOffset[d] / a : c.lastFlickSpeed[d] = 0, Math.abs(c.lastFlickSpeed[d]) < .1 && (c.lastFlickSpeed[d] = 0), c.slowDownRatio[d] = .95, c.slowDownRatioReverse[d] = 1 - c.slowDownRatio[d], c.speedDecelerationRatio[d] = 1 8166 }, 8167 calculateOverBoundsAnimOffset: function (a, b) { 8168 c.backAnimStarted[a] || (oa[a] > ca.min[a] ? c.backAnimDestination[a] = ca.min[a] : oa[a] < ca.max[a] && (c.backAnimDestination[a] = ca.max[a]), void 0 !== c.backAnimDestination[a] && (c.slowDownRatio[a] = .7, c.slowDownRatioReverse[a] = 1 - c.slowDownRatio[a], c.speedDecelerationRatioAbs[a] < .05 && (c.lastFlickSpeed[a] = 0, c.backAnimStarted[a] = !0, cb("bounceZoomPan" + a, oa[a], c.backAnimDestination[a], b || 300, e.easing.sine.out, function (b) { 8169 oa[a] = b, Ga() 8170 })))) 8171 }, 8172 calculateAnimOffset: function (a) { 8173 c.backAnimStarted[a] || (c.speedDecelerationRatio[a] = c.speedDecelerationRatio[a] * (c.slowDownRatio[a] + c.slowDownRatioReverse[a] - c.slowDownRatioReverse[a] * c.timeDiff / 10), c.speedDecelerationRatioAbs[a] = Math.abs(c.lastFlickSpeed[a] * c.speedDecelerationRatio[a]), c.distanceOffset[a] = c.lastFlickSpeed[a] * c.speedDecelerationRatio[a] * c.timeDiff, oa[a] += c.distanceOffset[a]) 8174 }, 8175 panAnimLoop: function () { 8176 return Za.zoomPan && (Za.zoomPan.raf = H(c.panAnimLoop), c.now = Da(), c.timeDiff = c.now - c.lastNow, c.lastNow = c.now, c.calculateAnimOffset("x"), c.calculateAnimOffset("y"), Ga(), c.calculateOverBoundsAnimOffset("x"), c.calculateOverBoundsAnimOffset("y"), c.speedDecelerationRatioAbs.x < .05 && c.speedDecelerationRatioAbs.y < .05) ? (oa.x = Math.round(oa.x), oa.y = Math.round(oa.y), Ga(), void _a("zoomPan")) : void 0 8177 } 8178 }; 8179 return c 8180 }, 8181 Sb = function (a) { 8182 return a.calculateSwipeSpeed("y"), ca = f.currItem.bounds, a.backAnimDestination = {}, a.backAnimStarted = {}, Math.abs(a.lastFlickSpeed.x) <= .05 && Math.abs(a.lastFlickSpeed.y) <= .05 ? (
8182a.speedDecelerationRatioAbs.x = a.speedDecelerationRatioAbs.y = 0, a.calculateOverBoundsAnimOffset("x"), a.calculateOverBoundsAnimOffset("y"), !0) : (ab("zoomPan"), a.lastNow = Da(), void a.panAnimLoop()) 8183 }, 8184 Tb = function (a, b) { 8185 var c; 8186 ea || (pb = m); 8187 var d; 8188 if ("swipe" === a) { 8189 var g = jb.x - kb.x, 8190 h = b.lastFlickDist.x < 10; 8191 g > eb && (h || b.lastFlickOffset.x > 20) ? d = -1 : -eb > g && (h || b.lastFlickOffset.x < -20) && (d = 1) 8192 } 8193 var j; 8194 d && (m += d, 0 > m ? (m = i.loop ? _b() - 1 : 0, j = !0) : m >= _b() && (m = i.loop ? 0 : _b() - 1, j = !0), (!j || i.loop) && (ta += d, qa -= d, c = !0)); 8195 var k, l = sa.x * qa, 8196 n = Math.abs(l - sb.x); 8197 return c || l > sb.x == b.lastFlickSpeed.x > 0 ? (k = Math.abs(b.lastFlickSpeed.x) > 0 ? n / Math.abs(b.lastFlickSpeed.x) : 333, k = Math.min(k, 400), k = Math.max(k, 250)) : k = 333, pb === m && (c = !1), ea = !0, Ca("mainScrollAnimStart"), cb("mainScroll", sb.x, l, k, e.easing.cubic.out, Ja, function () { 8198 bb(), ea = !1, pb = -1, (c || pb !== m) && f.updateCurrItem(), Ca("mainScrollAnimComplete") 8199 }), c && f.updateCurrItem(!0), c 8200 }, 8201 Ub = function (a) { 8202 return 1 / ba * a * t 8203 }, 8204 Vb = function () { 8205 var a = s, 8206 b = Sa(), 8207 c = Ta(); 8208 b > s ? a = b : s > c && (a = c); 8209 var d, g = 1, 8210 h = ia; 8211 return ha && !R && !ja && b > s ? (f.close(), !0) : (ha && (d = function (a) { 8212 Ea((g - h) * a + h) 8213 }), f.zoomTo(a, 0, 200, e.easing.cubic.out, d), !0) 8214 }; 8215 ya("Gestures", { 8216 publicMethods: { 8217 initGestures: function () { 8218 var a = function (a, b, c, d, e) { 8219 A = a + b, B = a + c, C = a + d, D = e ? a + e : "" 8220 }; 8221 F = N.pointerEvent, F && N.touch && (N.touch = !1), F ? navigator.pointerEnabled ? a("pointer", "down", "move", "up", "cancel") : a("MSPointer", "Down", "Move", "Up", "Cancel") : N.touch ? (a("touch", "start", "move", "end", "cancel"), G = !0) : a("mouse", "down", "move", "up"), p = B + " " + C + " " + D, q = A, F && !G && (G = navigator.maxTouchPoints > 1 || navigator.msMaxTouchPoints > 1), f.likelyTouchDevice = G, r[A] = Nb, r[B] = Ob, r[C] = Qb, D && (r[D] = r[C]), N.touch && (q += " mousedown", p += " mousemove mouseup", r.mousedown = r[A], r.mousemove = r[B], r.mouseup = r[C]), G || (i.allowPanToNext = !1) 8222 } 8223 } 8224 }); 8225 var Wb, Xb, Yb, Zb, $b, _b, ac, bc = function (b, c, d, g) { 8226 Wb && clearTimeout(Wb), Zb = !0, Yb = !0; 8227 var h; 8228 b.initialLayout ? (h = b.initialLayout, b.initialLayout = null) : h = i.getThumbBoundsFn && i.getThumbBoundsFn(m); 8229 var j = d ? i.hideAnimationDuration : i.showAnimationDuration, 8230 k = function () { 8231 _a("initialZoom"), d ? (f.template.removeAttribute("style"), f.bg.removeAttribute("style")) : (Ea(1), c && (c.style.display = "block"), e.addClass(a, "pswp--animated-in"), Ca("initialZoom" + (d ? "OutEnd" : "InEnd"))), g && g(), Zb = !1 8232 }; 8233 if (!j || !h || void 0 === h.x) return Ca("initialZoom" + (d ? "Out" : "In")), s = b.initialZoomLevel, La(oa, b.initialPosition), Ga(), a.style.opacity = d ? 0 : 1, Ea(1), void(j ? setTimeout(function () { 8234 k() 8235 }, j) : k()); 8236 var n = function () { 8237 var c = l, 8238 g = !f.currItem.src || f.currItem.loadError || i.showHideOpacity; 8239 b.miniImg && (b.miniImg.style.webkitBackfaceVisibility = "hidden"), d || (s = h.w / b.w, oa.x = h.x, oa.y = h.y - K, f[g ? "template" : "bg"].style.opacity = .001, Ga()), ab("initialZoom"), d && !c && e.removeClass(a, "pswp--animated-in"), g && (d ? e[(c ? "remove" : "add") + "Class"](a, "pswp--animate_opacity") : setTimeout(function () { 8240 e.addClass(a, "pswp--animate_opacity") 8241 }, 30)), Wb = setTimeout(function () { 8242 if (Ca("initialZoom" + (d ? "Out" : "In")), d) { 8243 var f = h.w / b.w, 8244 i = { 8245 x: oa.x, 8246 y: oa.y 8247 }, 8248 l = s, 8249 m = ia, 8250 n = function (b) { 8251 1 === b ? (s = f, oa.x = h.x, oa.y = h.y - M) : (s = (f - l) * b + l, oa.x = (h.x - i.x) * b + i.x, oa.y = (h.y - M - i.y) * b + i.y), Ga(), g ? a.style.opacity = 1 - b : Ea(m - b * m) 8252 }; 8253 c ? cb("initialZoom", 0, 1, j, e.easing.cubic.out, n, k) : (n(1), Wb = setTimeout(k, j + 20)) 8254 } else s = b.initialZoomLevel, La(oa, b.initialPosition), Ga(), Ea(1), g ? a.style.opacity = 1 : Ea(1), Wb = setTimeout(k, j + 20) 8255 }
8255, d ? 25 : 90) 8256 }; 8257 n() 8258 }, 8259 cc = {}, 8260 dc = [], 8261 ec = { 8262 index: 0, 8263 errorMsg: '<div class="pswp__error-msg"><a href="%url%" target="_blank">The image</a> could not be loaded.</div>', 8264 forceProgressiveLoading: !1, 8265 preload: [1, 1], 8266 getNumItemsFn: function () { 8267 return Xb.length 8268 } 8269 }, 8270 fc = function () { 8271 return { 8272 center: { 8273 x: 0, 8274 y: 0 8275 }, 8276 max: { 8277 x: 0, 8278 y: 0 8279 }, 8280 min: { 8281 x: 0, 8282 y: 0 8283 } 8284 } 8285 }, 8286 gc = function (a, b, c) { 8287 var d = a.bounds; 8288 d.center.x = Math.round((cc.x - b) / 2), d.center.y = Math.round((cc.y - c) / 2) + a.vGap.top, d.max.x = b > cc.x ? Math.round(cc.x - b) : d.center.x, d.max.y = c > cc.y ? Math.round(cc.y - c) + a.vGap.top : d.center.y, d.min.x = b > cc.x ? 0 : d.center.x, d.min.y = c > cc.y ? a.vGap.top : d.center.y 8289 }, 8290 hc = function (a, b, c) { 8291 if (a.src && !a.loadError) { 8292 var d = !c; 8293 if (d && (a.vGap || (a.vGap = { 8294 top: 0, 8295 bottom: 0 8296 }), Ca("parseVerticalMargin", a)), cc.x = b.x, cc.y = b.y - a.vGap.top - a.vGap.bottom, d) { 8297 var e = cc.x / a.w, 8298 f = cc.y / a.h; 8299 a.fitRatio = f > e ? e : f; 8300 var g = i.scaleMode; 8301 "orig" === g ? c = 1 : "fit" === g && (c = a.fitRatio), c > 1 && (c = 1), a.initialZoomLevel = c, a.bounds || (a.bounds = fc()) 8302 } 8303 if (!c) return; 8304 return gc(a, a.w * c, a.h * c), d && c === a.initialZoomLevel && (a.initialPosition = a.bounds.center), a.bounds 8305 } 8306 return a.w = a.h = 0, a.initialZoomLevel = a.fitRatio = 1, a.bounds = fc(), a.initialPosition = a.bounds.center, a.bounds 8307 }, 8308 ic = function (a, b, c, d, e, g) { 8309 b.loadError || d && (b.imageAppended = !0, lc(b, d, b === f.currItem && xa), c.appendChild(d), g && setTimeout(function () { 8310 b && b.loaded && b.placeholder && (b.placeholder.style.display = "none", b.placeholder = null) 8311 }, 500)) 8312 }, 8313 jc = function (a) { 8314 a.loading = !0, a.loaded = !1; 8315 var b = a.img = e.createEl("pswp__img", "img"), 8316 c = function () { 8317 a.loading = !1, a.loaded = !0, a.loadComplete ? a.loadComplete(a) : a.img = null, b.onload = b.onerror = null, b = null 8318 }; 8319 return b.onload = c, b.onerror = function () { 8320 a.loadError = !0, c() 8321 }, b.src = a.src, b 8322 }, 8323 kc = function (a, b) { 8324 return a.src && a.loadError && a.container ? (b && (a.container.innerHTML = ""), a.container.innerHTML = i.errorMsg.replace("%url%", a.src), !0) : void 0 8325 }, 8326 lc = function (a, b, c) { 8327 if (a.src) { 8328 b || (b = a.container.lastChild); 8329 var d = c ? a.w : Math.round(a.w * a.fitRatio), 8330 e = c ? a.h : Math.round(a.h * a.fitRatio); 8331 a.placeholder && !a.loaded && (a.placeholder.style.width = d + "px", a.placeholder.style.height = e + "px"), b.style.width = d + "px", b.style.height = e + "px" 8332 } 8333 }, 8334 mc = function () { 8335 if (dc.length) { 8336 for (var a, b = 0; b < dc.length; b++) a = dc[b], a.holder.index === a.index && ic(a.index, a.item, a.baseDiv, a.img, !1, a.clearPlaceholder); 8337 dc = [] 8338 } 8339 }; 8340 ya("Controller", { 8341 publicMethods: { 8342 lazyLoadItem: function (a) { 8343 a = za(a); 8344 var b = $b(a); 8345 b && (!b.loaded && !b.loading || x) && (Ca("gettingData", a, b), b.src && jc(b)) 8346 }, 8347 initController: function () { 8348 e.extend(i, ec, !0), f.items = Xb = c, $b = f.getItemAt, _b = i.getNumItemsFn, ac = i.loop, _b() < 3 && (i.loop = !1), Ba("beforeChange", function (a) { 8349 var b, c = i.preload, 8350 d = null === a ? !0 : a >= 0, 8351 e = Math.min(c[0], _b()), 8352 g = Math.min(c[1], _b()); 8353 for (b = 1; 8354 (d ? g : e) >= b; b++) f.lazyLoadItem(m + b); 8355 for (b = 1; 8356 (d ? e : g) >= b; b++) f.lazyLoadItem(m - b) 8357 }), Ba("initialLayout", function () { 8358 f.currItem.initialLayout = i.getThumbBoundsFn && i.getThumbBoundsFn(m) 8359 }), Ba("mainScrollAnimComplete", mc), Ba("initialZoomInEnd", mc), Ba("destroy", function () { 8360 for (var a, b = 0; b < Xb.length; b++) a = Xb[b], a.container && (a.container = null), a.placeholder && (a.placeholder = null), a.img && (a.img = null), a.preloader && (a.preloader = null), a.loadError && (a.loaded = a.loadError = !1); 8361 dc = null 8362 }) 8363 }, 8364 getItemAt: function (a) { 8365 return a >= 0 && void 0 !== Xb[a] ? Xb[a] : !1 8366 }, 8367 allowProgressiveImg: function () { 8368 return i.forceProgressiveLoading || !G || i.mouseUsed || screen.width > 1200 8369 }, 8370 setContent: function (a, b) { 8371 i.loop && (b = za(b)); 8372 var c = f.getItemAt(a.index); 8373 c && (c.container = null); 8374 var d, g = f.getItemAt(b); 8375 if (!g) return void(a.el.innerHTML = ""); 8376 Ca("gettingData", b, g), a.index = b, a.item = g; 8377 var h = g.container = e.createEl("pswp__zoom-wrap"); 8378 if (!g.src && g.html && (g.html.tagName ? h.appendChild(g.html) : h.innerHTML = g.html), kc(g), hc(g, pa), !g.src || g.loadError || g.loaded) g.src && !g.loadError && (d = e.createEl("pswp__img", "img"), d.style.opacity = 1, d.src = g.src, lc(g, d), ic(b, g, h, d, !0)); 8379 else { 8380 if (g.loadComplete = function (c) { 8381 if (j) { 8382 if (a && a.index === b) { 8383 if (kc(c, !0)) return c.loadComplete = c.img = null, hc(c, pa), Ha(c), void(a.index === m && f.updateCurrZoomItem()); 8384 c.imageAppended ? !Zb && c.placeholder && (c.placeholder.style.display = "none", c.placeholder = null) : N.transform && (ea || Zb) ? dc.push({ 8385 item: c, 8386 baseDiv: h, 8387 img: c.img, 8388 index: b, 8389 holder: a, 8390 clearPlaceholder: !0 8391 }) : ic(b, c, h, c.img, ea || Zb, !0) 8392 } 8393 c.loadComplete = null, c.img = null, Ca("imageLoadComplete", b, c) 8394 } 8395 }, e.features.transform) { 8396 var k = "pswp__img pswp__img--placeholder"; 8397 k += g.msrc ? "" : " pswp__img--placeholder--blank"; 8398 var l = e.createEl(k, g.msrc ? "img" : ""); 8399 g.msrc && (l.src = g.msrc), lc(g, l), h.appendChild(l), g.placeholder = l 8400 } 8401 g.loading || jc(g), f.allowProgressiveImg() && (!Yb && N.transform ? dc.push({ 8402 item: g, 8403 baseDiv: h, 8404 img: g.img, 8405 index: b, 8406 holder: a 8407 }) : ic(b, g, h, g.img, !0, !0)) 8408 } 8409 Yb || b !== m ? Ha(g) : (da = h.style, bc(g, d || g.img)), a.el.innerHTML = "", a.el.appendChild(h) 8410 }, 8411 cleanSlide: function (a) { 8412 a.img && (a.img.onload = a.img.onerror = null), a.loaded = a.loading = a.img = a.imageAppended = !1 8413 } 8414 } 8415 }); 8416 var nc, oc = {}, 8417 pc = function (a, b, c) { 8418 var d = document.createEvent("CustomEvent"), 8419 e = { 8420 origEvent: a, 8421 target: a.target, 8422 releasePoint: b, 8423 pointerType: c || "touch" 8424 }; 8425 d.initCustomEvent("pswpTap", !0, !0, e), a.target.dispatchEvent(d) 8426 }; 8427 ya("Tap", { 8428 publicMethods: { 8429 initTap: function () {
8430 Ba("firstTouchStart", f.onTapStart), Ba("touchRelease", f.onTapRelease), Ba("destroy", function () { 8431 oc = {}, nc = null 8432 }) 8433 }, 8434 onTapStart: function (a) { 8435 a.length > 1 && (clearTimeout(nc), nc = null) 8436 }, 8437 onTapRelease: function (a, b) { 8438 if (b && !X && !V && !$a) { 8439 var c = b; 8440 if (nc && (clearTimeout(nc), nc = null, wb(c, oc))) return void Ca("doubleTap", c); 8441 if ("mouse" === b.type) return void pc(a, b, "mouse"); 8442 var d = a.target.tagName.toUpperCase(); 8443 if ("BUTTON" === d || e.hasClass(a.target, "pswp__single-tap")) return void pc(a, b); 8444 La(oc, c), nc = setTimeout(function () { 8445 pc(a, b), nc = null 8446 }, 300) 8447 } 8448 } 8449 } 8450 }); 8451 var qc; 8452 ya("DesktopZoom", { 8453 publicMethods: { 8454 initDesktopZoom: function () { 8455 L || (G ? Ba("mouseUsed", function () { 8456 f.setupDesktopZoom() 8457 }) : f.setupDesktopZoom(!0)) 8458 }, 8459 setupDesktopZoom: function (b) { 8460 qc = {}; 8461 var c = "wheel mousewheel DOMMouseScroll"; 8462 Ba("bindEvents", function () { 8463 e.bind(a, c, f.handleMouseWheel) 8464 }), Ba("unbindEvents", function () { 8465 qc && e.unbind(a, c, f.handleMouseWheel) 8466 }), f.mouseZoomedIn = !1; 8467 var d, g = function () { 8468 f.mouseZoomedIn && (e.removeClass(a, "pswp--zoomed-in"), f.mouseZoomedIn = !1), 1 > s ? e.addClass(a, "pswp--zoom-allowed") : e.removeClass(a, "pswp--zoom-allowed"), h() 8469 }, 8470 h = function () { 8471 d && (e.removeClass(a, "pswp--dragging"), d = !1) 8472 }; 8473 Ba("resize", g), Ba("afterChange", g), Ba("pointerDown", function () { 8474 f.mouseZoomedIn && (d = !0, e.addClass(a, "pswp--dragging")) 8475 }), Ba("pointerUp", h), b || g() 8476 }, 8477 handleMouseWheel: function (a) { 8478 if (s <= f.currItem.fitRatio) return i.modal && (!i.closeOnScroll || $a || U ? a.preventDefault() : E && Math.abs(a.deltaY) > 2 && (l = !0, f.close())), !0; 8479 if (a.stopPropagation(), qc.x = 0, "deltaX" in a) 1 === a.deltaMode ? (qc.x = 18 * a.deltaX, qc.y = 18 * a.deltaY) : (qc.x = a.deltaX, qc.y = a.deltaY); 8480 else if ("wheelDelta" in a) a.wheelDeltaX && (qc.x = -.16 * a.wheelDeltaX), a.wheelDeltaY ? qc.y = -.16 * a.wheelDeltaY : qc.y = -.16 * a.wheelDelta; 8481 else { 8482 if (!("detail" in a)) return; 8483 qc.y = a.detail 8484 } 8485 Ra(s, !0); 8486 var b = oa.x - qc.x, 8487 c = oa.y - qc.y; 8488 (i.modal || b <= ca.min.x && b >= ca.max.x && c <= ca.min.y && c >= ca.max.y) && a.preventDefault(), f.panTo(b, c) 8489 }, 8490 toggleDesktopZoom: function (b) { 8491 b = b || { 8492 x: pa.x / 2 + ra.x, 8493 y: pa.y / 2 + ra.y 8494 }; 8495 var c = i.getDoubleTapZoom(!0, f.currItem), 8496 d = s === c; 8497 f.mouseZoomedIn = !d, f.zoomTo(d ? f.currItem.initialZoomLevel : c, b, 333), e[(d ? "remove" : "add") + "Class"](a, "pswp--zoomed-in") 8498 } 8499 } 8500 }); 8501 var rc, sc, tc, uc, vc, wc, xc, yc, zc, Ac, Bc, Cc, Dc = { 8502 history: !0, 8503 galleryUID: 1 8504 }, 8505 Ec = function () { 8506 return Bc.hash.substring(1) 8507 }, 8508 Fc = function () { 8509 rc && clearTimeout(rc), tc && clearTimeout(tc) 8510 }, 8511 Gc = function () { 8512 var a = Ec(), 8513 b = {}; 8514 if (a.length < 5) return b; 8515 var c, d = a.split("&"); 8516 for (c = 0; c < d.length; c++) 8517 if (d[c]) { 8518 var e = d[c].split("="); 8519 e.length < 2 || (b[e[0]] = e[1]) 8520 } 8521 if (i.galleryPIDs) { 8522 var f = b.pid; 8523 for (b.pid = 0, c = 0; c < Xb.length; c++) 8524 if (Xb[c].pid === f) { 8525 b.pid = c; 8526 break 8527 } 8528 } else b.pid = parseInt(b.pid, 10) - 1; 8529 return b.pid < 0 && (b.pid = 0), b 8530 }, 8531 Hc = function () { 8532 if (tc && clearTimeout(tc), $a || U) return void(tc = setTimeout(Hc, 500)); 8533 uc ? clearTimeout(sc) : uc = !0; 8534 var a = m + 1, 8535 b = $b(m); 8536 b.hasOwnProperty("pid") && (a = b.pid); 8537 var c = xc + "&gid=" + i.galleryUID + "&pid=" + a; 8538 yc || -1 === Bc.hash.indexOf(c) && (Ac = !0); 8539 var d = Bc.href.split("#")[0] + "#" + c; 8540 Cc ? "#" + c !== window.location.hash && history[yc ? "replaceState" : "pushState"]("", document.title, d) : yc ? Bc.replace(d) : Bc.hash = c, yc = !0, sc = setTimeout(function () { 8541 uc = !1 8542 }, 60) 8543 }; 8544 ya("History", { 8545 publicMethods: { 8546 initHistory: function () { 8547 if (e.extend(i, Dc, !0), i.history) { 8548 Bc = window.location, Ac = !1, zc = !1, yc = !1, xc = Ec(), Cc = "pushState" in history, xc.indexOf("gid=") > -1 && (xc = xc.split("&gid=")[0], xc = xc.split("?gid=")[0]), Ba("afterChange", f.updateURL), Ba("unbindEvents", function () { 8549 e.unbind(window, "hashchange", f.onHashChange) 8550 }); 8551 var a = function () { 8552 wc = !0, zc || (Ac ? history.back() : xc ? Bc.hash = xc : Cc ? history.pushState("", document.title, Bc.pathname + Bc.search) : Bc.hash = ""), Fc() 8553 }; 8554 Ba("unbindEvents", function () { 8555 l && a() 8556 }), Ba("destroy", function () { 8557 wc || a() 8558 }), Ba("firstUpdate", function () { 8559 m = Gc().pid 8560 }); 8561 var b = xc.indexOf("pid="); 8562 b > -1 && (xc = xc.substring(0, b), "&" === xc.slice(-1) && (xc = xc.slice(0, -1))), setTimeout(function () { 8563 j && e.bind(window, "hashchange", f.onHashChange) 8564 }, 40) 8565 } 8566 }, 8567 onHashChange: function () { 8568 return Ec() === xc ? (zc = !0, void f.close()) : void(uc || (vc = !0, f.goTo(Gc().pid), vc = !1)) 8569 }, 8570 updateURL: function () { 8571 Fc(), vc || (yc ? rc = setTimeout(Hc, 800) : Hc()) 8572 } 8573 } 8574 }), e.extend(f, db) 8575 }; 8576 return a 8577}); 8578 8579/*! PhotoSwipe Default UI - 4.1.1 - 2015-12-24 8580 * http://photoswipe.com 8581 * Copyright (c) 2015 Dmitry Semenov; */ 8582! function (a, b) { 8583 "function" == typeof define && define.amd ? define(b) : "object" == typeof exports ? module.exports = b() : a.PhotoSwipeUI_Default = b() 8584}(this, function () { 8585 "use strict"; 8586 var a = function (a, b) { 8587 var c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v = this, 8588 w = !1, 8589 x = !0, 8590 y = !0, 8591 z = { 8592 barsSize: { 8593 top: 44, 8594 bottom: "auto" 8595 }, 8596 closeElClasses: ["item", "caption", "zoom-wrap", "ui", "top-bar"], 8597 timeToIdle: 4e3, 8598 timeToIdleOutside: 1e3, 8599 loadingIndicatorDelay: 1e3, 8600 addCaptionHTMLFn: function (a, b) { 8601 return a.title ? (b.children[0].innerHTML = a.title, !0) : (b.children[0].innerHTML = "", !1) 8602 }, 8603 closeEl: !0, 8604 captionEl: !0, 8605 fullscreenEl: !0, 8606 zoomEl: !0, 8607 shareEl: !0, 8608 counterEl: !0,
8609 arrowEl: !0, 8610 preloaderEl: !0, 8611 tapToClose: !1, 8612 tapToToggleControls: !0, 8613 clickToCloseNonZoomable: !0, 8614 shareButtons: [{ 8615 id: "facebook", 8616 label: "Share on Facebook", 8617 url: "https://www.facebook.com/sharer/sharer.php?u={{url}}" 8618 }, { 8619 id: "twitter", 8620 label: "Tweet", 8621 url: "https://twitter.com/intent/tweet?text={{text}}&url={{url}}" 8622 }, { 8623 id: "pinterest", 8624 label: "Pin it", 8625 url: "http://www.pinterest.com/pin/create/button/?url={{url}}&media={{image_url}}&description={{text}}" 8626 }, { 8627 id: "download", 8628 label: "Download image", 8629 url: "{{raw_image_url}}", 8630 download: !0 8631 }], 8632 getImageURLForShare: function () { 8633 return a.currItem.src || "" 8634 }, 8635 getPageURLForShare: function () { 8636 return window.location.href 8637 }, 8638 getTextForShare: function () { 8639 return a.currItem.title || "" 8640 }, 8641 indexIndicatorSep: " / ", 8642 fitControlsWidth: 1200 8643 }, 8644 A = function (a) { 8645 if (r) return !0; 8646 a = a || window.event, q.timeToIdle && q.mouseUsed && !k && K(); 8647 for (var c, d, e = a.target || a.srcElement, f = e.getAttribute("class") || "", g = 0; g < S.length; g++) c = S[g], c.onTap && f.indexOf("pswp__" + c.name) > -1 && (c.onTap(), d = !0); 8648 if (d) { 8649 a.stopPropagation && a.stopPropagation(), r = !0; 8650 var h = b.features.isOldAndroid ? 600 : 30; 8651 s = setTimeout(function () { 8652 r = !1 8653 }, h) 8654 } 8655 }, 8656 B = function () { 8657 return !a.likelyTouchDevice || q.mouseUsed || screen.width > q.fitControlsWidth 8658 }, 8659 C = function (a, c, d) { 8660 b[(d ? "add" : "remove") + "Class"](a, "pswp__" + c) 8661 }, 8662 D = function () { 8663 var a = 1 === q.getNumItemsFn(); 8664 a !== p && (C(d, "ui--one-slide", a), p = a) 8665 }, 8666 E = function () { 8667 C(i, "share-modal--hidden", y) 8668 }, 8669 F = function () { 8670 return y = !y, y ? (b.removeClass(i, "pswp__share-modal--fade-in"), setTimeout(function () { 8671 y && E() 8672 }, 300)) : (E(), setTimeout(function () { 8673 y || b.addClass(i, "pswp__share-modal--fade-in") 8674 }, 30)), y || H(), !1 8675 }, 8676 G = function (b) { 8677 b = b || window.event; 8678 var c = b.target || b.srcElement; 8679 return a.shout("shareLinkClick", b, c), c.href ? c.hasAttribute("download") ? !0 : (window.open(c.href, "pswp_share", "scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,top=100,left=" + (window.screen ? Math.round(screen.width / 2 - 275) : 100)), y || F(), !1) : !1 8680 }, 8681 H = function () { 8682 for (var a, b, c, d, e, f = "", g = 0; g < q.shareButtons.length; g++) a = q.shareButtons[g], c = q.getImageURLForShare(a), d = q.getPageURLForShare(a), e = q.getTextForShare(a), b = a.url.replace("{{url}}", encodeURIComponent(d)).replace("{{image_url}}", encodeURIComponent(c)).replace("{{raw_image_url}}", c).replace("{{text}}", encodeURIComponent(e)), f += '<a href="' + b + '" target="_blank" class="pswp__share--' + a.id + '"' + (a.download ? "download" : "") + ">" + a.label + "</a>", q.parseShareButtonOut && (f = q.parseShareButtonOut(a, f)); 8683 i.children[0].innerHTML = f, i.children[0].onclick = G 8684 }, 8685 I = function (a) { 8686 for (var c = 0; c < q.closeElClasses.length; c++) 8687 if (b.hasClass(a, "pswp__" + q.closeElClasses[c])) return !0 8688 }, 8689 J = 0, 8690 K = function () { 8691 clearTimeout(u), J = 0, k && v.setIdle(!1) 8692 }, 8693 L = function (a) { 8694 a = a ? a : window.event; 8695 var b = a.relatedTarget || a.toElement; 8696 b && "HTML" !== b.nodeName || (clearTimeout(u), u = setTimeout(function () { 8697 v.setIdle(!0) 8698 }, q.timeToIdleOutside)) 8699 }, 8700 M = function () { 8701 q.fullscreenEl && !b.features.isOldAndroid && (c || (c = v.getFullscreenAPI()), c ? (b.bind(document, c.eventK, v.updateFullscreen), v.updateFullscreen(), b.addClass(a.template, "pswp--supports-fs")) : b.removeClass(a.template, "pswp--supports-fs")) 8702 }, 8703 N = function () { 8704 q.preloaderEl && (O(!0), l("beforeChange", function () { 8705 clearTimeout(o), o = setTimeout(function () { 8706 a.currItem && a.currItem.loading ? (!a.allowProgressiveImg() || a.currItem.img && !a.currItem.img.naturalWi
8706dth) && O(!1) : O(!0) 8707 }, q.loadingIndicatorDelay) 8708 }), l("imageLoadComplete", function (b, c) { 8709 a.currItem === c && O(!0) 8710 })) 8711 }, 8712 O = function (a) { 8713 n !== a && (C(m, "preloader--active", !a), n = a) 8714 }, 8715 P = function (a) { 8716 var c = a.vGap; 8717 if (B()) { 8718 var g = q.barsSize; 8719 if (q.captionEl && "auto" === g.bottom) 8720 if (f || (f = b.createEl("pswp__caption pswp__caption--fake"), f.appendChild(b.createEl("pswp__caption__center")), d.insertBefore(f, e), b.addClass(d, "pswp__ui--fit")), q.addCaptionHTMLFn(a, f, !0)) { 8721 var h = f.clientHeight; 8722 c.bottom = parseInt(h, 10) || 44 8723 } else c.bottom = g.top; 8724 else c.bottom = "auto" === g.bottom ? 0 : g.bottom; 8725 c.top = g.top 8726 } else c.top = c.bottom = 0 8727 }, 8728 Q = function () { 8729 q.timeToIdle && l("mouseUsed", function () { 8730 b.bind(document, "mousemove", K), b.bind(document, "mouseout", L), t = setInterval(function () { 8731 J++, 2 === J && v.setIdle(!0) 8732 }, q.timeToIdle / 2) 8733 }) 8734 }, 8735 R = function () { 8736 l("onVerticalDrag", function (a) { 8737 x && .95 > a ? v.hideControls() : !x && a >= .95 && v.showControls() 8738 }); 8739 var a; 8740 l("onPinchClose", function (b) { 8741 x && .9 > b ? (v.hideControls(), a = !0) : a && !x && b > .9 && v.showControls() 8742 }), l("zoomGestureEnded", function () { 8743 a = !1, a && !x && v.showControls() 8744 }) 8745 }, 8746 S = [{ 8747 name: "caption", 8748 option: "captionEl", 8749 onInit: function (a) { 8750 e = a 8751 } 8752 }, { 8753 name: "share-modal", 8754 option: "shareEl", 8755 onInit: function (a) { 8756 i = a 8757 }, 8758 onTap: function () { 8759 F() 8760 } 8761 }, { 8762 name: "button--share", 8763 option: "shareEl", 8764 onInit: function (a) { 8765 h = a 8766 }, 8767 onTap: function () { 8768 F() 8769 } 8770 }, { 8771 name: "button--zoom", 8772 option: "zoomEl", 8773 onTap: a.toggleDesktopZoom 8774 }, { 8775 name: "counter", 8776 option: "counterEl", 8777 onInit: function (a) { 8778 g = a 8779 } 8780 }, { 8781 name: "button--close", 8782 option: "closeEl", 8783 onTap: a.close 8784 }, { 8785 name: "button--arrow--left", 8786 option: "arrowEl", 8787 onTap: a.prev 8788 }, { 8789 name: "button--arrow--right", 8790 option: "arrowEl", 8791 onTap: a.next 8792 }, { 8793 name: "button--fs", 8794 option: "fullscreenEl", 8795 onTap: function () { 8796 c.isFullscreen() ? c.exit() : c.enter() 8797 } 8798 }, { 8799 name: "preloader", 8800 option: "preloaderEl", 8801 onInit: function (a) { 8802 m = a 8803 } 8804 }], 8805 T = function () { 8806 var a, c, e, f = function (d) { 8807 if (d) 8808 for (var f = d.length, g = 0; f > g; g++) { 8809 a = d[g], c = a.className; 8810 for (var h = 0; h < S.length; h++) e = S[h], c.indexOf("pswp__" + e.name) > -1 && (q[e.option] ? (b.removeClass(a, "pswp__element--disabled"), e.onInit && e.onInit(a)) : b.addClass(a, "pswp__element--disabled")) 8811 } 8812 }; 8813 f(d.children); 8814 var g = b.getChildByClass(d, "pswp__top-bar"); 8815 g && f(g.children) 8816 }; 8817 v.init = function () { 8818 b.extend(a.options, z, !0), q = a.options, d = b.getChildByClass(a.scrollWrap, "psw
8818p__ui"), l = a.listen, R(), l("beforeChange", v.update), l("doubleTap", function (b) { 8819 var c = a.currItem.initialZoomLevel; 8820 a.getZoomLevel() !== c ? a.zoomTo(c, b, 333) : a.zoomTo(q.getDoubleTapZoom(!1, a.currItem), b, 333) 8821 }), l("preventDragEvent", function (a, b, c) { 8822 var d = a.target || a.srcElement; 8823 d && d.getAttribute("class") && a.type.indexOf("mouse") > -1 && (d.getAttribute("class").indexOf("__caption") > 0 || /(SMALL|STRONG|EM)/i.test(d.tagName)) && (c.prevent = !1) 8824 }), l("bindEvents", function () { 8825 b.bind(d, "pswpTap click", A), b.bind(a.scrollWrap, "pswpTap", v.onGlobalTap), a.likelyTouchDevice || b.bind(a.scrollWrap, "mouseover", v.onMouseOver) 8826 }), l("unbindEvents", function () { 8827 y || F(), t && clearInterval(t), b.unbind(document, "mouseout", L), b.unbind(document, "mousemove", K), b.unbind(d, "pswpTap click", A), b.unbind(a.scrollWrap, "pswpTap", v.onGlobalTap), b.unbind(a.scrollWrap, "mouseover", v.onMouseOver), c && (b.unbind(document, c.eventK, v.updateFullscreen), c.isFullscreen() && (q.hideAnimationDuration = 0, c.exit()), c = null) 8828 }), l("destroy", function () { 8829 q.captionEl && (f && d.removeChild(f), b.removeClass(e, "pswp__caption--empty")), i && (i.children[0].onclick = null), b.removeClass(d, "pswp__ui--over-close"), b.addClass(d, "pswp__ui--hidden"), v.setIdle(!1) 8830 }), q.showAnimationDuration || b.removeClass(d, "pswp__ui--hidden"), l("initialZoomIn", function () { 8831 q.showAnimationDuration && b.removeClass(d, "pswp__ui--hidden") 8832 }), l("initialZoomOut", function () { 8833 b.addClass(d, "pswp__ui--hidden") 8834 }), l("parseVerticalMargin", P), T(), q.shareEl && h && i && (y = !0), D(), Q(), M(), N() 8835 }, v.setIdle = function (a) { 8836 k = a, C(d, "ui--idle", a) 8837 }, v.update = function () { 8838 x && a.currItem ? (v.updateIndexIndicator(), q.captionEl && (q.addCaptionHTMLFn(a.currItem, e), C(e, "caption--empty", !a.currItem.title)), w = !0) : w = !1, y || F(), D() 8839 }, v.updateFullscreen = function (d) { 8840 d && setTimeout(function () { 8841 a.setScrollOffset(0, b.getScrollY()) 8842 }, 50), b[(c.isFullscreen() ? "add" : "remove") + "Class"](a.template, "pswp--fs") 8843 }, v.updateIndexIndicator = function () { 8844 q.counterEl && (g.innerHTML = a.getCurrentIndex() + 1 + q.indexIndicatorSep + q.getNumItemsFn()) 8845 }, v.onGlobalTap = function (c) { 8846 c = c || window.event; 8847 var d = c.target || c.srcElement; 8848 if (!r) 8849 if (c.detail && "mouse" === c.detail.pointerType) { 8850 if (I(d)) return void a.close(); 8851 b.hasClass(d, "pswp__img") && (1 === a.getZoomLevel() && a.getZoomLevel() <= a.currItem.fitRatio ? q.clickToCloseNonZoomable && a.close() : a.toggleDesktopZoom(c.detail.releasePoint)) 8852 } else if (q.tapToToggleControls && (x ? v.hideControls() : v.showControls()), q.tapToClose && (b.hasClass(d, "pswp__img") || I(d))) return void a.close() 8853 }, v.onMouseOver = function (a) { 8854 a = a || window.event; 8855 var b = a.target || a.srcElement; 8856 C(d, "ui--over-close", I(b)) 8857 }, v.hideControls = function () { 8858 b.addClass(d, "pswp__ui--hidden"), x = !1 8859 }, v.showControls = function () { 8860 x = !0, w || v.update(), b.removeClass(d, "pswp__ui--hidden") 8861 }, v.supportsFullscreen = function () { 8862 var a = document; 8863 return !!(a.exitFullscreen || a.mozCancelFullScreen || a.webkitExitFullscreen || a.msExitFullscreen) 8864 }, v.getFullscreenAPI = function () { 8865 var b, c = document.documentElement, 8866 d = "fullscreenchange"; 8867 return c.requestFullscreen ? b = { 8868 enterK: "requestFullscreen", 8869 exitK: "exitFullscreen", 8870 elementK: "fullscreenElement", 8871 eventK: d 8872 } : c.mozRequestFullScreen ? b = { 8873 enterK: "mozRequestFullScreen", 8874 exitK: "mozCancelFullScreen", 8875 elementK: "mozFullScreenElement", 8876 eventK: "moz" + d 8877 } : c.webkitRequestFullscreen ? b = { 8878 enterK: "webkitRequestFullscreen", 8879 exitK: "webkitExitFullscreen", 8880 elementK: "webkitFullscreenElement", 8881 eventK: "webkit" + d 8882 } : c.msRequestFullscreen && (b = { 8883 enterK: "msRequestFullscreen", 8884 exitK: "msExitFullscreen", 8885 elementK: "msFullscreenElement", 8886 eventK: "MSFullscreenChange" 8887 }), b && (b.enter = function () { 8888 return j = q.closeOnScroll, q.closeOnScroll = !1, "webkitRequestFullscreen" !== this.enterK ? a.template[this.enterK]() : void a.template[this.enterK](Element.ALLOW_KEYBOARD_INPUT) 8889 }, b.exit = function () { 8890 return q.closeOnScroll = j, document[this.exitK]() 8891 }, b.isFullscreen = function () { 8892 return document[this.elementK] 8893 }), b 8894 } 8895 }; 8896 return a 8897}); 8898 8899var initPhotoSwipeFromDOM = function (gallerySelector) { 8900 8901 // parse slide data (url, title, size ...) from DOM elements 8902 // (children of gallerySelector) 8903 var parseThumbnailElements = function (el) { 8904 var thumbElements = el.childNodes, 8905 numNodes = thumbElements.length, 8906 items = [], 8907 figureEl, 8908 linkEl, 8909 size, 8910 item; 8911 8912 for (var i = 0; i < numNodes; i++) { 8913 8914 figureEl = thumbElements[i]; // <figure> element 8915 8916 // include only element nodes 8917 if (figureEl.nodeType !== 1) { 8918 continue; 8919 } 8920 8921 linkEl = figureEl.children[0]; // <a> element 8922 8923 size = linkEl.getAttribute('data-size').split('x'); 8924 8925 // create slide object 8926 item = { 8927 src: linkEl.getAttribute('href'), 8928 w: parseInt(size[0], 10), 8929 h: parseInt(size[1], 10) 8930 }; 8931 8932 8933 8934 if (figureEl.children.length > 1) { 8935 // <figcaption> content 8936 item.title = figureEl.children[1].innerHTML; 8937 } 8938 8939 if (linkEl.children.length > 0) { 8940 // <img> thumbnail element, retrieving thumbnail url 8941 item.msrc = linkEl.children[0].getAttribute('src'); 8942 } 8943 8944 item.el = figureEl; // save link to element for getThumbBoundsFn 8945 items.push(item); 8946 } 8947 8948 return items; 8949 }; 8950 8951 // find nearest parent element 8952 var closest = function closest(el, fn) { 8953 return el && (fn(el) ? el : closest(el.parentNode, fn)); 8954 }; 8955 8956 // triggers when user clicks on thumbnail 8957 var onThumbnailsClick = function (e) { 8958 e = e || window.event; 8959 e.preventDefault ? e.preventDefault() : e.returnValue = false;
8960 8961 var eTarget = e.target || e.srcElement; 8962 8963 // find root element of slide 8964 var clickedListItem = closest(eTarget, function (el) { 8965 return (el.tagName && el.tagName.toUpperCase() === 'FIGURE'); 8966 }); 8967 8968 if (!clickedListItem) { 8969 return; 8970 } 8971 8972 // find index of clicked item by looping through all child nodes 8973 // alternatively, you may define index via data- attribute 8974 var clickedGallery = clickedListItem.parentNode, 8975 childNodes = clickedListItem.parentNode.childNodes, 8976 numChildNodes = childNodes.length, 8977 nodeIndex = 0, 8978 index; 8979 8980 for (var i = 0; i < numChildNodes; i++) { 8981 if (childNodes[i].nodeType !== 1) { 8982 continue; 8983 } 8984 8985 if (childNodes[i] === clickedListItem) { 8986 index = nodeIndex; 8987 break; 8988 } 8989 nodeIndex++; 8990 } 8991 8992 8993 8994 if (index >= 0) { 8995 // open PhotoSwipe if valid index found 8996 openPhotoSwipe(index, clickedGallery); 8997 } 8998 return false; 8999 }; 9000 9001 // parse picture index and gallery index from URL (#&pid=1&gid=2) 9002 var photoswipeParseHash = function () { 9003 var hash = window.location.hash.substring(1), 9004 params = {}; 9005 9006 if (hash.length < 5) { 9007 return params; 9008 } 9009 9010 var vars = hash.split('&'); 9011 for (var i = 0; i < vars.length; i++) { 9012 if (!vars[i]) { 9013 continue; 9014 } 9015 var pair = vars[i].split('='); 9016 if (pair.length < 2) { 9017 continue; 9018 } 9019 params[pair[0]] = pair[1]; 9020 } 9021 9022 if (params.gid) { 9023 params.gid = parseInt(params.gid, 10); 9024 } 9025 9026 return params; 9027 }; 9028 9029 var openPhotoSwipe = function (index, galleryElement, disableAnimation, fromURL) { 9030 var pswpElement = document.querySelectorAll('.pswp')[0], 9031 gallery, 9032 options, 9033 items; 9034 9035 items = parseThumbnailElements(galleryElement); 9036 9037 // define options (if needed) 9038 options = { 9039 9040 // define gallery index (for URL) 9041 galleryUID: galleryElement.getAttribute('data-pswp-uid'), 9042 9043 getThumbBoundsFn: function (index) { 9044 // See Options -> getThumbBoundsFn section of documentation for more info 9045 var thumbnail = items[index].el.getElementsByTagName('img')[0], // find thumbnail 9046 pageYScroll = window.pageYOffset || document.documentElement.scrollTop, 9047 rect = thumbnail.getBoundingClientRect(); 9048 9049 return { 9050 x: rect.left, 9051 y: rect.top + pageYScroll, 9052 w: rect.width 9053 }; 9054 } 9055 9056 }; 9057 9058 // PhotoSwipe opened from URL 9059 if (fromURL) { 9060 if (options.galleryPIDs) { 9061 // parse real index when custom PIDs are used 9062 // http://photoswipe.com/documentation/faq.html#custom-pid-in-url 9063 for (var j = 0; j < items.length; j++) { 9064 if (items[j].pid == index) { 9065 options.index = j; 9066 break; 9067 } 9068 } 9069 } else { 9070 // in URL indexes start from 1 9071 options.index = parseInt(index, 10) - 1; 9072 } 9073 } else { 9074 options.index = parseInt(index, 10); 9075 } 9076 9077 // exit if index not found 9078 if (isNaN(options.index)) { 9079 return; 9080 } 9081 9082 if (disableAnimation) { 9083 options.showAnimationDuration = 0; 9084 } 9085 9086 // Pass data to PhotoSwipe and initialize it 9087 gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, options); 9088 gallery.init(); 9089 }; 9090 9091 // loop through all gallery elements and bind events 9092 var galleryElements = document.querySelectorAll(gallerySelector); 9093 9094 for (var i = 0, l = galleryElements.length; i < l; i++) { 9095 galleryElements[i].setAttribute('data-pswp-uid', i + 1); 9096 galleryElements[i].onclick = onThumbnailsClick; 9097 } 9098 9099 // Parse URL and open gallery if it contains #&pid=3&gid=1 9100 var hashData = photoswipeParseHash(); 9101 if (hashData.pid && hashData.gid) { 9102 openPhotoSwipe(hashData.pid, galleryElements[hashData.gid - 1], true, true); 9103 } 9104}; 9105 9106// execute above function 9107initPhotoSwipeFromDOM('.mdb-lightbox'); 9108"use strict"; 9109 9110function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 9111 9112function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 9113 9114function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 9115 9116(function ($) { 9117 var DEFAULT_TOP_SPACING = 0; 9118 9119 var Sticky = 9120 /*#__PURE__*/ 9121 function () { 9122 function Sticky(element, options) { 9123 _classCallCheck(this, Sticky); 9124 9125 this.defaults = { 9126 topSpacing: DEFAULT_TOP_SPACING,
9127 zIndex: false, 9128 stopper: '#footer', 9129 stickyClass: false, 9130 startScrolling: 'top', 9131 minWidth: false 9132 }; 9133 this.$element = element; 9134 this.options = this.assignOptions(options); 9135 this.$window = $(window); 9136 this.stopper = this.options.stopper; 9137 this.elementWidth = this.$element.outerWidth(); 9138 this.elementHeight = this.$element.outerHeight(true); 9139 this.$placeholder = $('<div class="sticky-placeholder"></div>'); 9140 this.scrollTop = 0; 9141 this.setPushPoint(); 9142 this.setStopperPosition(); 9143 this.bindEvents(); 9144 } 9145 9146 _createClass(Sticky, [{ 9147 key: "assignOptions", 9148 value: function assignOptions(options) { 9149 return $.extend({}, this.defaults, options); 9150 } 9151 }, { 9152 key: "bindEvents", 9153 value: function bindEvents() { 9154 this.$window.on('resize', this.handleResize.bind(this)); 9155 this.$window.on('scroll', this.init.bind(this)); 9156 } 9157 }, { 9158 key: "hasZIndex", 9159 value: function hasZIndex() { 9160 return typeof this.options.zIndex === 'number'; 9161 } 9162 }, { 9163 key: "hasStopper", 9164 value: function hasStopper() { 9165 return $(this.options.stopper).length || typeof this.options.stopper === 'number'; 9166 } 9167 }, { 9168 key: "isScreenHeightEnough", 9169 value: function isScreenHeightEnough() { 9170 return this.$element.outerHeight() + this.options.topSpacing < this.$window.height(); 9171 } 9172 }, { 9173 key: "setStopperPosition", 9174 value: function setStopperPosition() { 9175 if (typeof this.options.stopper === 'string') { 9176 this.stopPoint = $(this.stopper).offset().top - this.options.topSpacing; 9177 } else if (typeof this.options.stopper === 'number') { 9178 this.stopPoint = this.options.stopper; 9179 } 9180 } 9181 }, { 9182 key: "setPushPoint", 9183 value: function setPushPoint() { 9184 if (this.options.startScrolling === 'bottom' && !this.isScreenHeightEnough()) { 9185 this.$pushPoint = this.$element.offset().top + this.$element.outerHeight(true) - this.$window.height(); 9186 } else { 9187 this.$pushPoint = this.$element.offset().top - this.options.topSpacing; 9188 } 9189 } 9190 }, { 9191 key: "handleResize", 9192 value: function handleResize() { 9193 this.elementWidth = this.$element.outerWidth(); 9194 this.elementHeight = this.$element.outerHeight(true); 9195 this.setPushPoint(); 9196 this.setStopperPosition(); 9197 this.init(); 9198 } 9199 }, { 9200 key: "init", 9201 value: function init() { 9202 if (this.options.minWidth && this.options.minWidth > this.$window.innerWidth()) { 9203 return false; 9204 } 9205 9206 if (this.options.startScrolling === 'bottom' && !this.isScreenHeightEnough()) { 9207 this.scrollTop = this.$window.scrollTop() + this.$window.height(); 9208 } else { 9209 this.scrollTop = this.$window.scrollTop(); 9210 } 9211 9212 if (this.$pushPoint < this.scrollTop) { 9213 this.appendPlaceholder(); 9214 this.stickyStart(); 9215 } else { 9216 this.stickyEnd(); 9217 } 9218 9219 if (this.$window.scrollTop() > this.$pushPoint) { 9220 this.stop(); 9221 } else { 9222 this.stickyEnd(); 9223 } 9224 } 9225 }, { 9226 key: "appendPlaceholder", 9227 value: function appendPlaceholder() { 9228 this.$element.after(this.$placeholder); 9229 this.$placeholder.css({ 9230 width: this.elementWidth, 9231 height: this.elementHeight 9232 }); 9233 } 9234 }, { 9235 key: "stickyStart", 9236 value: function stickyStart() { 9237 if (this.options.stickyClass) { 9238 this.$element.addClass(this.options.stickyClass); 9239 } // @see: https://stackoverflow.com/a/4370047 9240 9241 9242 this.$element.get(0).style.overflow = 'scroll'; 9243 var scrollHeight = this.$element.get(0).scrollHeight; 9244 this.$element.get(0).style.overflow = ''; 9245 this.$element.css({ 9246 'position': 'fixed', 9247 'width': this.elementWidth, 9248 'height': scrollHeight 9249 }); 9250 9251 if (this.options.startScrolling === 'bottom' && !this.isScreenHeightEnough()) { 9252 this.$element.css({ 9253 bottom: 0, 9254 top: '' 9255 }); 9256 } else { 9257 this.$element.css({ 9258 top: this.options.topSpacing 9259 }); 9260 } 9261 9262 if (this.hasZIndex()) { 9263 this.$element.css({ 9264 zIndex: this.options.zIndex 9265 }); 9266 } 9267 } 9268 }, { 9269 key: "stickyEnd", 9270 value: function stickyEnd() { 9271 if (this.options.stickyClass) { 9272 this.$element.removeClass(this.options.stickyClass); 9273 } 9274 9275 this.$placeholder.remove(); 9276 this.$element.css({ 9277 position: 'static', 9278 top: DEFAULT_TOP_SPACING 9279 }); 9280 } 9281 }, { 9282 key: "stop", 9283 value: function stop() { 9284 if (this.stopPoint < $(this.$element).offset().top + this.$element.outerHeight(true)) { 9285 this.$element.css({ 9286 position: 'absolute', 9287 bottom: 0, 9288 top: '' 9289 }); 9290 } 9291 } 9292 }]); 9293 9294 return Sticky; 9295 }(); 9296 9297 $.fn.sticky = function (options) { 9298 return this.each(function () { 9299 var $self = $(this); 9300 $(window).on('load', function () { 9301 var sticky = new Sticky($self, options); 9302 sticky.init(); 9303 }); 9304 }); 9305 }; 9306})(jQuery); 9307/*! 9308 * perfect-scrollbar v1.4.0 9309 * (c) 2018 Hyunje Jun 9310 * @license MIT 9311 */ 9312!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.PerfectScrollbar=e()}(this,function(){"use strict";function t(t){return getComputedStyle(t)}function e(t,e){for(var i in e){var r=e[i];"number"==typeof r&&(r+="px"),t.style[i]=r}return t}function i(t){var e=document.createElement("div");return e.className=t,e}function r(t,e){if(!v)throw new Error("No element matching method supported");return v.call(t,e)}function l(t){t.remove?t.remove():t.parentNode&&t.parentNode.removeChild(t)}function n(t,e){return Array.prototype.filter.call(t.children,function(t){return r(t,e)})}function o(t,e){var i=t.element.classList,r=m.state.scrolling(e);i.contains(r)?clearTimeout(Y[e]):i.add(r)}function s(t,e){Y[e]=setTimeout(function(){return t.isAlive&&t.element.classList.remove(m.state.scrolling(e))},t.settings.scrollingThreshold)}function a(t,e){o(t,e),s(t,e)}function c(t){if("function"==typeof window.CustomEvent)return new CustomEvent(t);var e=document.createEvent("CustomEvent");return e.initCustomEvent(t,!1,!1,void 0),e}
9312function h(t,e,i,r,l){var n=i[0],o=i[1],s=i[2],h=i[3],u=i[4],d=i[5];void 0===r&&(r=!0),void 0===l&&(l=!1);var f=t.element;t.reach[h]=null,f[s]<1&&(t.reach[h]="start"),f[s]>t[n]-t[o]-1&&(t.reach[h]="end"),e&&(f.dispatchEvent(c("ps-scroll-"+h)),e<0?f.dispatchEvent(c("ps-scroll-"+u)):e>0&&f.dispatchEvent(c("ps-scroll-"+d)),r&&a(t,h)),t.reach[h]&&(e||l)&&f.dispatchEvent(c("ps-"+h+"-reach-"+t.reach[h]))}function u(t){return parseInt(t,10)||0}function d(t){return r(t,"input,[contenteditable]")||r(t,"select,[contenteditable]")||r(t,"textarea,[contenteditable]")||r(t,"button,[contenteditable]")}function f(e){var i=t(e);return u(i.width)+u(i.paddingLeft)+u(i.paddingRight)+u(i.borderLeftWidth)+u(i.borderRightWidth)}function p(t,e){return t.settings.minScrollbarLength&&(e=Math.max(e,t.settings.minScrollbarLength)),t.settings.maxScrollbarLength&&(e=Math.min(e,t.settings.maxScrollbarLength)),e}function b(t,i){var r={width:i.railXWidth},l=Math.floor(t.scrollTop);i.isRtl?r.left=i.negativeScrollAdjustment+t.scrollLeft+i.containerWidth-i.contentWidth:r.left=t.scrollLeft,i.isScrollbarXUsingBottom?r.bottom=i.scrollbarXBottom-l:r.top=i.scrollbarXTop+l,e(i.scrollbarXRail,r);var n={top:l,height:i.railYHeight};i.isScrollbarYUsingRight?i.isRtl?n.right=i.contentWidth-(i.negativeScrollAdjustment+t.scrollLeft)-i.scrollbarYRight-i.scrollbarYOuterWidth:n.right=i.scrollbarYRight-t.scrollLeft:i.isRtl?n.left=i.negativeScrollAdjustment+t.scrollLeft+2*i.containerWidth-i.contentWidth-i.scrollbarYLeft-i.scrollbarYOuterWidth:n.left=i.scrollbarYLeft+t.scrollLeft,e(i.scrollbarYRail,n),e(i.scrollbarX,{left:i.scrollbarXLeft,width:i.scrollbarXWidth-i.railBorderXWidth}),e(i.scrollbarY,{top:i.scrollbarYTop,height:i.scrollbarYHeight-i.railBorderYWidth})}function g(t,e){function i(e){b[d]=g+Y*(e[a]-v),o(t,f),R(t),e.stopPropagation(),e.preventDefault()}function r(){s(t,f),t[p].classList.remove(m.state.clicking),t.event.unbind(t.ownerDocument,"mousemove",i)}var l=e[0],n=e[1],a=e[2],c=e[3],h=e[4],u=e[5],d=e[6],f=e[7],p=e[8],b=t.element,g=null,v=null,Y=null;t.event.bind(t[h],"mousedown",function(e){g=b[d],v=e[a],Y=(t[n]-t[l])/(t[c]-t[u]),t.event.bind(t.ownerDocument,"mousemove",i),t.event.once(t.ownerDocument,"mouseup",r),t[p].classList.add(m.state.clicking),e.stopPropagation(),e.preventDefault()})}var v="undefined"!=typeof Element&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector),m={main:"ps",element:{thumb:function(t){return"ps__thumb-"+t},rail:function(t){return"ps__rail-"+t},consuming:"ps__child--consume"},state:{focus:"ps--focus",clicking:"ps--clicking",active:function(t){return"ps--active-"+t},scrolling:function(t){return"ps--scrolling-"+t}}},Y={x:null,y:null},X=function(t){this.element=t,this.handlers={}},w={isEmpty:{configurable:!0}};X.prototype.bind=function(t,e){void 0===this.handlers[t]&&(this.handlers[t]=[]),this.handlers[t].push(e),this.element.addEventListener(t,e,!1)},X.prototype.unbind=function(t,e){var i=this;this.handlers[t]=this.handlers[t].filter(function(r){return!(!e||r===e)||(i.element.removeEventListener(t,r,!1),!1)})},X.prototype.unbindAll=function(){var t=this;for(var e in t.handlers)t.unbind(e)},w.isEmpty.get=function(){var t=this;return Object.keys(this.handlers).every(function(e){return 0===t.handlers[e].length})},Object.defineProperties(X.prototype,w);var y=function(){this.eventElements=[]};y.prototype.eventElement=function(t){var e=this.eventElements.filter(function(e){return e.element===t})[0];return e||(e=new X(t),this.eventElements.push(e)),e},y.prototype.bind=function(t,e,i){this.eventElement(t).bind(e,i)},y.prototype.unbind=function(t,e,i){var r=this.eventElement(t);r.unbind(e,i),r.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(r),1)},y.prototype.unbindAll=function(){this.eventElements.forEach(function(t){return t.unbindAll()}),this.eventElements=[]},y.prototype.once=function(t,e,i){var r=this.eventElement(t),l=function(t){r.unbind(e,l),i(t)};r.bind(e,l)};var W=function(t,e,i,r,l){void 0===r&&(r=!0),void 0===l&&(l=!1);var n;if("top"===e)n=["contentHeight","containerHeight","scrollTop","y","up","down"];else{if("left"!==e)throw new Error("A proper axis should be provided");n=["contentWidth","containerWidth","scrollLeft","x","left","right"]}h(t,i,n,r,l)},L={isWebKit:"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style,supportsTouch:"undefined"!=typeof window&&("ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:"undefined"!=typeof navigator&&navigator.msMaxTouchPoints,isChrome:"undefined"!=typeof navigator&&/Chrome/i.test(navigator&&navigator.userAgent)},R=function(t){var e=t.element,i=Math.floor(e.scrollTop);t.containerWidth=e.clientWidth,t.containerHeight=e.clientHeight,t.contentWidth=e.scrollWidth,t.contentHeight=e.scrollHeight,e.contains(t.scrollbarXRail)||(n(e,m.element.rail("x")).forEac
vendor: 4,493 bytes, line 9312
9312h(function(t){return l(t)}),e.appendChild(t.scrollbarXRail)),e.contains(t.scrollbarYRail)||(n(e,m.element.rail("y")).forEach(function(t){return l(t)}),e.appendChild(t.scrollbarYRail)),!t.settings.suppressScrollX&&t.containerWidth+t.settings.scrollXMarginOffset<t.contentWidth?(t.scrollbarXActive=!0,t.railXWidth=t.containerWidth-t.railXMarginWidth,t.railXRatio=t.containerWidth/t.railXWidth,t.scrollbarXWidth=p(t,u(t.railXWidth*t.containerWidth/t.contentWidth)),t.scrollbarXLeft=u((t.negativeScrollAdjustment+e.scrollLeft)*(t.railXWidth-t.scrollbarXWidth)/(t.contentWidth-t.containerWidth))):t.scrollbarXActive=!1,!t.settings.suppressScrollY&&t.containerHeight+t.settings.scrollYMarginOffset<t.contentHeight?(t.scrollbarYActive=!0,t.railYHeight=t.containerHeight-t.railYMarginHeight,t.railYRatio=t.containerHeight/t.railYHeight,t.scrollbarYHeight=p(t,u(t.railYHeight*t.containerHeight/t.contentHeight)),t.scrollbarYTop=u(i*(t.railYHeight-t.scrollbarYHeight)/(t.contentHeight-t.containerHeight))):t.scrollbarYActive=!1,t.scrollbarXLeft>=t.railXWidth-t.scrollbarXWidth&&(t.scrollbarXLeft=t.railXWidth-t.scrollbarXWidth),t.scrollbarYTop>=t.railYHeight-t.scrollbarYHeight&&(t.scrollbarYTop=t.railYHeight-t.scrollbarYHeight),b(e,t),t.scrollbarXActive?e.classList.add(m.state.active("x")):(e.classList.remove(m.state.active("x")),t.scrollbarXWidth=0,t.scrollbarXLeft=0,e.scrollLeft=0),t.scrollbarYActive?e.classList.add(m.state.active("y")):(e.classList.remove(m.state.active("y")),t.scrollbarYHeight=0,t.scrollbarYTop=0,e.scrollTop=0)},T={"click-rail":function(t){t.event.bind(t.scrollbarY,"mousedown",function(t){return t.stopPropagation()}),t.event.bind(t.scrollbarYRail,"mousedown",function(e){var i=e.pageY-window.pageYOffset-t.scrollbarYRail.getBoundingClientRect().top>t.scrollbarYTop?1:-1;t.element.scrollTop+=i*t.containerHeight,R(t),e.stopPropagation()}),t.event.bind(t.scrollbarX,"mousedown",function(t){return t.stopPropagation()}),t.event.bind(t.scrollbarXRail,"mousedown",function(e){var i=e.pageX-window.pageXOffset-t.scrollbarXRail.getBoundingClientRect().left>t.scrollbarXLeft?1:-1;t.element.scrollLeft+=i*t.containerWidth,R(t),e.stopPropagation()})},"drag-thumb":function(t){g(t,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),g(t,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])},keyboard:function(t){function e(e,r){var l=Math.floor(i.scrollTop);if(0===e){if(!t.scrollbarYActive)return!1;if(0===l&&r>0||l>=t.contentHeight-t.containerHeight&&r<0)return!t.settings.wheelPropagation}var n=i.scrollLeft;if(0===r){if(!t.scrollbarXActive)return!1;if(0===n&&e<0||n>=t.contentWidth-t.containerWidth&&e>0)return!t.settings.wheelPropagation}return!0}var i=t.element,l=function(){return r(i,":hover")},n=function(){return r(t.scrollbarX,":focus")||r(t.scrollbarY,":focus")};t.event.bind(t.ownerDocument,"keydown",function(r){if(!(r.isDefaultPrevented&&r.isDefaultPrevented()||r.defaultPrevented)&&(l()||n())){var o=document.activeElement?document.activeElement:t.ownerDocument.activeElement;if(o){if("IFRAME"===o.tagName)o=o.contentDocument.activeElement;else for(;o.shadowRoot;)o=o.shadowRoot.activeElement;if(d(o))return}var s=0,a=0;switch(r.which){case 37:s=r.metaKey?-t.contentWidth:r.altKey?-t.containerWidth:-30;break;case 38:a=r.metaKey?t.contentHeight:r.altKey?t.containerHeight:30;break;case 39:s=r.metaKey?t.contentWidth:r.altKey?t.containerWidth:30;break;case 40:a=r.metaKey?-t.contentHeight:r.altKey?-t.containerHeight:-30;break;case 32:a=r.shiftKey?t.containerHeight:-t.containerHeight;break;case 33:a=t.containerHeight;break;case 34:a=-t.containerHeight;break;case 36:a=t.contentHeight;break;case 35:a=-t.contentHeight;break;default:return}t.settings.suppressScrollX&&0!==s||t.settings.suppressScrollY&&0!==a||(i.scrollTop-=a,i.scrollLeft+=s,R(t),e(s,a)&&r.preventDefault())}})},wheel:function(e){function i(t,i){var r=Math.floor(o.scrollTop),l=0===o.scrollTop,n=r+o.offsetHeight===o.scrollHeight,s=0===o.scrollLeft,a=o.scrollLeft+o.offsetWidth===o.scrollWidth;return!(Math.abs(i)>Math.abs(t)?l||n:s||a)||!e.settings.wheelPropagation}function r(t){var e=t.deltaX,i=-1*t.deltaY;return void 0!==e&&void 0!==i||(e=-1*t.wheelDeltaX/6,i=t.wheelDeltaY/6),t.deltaMode&&1===t.deltaMode&&(e*=10,i*=10),e!==e&&i!==i&&(e=0,i=t.wheelDelta),t.shiftKey?[-i,-e]:[e,i]}function l(e,i,r){if(!L.isWebKit&&o.querySelector("select:focus"))return!0;
vendor: 6,046 bytes, line 9312
9312if(!o.contains(e))return!1;for(var l=e;l&&l!==o;){if(l.classList.contains(m.element.consuming))return!0;var n=t(l);if([n.overflow,n.overflowX,n.overflowY].join("").match(/(scroll|auto)/)){var s=l.scrollHeight-l.clientHeight;if(s>0&&!(0===l.scrollTop&&r>0||l.scrollTop===s&&r<0))return!0;var a=l.scrollWidth-l.clientWidth;if(a>0&&!(0===l.scrollLeft&&i<0||l.scrollLeft===a&&i>0))return!0}l=l.parentNode}return!1}function n(t){var n=r(t),s=n[0],a=n[1];if(!l(t.target,s,a)){var c=!1;e.settings.useBothWheelAxes?e.scrollbarYActive&&!e.scrollbarXActive?(a?o.scrollTop-=a*e.settings.wheelSpeed:o.scrollTop+=s*e.settings.wheelSpeed,c=!0):e.scrollbarXActive&&!e.scrollbarYActive&&(s?o.scrollLeft+=s*e.settings.wheelSpeed:o.scrollLeft-=a*e.settings.wheelSpeed,c=!0):(o.scrollTop-=a*e.settings.wheelSpeed,o.scrollLeft+=s*e.settings.wheelSpeed),R(e),(c=c||i(s,a))&&!t.ctrlKey&&(t.stopPropagation(),t.preventDefault())}}var o=e.element;void 0!==window.onwheel?e.event.bind(o,"wheel",n):void 0!==window.onmousewheel&&e.event.bind(o,"mousewheel",n)},touch:function(e){function i(t,i){var r=Math.floor(h.scrollTop),l=h.scrollLeft,n=Math.abs(t),o=Math.abs(i);if(o>n){if(i<0&&r===e.contentHeight-e.containerHeight||i>0&&0===r)return 0===window.scrollY&&i>0&&L.isChrome}else if(n>o&&(t<0&&l===e.contentWidth-e.containerWidth||t>0&&0===l))return!0;return!0}function r(t,i){h.scrollTop-=i,h.scrollLeft-=t,R(e)}function l(t){return t.targetTouches?t.targetTouches[0]:t}function n(t){return!(t.pointerType&&"pen"===t.pointerType&&0===t.buttons||(!t.targetTouches||1!==t.targetTouches.length)&&(!t.pointerType||"mouse"===t.pointerType||t.pointerType===t.MSPOINTER_TYPE_MOUSE))}function o(t){if(n(t)){var e=l(t);u.pageX=e.pageX,u.pageY=e.pageY,d=(new Date).getTime(),null!==p&&clearInterval(p)}}function s(e,i,r){if(!h.contains(e))return!1;for(var l=e;l&&l!==h;){if(l.classList.contains(m.element.consuming))return!0;var n=t(l);if([n.overflow,n.overflowX,n.overflowY].join("").match(/(scroll|auto)/)){var o=l.scrollHeight-l.clientHeight;if(o>0&&!(0===l.scrollTop&&r>0||l.scrollTop===o&&r<0))return!0;var s=l.scrollLeft-l.clientWidth;if(s>0&&!(0===l.scrollLeft&&i<0||l.scrollLeft===s&&i>0))return!0}l=l.parentNode}return!1}function a(t){if(n(t)){var e=l(t),o={pageX:e.pageX,pageY:e.pageY},a=o.pageX-u.pageX,c=o.pageY-u.pageY;if(s(t.target,a,c))return;r(a,c),u=o;var h=(new Date).getTime(),p=h-d;p>0&&(f.x=a/p,f.y=c/p,d=h),i(a,c)&&t.preventDefault()}}function c(){e.settings.swipeEasing&&(clearInterval(p),p=setInterval(function(){e.isInitialized?clearInterval(p):f.x||f.y?Math.abs(f.x)<.01&&Math.abs(f.y)<.01?clearInterval(p):(r(30*f.x,30*f.y),f.x*=.8,f.y*=.8):clearInterval(p)},10))}if(L.supportsTouch||L.supportsIePointer){var h=e.element,u={},d=0,f={},p=null;L.supportsTouch?(e.event.bind(h,"touchstart",o),e.event.bind(h,"touchmove",a),e.event.bind(h,"touchend",c)):L.supportsIePointer&&(window.PointerEvent?(e.event.bind(h,"pointerdown",o),e.event.bind(h,"pointermove",a),e.event.bind(h,"pointerup",c)):window.MSPointerEvent&&(e.event.bind(h,"MSPointerDown",o),e.event.bind(h,"MSPointerMove",a),e.event.bind(h,"MSPointerUp",c)))}}},H=function(r,l){var n=this;if(void 0===l&&(l={}),"string"==typeof r&&(r=document.querySelector(r)),!r||!r.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");this.element=r,r.classList.add(m.main),this.settings={handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1};for(var o in l)n.settings[o]=l[o];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var s=function(){return r.classList.add(m.state.focus)},a=function(){return r.classList.remove(m.state.focus)};this.isRtl="rtl"===t(r).direction,this.isNegativeScroll=function(){var t=r.scrollLeft,e=null;return r.scrollLeft=-1,e=r.scrollLeft<0,r.scrollLeft=t,e}(),this.negativeScrollAdjustment=this.isNegativeScroll?r.scrollWidth-r.clientWidth:0,this.event=new y,this.ownerDocument=r.ownerDocument||document,this.scrollbarXRail=i(m.element.rail("x")),r.appendChild(this.scrollbarXRail),this.scrollbarX=i(m.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",s),this.event.bind(this.scrollbarX,"blur",a),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var c=t(this.scrollbarXRail);this.scrollbarXBottom=parseInt(c.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=u(c.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=u(c.borderLeftWidth)+u(c.borderRightWidth),e(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=u(c.marginLeft)+u(c.marginRight),e(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=i(m.element.rail("y")),r.appendChild(this.scrollbarYRail),this.scrollbarY=i(m.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",s),this.event.bind(this.scrollbarY,"blur",a),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var h=t(this.scrollbarYRail);this.scrollbarYRight=parseInt(h.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=u(h.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?f(this.scrollbarY):null,this.railBorderYWidth=u(h.borderTopWidth)+u(h.borderBottomWidth),e(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=u(h.marginTop)+u(h.marginBottom),e(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:r.scrollLeft<=0?"start":r.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:r.scrollTop<=0?"start":r.scrollTop>=this.contentHeight-this.containerHeight?"end":null}
9312,this.isAlive=!0,this.settings.handlers.forEach(function(t){return T[t](n)}),this.lastScrollTop=Math.floor(r.scrollTop),this.lastScrollLeft=r.scrollLeft,this.event.bind(this.element,"scroll",function(t){return n.onScroll(t)}),R(this)};return H.prototype.update=function(){this.isAlive&&(this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,e(this.scrollbarXRail,{display:"block"}),e(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=u(t(this.scrollbarXRail).marginLeft)+u(t(this.scrollbarXRail).marginRight),this.railYMarginHeight=u(t(this.scrollbarYRail).marginTop)+u(t(this.scrollbarYRail).marginBottom),e(this.scrollbarXRail,{display:"none"}),e(this.scrollbarYRail,{display:"none"}),R(this),W(this,"top",0,!1,!0),W(this,"left",0,!1,!0),e(this.scrollbarXRail,{display:""}),e(this.scrollbarYRail,{display:""}))},H.prototype.onScroll=function(t){this.isAlive&&(R(this),W(this,"top",this.element.scrollTop-this.lastScrollTop),W(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=Math.floor(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)},H.prototype.destroy=function(){this.isAlive&&(this.event.unbindAll(),l(this.scrollbarX),l(this.scrollbarY),l(this.scrollbarXRail),l(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1)},H.prototype.removePsClasses=function(){this.element.className=this.element.className.split(" ").filter(function(t){return!t.match(/^ps([-_].+|)$/)}).join(" ")},H}); 9313"use strict"; 9314 9315(function ($) { 9316 $(document).ready(function () { 9317 $(document).on('click', '.chip .close', function () { 9318 var $this = $(this); 9319 9320 if ($this.closest('.chips').data('initialized')) { 9321 return; 9322 } 9323 9324 $this.closest('.chip').remove(); 9325 }); 9326 }); 9327 9328 $.fn.materialChip = function (options) { 9329 var _this = this; 9330 9331 this.$el = $(this); 9332 this.$document = $(document); 9333 this.eventsHandled = false; 9334 this.defaultOptions = { 9335 data: [], 9336 placeholder: '', 9337 secondaryPlaceholder: '' 9338 }; 9339 this.selectors = { 9340 chips: '.chips', 9341 chip: '.chip', 9342 input: 'input', 9343 delete: '.fas', 9344 selectedChip: '.selected' 9345 }; 9346 this.keyCodes = { 9347 enter: 13, 9348 backspace: 8, 9349 delete: 46, 9350 arrowLeft: 37, 9351 arrowRight: 39 9352 }; 9353 9354 if (options === 'data') { 9355 return this.$el.data('chips'); 9356 } 9357 9358 if (options === 'options') { 9359 return this.$el.data('options'); 9360 } 9361 9362 this.$el.data('options', $.extend({}, this.defaultOptions, options)); 9363 9364 this.init = function () { 9365 _this.$el.each(function (index, element) { 9366 var $this = $(element); 9367 9368 if ($this.data('initialized')) { 9369 return; 9370 } 9371 9372 var options = $this.data('options'); 9373 9374 if (!options.data || !Array.isArray(options.data)) { 9375 options.data = []; 9376 } 9377 9378 $this.data('chips', options.data); 9379 $this.data('index', index); 9380 $this.data('initialized', true); 9381 9382 if (!$this.hasClass(_this.selectors.chips)) { 9383 $this.addClass('chips'); 9384 } 9385 9386 _this.renderChips($this); 9387 }); 9388 }; 9389 9390 this.handleEvents = function () { 9391 var _this2 = this; 9392 9393 this.$document.on('click', this.selectors.chips, function (e) { 9394 $(e.target).find(_this2.selectors.input).focus(); 9395 }); 9396 this.$document.on('click', this.selectors.chip, function (e) { 9397 $(_this2.selectors.chip).removeClass('selected'); 9398 $(e.target).addClass('selected'); 9399 }); 9400 this.$document.on('keydown', function (e) { 9401 if ($(e.target).is('input, textarea')) { 9402 return; 9403 } 9404 9405 var $selectedChip = _this2.$document.find(_this2.selectors.chip + _this2.selectors.selectedChip); 9406 9407 var $chipsWrapper = $selectedChip.closest(_this2.selectors.chips); 9408 var siblingsLength = $selectedChip.siblings(_this2.selectors.chip).length; 9409 9410 if (!$selectedChip.length) { 9411 return; 9412 } 9413 9414 var backspacePressed = e.which === _this2.keyCodes.backspace; 9415 var deletePressed = e.which === _this2.keyCodes.delete; 9416 var leftArrowPressed = e.which === _this2.keyCodes.arrowLeft; 9417 var rightArrowPressed = e.which === _this2.keyCodes.arrowRight; 9418 9419 if (backspacePressed || deletePressed) { 9420 e.preventDefault(); 9421 9422 _this2.deleteSelectedChip($chipsWrapper, $selectedChip, siblingsLength); 9423 } else if (leftArrowPressed) { 9424 _this2.selectLeftChip($chipsWrapper, $selectedChip); 9425 } else if (rightArrowPressed) { 9426 _this2.selectRightChip($chipsWrapper, $selectedChip, siblingsLength); 9427 } 9428 }); 9429 this.$document.on('focusin', "".concat(this.selectors.chips, " ").concat(this.selectors.input), function (e) { 9430 $(e.target).closest(_this2.selectors.chips).addClass('focus'); 9431 $(_this2.selectors.chip).removeClass('selected'); 9432 }); 9433 this.$document.on('focusout', "".concat(this.selectors.chips, " ").concat(this.selectors.input), function (e) { 9434 $(e.target).closest(_this2.selectors.chips).removeClass('focus'); 9435 }); 9436 this.$document.on('keydown', "".concat(this.selectors.chips, " ").concat(this.selectors.input), function (e) { 9437 var $target = $(e.target); 9438 var $chipsWrapper = $target.closest(_this2.selectors.chips); 9439 var chipsIndex = $chipsWrapper.data('index'); 9440 var chipsLength = $chipsWrapper.children(_this2.selectors.chip).length; 9441 var enterPressed = e.which === _this2.keyCodes.enter; 9442 9443 if (enterPressed) { 9444 e.preventDefault(); 9445 9446 _this2.addChip(chipsIndex, { 9447 tag: $target.val() 9448 }, $chipsWrapper); 9449 9450 $target.val(''); 9451 return; 9452 } 9453 9454 var leftArrowOrDeletePressed = e.keyCode === _this2.keyCodes.arrowLeft || e.keyCode === _this2.keyCodes.delete; 9455 var isValueEmpty = $target.val() === ''; 9456 9457 if (leftArrowOrDeletePressed && isValueEmpty && chipsLength) { 9458 _this2.selectChip(chipsIndex, chipsLength - 1, $chipsWrapper); 9459 9460 $target.blur(); 9461 } 9462 }); 9463 this.$document.on('click', "".concat(this.selectors.chips, " ").concat(this.selectors.delete), function (e) { 9464 var $target = $(e.target); 9465 var $chipsWrapper = $target.closest(_this2.selectors.chips); 9466 var $chip = $target.closest(_this2.selectors.chip); 9467 e.stopPropagation(); 9468 9469 _this2.deleteChip($chipsWrapper.data('index'), $chip.index(), $chipsWrapper); 9470 9471 $chipsWrapper.find('input').focus(); 9472 }); 9473 }; 9474 9475 this.deleteSelectedChip = function ($chipsWrapper, $selectedChip, siblingsLength) { 9476 var chipsIndex = $chipsWrapper.data('index'); 9477 var chipIndex = $selectedChip.index(); 9478 9479 _this.deleteChip(chipsIndex, chipIndex, $chipsWrapper); 9480 9481 var selectIndex = null; 9482 9483 if (chipIndex < siblingsLength - 1) { 9484 selectIndex = chipIndex; 9485 } else if (chipIndex === siblingsLength || chipIndex === siblingsLength - 1) { 9486 selectIndex = siblingsLength - 1; 9487 } 9488 9489 if (selectIndex < 0) { 9490 selectIndex = null; 9491 } 9492 9493 if (selectIndex !== null) { 9494 _this.selectChip(chipsIndex, selectIndex, $chipsWrapper); 9495 } 9496 9497 if (!siblingsLength) { 9498 $chipsWrapper.find('input').focus(); 9499 } 9500 }; 9501 9502 this.selectLeftChip = function ($chipsWrapper, $selectedChip) { 9503 var chipIndex = $selectedChip.index() - 1; 9504 9505 if (chipIndex < 0) { 9506 return; 9507 } 9508 9509 $(_this.selectors.chip).removeClass('selected'); 9510 9511 _this.selectChip($chipsWrapper.data('index'), chipIndex, $chipsWrapper); 9512 }; 9513 9514 this.selectRightChip = function ($chipsWrapper, $selectedChip, siblingsLength) { 9515 var chipIndex = $selectedChip.index() + 1; 9516 $(_this.selectors.chip).removeClass('selected'); 9517 9518 if (chipIndex > siblingsLength) { 9519 $chipsWrapper.find('input').focus(); 9520 return; 9521 } 9522 9523 _this.selectChip($chipsWrapper.data('index'), chipIndex, $chipsWrapper); 9524 }; 9525 9526 this.renderChips = function ($chipsWrapper) { 9527 var html = ''; 9528 $chipsWrapper.data('chips').forEach(function (elem) {
9529 html += _this.getSingleChipHtml(elem); 9530 }); 9531 html += '<input class="input" placeholder="">'; 9532 $chipsWrapper.html(html); 9533 9534 _this.setPlaceholder($chipsWrapper); 9535 }; 9536 9537 this.getSingleChipHtml = function (elem) { 9538 if (!elem.tag) { 9539 return ''; 9540 } 9541 9542 var html = "<div class=\"chip\">".concat(elem.tag); 9543 9544 if (elem.image) { 9545 html += " <img src=\"".concat(elem.image, "\"> "); 9546 } 9547 9548 html += '<i class="close fas fa-times"></i>'; 9549 html += '</div>'; 9550 return html; 9551 }; 9552 9553 this.setPlaceholder = function ($chips) { 9554 var options = $chips.data('options'); 9555 9556 if ($chips.data('chips').length && options.placeholder) { 9557 $chips.find('input').prop('placeholder', options.placeholder); 9558 } else if (!$chips.data('chips').length && options.secondaryPlaceholder) { 9559 $chips.find('input').prop('placeholder', options.secondaryPlaceholder); 9560 } 9561 }; 9562 9563 this.isValid = function ($chipsWrapper, elem) { 9564 var chips = $chipsWrapper.data('chips'); 9565 9566 for (var i = 0; i < chips.length; i++) { 9567 if (chips[i].tag === elem.tag) { 9568 return false; 9569 } 9570 } 9571 9572 return elem.tag !== ''; 9573 }; 9574 9575 this.addChip = function (chipsIndex, elem, $chipsWrapper) { 9576 if (!_this.isValid($chipsWrapper, elem)) { 9577 return; 9578 } 9579 9580 var chipHtml = _this.getSingleChipHtml(elem); 9581 9582 $chipsWrapper.data('chips').push(elem); 9583 $(chipHtml).insertBefore($chipsWrapper.find('input')); 9584 $chipsWrapper.trigger('chip.add', elem); 9585 9586 _this.setPlaceholder($chipsWrapper); 9587 }; 9588 9589 this.deleteChip = function (chipsIndex, chipIndex, $chipsWrapper) { 9590 var chip = $chipsWrapper.data('chips')[chipIndex]; 9591 $chipsWrapper.find('.chip').eq(chipIndex).remove(); 9592 $chipsWrapper.data('chips').splice(chipIndex, 1); 9593 $chipsWrapper.trigger('chip.delete', chip); 9594 9595 _this.setPlaceholder($chipsWrapper); 9596 }; 9597 9598 this.selectChip = function (chipsIndex, chipIndex, $chipsWrapper) { 9599 var $chip = $chipsWrapper.find('.chip').eq(chipIndex); 9600 9601 if ($chip && $chip.hasClass('selected') === false) { 9602 $chip.addClass('selected'); 9603 $chipsWrapper.trigger('chip.select', $chipsWrapper.data('chips')[chipIndex]); 9604 } 9605 }; 9606 9607 this.getChipsElement = function (index, $chipsWrapper) { 9608 return $chipsWrapper.eq(index); 9609 }; 9610 9611 this.init(); 9612 9613 if (!this.eventsHandled) { 9614 this.handleEvents(); 9615 this.eventsHandled = true; 9616 } 9617 9618 return this; 9619 }; // Deprecated. To be deleted in future releases 9620 9621 9622 $.fn.material_chip = $.fn.materialChip; 9623})(jQuery); 9624/*! npm.im/object-fit-images 3.2.4 */ 9625var objectFitImages = (function () { 9626 'use strict'; 9627 9628 var OFI = 'bfred-it:object-fit-images'; 9629 var propRegex = /(object-fit|object-position)\s*:\s*([-.\w\s%]+)/g; 9630 var testImg = typeof Image === 'undefined' ? {style: {'object-position': 1}} : new Image(); 9631 var supportsObjectFit = 'object-fit' in testImg.style; 9632 var supportsObjectPosition = 'object-position' in testImg.style; 9633 var supportsOFI = 'background-size' in testImg.style; 9634 var supportsCurrentSrc = typeof testImg.currentSrc === 'string'; 9635 var nativeGetAttribute = testImg.getAttribute; 9636 var nativeSetAttribute = testImg.setAttribute; 9637 var autoModeEnabled = false; 9638 9639 function createPlaceholder(w, h) { 9640 return ("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='" + w + "' height='" + h + "'%3E%3C/svg%3E"); 9641 } 9642 9643 function polyfillCurrentSrc(el) { 9644 if (el.srcset && !supportsCurrentSrc && window.picturefill) { 9645 var pf = window.picturefill._; 9646 // parse srcset with picturefill where currentSrc isn't available 9647 if (!el[pf.ns] || !el[pf.ns].evaled) { 9648 // force synchronous srcset parsing 9649 pf.fillImg(el, {reselect: true}); 9650 } 9651 9652 if (!el[pf.ns].curSrc) { 9653 // force picturefill to parse srcset 9654 el[pf.ns].supported = false;
vendor: 5,196 bytes, lines 9655-9794
9655 pf.fillImg(el, {reselect: true}); 9656 } 9657 9658 // retrieve parsed currentSrc, if any 9659 el.currentSrc = el[pf.ns].curSrc || el.src; 9660 } 9661 } 9662 9663 function getStyle(el) { 9664 var style = getComputedStyle(el).fontFamily; 9665 var parsed; 9666 var props = {}; 9667 while ((parsed = propRegex.exec(style)) !== null) { 9668 props[parsed[1]] = parsed[2]; 9669 } 9670 return props; 9671 } 9672 9673 function setPlaceholder(img, width, height) { 9674 // Default: fill width, no height 9675 var placeholder = createPlaceholder(width || 1, height || 0); 9676 9677 // Only set placeholder if it's different 9678 if (nativeGetAttribute.call(img, 'src') !== placeholder) { 9679 nativeSetAttribute.call(img, 'src', placeholder); 9680 } 9681 } 9682 9683 function onImageReady(img, callback) { 9684 // naturalWidth is only available when the image headers are loaded, 9685 // this loop will poll it every 100ms. 9686 if (img.naturalWidth) { 9687 callback(img); 9688 } else { 9689 setTimeout(onImageReady, 100, img, callback); 9690 } 9691 } 9692 9693 function fixOne(el) { 9694 var style = getStyle(el); 9695 var ofi = el[OFI]; 9696 style['object-fit'] = style['object-fit'] || 'fill'; // default value 9697 9698 // Avoid running where unnecessary, unless OFI had already done its deed 9699 if (!ofi.img) { 9700 // fill is the default behavior so no action is necessary 9701 if (style['object-fit'] === 'fill') { 9702 return; 9703 } 9704 9705 // Where object-fit is supported and object-position isn't (Safari < 10) 9706 if ( 9707 !ofi.skipTest && // unless user wants to apply regardless of browser support 9708 supportsObjectFit && // if browser already supports object-fit 9709 !style['object-position'] // unless object-position is used 9710 ) { 9711 return; 9712 } 9713 } 9714 9715 // keep a clone in memory while resetting the original to a blank 9716 if (!ofi.img) { 9717 ofi.img = new Image(el.width, el.height); 9718 ofi.img.srcset = nativeGetAttribute.call(el, "data-ofi-srcset") || el.srcset; 9719 ofi.img.src = nativeGetAttribute.call(el, "data-ofi-src") || el.src; 9720 9721 // preserve for any future cloneNode calls 9722 // https://github.com/bfred-it/object-fit-images/issues/53 9723 nativeSetAttribute.call(el, "data-ofi-src", el.src); 9724 if (el.srcset) { 9725 nativeSetAttribute.call(el, "data-ofi-srcset", el.srcset); 9726 } 9727 9728 setPlaceholder(el, el.naturalWidth || el.width, el.naturalHeight || el.height); 9729 9730 // remove srcset because it overrides src 9731 if (el.srcset) { 9732 el.srcset = ''; 9733 } 9734 try { 9735 keepSrcUsable(el); 9736 } catch (err) { 9737 if (window.console) { 9738 console.warn('https://bit.ly/ofi-old-browser'); 9739 } 9740 } 9741 } 9742 9743 polyfillCurrentSrc(ofi.img); 9744 9745 el.style.backgroundImage = "url(\"" + ((ofi.img.currentSrc || ofi.img.src).replace(/"/g, '\\"')) + "\")"; 9746 el.style.backgroundPosition = style['object-position'] || 'center'; 9747 el.style.backgroundRepeat = 'no-repeat'; 9748 el.style.backgroundOrigin = 'content-box'; 9749 9750 if (/scale-down/.test(style['object-fit'])) { 9751 onImageReady(ofi.img, function () { 9752 if (ofi.img.naturalWidth > el.width || ofi.img.naturalHeight > el.height) { 9753 el.style.backgroundSize = 'contain'; 9754 } else { 9755 el.style.backgroundSize = 'auto'; 9756 } 9757 }); 9758 } else { 9759 el.style.backgroundSize = style['object-fit'].replace('none', 'auto').replace('fill', '100% 100%'); 9760 } 9761 9762 onImageReady(ofi.img, function (img) { 9763 setPlaceholder(el, img.naturalWidth, img.naturalHeight); 9764 }); 9765 } 9766 9767 function keepSrcUsable(el) { 9768 var descriptors = { 9769 get: function get(prop) { 9770 return el[OFI].img[prop ? prop : 'src']; 9771 }, 9772 set: function set(value, prop) { 9773 el[OFI].img[prop ? prop : 'src'] = value; 9774 nativeSetAttribute.call(el, ("data-ofi-" + prop), value); // preserve for any future cloneNode 9775 fixOne(el); 9776 return value; 9777 } 9778 }; 9779 Object.defineProperty(el, 'src', descriptors); 9780 Object.defineProperty(el, 'currentSrc', { 9781 get: function () { return descriptors.get('currentSrc'); } 9782 }); 9783 Object.defineProperty(el, 'srcset', { 9784 get: function () { return descriptors.get('srcset'); }, 9785 set: function (ss) { return descriptors.set(ss, 'srcset'); } 9786 }); 9787 } 9788 9789 function hijackAttributes() { 9790 function getOfiImageMaybe(el, name) { 9791 return el[OFI] && el[OFI].img && (name === 'src' || name === 'srcset') ? el[OFI].img : el; 9792 } 9793 if (!supportsObjectPosition) { 9794 HTMLImageElement.prototype.getAttribute = function (name) {
9795 return nativeGetAttribute.call(getOfiImageMaybe(this, name), name); 9796 }; 9797 9798 HTMLImageElement.prototype.setAttribute = function (name, value) { 9799 return nativeSetAttribute.call(getOfiImageMaybe(this, name), name, String(value)); 9800 }; 9801 } 9802 } 9803 9804 function fix(imgs, opts) { 9805 var startAutoMode = !autoModeEnabled && !imgs; 9806 opts = opts || {}; 9807 imgs = imgs || 'img'; 9808 9809 if ((supportsObjectPosition && !opts.skipTest) || !supportsOFI) { 9810 return false; 9811 } 9812 9813 // use imgs as a selector or just select all images 9814 if (imgs === 'img') { 9815 imgs = document.getElementsByTagName('img'); 9816 } else if (typeof imgs === 'string') { 9817 imgs = document.querySelectorAll(imgs); 9818 } else if (!('length' in imgs)) { 9819 imgs = [imgs]; 9820 } 9821 9822 // apply fix to all 9823 for (var i = 0; i < imgs.length; i++) { 9824 imgs[i][OFI] = imgs[i][OFI] || { 9825 skipTest: opts.skipTest 9826 }; 9827 fixOne(imgs[i]); 9828 } 9829 9830 if (startAutoMode) { 9831 document.body.addEventListener('load', function (e) { 9832 if (e.target.tagName === 'IMG') { 9833 fix(e.target, { 9834 skipTest: opts.skipTest 9835 }); 9836 } 9837 }, true); 9838 autoModeEnabled = true; 9839 imgs = 'img'; // reset to a generic selector for watchMQ 9840 } 9841 9842 // if requested, watch media queries for object-fit change 9843 if (opts.watchMQ) { 9844 window.addEventListener('resize', fix.bind(null, imgs, { 9845 skipTest: opts.skipTest 9846 })); 9847 } 9848 } 9849 9850 fix.supportsObjectFit = supportsObjectFit; 9851 fix.supportsObjectPosition = supportsObjectPosition; 9852 9853 hijackAttributes(); 9854 9855 return fix; 9856 9857}()); 9858 9859/*! 9860 * Name : Just Another Parallax [Jarallax] 9861 * Version : 1.10.4 9862 * Author : nK <https://nkdev.info> 9863 * GitHub : https://github.com/nk-o/jarallax 9864 */ 9865/******/ (function(modules) { // webpackBootstrap 9866 /******/ // The module cache 9867 /******/ var installedModules = {}; 9868 /******/ 9869 /******/ // The require function 9870 /******/ function __webpack_require__(moduleId) { 9871 /******/ 9872 /******/ // Check if module is in cache 9873 /******/ if(installedModules[moduleId]) { 9874 /******/ return installedModules[moduleId].exports; 9875 /******/ } 9876 /******/ // Create a new module (and put it into the cache) 9877 /******/ var module = installedModules[moduleId] = { 9878 /******/ i: moduleId, 9879 /******/ l: false, 9880 /******/ exports: {} 9881 /******/ }; 9882 /******/ 9883 /******/ // Execute the module function 9884 /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 9885 /******/ 9886 /******/ // Flag the module as loaded 9887 /******/ module.l = true; 9888 /******/ 9889 /******/ // Return the exports of the module 9890 /******/ return module.exports; 9891 /******/ } 9892 /******/ 9893 /******/ 9894 /******/ // expose the modules object (__webpack_modules__) 9895 /******/ __webpack_require__.m = modules; 9896 /******/ 9897 /******/ // expose the module cache 9898 /******/ __webpack_require__.c = installedModules; 9899 /******/ 9900 /******/ // define getter function for harmony exports 9901 /******/ __webpack_require__.d = function(exports, name, getter) { 9902 /******/ if(!__webpack_require__.o(exports, name)) { 9903 /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 9904 /******/ } 9905 /******/ }; 9906 /******/ 9907 /******/ // define __esModule on exports 9908 /******/ __webpack_require__.r = function(exports) { 9909 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 9910 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 9911 /******/ } 9912 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 9913 /******/ }; 9914 /******/ 9915 /******/ // create a fake namespace object 9916 /******/ // mode & 1: value is a module id, require it 9917 /******/ // mode & 2: merge all properties of value into the ns 9918 /******/ // mode & 4: return value when already ns object 9919 /******/ // mode & 8|1: behave like require 9920 /******/ __webpack_require__.t = function(value, mode) { 9921 /******/ if(mode & 1) value = __webpack_require__(value); 9922 /******/ if(mode & 8) return value; 9923 /******/ if((mode & 4) && typeof value === 'object' && value && value.__esMo
9923dule) return value; 9924 /******/ var ns = Object.create(null); 9925 /******/ __webpack_require__.r(ns); 9926 /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 9927 /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 9928 /******/ return ns; 9929 /******/ }; 9930 /******/ 9931 /******/ // getDefaultExport function for compatibility with non-harmony modules 9932 /******/ __webpack_require__.n = function(module) { 9933 /******/ var getter = module && module.__esModule ? 9934 /******/ function getDefault() { return module['default']; } : 9935 /******/ function getModuleExports() { return module; }; 9936 /******/ __webpack_require__.d(getter, 'a', getter); 9937 /******/ return getter; 9938 /******/ }; 9939 /******/ 9940 /******/ // Object.prototype.hasOwnProperty.call 9941 /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 9942 /******/ 9943 /******/ // __webpack_public_path__ 9944 /******/ __webpack_require__.p = ""; 9945 /******/ 9946 /******/ 9947 /******/ // Load entry module and return exports 9948 /******/ return __webpack_require__(__webpack_require__.s = 11); 9949 /******/ }) 9950/************************************************************************/ 9951/******/ ([ 9952 /* 0 */, 9953 /* 1 */, 9954 /* 2 */ 9955 /***/ (function(module, exports, __webpack_require__) { 9956 9957 "use strict"; 9958 9959 9960 module.exports = function (callback) { 9961 9962 if (document.readyState === 'complete' || document.readyState === 'interactive') { 9963 // Already ready or interactive, execute callback 9964 callback.call(); 9965 } else if (document.attachEvent) { 9966 // Old browsers 9967 document.attachEvent('onreadystatechange', function () { 9968 if (document.readyState === 'interactive') callback.call(); 9969 }); 9970 } else if (document.addEventListener) { 9971 // Modern browsers 9972 document.addEventListener('DOMContentLoaded', callback); 9973 } 9974 }; 9975 9976 /***/ }), 9977 /* 3 */, 9978 /* 4 */ 9979 /***/ (function(module, exports, __webpack_require__) { 9980 9981 "use strict"; 9982 /* WEBPACK VAR INJECTION */(function(global) { 9983 9984 var win; 9985 9986 if (typeof window !== "undefined") { 9987 win = window; 9988 } else if (typeof global !== "undefined") { 9989 win = global; 9990 } else if (typeof self !== "undefined") { 9991 win = self; 9992 } else { 9993 win = {}; 9994 } 9995 9996 module.exports = win; 9997 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(5))) 9998 9999 /***/ }), 10000 /* 5 */ 10001 /***/ (function(module, exports, __webpack_require__) { 10002 10003 "use strict"; 10004 10005 10006 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 10007 10008 var g; 10009 10010// This works in non-strict mode 10011 g = function () { 10012 return this; 10013 }(); 10014 10015 try { 10016 // This works if eval is allowed (see CSP) 10017 g = g || Function("return this")() || (1, eval)("this"); 10018 } catch (e) { 10019 // This works if the window reference is available 10020 if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === "object") g = window; 10021 } 10022 10023// g can still be undefined, but nothing to do about it... 10024// We return undefined, instead of nothing here, so it's 10025// easier to handle this case. if(!global) { ...} 10026 10027 module.exports = g; 10028 10029 /***/ }), 10030 /* 6 */, 10031 /* 7 */, 10032 /* 8 */, 10033 /* 9 */, 10034 /* 10 */, 10035 /* 11 */ 10036 /***/ (function(module, exports, __webpack_require__) { 10037 10038 module.exports = __webpack_require__(12); 10039 10040 10041 /***/ }), 10042 /* 12 */ 10043 /***/ (function(module, exports, __webpack_require__) { 10044 10045 "use strict"; 10046 10047 10048 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 10049 10050 var _liteReady = __webpack_require__(2); 10051 10052 var _liteReady2 = _interopRequireDefault(_liteReady); 10053 10054 var _global = __webpack_require__(4); 10055 10056 var _jarallax = __webpack_require__(13); 10057 10058 var _jarallax2 = _interopRequireDefault(_jarallax); 10059 10060 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 10061 10062// no conflict 10063 var oldPlugin = _global.window.jarallax; 10064 _global.window.jarallax = _jarallax2.default; 10065 _global.window.jarallax.noConflict = function () { 10066 _global.window.jarallax = oldPlugin; 10067 return this; 10068 }; 10069 10070// jQuery support 10071 if (typeof _global.jQuery !== 'undefined') { 10072 var jQueryPlugin = function jQueryPlugin() { 10073 var args = arguments || []; 10074 Array.prototype.unshift.call(args, this); 10075 var res = _jarallax2.default.apply(_global.window, args); 10076 return (typeof res === 'undefined' ? 'undefined' : _typeof(res)) !== 'object' ? res : this; 10077 }; 10078 jQueryPlugin.constructor = _jarallax2.default.constructor; 10079 10080 // no conflict 10081 var oldJqPlugin = _global.jQuery.fn.jarallax; 10082 _global.jQuery.fn.jarallax = jQueryPlugin; 10083 _global.jQuery.fn.jarallax.noConflict = function () { 10084 _global.jQuery.fn.jarallax = oldJqPlugin; 10085 return this; 10086 }; 10087 } 10088 10089// data-jarallax initialization 10090 (0, _liteReady2.default)(function () { 10091 (0, _jarallax2.default)(document.querySelectorAll('[data-jarallax]')); 10092 }); 10093 10094 /***/ }), 10095 /* 13 */ 10096 /***/ (function(module, exports, __webpack_require__) { 10097 10098 "use strict"; 10099 /* WEBPACK VAR INJECTION */(function(global) { 10100 10101 Object.defineProperty(exports, "__esModule", { 10102 value: true 10103 }); 10104 10105 var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); }
10105 else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); 10106 10107 var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 10108 10109 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 10110 10111 var _liteReady = __webpack_require__(2); 10112 10113 var _liteReady2 = _interopRequireDefault(_liteReady); 10114 10115 var _rafl = __webpack_require__(14); 10116 10117 var _rafl2 = _interopRequireDefault(_rafl); 10118 10119 var _global = __webpack_require__(4); 10120 10121 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 10122 10123 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 10124 10125 var isIE = navigator.userAgent.indexOf('MSIE ') > -1 || navigator.userAgent.indexOf('Trident/') > -1 || navigator.userAgent.indexOf('Edge/') > -1; 10126 10127 var supportTransform = function () { 10128 var prefixes = 'transform WebkitTransform MozTransform'.split(' '); 10129 var div = document.createElement('div'); 10130 for (var i = 0; i < prefixes.length; i++) { 10131 if (div && div.style[prefixes[i]] !== undefined) { 10132 return prefixes[i]; 10133 } 10134 } 10135 return false; 10136 }(); 10137 10138// Window data 10139 var wndW = void 0; 10140 var wndH = void 0; 10141 var wndY = void 0; 10142 var forceResizeParallax = false; 10143 var forceScrollParallax = false; 10144 function updateWndVars(e) { 10145 wndW = _global.window.innerWidth || document.documentElement.clientWidth; 10146 wndH = _global.window.innerHeight || document.documentElement.clientHeight; 10147 if ((typeof e === 'undefined' ? 'undefined' : _typeof(e)) === 'object' && (e.type === 'load' || e.type === 'dom-loaded')) { 10148 forceResizeParallax = true; 10149 } 10150 } 10151 updateWndVars(); 10152 _global.window.addEventListener('resize', updateWndVars); 10153 _global.window.addEventListener('orientationchange', updateWndVars); 10154 _global.window.addEventListener('load', updateWndVars); 10155 (0, _liteReady2.default)(function () { 10156 updateWndVars({ 10157 type: 'dom-loaded' 10158 }); 10159 }); 10160 10161// list with all jarallax instances 10162// need to render all in one scroll/resize event 10163 var jarallaxList = []; 10164 10165// Animate if changed window size or scrolled page 10166 var oldPageData = false; 10167 function updateParallax() { 10168 if (!jarallaxList.length) { 10169 return; 10170 } 10171 10172 if (_global.window.pageYOffset !== undefined) { 10173 wndY = _global.window.pageYOffset; 10174 } else { 10175 wndY = (document.documentElement || document.body.parentNode || document.body).scrollTop; 10176 } 10177 10178 var isResized = forceResizeParallax || !oldPageData || oldPageData.width !== wndW || oldPageData.height !== wndH; 10179 var isScrolled = forceScrollParallax || isResized || !oldPageData || oldPageData.y !== wndY; 10180 10181 forceResizeParallax = false; 10182 forceScrollParallax = false;
10183 10184 if (isResized || isScrolled) { 10185 jarallaxList.forEach(function (item) { 10186 if (isResized) { 10187 item.onResize(); 10188 } 10189 if (isScrolled) { 10190 item.onScroll(); 10191 } 10192 }); 10193 10194 oldPageData = { 10195 width: wndW, 10196 height: wndH, 10197 y: wndY 10198 }; 10199 } 10200 10201 (0, _rafl2.default)(updateParallax); 10202 } 10203 10204// ResizeObserver 10205 var resizeObserver = global.ResizeObserver ? new global.ResizeObserver(function (entry) { 10206 if (entry && entry.length) { 10207 (0, _rafl2.default)(function () { 10208 entry.forEach(function (item) { 10209 if (item.target && item.target.jarallax) { 10210 if (!forceResizeParallax) { 10211 item.target.jarallax.onResize(); 10212 } 10213 forceScrollParallax = true; 10214 } 10215 }); 10216 }); 10217 } 10218 }) : false; 10219 10220 var instanceID = 0; 10221 10222// Jarallax class 10223 10224 var Jarallax = function () { 10225 function Jarallax(item, userOptions) { 10226 _classCallCheck(this, Jarallax); 10227 10228 var self = this; 10229 10230 self.instanceID = instanceID++; 10231 10232 self.$item = item; 10233 10234 self.defaults = { 10235 type: 'scroll', // type of parallax: scroll, scale, opacity, scale-opacity, scroll-opacity 10236 speed: 0.5, // supported value from -1 to 2 10237 imgSrc: null, 10238 imgElement: '.jarallax-img', 10239 imgSize: 'cover', 10240 imgPosition: '50% 50%', 10241 imgRepeat: 'no-repeat', // supported only for background, not for <img> tag 10242 keepImg: false, // keep <img> tag in it's default place 10243 elementInViewport: null, 10244 zIndex: -100, 10245 disableParallax: false, 10246 disableVideo: false, 10247 automaticResize: true, // use ResizeObserver to recalculate position and size of parallax image 10248 10249 // video 10250 videoSrc: null, 10251 videoStartTime: 0, 10252 videoEndTime: 0, 10253 videoVolume: 0, 10254 videoPlayOnlyVisible: true, 10255 10256 // events 10257 onScroll: null, // function(calculations) {} 10258 onInit: null, // function() {} 10259 onDestroy: null, // function() {} 10260 onCoverImage: null // function() {} 10261 }; 10262 10263 // DEPRECATED: old data-options 10264 var deprecatedDataAttribute = self.$item.getAttribute('data-jarallax'); 10265 var oldDataOptions = JSON.parse(deprecatedDataAttribute || '{}'); 10266 if (deprecatedDataAttribute) { 10267 // eslint-disable-next-line no-console 10268 console.warn('Detected usage of deprecated data-jarallax JSON options, you should use pure data-attribute options. See info here - https://github.com/nk-o/jarallax/issues/53'); 10269 } 10270 10271 // prepare data-options 10272 var dataOptions = self.$item.dataset || {}; 10273 var pureDataOptions = {}; 10274 Object.keys(dataOptions).forEach(function (key) { 10275 var loweCaseOption = key.substr(0, 1).toLowerCase() + key.substr(1); 10276 if (loweCaseOption && typeof self.defaults[loweCaseOption] !== 'undefined') { 10277 pureDataOptions[loweCaseOption] = dataOptions[key]; 10278 } 10279 }); 10280 10281 self.options = self.extend({}, self.defaults, oldDataOptions, pureDataOptions, userOptions); 10282 self.pureOptions = self.extend({}, self.options); 10283 10284 // prepare 'true' and 'false' strings to boolean
10285 Object.keys(self.options).forEach(function (key) { 10286 if (self.options[key] === 'true') { 10287 self.options[key] = true; 10288 } else if (self.options[key] === 'false') { 10289 self.options[key] = false; 10290 } 10291 }); 10292 10293 // fix speed option [-1.0, 2.0] 10294 self.options.speed = Math.min(2, Math.max(-1, parseFloat(self.options.speed))); 10295 10296 // deprecated noAndroid and noIos options 10297 if (self.options.noAndroid || self.options.noIos) { 10298 // eslint-disable-next-line no-console 10299 console.warn('Detected usage of deprecated noAndroid or noIos options, you should use disableParallax option. See info here - https://github.com/nk-o/jarallax/#disable-on-mobile-devices'); 10300 10301 // prepare fallback if disableParallax option is not used 10302 if (!self.options.disableParallax) { 10303 if (self.options.noIos && self.options.noAndroid) { 10304 self.options.disableParallax = /iPad|iPhone|iPod|Android/; 10305 } else if (self.options.noIos) { 10306 self.options.disableParallax = /iPad|iPhone|iPod/; 10307 } else if (self.options.noAndroid) { 10308 self.options.disableParallax = /Android/; 10309 } 10310 } 10311 } 10312 10313 // prepare disableParallax callback 10314 if (typeof self.options.disableParallax === 'string') { 10315 self.options.disableParallax = new RegExp(self.options.disableParallax); 10316 } 10317 if (self.options.disableParallax instanceof RegExp) { 10318 var disableParallaxRegexp = self.options.disableParallax; 10319 self.options.disableParallax = function () { 10320 return disableParallaxRegexp.test(navigator.userAgent); 10321 }; 10322 } 10323 if (typeof self.options.disableParallax !== 'function') { 10324 self.options.disableParallax = function () { 10325 return false; 10326 }; 10327 } 10328 10329 // prepare disableVideo callback 10330 if (typeof self.options.disableVideo === 'string') { 10331 self.options.disableVideo = new RegExp(self.options.disableVideo); 10332 } 10333 if (self.options.disableVideo instanceof RegExp) { 10334 var disableVideoRegexp = self.options.disableVideo; 10335 self.options.disableVideo = function () { 10336 return disableVideoRegexp.test(navigator.userAgent); 10337 }; 10338 } 10339 if (typeof self.options.disableVideo !== 'function') { 10340 self.options.disableVideo = function () { 10341 return false; 10342 }; 10343 } 10344 10345 // custom element to check if parallax in viewport 10346 var elementInVP = self.options.elementInViewport; 10347 // get first item from array 10348 if (elementInVP && (typeof elementInVP === 'undefined' ? 'undefined' : _typeof(elementInVP)) === 'object' && typeof elementInVP.length !== 'undefined') { 10349 var _elementInVP = elementInVP; 10350 10351 var _elementInVP2 = _slicedToArray(_elementInVP, 1); 10352 10353 elementInVP = _elementInVP2[0]; 10354 } 10355 // check if dom element 10356 if (!(elementInVP instanceof Element)) { 10357 elementInVP = null; 10358 } 10359 self.options.elementInViewport = elementInVP; 10360 10361 self.image = { 10362 src: self.options.imgSrc || null, 10363 $container: null, 10364 useImgTag: false, 10365 10366 // position fixed is needed for the most of browsers because absolute position have glitches 10367 // on MacOS with smooth scroll there is a huge lags with absolute position - https://github.com/nk-o/jarallax/issues/75 10368 // on mobile devices better scrolled with absolute position 10369 position: /iPad|iPhone|iPod|Android/.test(navigator.userAgent) ? 'absolute' : 'fixed' 10370 }; 10371 10372 if (self.initImg() && self.canInitParallax()) { 10373 self.init(); 10374 } 10375 } 10376 10377 // add styles to element 10378 10379 10380 _createClass(Jarallax, [{ 10381 key: 'css', 10382 value: function css(el, styles) { 10383 if (typeof styles === 'string') { 10384 return _global.window.getComputedStyle(el).getPropertyValue(styles); 10385 } 10386 10387 // add transform property with vendor prefix 10388 if (styles.transform && supportTransform) { 10389 styles[supportTransform] = styles.transform; 10390 } 10391
10392 Object.keys(styles).forEach(function (key) { 10393 el.style[key] = styles[key]; 10394 }); 10395 return el; 10396 } 10397 10398 // Extend like jQuery.extend 10399 10400 }, { 10401 key: 'extend', 10402 value: function extend(out) { 10403 var _arguments = arguments; 10404 10405 out = out || {}; 10406 Object.keys(arguments).forEach(function (i) { 10407 if (!_arguments[i]) { 10408 return; 10409 } 10410 Object.keys(_arguments[i]).forEach(function (key) { 10411 out[key] = _arguments[i][key]; 10412 }); 10413 }); 10414 return out; 10415 } 10416 10417 // get window size and scroll position. Useful for extensions 10418 10419 }, { 10420 key: 'getWindowData', 10421 value: function getWindowData() { 10422 return { 10423 width: wndW, 10424 height: wndH, 10425 y: wndY 10426 }; 10427 } 10428 10429 // Jarallax functions 10430 10431 }, { 10432 key: 'initImg', 10433 value: function initImg() { 10434 var self = this; 10435 10436 // find image element 10437 var $imgElement = self.options.imgElement; 10438 if ($imgElement && typeof $imgElement === 'string') { 10439 $imgElement = self.$item.querySelector($imgElement); 10440 } 10441 // check if dom element 10442 if (!($imgElement instanceof Element)) { 10443 $imgElement = null; 10444 } 10445 10446 if ($imgElement) { 10447 if (self.options.keepImg) { 10448 self.image.$item = $imgElement.cloneNode(true); 10449 } else { 10450 self.image.$item = $imgElement; 10451 self.image.$itemParent = $imgElement.parentNode; 10452 } 10453 self.image.useImgTag = true; 10454 } 10455 10456 // true if there is img tag 10457 if (self.image.$item) { 10458 return true; 10459 } 10460 10461 // get image src 10462 if (self.image.src === null) { 10463 self.image.src = self.css(self.$item, 'background-image').replace(/^url\(['"]?/g, '').replace(/['"]?\)$/g, ''); 10464 } 10465 return !(!self.image.src || self.image.src === 'none'); 10466 } 10467 }, { 10468 key: 'canInitParallax', 10469 value: function canInitParallax() { 10470 return supportTransform && !this.options.disableParallax(); 10471 } 10472 }, { 10473 key: 'init', 10474 value: function init() { 10475 var self = this; 10476 var containerStyles = { 10477 position: 'absolute', 10478 top: 0, 10479 left: 0, 10480 width: '100%', 10481 height: '100%', 10482 overflow: 'hidden', 10483 pointerEvents: 'none' 10484 }; 10485 var imageStyles = {}; 10486 10487 if (!self.options.keepImg) { 10488 // save default user styles 10489 var curStyle = self.$item.getAttribute('style'); 10490 if (curStyle) { 10491 self.$item.setAttribute('data-jarallax-original-styles', curStyle); 10492 } 10493 if (self.image.useImgTag) { 10494 var curImgStyle = self.image.$item.getAttribute('style'); 10495 if (curImgStyle) { 10496 self.image.$item.setAttribute('data-jarallax-original-styles', curImgStyle); 10497 } 10498 } 10499 } 10500 10501 // set relative position and z-index to the parent 10502 if (self.css(self.$item, 'position') === 'static') { 10503 self.css(self.$item, { 10504 position: 'relative' 10505 }); 10506 } 10507 if (self.css(self.$item, 'z-index') === 'auto') { 10508 self.css(self.$item, { 10509 zIndex: 0 10510 }); 10511 } 10512 10513 // container for parallax image 10514 self.image.$container = document.createElement('div'); 10515 self.css(self.image.$container, containerStyles); 10516 self.css(self.image.$container, { 10517 'z-index': self.options.zIndex 10518 }); 10519 10520 // fix for IE https://github.com/nk-o/jarallax/issues/110 10521 if (isIE) { 10522 self.css(self.image.$container, { 10523 opacity: 0.9999 10524 }); 10525 } 10526 10527 self.image.$container.setAttribute('id', 'jarallax-container-' + self.instanceID); 10528 self.$item.appendChild(self.image.$container); 10529 10530 // use img tag 10531 if (self.image.useImgTag) { 10532 imageStyles = self.extend({ 10533 'object-fit': self.options.imgSize, 10534 'object-position': self.options.imgPosition, 10535 // support for plugin https://github.com/bfred-it/object-fit-images 10536 'font-family': 'object-fit: ' + self.options.imgSize + '; object-position: ' + self.options.imgPosition + ';', 10537 'max-width': 'none' 10538 }, containerStyles, imageStyles); 10539 10540 // use div with background image 10541 } else { 10542 self.image.$item = document.createElement('div'); 10543 if (self.image.src) { 10544 imageStyles = self.extend({ 10545 'background-position': self.options.imgPosition, 10546 'background-size': self.options.imgSize, 10547 'background-repeat': self.options.imgRepeat, 10548 'background-image': 'url("' + self.image.src + '")' 10549 }, containerStyles, imageStyles); 10550 } 10551 } 10552 10553 if (self.options.type === 'opacity' || self.options.type === 'scale' || self.options.type === 'scale-opacity' || self.options.speed === 1) { 10554 self.image.position = 'absolute'; 10555 } 10556 10557 // check if one of parents have transform style (without this check, scroll transform will be inverted if used parallax with position fixed) 10558 // discussion - https://github.com/nk-o/jarallax/issues/9 10559 if (self.image.position === 'fixed') { 10560 var parentWithTransform = 0; 10561 var $itemParents = self.$item; 10562 while ($itemParents !== null && $itemParents !== document && parentWithTransform === 0) { 10563 var parentTransform = self.css($itemParents, '-webkit-transform') || self.css($itemParents, '-moz-transform') || self.css($itemParents, 'transform'); 10564 if (parentTransform && parentTransform !== 'none') { 10565 parentWithTransform = 1; 10566 self.image.position = 'absolute'; 10567 } 10568 $itemParents = $itemParents.parentNode; 10569 } 10570 } 10571 10572 // add position to parallax block 10573 imageStyles.position = self.image.position; 10574 10575 // insert parallax image 10576 self.css(self.image.$item, imageStyles); 10577 self.image.$container.appendChild(self.image.$item); 10578 10579 // set initial position and size 10580 self.onResize(); 10581 self.onScroll(true); 10582 10583 // ResizeObserver 10584 if (self.options.automaticResize && resizeObserver) { 10585 resizeObserver.observe(self.$item); 10586 } 10587 10588 // call onInit event 10589 if (self.options.onInit) { 10590 self.options.onInit.call(self); 10591 } 10592 10593 // remove default user background 10594 if (self.css(self.$item, 'background-image') !== 'none') { 10595 self.css(self.$item, { 10596 'background-image': 'none' 10597 }); 10598 } 10599 10600 self.addToParallaxList(); 10601 } 10602 10603 // add to parallax instances list 10604 10605 }, { 10606 key: 'addToParallaxList', 10607 value: function addToParallaxList() { 10608 jarallaxList.push(this); 10609 10610 if (jarallaxList.length === 1) { 10611 updateParallax(); 10612 } 10613 } 10614 10615 // remove from parallax instances list 10616 10617 }, { 10618 key: 'removeFromParallaxList', 10619 value: function removeFromParallaxList() { 10620 var self = this; 10621 10622 jarallaxList.forEach(function (item, key) { 10623 if (item.instanceID === self.instanceID) { 10624 jarallaxList.splice(key, 1); 10625 } 10626 }); 10627 } 10628 }, { 10629 key: 'destroy', 10630 value: function destroy() { 10631 var self = this; 10632 10633 self.removeFromParallaxList(); 10634 10635 // return styles on container as before jarallax init 10636 var originalStylesTag = self.$item.getAttribute('data-jarallax-original-styles'); 10637 self.$item.removeAttribute('data-jarallax-original-styles'); 10638 // null occurs if there is no style tag before jarallax init 10639 if (!originalStylesTag) { 10640 self.$item.removeAttribute('style'); 10641 } else { 10642 self.$item.setAttribute('style', originalStylesTag); 10643 } 10644 10645 if (self.image.useImgTag) { 10646 // return styles on img tag as before jarallax init 10647 var originalStylesImgTag = self.image.$item.getAttribute('data-jarallax-original-styles'); 10648 self.image.$item.removeAttribute('data-jarallax-original-styles'); 10649 // null occurs if there is no style tag before jarallax init 10650 if (!originalStylesImgTag) { 10651 self.image.$item.removeAttribute('style'); 10652 } else { 10653 self.image.$item.setAttribute('style', originalStylesTag); 10654 } 10655 10656 // move img tag to its default position 10657 if (self.image.$itemParent) { 10658 self.image.$itemParent.appendChild(self.image.$item); 10659 } 10660 } 10661 10662 // remove additional dom elements 10663 if (self.$clipStyles) { 10664 self.$clipStyles.parentNode.removeChild(self.$clipStyles); 10665 } 10666 if (self.image.$container) { 10667 self.image.$container.parentNode.removeChild(self.image.$container); 10668 } 10669 10670 // call onDestroy event 10671 if (self.options.onDestroy) { 10672 self.options.onDestroy.call(self); 10673 } 10674 10675 // delete jarallax from item 10676 delete self.$item.jarallax; 10677 } 10678 10679 // it will remove some image overlapping 10680 // overlapping occur due to an image position fixed inside absolute position element 10681 10682 }, { 10683 key: 'clipContainer', 10684 value: function clipContainer() { 10685 // needed only when background in fixed position 10686 if (this.image.position !== 'fixed') { 10687 return; 10688 } 10689 10690 var self = this; 10691 var rect = self.image.$container.getBoundingClientRect(); 10692 var width = rect.width, 10693 height = rect.height; 10694 10695 10696 if (!self.$clipStyles) { 10697 self.$clipStyles = document.createElement('style'); 10698 self.$clipStyles.setAttribute('type', 'text/css'); 10699 self.$clipStyles.setAttribute('id', 'jarallax-clip-' + self.instanceID); 10700 var head = document.head || document.getElementsByTagName('head')[0]; 10701 head.appendChild(self.$clipStyles); 10702 } 10703 10704 var styles = '#jarallax-container-' + self.instanceID + ' {\n clip: rect(0 ' + width + 'px ' + height + 'px 0);\n clip: rect(0, ' + width + 'px, ' + height + 'px, 0);\n }'; 10705 10706 // add clip styles inline (this method need for support IE8 and less browsers) 10707 if (self.$clipStyles.styleSheet) { 10708 self.$clipStyles.styleSheet.cssText = styles; 10709 } else { 10710 self.$clipStyles.innerHTML = styles; 10711 } 10712 } 10713 }, { 10714 key: 'coverImage', 10715 value: function coverImage() { 10716 var self = this; 10717 10718 var rect = self.image.$container.getBoundingClientRect(); 10719 var contH = rect.height; 10720 var speed = self.options.speed; 10721 10722 var isScroll = self.options.type === 'scroll' || self.options.type === 'scroll-opacity'; 10723 var scrollDist = 0; 10724 var resultH = contH; 10725 var resultMT = 0; 10726 10727 // scroll parallax 10728 if (isScroll) { 10729 // scroll distance and height for image 10730 if (speed < 0) { 10731 scrollDist = speed * Math.max(contH, wndH); 10732 } else { 10733 scrollDist = speed * (contH + wndH); 10734 } 10735 10736 // size for scroll parallax 10737 if (speed > 1) { 10738 resultH = Math.abs(scrollDist - wndH); 10739 } else if (speed < 0) { 10740
10740 resultH = scrollDist / speed + Math.abs(scrollDist); 10741 } else { 10742 resultH += Math.abs(wndH - contH) * (1 - speed); 10743 } 10744 10745 scrollDist /= 2; 10746 } 10747 10748 // store scroll distance 10749 self.parallaxScrollDistance = scrollDist; 10750 10751 // vertical center 10752 if (isScroll) { 10753 resultMT = (wndH - resultH) / 2; 10754 } else { 10755 resultMT = (contH - resultH) / 2; 10756 } 10757 10758 // apply result to item 10759 self.css(self.image.$item, { 10760 height: resultH + 'px', 10761 marginTop: resultMT + 'px', 10762 left: self.image.position === 'fixed' ? rect.left + 'px' : '0', 10763 width: rect.width + 'px' 10764 }); 10765 10766 // call onCoverImage event 10767 if (self.options.onCoverImage) { 10768 self.options.onCoverImage.call(self); 10769 } 10770 10771 // return some useful data. Used in the video cover function 10772 return { 10773 image: { 10774 height: resultH, 10775 marginTop: resultMT 10776 }, 10777 container: rect 10778 }; 10779 } 10780 }, { 10781 key: 'isVisible', 10782 value: function isVisible() { 10783 return this.isElementInViewport || false; 10784 } 10785 }, { 10786 key: 'onScroll', 10787 value: function onScroll(force) { 10788 var self = this; 10789 10790 var rect = self.$item.getBoundingClientRect(); 10791 var contT = rect.top; 10792 var contH = rect.height; 10793 var styles = {}; 10794 10795 // check if in viewport 10796 var viewportRect = rect; 10797 if (self.options.elementInViewport) { 10798 viewportRect = self.options.elementInViewport.getBoundingClientRect(); 10799 } 10800 self.isElementInViewport = viewportRect.bottom >= 0 && viewportRect.right >= 0 && viewportRect.top <= wndH && viewportRect.left <= wndW; 10801 10802 // stop calculations if item is not in viewport 10803 if (force ? false : !self.isElementInViewport) { 10804 return; 10805 } 10806 10807 // calculate parallax helping variables 10808 var beforeTop = Math.max(0, contT); 10809 var beforeTopEnd = Math.max(0, contH + contT); 10810 var afterTop = Math.max(0, -contT); 10811 var beforeBottom = Math.max(0, contT + contH - wndH); 10812 var beforeBottomEnd = Math.max(0, contH - (contT + contH - wndH)); 10813 var afterBottom = Math.max(0, -contT + wndH - contH); 10814 var fromViewportCenter = 1 - 2 * (wndH - contT) / (wndH + contH); 10815 10816 // calculate on how percent of section is visible 10817 var visiblePercent = 1; 10818 if (contH < wndH) { 10819 visiblePercent = 1 - (afterTop || beforeBottom) / contH; 10820 } else if (beforeTopEnd <= wndH) { 10821 visiblePercent = beforeTopEnd / wndH; 10822 } else if (beforeBottomEnd <= wndH) { 10823 visiblePercent = beforeBottomEnd / wndH; 10824 } 10825 10826 // opacity 10827 if (self.options.type === 'opacity' || self.options.type === 'scale-opacity' || self.options.type === 'scroll-opacity') {
10828 styles.transform = 'translate3d(0,0,0)'; 10829 styles.opacity = visiblePercent; 10830 } 10831 10832 // scale 10833 if (self.options.type === 'scale' || self.options.type === 'scale-opacity') { 10834 var scale = 1; 10835 if (self.options.speed < 0) { 10836 scale -= self.options.speed * visiblePercent; 10837 } else { 10838 scale += self.options.speed * (1 - visiblePercent); 10839 } 10840 styles.transform = 'scale(' + scale + ') translate3d(0,0,0)'; 10841 } 10842 10843 // scroll 10844 if (self.options.type === 'scroll' || self.options.type === 'scroll-opacity') { 10845 var positionY = self.parallaxScrollDistance * fromViewportCenter; 10846 10847 // fix if parallax block in absolute position 10848 if (self.image.position === 'absolute') { 10849 positionY -= contT; 10850 } 10851 10852 styles.transform = 'translate3d(0,' + positionY + 'px,0)'; 10853 } 10854 10855 self.css(self.image.$item, styles); 10856 10857 // call onScroll event 10858 if (self.options.onScroll) { 10859 self.options.onScroll.call(self, { 10860 section: rect, 10861 10862 beforeTop: beforeTop, 10863 beforeTopEnd: beforeTopEnd, 10864 afterTop: afterTop, 10865 beforeBottom: beforeBottom, 10866 beforeBottomEnd: beforeBottomEnd, 10867 afterBottom: afterBottom, 10868 10869 visiblePercent: visiblePercent, 10870 fromViewportCenter: fromViewportCenter 10871 }); 10872 } 10873 } 10874 }, { 10875 key: 'onResize', 10876 value: function onResize() { 10877 this.coverImage(); 10878 this.clipContainer(); 10879 } 10880 }]); 10881 10882 return Jarallax; 10883 }(); 10884 10885// global definition 10886 10887 10888 var plugin = function plugin(items) { 10889 // check for dom element 10890 // thanks: http://stackoverflow.com/questions/384286/javascript-isdom-how-do-you-check-if-a-javascript-object-is-a-dom-object 10891 if ((typeof HTMLElement === 'undefined' ? 'undefined' : _typeof(HTMLElement)) === 'object' ? items instanceof HTMLElement : items && (typeof items === 'undefined' ? 'undefined' : _typeof(items)) === 'object' && items !== null && items.nodeType === 1 && typeof items.nodeName === 'string') { 10892 items = [items]; 10893 } 10894 10895 var options = arguments[1]; 10896 var args = Array.prototype.slice.call(arguments, 2); 10897 var len = items.length; 10898 var k = 0; 10899 var ret = void 0; 10900 10901 for (k; k < len; k++) { 10902 if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object' || typeof options === 'undefined') { 10903 if (!items[k].jarallax) { 10904 items[k].jarallax = new Jarallax(items[k], options); 10905 } 10906 } else if (items[k].jarallax) { 10907 // eslint-disable-next-line prefer-spread 10908 ret = items[k].jarallax[options].apply(items[k].jarallax, args); 10909 } 10910 if (typeof ret !== 'undefined') { 10911 return ret; 10912 } 10913 } 10914 10915 return items; 10916 }; 10917 plugin.constructor = Jarallax; 10918 10919 exports.default = plugin; 10920 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(5))) 10921 10922 /***/ }), 10923 /* 14 */ 10924 /***/ (function(module, exports, __webpack_require__) { 10925 10926 "use strict"; 10927 10928 10929 var global = __webpack_require__(4); 10930 10931 /** 10932 * `requestAnimationFrame()` 10933 */ 10934 10935 var request = global.requestAnimationFrame || global.webkitRequestAnimationFrame || global.mozRequestAnimationFrame || fallback; 10936 10937 var prev = +new Date(); 10938 function fallback(fn) { 10939 var curr = +new Date(); 10940 var ms = Math.max(0, 16 - (curr - prev)); 10941 var req = setTimeout(fn, ms); 10942 return prev = curr, req; 10943 } 10944 10945 /** 10946 * `cancelAnimationFrame()` 10947 */ 10948 10949 var cancel = global.cancelAnimationFrame || global.webkitCancelAnimationFrame || global.mozCancelAnimationFrame || clearTimeout; 10950 10951 if (Function.prototype.bind) { 10952 request = request.bind(global); 10953 cancel = cancel.bind(global); 10954 } 10955 10956 exports = module.exports = request; 10957 exports.cancel = cancel; 10958 10959 /***/ }) 10960 /******/ ]); 10961 10962/*!
10963 * Name : Video Background Extension for Jarallax 10964 * Version : 1.0.1 10965 * Author : nK <https://nkdev.info> 10966 * GitHub : https://github.com/nk-o/jarallax 10967 */ 10968/******/ (function(modules) { // webpackBootstrap 10969 /******/ // The module cache 10970 /******/ var installedModules = {}; 10971 /******/ 10972 /******/ // The require function 10973 /******/ function __webpack_require__(moduleId) { 10974 /******/ 10975 /******/ // Check if module is in cache 10976 /******/ if(installedModules[moduleId]) { 10977 /******/ return installedModules[moduleId].exports; 10978 /******/ } 10979 /******/ // Create a new module (and put it into the cache) 10980 /******/ var module = installedModules[moduleId] = { 10981 /******/ i: moduleId, 10982 /******/ l: false, 10983 /******/ exports: {} 10984 /******/ }; 10985 /******/ 10986 /******/ // Execute the module function 10987 /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 10988 /******/ 10989 /******/ // Flag the module as loaded 10990 /******/ module.l = true; 10991 /******/ 10992 /******/ // Return the exports of the module 10993 /******/ return module.exports; 10994 /******/ } 10995 /******/ 10996 /******/ 10997 /******/ // expose the modules object (__webpack_modules__) 10998 /******/ __webpack_require__.m = modules; 10999 /******/ 11000 /******/ // expose the module cache 11001 /******/ __webpack_require__.c = installedModules; 11002 /******/ 11003 /******/ // define getter function for harmony exports 11004 /******/ __webpack_require__.d = function(exports, name, getter) { 11005 /******/ if(!__webpack_require__.o(exports, name)) { 11006 /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 11007 /******/ } 11008 /******/ }; 11009 /******/ 11010 /******/ // define __esModule on exports 11011 /******/ __webpack_require__.r = function(exports) { 11012 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 11013 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 11014 /******/ } 11015 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 11016 /******/ }; 11017 /******/ 11018 /******/ // create a fake namespace object 11019 /******/ // mode & 1: value is a module id, require it 11020 /******/ // mode & 2: merge all properties of value into the ns 11021 /******/ // mode & 4: return value when already ns object 11022 /******/ // mode & 8|1: behave like require 11023 /******/ __webpack_require__.t = function(value, mode) { 11024 /******/ if(mode & 1) value = __webpack_require__(value); 11025 /******/ if(mode & 8) return value; 11026 /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 11027 /******/ var ns = Object.create(null); 11028 /******/ __webpack_require__.r(ns); 11029 /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 11030 /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 11031 /******/ return ns; 11032 /******/ }; 11033 /******/ 11034 /******/ // getDefaultExport function for compatibility with non-harmony modules 11035 /******/ __webpack_require__.n = function(module) { 11036 /******/ var getter = module && module.__esModule ? 11037 /******/ function getDefault() { return module['default']; } : 11038 /******/ function getModuleExports() { return module; }; 11039 /******/ __webpack_require__.d(getter, 'a', getter); 11040 /******/ return getter; 11041 /******/ }; 11042 /******/ 11043 /******/ // Object.prototype.hasOwnProperty.call 11044 /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 11045 /******/ 11046 /******/ // __webpack_public_path__ 11047 /******/ __webpack_require__.p = ""; 11048 /******/ 11049 /******/ 11050 /******/ // Load entry module and return exports 11051 /******/ return __webpack_require__(__webpack_require__.s = 6); 11052 /******/ }) 11053/************************************************************************/ 11054/******/ ([ 11055 /* 0 */, 11056 /* 1 */, 11057 /* 2 */ 11058 /***/ (function(module, exports, __webpack_require__) { 11059 11060 "use strict"; 11061 11062 11063 module.exports = function (callback) { 11064 11065 if (document.readyState === 'complete' || document.readyState === 'interactive') { 11066 // Already ready or interactive, execute callback 11067 callback.call(); 11068 } else if (document.attachEvent) { 11069 // Old browsers 11070 document.attachEvent('onreadystatechange', function () { 11071 if (document.readyState === 'interactive') callback.call(); 11072 }); 11073 } else if (document.addEventListener) { 11074 // Modern browsers 11075 document.addEventListener('DOMContentLoaded', callback); 11076 } 11077 }; 11078 11079 /***/ }), 11080 /* 3 */, 11081 /* 4 */ 11082 /***/ (function(module, exports, __webpack_require__) { 11083 11084 "use strict"; 11085 /* WEBPACK VAR INJECTION */(function(global) { 11086 11087 var win; 11088 11089 if (typeof window !== "undefined") { 11090 win = window; 11091 } else if (typeof global !== "undefined") { 11092 win = global; 11093 } else if (typeof self !== "undefined") { 11094 win = self; 11095 } else { 11096 win = {}; 11097 } 11098 11099 module.exports = win; 11100 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(5))) 11101 11102 /***/ }), 11103 /* 5 */ 11104 /***/ (function(module, exports, __webpack_require__) { 11105 11106 "use strict"; 11107 11108 11109 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 11110 11111 var g; 11112 11113// This works in non-strict mode 11114 g = function () { 11115 return this; 11116 }(); 11117 11118 try { 11119 // This works if eval is allowed (see CSP) 11120 g = g || Function("return this")() || (1, eval)("this"); 11121 } catch (e) { 11122 // This works if the window reference is available 11123 if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === "object") g = window; 11124 } 11125 11126// g can still be undefined, but nothing to do about it... 11127// We return undefined, instead of nothing here, so it's 11128// easier to handle this case. if(!global) { ...} 11129 11130 module.exports = g; 11131 11132 /***/ }), 11133 /* 6 */ 11134 /***/ (function(module, exports, __webpack_require__) { 11135 11136 module.exports = __webpack_require__(7); 11137 11138 11139 /***/ }), 11140 /* 7 */ 11141 /***/ (function(module, exports, __webpack_require__) { 11142 11143 "use strict"; 11144 11145 11146 var _videoWorker = __webpack_require__(8); 11147 11148 var _videoWorker2 = _interopRequireDefault(_videoWorker); 11149 11150 var _global = __webpack_require__(4); 11151 11152 var _global2 = _interopRequireDefault(_global); 11153 11154 var _liteReady = __webpack_require__(2); 11155 11156 var _liteReady2 = _interopRequireDefault(_liteReady); 11157 11158 var _jarallaxVideo = __webpack_require__(10); 11159 11160 var _jarallaxVideo2 = _interopRequireDefault(_jarallaxVideo); 11161 11162 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 11163 11164// add video worker globally to fallback jarallax < 1.10 versions 11165 _global2.default.VideoWorker = _global2.default.VideoWorker || _videoWorker2.default; 11166 11167 (0, _jarallaxVideo2.default)(); 11168 11169// data-jarallax-video initialization 11170 (0, _liteReady2.default)(function () { 11171 if (typeof jarallax !== 'undefined') { 11172 jarallax(document.querySelectorAll('[data-jarallax-video]')); 11173 } 11174 }); 11175 11176 /***/ }), 11177 /* 8 */ 11178 /***/ (function(module, exports, __webpack_require__) { 11179 11180 "use strict"; 11181 11182 11183 module.exports = __webpack_require__(9); 11184 11185 /***/ }), 11186 /* 9 */ 11187 /***/ (function(module, exports, __webpack_require__) { 11188 11189 "use strict"; 11190 11191 11192 Object.defineProperty(exports, "__esModule", { 11193 value: true 11194 }); 11195 11196 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 11197 11198 var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 11199 11200 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 11201 11202// Deferred 11203// thanks http://stackoverflow.com/questions/18096715/implement-deferred-object-without-using-jquery 11204 function Deferred() { 11205 this._done = []; 11206 this._fail = []; 11207 } 11208 Deferred.prototype = {
11209 execute: function execute(list, args) { 11210 var i = list.length; 11211 args = Array.prototype.slice.call(args); 11212 while (i--) { 11213 list[i].apply(null, args); 11214 } 11215 }, 11216 resolve: function resolve() { 11217 this.execute(this._done, arguments); 11218 }, 11219 reject: function reject() { 11220 this.execute(this._fail, arguments); 11221 }, 11222 done: function done(callback) { 11223 this._done.push(callback); 11224 }, 11225 fail: function fail(callback) { 11226 this._fail.push(callback); 11227 } 11228 }; 11229 11230 var ID = 0; 11231 var YoutubeAPIadded = 0; 11232 var VimeoAPIadded = 0; 11233 var loadingYoutubePlayer = 0; 11234 var loadingVimeoPlayer = 0; 11235 var loadingYoutubeDefer = new Deferred(); 11236 var loadingVimeoDefer = new Deferred(); 11237 11238 var VideoWorker = function () { 11239 function VideoWorker(url, options) { 11240 _classCallCheck(this, VideoWorker); 11241 11242 var self = this; 11243 11244 self.url = url; 11245 11246 self.options_default = { 11247 autoplay: false, 11248 loop: false, 11249 mute: false, 11250 volume: 100, 11251 showContols: true, 11252 11253 // start / end video time in seconds 11254 startTime: 0, 11255 endTime: 0 11256 }; 11257 11258 self.options = self.extend({}, self.options_default, options); 11259 11260 // check URL 11261 self.videoID = self.parseURL(url); 11262 11263 // init 11264 if (self.videoID) { 11265 self.ID = ID++; 11266 self.loadAPI(); 11267 self.init(); 11268 } 11269 } 11270 11271 // Extend like jQuery.extend 11272 11273 11274 _createClass(VideoWorker, [{ 11275 key: 'extend', 11276 value: function extend(out) { 11277 var _arguments = arguments; 11278 11279 out = out || {}; 11280 Object.keys(arguments).forEach(function (i) { 11281 if (!_arguments[i]) { 11282 return; 11283 } 11284 Object.keys(_arguments[i]).forEach(function (key) { 11285 out[key] = _arguments[i][key]; 11286 }); 11287 }); 11288 return out; 11289 } 11290 }, { 11291 key: 'parseURL', 11292 value: function parseURL(url) { 11293 // parse youtube ID 11294 function getYoutubeID(ytUrl) { 11295 // eslint-disable-next-line no-useless-escape 11296 var regExp = /.*(?:youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=)([^#\&\?]*).*/; 11297 var match = ytUrl.match(regExp); 11298 return match && match[1].length === 11 ? match[1] : false; 11299 } 11300 11301 // parse vimeo ID 11302 function getVimeoID(vmUrl) { 11303 // eslint-disable-next-line no-useless-escape 11304 var regExp = /https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)/; 11305 var match = vmUrl.match(regExp); 11306 return match && match[3] ? match[3] : false; 11307 } 11308 11309 // parse local string 11310 function getLocalVideos(locUrl) { 11311 // eslint-disable-next-line no-useless-escape 11312 var videoFormats = locUrl.split(/,(?=mp4\:|webm\:|ogv\:|ogg\:)/); 11313 var result = {}; 11314 var ready = 0; 11315 videoFormats.forEach(function (val) { 11316 // eslint-disable-next-line no-useless-escape 11317 var match = val.match(/^(mp4|webm|ogv|ogg)\:(.*)/); 11318 if (match && match[1] && match[2]) { 11319 // eslint-disable-next-line prefer-destructuring 11320 result[match[1] === 'ogv' ? 'ogg' : match[1]] = match[2]; 11321 ready = 1; 11322 } 11323 }); 11324 return ready ? result : false;
11325 } 11326 11327 var Youtube = getYoutubeID(url); 11328 var Vimeo = getVimeoID(url); 11329 var Local = getLocalVideos(url); 11330 11331 if (Youtube) { 11332 this.type = 'youtube'; 11333 return Youtube; 11334 } else if (Vimeo) { 11335 this.type = 'vimeo'; 11336 return Vimeo; 11337 } else if (Local) { 11338 this.type = 'local'; 11339 return Local; 11340 } 11341 11342 return false; 11343 } 11344 }, { 11345 key: 'isValid', 11346 value: function isValid() { 11347 return !!this.videoID; 11348 } 11349 11350 // events 11351 11352 }, { 11353 key: 'on', 11354 value: function on(name, callback) { 11355 this.userEventsList = this.userEventsList || []; 11356 11357 // add new callback in events list 11358 (this.userEventsList[name] || (this.userEventsList[name] = [])).push(callback); 11359 } 11360 }, { 11361 key: 'off', 11362 value: function off(name, callback) { 11363 var _this = this; 11364 11365 if (!this.userEventsList || !this.userEventsList[name]) { 11366 return; 11367 } 11368 11369 if (!callback) { 11370 delete this.userEventsList[name]; 11371 } else { 11372 this.userEventsList[name].forEach(function (val, key) { 11373 if (val === callback) { 11374 _this.userEventsList[name][key] = false; 11375 } 11376 }); 11377 } 11378 } 11379 }, { 11380 key: 'fire', 11381 value: function fire(name) { 11382 var _this2 = this; 11383 11384 var args = [].slice.call(arguments, 1); 11385 if (this.userEventsList && typeof this.userEventsList[name] !== 'undefined') { 11386 this.userEventsList[name].forEach(function (val) { 11387 // call with all arguments 11388 if (val) { 11389 val.apply(_this2, args); 11390 } 11391 }); 11392 } 11393 } 11394 }, { 11395 key: 'play', 11396 value: function play(start) { 11397 var self = this; 11398 if (!self.player) { 11399 return; 11400 } 11401 11402 if (self.type === 'youtube' && self.player.playVideo) { 11403 if (typeof start !== 'undefined') { 11404 self.player.seekTo(start || 0); 11405 } 11406 if (YT.PlayerState.PLAYING !== self.player.getPlayerState()) { 11407 self.player.playVideo(); 11408 } 11409 } 11410 11411 if (self.type === 'vimeo') { 11412 if (typeof start !== 'undefined') { 11413 self.player.setCurrentTime(start); 11414 } 11415 self.player.getPaused().then(function (paused) { 11416 if (paused) { 11417 self.player.play(); 11418 } 11419 }); 11420 } 11421 11422 if (self.type === 'local') { 11423 if (typeof start !== 'undefined') { 11424 self.player.currentTime = start; 11425 } 11426 if (self.player.paused) { 11427 self.player.play(); 11428 } 11429 } 11430 } 11431 }, { 11432 key: 'pause', 11433 value: function pause() { 11434 var self = this; 11435 if (!self.player) { 11436 return; 11437 } 11438 11439 if (self.type === 'youtube' && self.player.pauseVideo) { 11440 if (YT.PlayerState.PLAYING === self.player.getPlayerState()) { 11441 self.player.pauseVideo(); 11442 } 11443 } 11444 11445 if (self.type === 'vimeo') { 11446 self.player.getPaused().then(function (paused) { 11447 if (!paused) { 11448 self.player.pause(); 11449 } 11450 }); 11451 } 11452 11453 if (self.type === 'local') { 11454 if (!self.player.paused) { 11455 self.player.pause(); 11456 } 11457 } 11458 } 11459 }, { 11460 key: 'mute', 11461 value: function mute() { 11462 var self = this; 11463 if (!self.player) { 11464 return; 11465 } 11466 11467 if (self.type === 'youtube' && self.player.mute) { 11468 self.player.mute(); 11469 } 11470 11471 if (self.type === 'vimeo' && self.player.setVolume) { 11472 self.player.setVolume(0); 11473 } 11474 11475 if (self.type === 'local') { 11476 self.$video.muted = true; 11477 } 11478 } 11479 }, { 11480 key: 'unmute', 11481 value: function unmute() { 11482 var self = this; 11483 if (!self.player) { 11484 return; 11485 } 11486 11487 if (self.type === 'youtube' && self.player.mute) { 11488 self.player.unMute(); 11489 } 11490 11491 if (self.type === 'vimeo' && self.player.setVolume) { 11492 self.player.setVolume(self.options.volume); 11493 } 11494 11495 if (self.type === 'local') { 11496 self.$video.muted = false;
11497 } 11498 } 11499 }, { 11500 key: 'setVolume', 11501 value: function setVolume() { 11502 var volume = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; 11503 11504 var self = this; 11505 if (!self.player || !volume) { 11506 return; 11507 } 11508 11509 if (self.type === 'youtube' && self.player.setVolume) { 11510 self.player.setVolume(volume); 11511 } 11512 11513 if (self.type === 'vimeo' && self.player.setVolume) { 11514 self.player.setVolume(volume); 11515 } 11516 11517 if (self.type === 'local') { 11518 self.$video.volume = volume / 100; 11519 } 11520 } 11521 }, { 11522 key: 'getVolume', 11523 value: function getVolume(callback) { 11524 var self = this; 11525 if (!self.player) { 11526 callback(false); 11527 return; 11528 } 11529 11530 if (self.type === 'youtube' && self.player.getVolume) { 11531 callback(self.player.getVolume()); 11532 } 11533 11534 if (self.type === 'vimeo' && self.player.getVolume) { 11535 self.player.getVolume().then(function (volume) { 11536 callback(volume); 11537 }); 11538 } 11539 11540 if (self.type === 'local') { 11541 callback(self.$video.volume * 100); 11542 } 11543 } 11544 }, { 11545 key: 'getMuted', 11546 value: function getMuted(callback) { 11547 var self = this; 11548 if (!self.player) { 11549 callback(null); 11550 return; 11551 } 11552 11553 if (self.type === 'youtube' && self.player.isMuted) { 11554 callback(self.player.isMuted()); 11555 } 11556 11557 if (self.type === 'vimeo' && self.player.getVolume) { 11558 self.player.getVolume().then(function (volume) { 11559 callback(!!volume); 11560 }); 11561 } 11562 11563 if (self.type === 'local') { 11564 callback(self.$video.muted); 11565 } 11566 } 11567 }, { 11568 key: 'getImageURL', 11569 value: function getImageURL(callback) { 11570 var self = this; 11571 11572 if (self.videoImage) { 11573 callback(self.videoImage); 11574 return; 11575 } 11576 11577 if (self.type === 'youtube') { 11578 var availableSizes = ['maxresdefault', 'sddefault', 'hqdefault', '0']; 11579 var step = 0; 11580 11581 var tempImg = new Image(); 11582 tempImg.onload = function () { 11583 // if no thumbnail, youtube add their own image with width = 120px 11584 if ((this.naturalWidth || this.width) !== 120 || step === availableSizes.length - 1) { 11585 // ok 11586 self.videoImage = 'https://img.youtube.com/vi/' + self.videoID + '/' + availableSizes[step] + '.jpg'; 11587 callback(self.videoImage); 11588 } else { 11589 // try another size 11590 step++; 11591 this.src = 'https://img.youtube.com/vi/' + self.videoID + '/' + availableSizes[step] + '.jpg'; 11592 } 11593 }; 11594 tempImg.src = 'https://img.youtube.com/vi/' + self.videoID + '/' + availableSizes[step] + '.jpg'; 11595 } 11596 11597 if (self.type === 'vimeo') { 11598 var request = new XMLHttpRequest(); 11599 request.open('GET', 'https://vimeo.com/api/v2/video/' + self.videoID + '.json', true); 11600 request.onreadystatechange = function () { 11601 if (this.readyState === 4) { 11602 if (this.status >= 200 && this.status < 400) { 11603 // Success! 11604 var response = JSON.parse(this.responseText); 11605 self.videoImage = response[0].thumbnail_large; 11606 callback(self.videoImage); 11607 } else { 11608 // Error :( 11609 } 11610 } 11611 }; 11612 request.send(); 11613 request = null; 11614 } 11615 } 11616 11617 // fallback to the old version. 11618 11619 }, { 11620 key: 'getIframe', 11621 value: function getIframe(callback) { 11622 this.getVideo(callback); 11623 } 11624 }, { 11625 key: 'getVideo', 11626 value: function getVideo(callback) { 11627 var self = this; 11628 11629 // return generated video block 11630 if (self.$video) { 11631 callback(self.$video); 11632 return; 11633 } 11634 11635 // generate new video block 11636 self.onAPIready(function () { 11637 var hiddenDiv = void 0; 11638 if (!self.$video) { 11639 hiddenDiv = document.createElement('div'); 11640 hiddenDiv.style.display = 'none'; 11641 } 11642 11643 // Youtube
11644 if (self.type === 'youtube') { 11645 self.playerOptions = {}; 11646 self.playerOptions.videoId = self.videoID; 11647 self.playerOptions.playerVars = { 11648 autohide: 1, 11649 rel: 0, 11650 autoplay: 0, 11651 // autoplay enable on mobile devices 11652 playsinline: 1 11653 }; 11654 11655 // hide controls 11656 if (!self.options.showContols) { 11657 self.playerOptions.playerVars.iv_load_policy = 3; 11658 self.playerOptions.playerVars.modestbranding = 1; 11659 self.playerOptions.playerVars.controls = 0; 11660 self.playerOptions.playerVars.showinfo = 0; 11661 self.playerOptions.playerVars.disablekb = 1; 11662 } 11663 11664 // events 11665 var ytStarted = void 0; 11666 var ytProgressInterval = void 0; 11667 self.playerOptions.events = { 11668 onReady: function onReady(e) { 11669 // mute 11670 if (self.options.mute) { 11671 e.target.mute(); 11672 } else if (self.options.volume) { 11673 e.target.setVolume(self.options.volume); 11674 } 11675 11676 // autoplay 11677 if (self.options.autoplay) { 11678 self.play(self.options.startTime); 11679 } 11680 self.fire('ready', e); 11681 11682 // volumechange 11683 setInterval(function () { 11684 self.getVolume(function (volume) { 11685 if (self.options.volume !== volume) { 11686 self.options.volume = volume; 11687 self.fire('volumechange', e); 11688 } 11689 }); 11690 }, 150); 11691 }, 11692 onStateChange: function onStateChange(e) { 11693 // loop 11694 if (self.options.loop && e.data === YT.PlayerState.ENDED) { 11695 self.play(self.options.startTime); 11696 } 11697 if (!ytStarted && e.data === YT.PlayerState.PLAYING) { 11698 ytStarted = 1; 11699 self.fire('started', e); 11700 } 11701 if (e.data === YT.PlayerState.PLAYING) { 11702 self.fire('play', e); 11703 } 11704 if (e.data === YT.PlayerState.PAUSED) { 11705 self.fire('pause', e); 11706 } 11707 if (e.data === YT.PlayerState.ENDED) { 11708 self.fire('ended', e); 11709 } 11710 11711 // progress check 11712 if (e.data === YT.PlayerState.PLAYING) { 11713 ytProgressInterval = setInterval(function () { 11714 self.fire('timeupdate', e); 11715 11716 // check for end of video and play again or stop 11717 if (self.options.endTime && self.player.getCurrentTime() >= self.options.endTime) { 11718 if (self.options.loop) { 11719 self.play(self.options.startTime); 11720 } else { 11721 self.pause(); 11722 } 11723 } 11724 }, 150); 11725 } else { 11726 clearInterval(ytProgressInterval); 11727 } 11728 } 11729 }; 11730 11731 var firstInit = !self.$video; 11732 if (firstInit) { 11733 var div = document.createElement('div'); 11734 div.setAttribute('id', self.playerID); 11735 hiddenDiv.appendChild(div); 11736 document.body.appendChild(hiddenDiv); 11737 } 11738 self.player = self.player || new window.YT.Player(self.playerID, self.playerOptions); 11739 if (firstInit) { 11740 self.$video = document.getElementById(self.playerID); 11741 11742 // get video width and height 11743 self.videoWidth = parseInt(self.$video.getAttribute('width'), 10) || 1280; 11744 self.videoHeight = parseInt(self.$video.getAttribute('height'), 10) || 720; 11745 } 11746 } 11747 11748 // Vimeo 11749 if (self.type === 'vimeo') { 11750 self.playerOptions = ''; 11751 11752 self.playerOptions += 'player_id=' + self.playerID; 11753 self.playerOptions += '&autopause=0'; 11754 self.playerOptions += '&transparent=0'; 11755 11756 // hide controls 11757 if (!self.options.showContols) { 11758 self.playerOptions += '&badge=0&byline=0&portrait=0&title=0'; 11759 } 11760 11761 // autoplay 11762 self.playerOptions += '&autoplay=' + (self.options.autoplay ? '1' : '0'); 11763 11764 // loop 11765 self.playerOptions += '&loop=' + (self.options.loop ? 1 : 0); 11766 11767 if (!self.$video) { 11768 self.$video = document.createElement('iframe'); 11769 self.$video.setAttribute('id', self.playerID); 11770 self.$video.setAttribute('src', 'https://player.vimeo.com/video/' + self.videoID + '?' + self.playerOptions); 11771 self.$video.setAttribute('frameborder', '0'); 11772 hiddenDiv.appendChild(self.$video); 11773 document.body.appendChild(hiddenDiv); 11774 } 11775 11776 self.player = self.player || new Vimeo.Player(self.$video); 11777 11778 // get video width and height 11779 self.player.getVideoWidth().then(function (width) { 11780 self.videoWidth = width || 1280; 11781 }); 11782 self.player.getVideoHeight().then(function (height) { 11783 self.videoHeight = height || 720; 11784 }); 11785 11786 // set current time for autoplay 11787 if (self.options.startTime && self.options.autoplay) { 11788 self.player.setCurrentTime(self.options.startTime); 11789 } 11790 11791 // mute 11792 if (self.options.mute) { 11793 self.player.setVolume(0); 11794 } else if (self.options.volume) { 11795 self.player.setVolume(self.options.volume); 11796 } 11797 11798 var vmStarted = void 0; 11799 self.player.on('timeupdate', function (e) { 11800 if (!vmStarted) { 11801 self.fire('started', e); 11802 vmStarted = 1; 11803 } 11804 11805 self.fire('timeupdate', e); 11806 11807 // check for end of video and play again or stop 11808 if (self.options.endTime) { 11809 if (self.options.endTime && e.seconds >= self.options.endTime) { 11810 if (self.options.loop) { 11811 self.play(self.options.startTime); 11812 } else { 11813 self.pause(); 11814 } 11815 } 11816 } 11817 }); 11818 self.player.on('play', function (e) { 11819 self.fire('play', e); 11820 11821 // check for the start time and start with it 11822 if (self.options.startTime && e.seconds === 0) { 11823 self.play(self.options.startTime); 11824 } 11825 }); 11826 self.player.on('pause', function (e) { 11827 self.fire('pause', e); 11828 }); 11829 self.player.on('ended', function (e) { 11830 self.fire('ended', e); 11831 }); 11832 self.player.on('loaded', function (e) { 11833 self.fire('ready', e); 11834 }); 11835 self.player.on('volumechange', function (e) { 11836 self.fire('volumechange', e); 11837 }); 11838 } 11839 11840 // Local 11841 function addSourceToLocal(element, src, type) { 11842 var source = document.createElement('source'); 11843 source.src = src; 11844 source.type = type; 11845 element.appendChild(source); 11846 } 11847 if (self.type === 'local') { 11848 if (!self.$video) { 11849 self.$video = document.createElement('video'); 11850 11851 // show controls 11852 if (self.options.showContols) { 11853 self.$video.controls = true; 11854 } 11855 11856 // mute 11857 if (self.options.mute) { 11858 self.$video.muted = true; 11859 } else if (self.$video.volume) { 11860 self.$video.volume = self.options.volume / 100; 11861 } 11862 11863 // loop 11864 if (self.options.loop) { 11865 self.$video.loop = true; 11866 } 11867 11868 // autoplay enable on mobile devices 11869 self.$video.setAttribute('playsinline', ''); 11870 self.$video.setAttribute('webkit-playsinline', ''); 11871 11872 self.$video.setAttribute('id', self.playerID); 11873 hiddenDiv.appendChild(self.$video); 11874 document.body.appendChild(hiddenDiv); 11875 11876 Object.keys(self.videoID).forEac
11876h(function (key) { 11877 addSourceToLocal(self.$video, self.videoID[key], 'video/' + key); 11878 }); 11879 } 11880 11881 self.player = self.player || self.$video; 11882 11883 var locStarted = void 0; 11884 self.player.addEventListener('playing', function (e) { 11885 if (!locStarted) { 11886 self.fire('started', e); 11887 } 11888 locStarted = 1; 11889 }); 11890 self.player.addEventListener('timeupdate', function (e) { 11891 self.fire('timeupdate', e); 11892 11893 // check for end of video and play again or stop 11894 if (self.options.endTime) { 11895 if (self.options.endTime && this.currentTime >= self.options.endTime) { 11896 if (self.options.loop) { 11897 self.play(self.options.startTime); 11898 } else { 11899 self.pause(); 11900 } 11901 } 11902 } 11903 }); 11904 self.player.addEventListener('play', function (e) { 11905 self.fire('play', e); 11906 }); 11907 self.player.addEventListener('pause', function (e) { 11908 self.fire('pause', e); 11909 }); 11910 self.player.addEventListener('ended', function (e) { 11911 self.fire('ended', e); 11912 }); 11913 self.player.addEventListener('loadedmetadata', function () { 11914 // get video width and height 11915 self.videoWidth = this.videoWidth || 1280; 11916 self.videoHeight = this.videoHeight || 720; 11917 11918 self.fire('ready'); 11919 11920 // autoplay 11921 if (self.options.autoplay) { 11922 self.play(self.options.startTime); 11923 } 11924 }); 11925 self.player.addEventListener('volumechange', function (e) { 11926 self.getVolume(function (volume) { 11927 self.options.volume = volume; 11928 }); 11929 self.fire('volumechange', e); 11930 }); 11931 } 11932 11933 callback(self.$video); 11934 }); 11935 } 11936 }, { 11937 key: 'init', 11938 value: function init() { 11939 var self = this; 11940 11941 self.playerID = 'VideoWorker-' + self.ID; 11942 } 11943 }, { 11944 key: 'loadAPI', 11945 value: function loadAPI() { 11946 var self = this; 11947 11948 if (YoutubeAPIadded && VimeoAPIadded) { 11949 return; 11950 } 11951 11952 var src = ''; 11953 11954 // load Youtube API 11955 if (self.type === 'youtube' && !YoutubeAPIadded) { 11956 YoutubeAPIadded = 1; 11957 src = 'https://www.youtube.com/iframe_api'; 11958 } 11959 11960 // load Vimeo API 11961 if (self.type === 'vimeo' && !VimeoAPIadded) { 11962 VimeoAPIadded = 1; 11963 src = 'https://player.vimeo.com/api/player.js'; 11964 } 11965 11966 if (!src) { 11967 return; 11968 } 11969 11970 // add script in head section 11971 var tag = document.createElement('script'); 11972 var head = document.getElementsByTagName('head')[0]; 11973 tag.src = src; 11974 11975 head.appendChild(tag); 11976 11977 head = null; 11978 tag = null; 11979 } 11980 }, { 11981 key: 'onAPIready', 11982 value: function onAPIready(callback) { 11983 var self = this; 11984 11985 // Youtube
11986 if (self.type === 'youtube') { 11987 // Listen for global YT player callback 11988 if ((typeof YT === 'undefined' || YT.loaded === 0) && !loadingYoutubePlayer) { 11989 // Prevents Ready event from being called twice 11990 loadingYoutubePlayer = 1; 11991 11992 // Creates deferred so, other players know when to wait. 11993 window.onYouTubeIframeAPIReady = function () { 11994 window.onYouTubeIframeAPIReady = null; 11995 loadingYoutubeDefer.resolve('done'); 11996 callback(); 11997 }; 11998 } else if ((typeof YT === 'undefined' ? 'undefined' : _typeof(YT)) === 'object' && YT.loaded === 1) { 11999 callback(); 12000 } else { 12001 loadingYoutubeDefer.done(function () { 12002 callback(); 12003 }); 12004 } 12005 } 12006 12007 // Vimeo 12008 if (self.type === 'vimeo') { 12009 if (typeof Vimeo === 'undefined' && !loadingVimeoPlayer) { 12010 loadingVimeoPlayer = 1; 12011 var vimeoInterval = setInterval(function () { 12012 if (typeof Vimeo !== 'undefined') { 12013 clearInterval(vimeoInterval); 12014 loadingVimeoDefer.resolve('done'); 12015 callback(); 12016 } 12017 }, 20); 12018 } else if (typeof Vimeo !== 'undefined') { 12019 callback(); 12020 } else { 12021 loadingVimeoDefer.done(function () { 12022 callback(); 12023 }); 12024 } 12025 } 12026 12027 // Local 12028 if (self.type === 'local') { 12029 callback(); 12030 } 12031 } 12032 }]); 12033 12034 return VideoWorker; 12035 }(); 12036 12037 exports.default = VideoWorker; 12038 12039 /***/ }), 12040 /* 10 */ 12041 /***/ (function(module, exports, __webpack_require__) { 12042 12043 "use strict"; 12044 12045 12046 Object.defineProperty(exports, "__esModule", { 12047 value: true 12048 }); 12049 exports.default = jarallaxVideo; 12050 12051 var _videoWorker = __webpack_require__(8); 12052 12053 var _videoWorker2 = _interopRequireDefault(_videoWorker); 12054 12055 var _global = __webpack_require__(4); 12056 12057 var _global2 = _interopRequireDefault(_global); 12058 12059 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 12060 12061 function jarallaxVideo() { 12062 var jarallax = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _global2.default.jarallax; 12063 12064 if (typeof jarallax === 'undefined') { 12065 return; 12066 } 12067 12068 var Jarallax = jarallax.constructor; 12069 12070 // append video after init Jarallax 12071 var defInit = Jarallax.prototype.init; 12072 Jarallax.prototype.init = function () { 12073 var self = this; 12074 12075 defInit.apply(self); 12076 12077 if (self.video && !self.options.disableVideo()) { 12078 self.video.getVideo(function (video) { 12079 var $parent = video.parentNode; 12080 self.css(video, { 12081 position: self.image.position, 12082 top: '0px', 12083 left: '0px', 12084 right: '0px', 12085 bottom: '0px', 12086 width: '100%', 12087 height: '100%', 12088 maxWidth: 'none', 12089 maxHeight: 'none', 12090 margin: 0, 12091 zIndex: -1 12092 }); 12093 self.$video = video; 12094 self.image.$container.appendChild(video); 12095 12096 // remove parent video element (created by VideoWorker) 12097 $parent.parentNode.removeChild($parent); 12098 }); 12099 } 12100 }; 12101 12102 // cover video 12103 var defCoverImage = Jarallax.prototype.coverImage; 12104 Jarallax.prototype.coverImage = function () { 12105 var self = this; 12106 var imageData = defCoverImage.apply(self); 12107 var node = self.image.$item ? self.image.$item.nodeName : false;
12108 12109 if (imageData && self.video && node && (node === 'IFRAME' || node === 'VIDEO')) { 12110 var h = imageData.image.height; 12111 var w = h * self.image.width / self.image.height; 12112 var ml = (imageData.container.width - w) / 2; 12113 var mt = imageData.image.marginTop; 12114 12115 if (imageData.container.width > w) { 12116 w = imageData.container.width; 12117 h = w * self.image.height / self.image.width; 12118 ml = 0; 12119 mt += (imageData.image.height - h) / 2; 12120 } 12121 12122 // add video height over than need to hide controls 12123 if (node === 'IFRAME') { 12124 h += 400; 12125 mt -= 200; 12126 } 12127 12128 self.css(self.$video, { 12129 width: w + 'px', 12130 marginLeft: ml + 'px', 12131 height: h + 'px', 12132 marginTop: mt + 'px' 12133 }); 12134 } 12135 12136 return imageData; 12137 }; 12138 12139 // init video 12140 var defInitImg = Jarallax.prototype.initImg; 12141 Jarallax.prototype.initImg = function () { 12142 var self = this; 12143 var defaultResult = defInitImg.apply(self); 12144 12145 if (!self.options.videoSrc) { 12146 self.options.videoSrc = self.$item.getAttribute('data-jarallax-video') || null; 12147 } 12148 12149 if (self.options.videoSrc) { 12150 self.defaultInitImgResult = defaultResult; 12151 return true; 12152 } 12153 12154 return defaultResult; 12155 }; 12156 12157 var defCanInitParallax = Jarallax.prototype.canInitParallax; 12158 Jarallax.prototype.canInitParallax = function () { 12159 var self = this; 12160 var defaultResult = defCanInitParallax.apply(self); 12161 12162 if (!self.options.videoSrc) { 12163 return defaultResult; 12164 } 12165 12166 var video = new _videoWorker2.default(self.options.videoSrc, { 12167 autoplay: true, 12168 loop: true, 12169 showContols: false, 12170 startTime: self.options.videoStartTime || 0, 12171 endTime: self.options.videoEndTime || 0, 12172 mute: self.options.videoVolume ? 0 : 1, 12173 volume: self.options.videoVolume || 0 12174 }); 12175 12176 if (video.isValid()) { 12177 // if parallax will not be inited, we can add thumbnail on background. 12178 if (!defaultResult) { 12179 if (!self.defaultInitImgResult) { 12180 video.getImageURL(function (url) { 12181 // save default user styles 12182 var curStyle = self.$item.getAttribute('style'); 12183 if (curStyle) { 12184 self.$item.setAttribute('data-jarallax-original-styles', curStyle); 12185 } 12186 12187 // set new background 12188 self.css(self.$item, { 12189 'background-image': 'url("' + url + '")', 12190 'background-position': 'center', 12191 'background-size': 'cover' 12192 }); 12193 }); 12194 } 12195 12196 // init video 12197 } else { 12198 video.on('ready', function () { 12199 if (self.options.videoPlayOnlyVisible) { 12200 var oldOnScroll = self.onScroll; 12201 self.onScroll = function () { 12202 oldOnScroll.apply(self); 12203 if (self.isVisible()) { 12204 video.play(); 12205 } else { 12206 video.pause(); 12207 } 12208 }; 12209 } else { 12210 video.play(); 12211 } 12212 }); 12213 12214 video.on('started', function () { 12215 self.image.$default_item = self.image.$item; 12216 self.image.$item = self.$video; 12217 12218 // set video width and height 12219 self.image.width = self.video.videoWidth || 1280; 12220 self.image.height = self.video.videoHeight || 720; 12221 self.options.imgWidth = self.image.width; 12222 self.options.imgHeight = self.image.height; 12223 self.coverImage(); 12224 self.clipContainer(); 12225 self.onScroll(); 12226 12227 // hide image 12228 if (self.image.$default_item) { 12229 self.image.$default_item.style.display = 'none'; 12230 } 12231 }); 12232 12233 self.video = video; 12234 12235 // set image if not exists 12236 if (!self.defaultInitImgResult) { 12237 if (video.type !== 'local') { 12238 video.getImageURL(function (url) { 12239 self.image.src = url; 12240 self.init(); 12241 }); 12242 12243 return false;
12244 } 12245 12246 // set empty image on local video if not defined 12247 self.image.src = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'; 12248 return true; 12249 } 12250 } 12251 } 12252 12253 return defaultResult; 12254 }; 12255 12256 // Destroy video parallax 12257 var defDestroy = Jarallax.prototype.destroy; 12258 Jarallax.prototype.destroy = function () { 12259 var self = this; 12260 12261 if (self.image.$default_item) { 12262 self.image.$item = self.image.$default_item; 12263 delete self.image.$default_item; 12264 } 12265 12266 defDestroy.apply(self); 12267 }; 12268 } 12269 12270 /***/ }) 12271 /******/ ]); 12272"use strict"; 12273 12274function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 12275 12276function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 12277 12278function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 12279 12280(function ($) { 12281 var INPUT_DATA = {}; 12282 var DATA_COLOR = ''; 12283 var BUTTON_X_COLOR = ''; 12284 var BUTTON_X_BLUR_COLOR = '#ced4da'; 12285 var INPUT_FOCUS = '1px solid #4285f4'; 12286 var INPUT_BLUR = '1px solid #ced4da'; 12287 var INPUT_FOCUS_SHADOW = '0 1px 0 0 #4285f4'; 12288 var INPUT_BLUR_SHADOW = ''; 12289 var ENTER_CHAR_CODE = 13; 12290 12291 var mdbAutocomplete = 12292 /*#__PURE__*/ 12293 function () { 12294 function mdbAutocomplete(input, options) { 12295 _classCallCheck(this, mdbAutocomplete); 12296 12297 this.defaults = { 12298 data: INPUT_DATA, 12299 dataColor: DATA_COLOR, 12300 xColor: BUTTON_X_COLOR, 12301 xBlurColor: BUTTON_X_BLUR_COLOR, 12302 inputFocus: INPUT_FOCUS, 12303 inputBlur: INPUT_BLUR, 12304 inputFocusShadow: INPUT_FOCUS_SHADOW, 12305 inputBlurShadow: INPUT_BLUR_SHADOW 12306 }; 12307 this.$input = input; 12308 this.options = this.assignOptions(options); 12309 this.$clearButton = $('.mdb-autocomplete-clear'); 12310 this.$autocompleteWrap = $('<ul class="mdb-autocomplete-wrap"></ul>'); 12311 this.init(); 12312 } 12313 12314 _createClass(mdbAutocomplete, [{ 12315 key: "init", 12316 value: function init() { 12317 this.setData(); 12318 this.inputFocus(); 12319 this.inputBlur(); 12320 this.inputKeyupData(); 12321 this.inputLiClick(); 12322 this.clearAutocomplete(); 12323 } 12324 }, { 12325 key: "assignOptions", 12326 value: function assignOptions(newOptions) { 12327 return $.extend({}, this.defaults, newOptions); 12328 } 12329 }, { 12330 key: "setData", 12331 value: function setData() { 12332 if (Object.keys(this.options.data).length) { 12333 this.$autocompleteWrap.insertAfter(this.$input); 12334 } 12335 } 12336 }, { 12337 key: "inputFocus", 12338 value: function inputFocus() { 12339 var _this = this; 12340 12341 this.$input.on('focus', function () { 12342 _this.$input.css('border-bottom', _this.options.inputFocus); 12343 12344 _this.$input.css('box-shadow', _this.options.inputFocusShadow); 12345 }); 12346 } 12347 }, { 12348 key: "inputBlur", 12349 value: function inputBlur() { 12350 var _this2 = this; 12351 12352 this.$input.on('blur', function () { 12353 _this2.$input.css('border-bottom', _this2.options.inputBlur); 12354 12355 _this2.$input.css('box-shadow', _this2.options.inputBlurShadow); 12356 }); 12357 } 12358 }, { 12359 key: "inputKeyupData", 12360 value: function inputKeyupData() { 12361 var _this3 = this; 12362 12363 this.$input.on('keyup', function (e) { 12364 var $inputValue = _this3.$input.val(); 12365 12366 _this3.$autocompleteWrap.empty(); 12367 12368 if ($inputValue.length) { 12369 for (var item in _this3.options.data) { 12370 if (_this3.options.data[item].toLowerCase().indexOf($inputValue.toLowerCase()) !== -1) { 12371 var option = $("<li>".concat(_this3.options.data[item], "</li>")); 12372 12373 _this3.$autocompleteWrap.append(option); 12374 } 12375 } 12376 } 12377 12378 if (e.which === ENTER_CHAR_CODE) { 12379 _this3.$autocompleteWrap.children(':first').trigger('click'); 12380 12381 _this3.$autocompleteWrap.empty(); 12382 } 12383 12384 if ($inputValue.length === 0) { 12385 _this3.$input.parent().find('.mdb-autocomplete-clear').css('visibility', 'hidden'); 12386 } else { 12387 _this3.$input.parent().find('.mdb-autocomplete-clear').css('visibility', 'visible'); 12388 } 12389 12390 _this3.$autocompleteWrap.children().css('color', _this3.options.dataColor); 12391 }); 12392 } 12393 }, { 12394 key: "inputLiClick",
12395 value: function inputLiClick() { 12396 var _this4 = this; 12397 12398 this.$autocompleteWrap.on('click', 'li', function (e) { 12399 e.preventDefault(); 12400 12401 _this4.$input.val($(e.target).text()); 12402 12403 _this4.$autocompleteWrap.empty(); 12404 }); 12405 } 12406 }, { 12407 key: "clearAutocomplete", 12408 value: function clearAutocomplete() { 12409 var _this5 = this; 12410 12411 this.$clearButton.on('click', function (e) { 12412 e.preventDefault(); 12413 var $this = $(e.currentTarget); 12414 $this.parent().find('.mdb-autocomplete').val(''); 12415 $this.css('visibility', 'hidden'); 12416 12417 _this5.$autocompleteWrap.empty(); 12418 12419 $this.parent().find('label').removeClass('active'); 12420 }); 12421 } 12422 }, { 12423 key: "changeSVGcolors", 12424 value: function changeSVGcolors() { 12425 if (this.$input.hasClass('mdb-autocomplete')) { 12426 this.$input.on('click keyup', function (e) { 12427 e.preventDefault(); 12428 $(e.target).parent().find('.mdb-autocomplete-clear').find('svg').css('fill', xColor); 12429 }); 12430 this.$input.on('blur', function (e) { 12431 e.preventDefault(); 12432 $(e.target).parent().find('.mdb-autocomplete-clear').find('svg').css('fill', xBlurColor); 12433 }); 12434 } 12435 } 12436 }]); 12437 12438 return mdbAutocomplete; 12439 }(); 12440 12441 $.fn.mdbAutocomplete = function (options) { 12442 return this.each(function () { 12443 new mdbAutocomplete($(this), options); 12444 }); 12445 }; //deprecated, delete soon 12446 12447 12448 $.fn.mdb_autocomplete = $.fn.mdbAutocomplete; 12449})(jQuery); 12450/* 12451 Enhanced Bootstrap Modals 12452 https://mdbootstrap.com 12453 [email protected] 12454*/ 12455 12456(function($){ 12457 $('body').on('shown.bs.modal', '.modal', function() { 12458 if(!$('.modal-backdrop').length) { 12459 12460 $modal_dialog = $(this).children('.modal-dialog') 12461 12462 if($modal_dialog.hasClass('modal-side')) { 12463 $(this).addClass('modal-scrolling'); 12464 $('body').addClass('scrollable'); 12465 } 12466 12467 if($modal_dialog.hasClass('modal-frame')) { 12468 $(this).addClass('modal-content-clickable'); 12469 $('body').addClass('scrollable'); 12470 } 12471 } 12472 }); 12473 $('body').on('hidden.bs.modal', '.modal', function() { 12474 $('body').removeClass('scrollable'); 12475 }); 12476})(jQuery); 12477 12478"use strict"; 12479 12480var toggler = document.getElementsByClassName("rotate"); 12481var i; 12482 12483for (i = 0; i < toggler.length; i++) { 12484 toggler[i].addEventListener("click", function () { 12485 this.parentElement.querySelector(".nested").classList.toggle("active"); 12486 this.classList.toggle("down"); 12487 }); 12488} 12489/*! 12490 * bsCustomFileInput v1.3.2 (https://github.com/Johann-S/bs-custom-file-input) 12491 * Copyright 2018 - 2019 Johann-S <[email protected]> 12492 * Licensed under MIT (https://github.com/Johann-S/bs-custom-file-input/blob/master/LICENSE) 12493 */ 12494(function (global, factory) { 12495 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 12496 typeof define === 'function' && define.amd ? define(factory) : 12497 (global = global || self, global.bsCustomFileInput = factory()); 12498}(this, function () { 12499 'use strict'; 12500 12501 var Selector = { 12502 CUSTOMFILE: '.custom-file input[type="file"]', 12503 CUSTOMFILELABEL: '.custom-file-label', 12504 FORM: 'form', 12505 INPUT: 'input' 12506 }; 12507 12508 var textNodeType = 3; 12509 12510 var getDefaultText = function getDefaultText(input) { 12511 var defaultText = ''; 12512 var label = input.parentNode.querySelector(Selector.CUSTOMFILELABEL); 12513 12514 if (label) { 12515 defaultText = label.innerHTML; 12516 } 12517 12518 return defaultText; 12519 }; 12520 12521 var findFirstChildNode = function findFirstChildNode(element) { 12522 if (element.childNodes.length > 0) { 12523 var childNodes = [].slice.call(element.childNodes); 12524 12525 for (var i = 0; i < childNodes.length; i++) { 12526 var node = childNodes[i]; 12527 12528 if (node.nodeType !== textNodeType) { 12529 return node; 12530 } 12531 } 12532 } 12533 12534 return element; 12535 }; 12536 12537 var restoreDefaultText = function restoreDefaultText(input) { 12538 var defaultText = input.bsCustomFileInput.defaultText; 12539 var label = input.parentNode.querySelector(Selector.CUSTOMFILELABEL); 12540 12541 if (label) { 12542 var element = findFirstChildNode(label); 12543 element.innerHTML = defaultText; 12544 } 12545 }; 12546 12547 var fileApi = !!window.File; 12548 var FAKE_PATH = 'fakepath'; 12549 var FAKE_PATH_SEPARATOR = '\\'; 12550 12551 var getSelectedFiles = function getSelectedFiles(input) { 12552 if (input.hasAttribute('multiple') && fileApi) { 12553 return [].slice.call(input.files).map(function (file) { 12554 return file.name; 12555 }).join(', '); 12556 } 12557 12558 if (input.value.indexOf(FAKE_PATH) !== -1) { 12559 var splittedValue = input.value.split(FAKE_PATH_SEPARATOR); 12560 return splittedValue[splittedValue.length - 1]; 12561 } 12562 12563 return input.value; 12564 }; 12565 12566 function handleInputChange() { 12567 var label = this.parentNode.querySelector(Selector.CUSTOMFILELABEL); 12568 12569 if (label) { 12570 var element = findFirstChildNode(label); 12571 var inputValue = getSelectedFiles(this); 12572 12573 if (inputValue.length) { 12574 element.innerHTML = inputValue; 12575 } else { 12576 restoreDefaultText(this); 12577 } 12578 } 12579 } 12580 12581 function handleFormReset() { 12582 var customFileList = [].slice.call(this.querySelectorAll(Selector.INPUT)).filter(function (input) { 12583 return !!input.bsCustomFileInput; 12584 }); 12585 12586 for (var i = 0, len = customFileList.length; i < len; i++) { 12587 restoreDefaultText(customFileList[i]); 12588 } 12589 } 12590 12591 var customProperty = 'bsCustomFileInput'; 12592 var Event = { 12593 FORMRESET: 'reset', 12594 INPUTCHANGE: 'change' 12595 }; 12596 var bsCustomFileInput = { 12597 init: function init(inputSelector, formSelector) { 12598 if (inputSelector === void 0) { 12599 inputSelector = Selector.CUSTOMFILE; 12600 } 12601 12602 if (formSelector === void 0) { 12603 formSelector = Selector.FORM; 12604 } 12605 12606 var customFileInputList = [].slice.call(document.querySelectorAll(inputSelector)); 12607 var formList = [].slice.call(document.querySelectorAll(formSelector)); 12608 12609 for (var i = 0, len = customFileInputList.length; i < len; i++) { 12610 var input = customFileInputList[i]; 12611 Object.defineProperty(input, customProperty, { 12612 value: { 12613 defaultText: getDefaultText(input) 12614 }, 12615 writable: true 12616 }); 12617 handleInputChange.call(input); 12618 input.addEventListener(Event.INPUTCHANGE, handleInputChange); 12619 } 12620 12621 for (var _i = 0, _len = formList.length; _i < _len; _i++) { 12622 formList[_i].addEventListener(Event.FORMRESET, handleFormReset); 12623 12624 Object.defineProperty(formList[_i], customProperty, { 12625 value: true, 12626 writable: true 12627 }); 12628 } 12629 }, 12630 destroy: function destroy() { 12631 var formList = [].slice.call(document.querySelectorAll(Selector.FORM)).filter(function (form) { 12632 return !!form.bsCustomFileInput; 12633 }); 12634 var customFileInputList = [].slice.call(document.querySelectorAll(Selector.INPUT)).filter(function (input) { 12635 return !!input.bsCustomFileInput; 12636 }); 12637 12638 for (var i = 0, len = customFileInputList.length; i < len; i++) { 12639 var input = customFileInputList[i]; 12640 restoreDefaultText(input); 12641 input[customProperty] = undefined; 12642 input.removeEventListener(Event.INPUTCHANGE, handleInputChange); 12643 } 12644 12645 for (var _i2 = 0, _len2 = formList.length; _i2 < _len2; _i2++) { 12646 formList[_i2].removeEventListener(Event.FORMRESET, handleFormReset); 12647 12648 formList[_i2][customProperty] = undefined; 12649 } 12650 } 12651 }; 12652 12653 return bsCustomFileInput; 12654 12655})); 12656//# sourceMappingURL=bs-custom-file-input.js.map 12657 12658document.addEventListener("DOMContentLoaded", function () { 12659 12660 bsCustomFileInput.init() 12661}); 12662 12663 12664jQuery(document).ready(function(){ 12665 jQuery('.scroll-top').hide(); 12666 var offset = 220; 12667 var duration = 500; 12668 jQuery(window).scroll(function() { 12669 if (jQuery(this).scrollTop() > offset) { 12670 jQuery('.scroll-top').fadeIn(duration); 12671 } else { 12672 jQuery('.scroll-top').fadeOut(duration); 12673 } 12674 }); 12675 12676 jQuery('.scroll-top').click(function(event) { 12677 event.preventDefault(); 12678 jQuery('html, body').animate({scrollTop: 0}, duration); 12679 return false;
12680 }); 12681 12682});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.