window.forgeryTokenHandler = function() {
    return {
        getAntiForgeryToken: function() {
            return $("[name='__RequestVerificationToken']").val();
        }
    };
}();;
/*! jQuery v3.6.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,y=n.hasOwnProperty,a=y.toString,l=a.call(Object),v={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=y.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:v}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,y,s,c,v,S="sizzle"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),j=function(e,t){return e===t&&(l=!0),0},D={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",$=new RegExp(M+"+","g"),B=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&v(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!y||!y.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ve(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ye(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ve(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],y=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="<a id='"+S+"'></a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||y.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||y.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||y.push(".#.+[+~]"),e.querySelectorAll("\\\f"),y.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),y=y.length&&new RegExp(y.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),v=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&v(p,e)?-1:t==C||t.ownerDocument==p&&v(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!y||!y.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!=C&&T(e),v(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&D.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(j),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace($," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,y){var v="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===y?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=v!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(v){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l="only"===h&&!u&&"nextSibling"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[k,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[k,d]),a===e))break;return(d-=y)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace(B,"$1"));return s[S]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||"")||se.error("unsupported lang: "+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ye(function(){return[0]}),last:ye(function(e,t){return[t-1]}),eq:ye(function(e,t,n){return[n<0?n+t:n]}),even:ye(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ye(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ye(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ye(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[k,p];if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[S]||(e[S]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===k&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,y,v,e){return y&&!y[S]&&(y=Ce(y)),v&&!v[S]&&(v=Ce(v,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?v||(e?d:l||y)?[]:t:f;if(g&&g(f,p,n,r),y){i=Te(p,u),y(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(v||d){if(v){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);v(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=v?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),v?v(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(B,"$1"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace(B," ")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,y,v,m,x,r,i=[],o=[],a=A[e+" "];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[S]?i.push(a):o.push(a);(a=A(e,(y=o,m=0<(v=i).length,x=0<y.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=k+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==C||(T(o),n=!E);while(s=y[a++])if(s(o,t||C,n)){r.push(o);break}i&&(k=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=v[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+v.length&&se.uniqueSort(r)}return i&&(k=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ve(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ve(t.parentNode)||t),n},d.sortStable=S.split("").sort(j).join("")===S,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);S.find=d,S.expr=d.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=d.uniqueSort,S.text=d.getText,S.isXMLDoc=d.isXML,S.contains=d.contains,S.escapeSelector=d.escape;var h=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},T=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=S.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1<i.call(n,e)!==r}):S.filter(n,e,r)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return 1<r?S.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&k.test(e)?S(e):e||[],!1).length}});var D,q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&S(e);if(!k.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(S(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,"parentNode")},parentsUntil:function(e,t,n){return h(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return h(e,"nextSibling")},prevAll:function(e){return h(e,"previousSibling")},nextUntil:function(e,t,n){return h(e,"nextSibling",n)},prevUntil:function(e,t,n){return h(e,"previousSibling",n)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(r,i){S.fn[r]=function(e,t){var n=S.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=S.filter(t,n)),1<this.length&&(H[r]||S.uniqueSort(n),L.test(r)&&n.reverse()),this.pushStack(n)}});var P=/[^\x20\t\r\n\f]+/g;function R(e){return e}function M(e){throw e}function I(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},S.each(e.match(P)||[],function(e,t){n[t]=!0}),n):S.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){S.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return S.each(arguments,function(e,t){var n;while(-1<(n=S.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<S.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},S.extend({Deferred:function(e){var o=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return S.Deferred(function(r){S.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,R,s),l(u,o,M,s)):(u++,t.call(e,l(u,o,R,s),l(u,o,M,s),l(u,o,R,o.notifyWith))):(a!==R&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==M&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(S.Deferred.getStackHook&&(t.stackTrace=S.Deferred.getStackHook()),C.setTimeout(t))}}return S.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:R,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:R)),o[2][3].add(l(0,e,m(n)?n:M))}).promise()},promise:function(e){return null!=e?S.extend(e,a):a}},s={};return S.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=S.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(I(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)I(i[t],a(t),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&W.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){C.setTimeout(function(){throw e})};var F=S.Deferred();function $(){E.removeEventListener("DOMContentLoaded",$),C.removeEventListener("load",$),S.ready()}S.fn.ready=function(e){return F.then(e)["catch"](function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0)!==e&&0<--S.readyWait||F.resolveWith(E,[S])}}),S.ready.then=F.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(S.ready):(E.addEventListener("DOMContentLoaded",$),C.addEventListener("load",$));var B=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===w(n))for(s in i=!0,n)B(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(S(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},_=/^-ms-/,z=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function X(e){return e.replace(_,"ms-").replace(z,U)}var V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=S.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[X(t)]=n;else for(r in t)i[X(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][X(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(X):(t=X(t))in r?[t]:t.match(P)||[]).length;while(n--)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var Y=new G,Q=new G,J=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Z(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(K,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:J.test(i)?JSON.parse(i):i)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return Q.hasData(e)||Y.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),S.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=Q.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=X(r.slice(5)),Z(o,r,i[r]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){Q.set(this,n)}):B(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=Q.get(o,n))?t:void 0!==(t=Z(o,n))?t:void 0;this.each(function(){Q.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){S.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:S.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?S.queue(this[0],t):void 0===n?this:this.each(function(){var e=S.queue(this,t,n);S._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&S.dequeue(this,t)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=S.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=Y.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],re=E.documentElement,ie=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ie(e)&&"none"===S.css(e,"display")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,"")},u=s(),l=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==l&&+u)&&te.exec(S.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)S.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,S.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ue={};function le(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=Y.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ae(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ue[s])||(o=a.body.appendChild(a.createElement(s)),u=S.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ue[s]=u)))):"none"!==n&&(l[c]="none",Y.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}S.fn.extend({show:function(){return le(this,!0)},hide:function(){return le(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?S(this).show():S(this).hide()})}});var ce,fe,pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),v.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",v.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",v.option=!!ce.lastChild;var ge={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td,v.option||(ge.optgroup=ge.option=[1,"<select multiple='multiple'>","</select>"]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===w(o))S.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+S.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;S.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<S.inArray(o,r))i&&i.push(o);else if(l=ie(o),a=ye(f.appendChild(o),"script"),l&&ve(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}var be=/^([^.]*)(?:\.(.+)|)/;function we(){return!0}function Te(){return!1}function Ce(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ee(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ee(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Te;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,i,r,n)})}function Se(e,i,o){o?(Y.set(e,i,!1),S.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Y.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(S.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Y.set(this,i,r),t=o(this,i),this[i](),r!==(n=Y.get(this,i))||t?Y.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n&&n.value}else r.length&&(Y.set(this,i,{value:S.event.trigger(S.extend(r[0],S.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,i)&&S.event.add(e,i,we)}S.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=Y.get(t);if(V(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(re,i),n.guid||(n.guid=S.guid++),(u=y.events)||(u=y.events=Object.create(null)),(a=y.handle)||(a=y.handle=function(e){return"undefined"!=typeof S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(P)||[""]).length;while(l--)d=g=(s=be.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=S.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=S.event.special[d]||{},c=S.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=Y.hasData(e)&&Y.get(e);if(y&&(u=y.events)){l=(t=(t||"").match(P)||[""]).length;while(l--)if(d=g=(s=be.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=S.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,y.handle)||S.removeEvent(e,d,y.handle),delete u[d])}else for(d in u)S.event.remove(e,d+t[l],n,r,!0);S.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=S.event.fix(e),l=(Y.get(this,"events")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=S.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<S(i,this).index(l):S.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Se(t,"click",we),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Se(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,"input")&&Y.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?we:Te,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Te,isPropagationStopped:Te,isImmediatePropagationStopped:Te,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=we,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=we,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=we,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(t,e){S.event.special[t]={setup:function(){return Se(this,t,Ce),!1},trigger:function(){return Se(this,t),!0},_default:function(e){return Y.get(e.target,t)},delegateType:e}}),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){S.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||S.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),S.fn.extend({on:function(e,t,n,r){return Ee(this,e,t,n,r)},one:function(e,t,n,r){return Ee(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Te),this.each(function(){S.event.remove(this,e,n,t)})}});var ke=/<script|<style|<link/i,Ae=/checked\s*(?:[^=]|=\s*.checked.)/i,Ne=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)S.event.add(t,i,s[i][n]);Q.hasData(e)&&(o=Q.access(e),a=S.extend({},o),Q.set(t,a))}}function He(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&"string"==typeof d&&!v.checkClone&&Ae.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),He(t,r,i,o)});if(f&&(t=(e=xe(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=S.map(ye(e,"script"),De)).length;c<f;c++)u=e,c!==p&&(u=S.clone(u,!0,!0),s&&S.merge(a,ye(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,S.map(a,qe),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Y.access(u,"globalEval")&&S.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):b(u.textContent.replace(Ne,""),u,l))}return n}function Oe(e,t,n){for(var r,i=t?S.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||S.cleanData(ye(r)),r.parentNode&&(n&&ie(r)&&ve(ye(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=ie(e);if(!(v.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ye(c),r=0,i=(o=ye(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ye(e),a=a||ye(c),r=0,i=o.length;r<i;r++)Le(o[r],a[r]);else Le(e,c);return 0<(a=ye(c,"script")).length&&ve(a,!f&&ye(e,"script")),c},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Oe(this,e,!0)},remove:function(e){return Oe(this,e)},text:function(e){return B(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return He(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||je(this,e).appendChild(e)})},prepend:function(){return He(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=je(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return He(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return He(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(ye(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return B(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!ke.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ye(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return He(this,arguments,function(e){var t=this.parentNode;S.inArray(this,n)<0&&(S.cleanData(ye(this)),t&&t.replaceChild(e,this))},n)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){S.fn[e]=function(e){for(var t,n=[],r=S(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),S(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var Pe=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),Re=/^--/,Me=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},Ie=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},We=new RegExp(ne.join("|"),"i"),Fe="[\\x20\\t\\r\\n\\f]",$e=new RegExp("^"+Fe+"+|((?:^|[^\\\\])(?:\\\\.)*)"+Fe+"+$","g");function Be(e,t,n){var r,i,o,a,s=Re.test(t),u=e.style;return(n=n||Me(e))&&(a=n.getPropertyValue(t)||n[t],s&&(a=a.replace($e,"$1")),""!==a||ie(e)||(a=S.style(e,t)),!v.pixelBoxStyles()&&Pe.test(a)&&We.test(t)&&(r=u.width,i=u.minWidth,o=u.maxWidth,u.minWidth=u.maxWidth=u.width=a,a=n.width,u.width=r,u.minWidth=i,u.maxWidth=o)),void 0!==a?a+"":a}function _e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",re.appendChild(u).appendChild(l);var e=C.getComputedStyle(l);n="1%"!==e.top,s=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),re.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=E.createElement("div"),l=E.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",v.clearCloneStyle="content-box"===l.style.backgroundClip,S.extend(v,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=E.createElement("table"),t=E.createElement("tr"),n=E.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="border:1px solid",t.style.height="1px",n.style.height="9px",n.style.display="block",re.appendChild(e).appendChild(t).appendChild(n),r=C.getComputedStyle(t),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===t.offsetHeight,re.removeChild(e)),a}}))}();var ze=["Webkit","Moz","ms"],Ue=E.createElement("div").style,Xe={};function Ve(e){var t=S.cssProps[e]||Xe[e];return t||(e in Ue?e:Xe[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=ze.length;while(n--)if((e=ze[n]+t)in Ue)return e}(e)||e)}var Ge=/^(none|table(?!-c[ea]).+)/,Ye={position:"absolute",visibility:"hidden",display:"block"},Qe={letterSpacing:"0",fontWeight:"400"};function Je(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ke(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=S.css(e,n+ne[a],!0,i)),r?("content"===n&&(u-=S.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(u-=S.css(e,"border"+ne[a]+"Width",!0,i))):(u+=S.css(e,"padding"+ne[a],!0,i),"padding"!==n?u+=S.css(e,"border"+ne[a]+"Width",!0,i):s+=S.css(e,"border"+ne[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function Ze(e,t,n){var r=Me(e),i=(!v.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=i,a=Be(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Pe.test(a)){if(!n)return a;a="auto"}return(!v.boxSizingReliable()&&i||!v.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Ke(e,t,n||(i?"border":"content"),o,r,a)+"px"}function et(e,t,n,r,i){return new et.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Be(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=X(t),u=Re.test(t),l=e.style;if(u||(t=Ve(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(S.cssNumber[s]?"":"px")),v.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=X(t);return Re.test(t)||(t=Ve(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Be(e,t,r)),"normal"===i&&t in Qe&&(i=Qe[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each(["height","width"],function(e,u){S.cssHooks[u]={get:function(e,t,n){if(t)return!Ge.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Ze(e,u,n):Ie(e,Ye,function(){return Ze(e,u,n)})},set:function(e,t,n){var r,i=Me(e),o=!v.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===S.css(e,"boxSizing",!1,i),s=n?Ke(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-Ke(e,u,"border",!1,i)-.5)),s&&(r=te.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=S.css(e,u)),Je(0,t,s)}}}),S.cssHooks.marginLeft=_e(v.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Be(e,"marginLeft"))||e.getBoundingClientRect().left-Ie(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(i,o){S.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+ne[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(S.cssHooks[i+o].set=Je)}),S.fn.extend({css:function(e,t){return B(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Me(e),i=t.length;a<i;a++)o[t[a]]=S.css(e,t[a],!1,r);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,1<arguments.length)}}),((S.Tween=et).prototype={constructor:et,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var e=et.propHooks[this.prop];return e&&e.get?e.get(this):et.propHooks._default.get(this)},run:function(e){var t,n=et.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):et.propHooks._default.set(this),this}}).init.prototype=et.prototype,(et.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[Ve(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=et.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=et.prototype.init,S.fx.step={};var tt,nt,rt,it,ot=/^(?:toggle|show|hide)$/,at=/queueHooks$/;function st(){nt&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(st):C.setTimeout(st,S.fx.interval),S.fx.tick())}function ut(){return C.setTimeout(function(){tt=void 0}),tt=Date.now()}function lt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ct(e,t,n){for(var r,i=(ft.tweeners[t]||[]).concat(ft.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ft(o,e,t){var n,a,r=0,i=ft.prefilters.length,s=S.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=tt||ut(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},t),originalProperties:e,originalOptions:t,startTime:tt||ut(),duration:t.duration,tweens:[],createTween:function(e,t){var n=S.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=X(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=S.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=ft.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return S.map(c,ct,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(ft,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],ft.tweeners[n]=ft.tweeners[n]||[],ft.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),y=Y.get(e,"fxshow");for(r in n.queue||(null==(a=S._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,S.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],ot.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!y||void 0===y[r])continue;g=!0}d[r]=y&&y[r]||S.style(e,r)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=y&&y.display)&&(l=Y.get(e,"display")),"none"===(c=S.css(e,"display"))&&(l?c=l:(le([e],!0),l=e.style.display||l,c=S.css(e,"display"),le([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===S.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(y?"hidden"in y&&(g=y.hidden):y=Y.access(e,"fxshow",{display:l}),o&&(y.hidden=!g),g&&le([e],!0),p.done(function(){for(r in g||le([e]),Y.remove(e,"fxshow"),d)S.style(e,r,d[r])})),u=ct(g?y[r]:0,r,p),r in y||(y[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?ft.prefilters.unshift(e):ft.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=S.isEmptyObject(t),o=S.speed(e,n,r),a=function(){var e=ft(this,S.extend({},t),o);(i||Y.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=S.timers,r=Y.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&at.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||S.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Y.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=S.timers,o=n?n.length:0;for(t.finish=!0,S.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),S.each(["toggle","show","hide"],function(e,r){var i=S.fn[r];S.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(lt(r,!0),e,t,n)}}),S.each({slideDown:lt("show"),slideUp:lt("hide"),slideToggle:lt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){S.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(tt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),tt=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){nt||(nt=!0,st())},S.fx.stop=function(){nt=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(r,e){return r=S.fx&&S.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},rt=E.createElement("input"),it=E.createElement("select").appendChild(E.createElement("option")),rt.type="checkbox",v.checkOn=""!==rt.value,v.optSelected=it.selected,(rt=E.createElement("input")).value="t",rt.type="radio",v.radioValue="t"===rt.value;var pt,dt=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return B(this,S.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?pt:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!v.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),pt={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var a=dt[t]||S.find.attr;dt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=dt[o],dt[o]=r,r=null!=a(e,t,n)?o:null,dt[o]=i),r}});var ht=/^(?:input|select|textarea|button)$/i,gt=/^(?:a|area)$/i;function yt(e){return(e.match(P)||[]).join(" ")}function vt(e){return e.getAttribute&&e.getAttribute("class")||""}function mt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}S.fn.extend({prop:function(e,t){return B(this,S.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):ht.test(e.nodeName)||gt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),v.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(t){var e,n,r,i,o,a;return m(t)?this.each(function(e){S(this).addClass(t.call(this,e,vt(this)))}):(e=mt(t)).length?this.each(function(){if(r=vt(this),n=1===this.nodeType&&" "+yt(r)+" "){for(o=0;o<e.length;o++)i=e[o],n.indexOf(" "+i+" ")<0&&(n+=i+" ");a=yt(n),r!==a&&this.setAttribute("class",a)}}):this},removeClass:function(t){var e,n,r,i,o,a;return m(t)?this.each(function(e){S(this).removeClass(t.call(this,e,vt(this)))}):arguments.length?(e=mt(t)).length?this.each(function(){if(r=vt(this),n=1===this.nodeType&&" "+yt(r)+" "){for(o=0;o<e.length;o++){i=e[o];while(-1<n.indexOf(" "+i+" "))n=n.replace(" "+i+" "," ")}a=yt(n),r!==a&&this.setAttribute("class",a)}}):this:this.attr("class","")},toggleClass:function(t,n){var e,r,i,o,a=typeof t,s="string"===a||Array.isArray(t);return m(t)?this.each(function(e){S(this).toggleClass(t.call(this,e,vt(this),n),n)}):"boolean"==typeof n&&s?n?this.addClass(t):this.removeClass(t):(e=mt(t),this.each(function(){if(s)for(o=S(this),i=0;i<e.length;i++)r=e[i],o.hasClass(r)?o.removeClass(r):o.addClass(r);else void 0!==t&&"boolean"!==a||((r=vt(this))&&Y.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===t?"":Y.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+yt(vt(n))+" ").indexOf(t))return!0;return!1}});var xt=/\r/g;S.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,S(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=S.map(t,function(e){return null==e?"":e+""})),(r=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=S.valHooks[t.type]||S.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(xt,""):null==e?"":e:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:yt(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=S(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=S.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<S.inArray(S.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<S.inArray(S(e).val(),t)}},v.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),v.focusin="onfocusin"in C;var bt=/^(?:focusinfocus|focusoutblur)$/,wt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=y.call(e,"type")?e.type:e,h=y.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!bt.test(d+S.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[S.expando]?e:new S.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:S.makeArray(t,[e]),c=S.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,bt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Y.get(o,"events")||Object.create(null))[e.type]&&Y.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&V(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!V(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),S.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,wt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,wt),S.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),v.focusin||S.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){S.event.simulate(r,e.target,S.event.fix(e))};S.event.special[r]={setup:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r);t||e.addEventListener(n,i,!0),Y.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r)-1;t?Y.access(e,r,t):(e.removeEventListener(n,i,!0),Y.remove(e,r))}}});var Tt=C.location,Ct={guid:Date.now()},Et=/\?/;S.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||S.error("Invalid XML: "+(n?S.map(n.childNodes,function(e){return e.textContent}).join("\n"):e)),t};var St=/\[\]$/,kt=/\r?\n/g,At=/^(?:submit|button|image|reset|file)$/i,Nt=/^(?:input|select|textarea|keygen)/i;function jt(n,e,r,i){var t;if(Array.isArray(e))S.each(e,function(e,t){r||St.test(n)?i(n,t):jt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)jt(n+"["+t+"]",e[t],r,i)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){i(this.name,this.value)});else for(n in e)jt(n,e[n],t,i);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&Nt.test(this.nodeName)&&!At.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(kt,"\r\n")}}):{name:t.name,value:n.replace(kt,"\r\n")}}).get()}});var Dt=/%20/g,qt=/#.*$/,Lt=/([?&])_=[^&]*/,Ht=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ot=/^(?:GET|HEAD)$/,Pt=/^\/\//,Rt={},Mt={},It="*/".concat("*"),Wt=E.createElement("a");function Ft(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(P)||[];if(m(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function $t(t,i,o,a){var s={},u=t===Mt;function l(e){var r;return s[e]=!0,S.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function Bt(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Wt.href=Tt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Tt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Tt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":It,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Bt(Bt(e,S.ajaxSettings),t):Bt(S.ajaxSettings,e)},ajaxPrefilter:Ft(Rt),ajaxTransport:Ft(Mt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,y=S.ajaxSetup({},t),v=y.context||y,m=y.context&&(v.nodeType||v.jquery)?S(v):S.event,x=S.Deferred(),b=S.Callbacks("once memory"),w=y.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Ht.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(y.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),y.url=((e||y.url||Tt.href)+"").replace(Pt,Tt.protocol+"//"),y.type=t.method||t.type||y.method||y.type,y.dataTypes=(y.dataType||"*").toLowerCase().match(P)||[""],null==y.crossDomain){r=E.createElement("a");try{r.href=y.url,r.href=r.href,y.crossDomain=Wt.protocol+"//"+Wt.host!=r.protocol+"//"+r.host}catch(e){y.crossDomain=!0}}if(y.data&&y.processData&&"string"!=typeof y.data&&(y.data=S.param(y.data,y.traditional)),$t(Rt,y,t,T),h)return T;for(i in(g=S.event&&y.global)&&0==S.active++&&S.event.trigger("ajaxStart"),y.type=y.type.toUpperCase(),y.hasContent=!Ot.test(y.type),f=y.url.replace(qt,""),y.hasContent?y.data&&y.processData&&0===(y.contentType||"").indexOf("application/x-www-form-urlencoded")&&(y.data=y.data.replace(Dt,"+")):(o=y.url.slice(f.length),y.data&&(y.processData||"string"==typeof y.data)&&(f+=(Et.test(f)?"&":"?")+y.data,delete y.data),!1===y.cache&&(f=f.replace(Lt,"$1"),o=(Et.test(f)?"&":"?")+"_="+Ct.guid+++o),y.url=f+o),y.ifModified&&(S.lastModified[f]&&T.setRequestHeader("If-Modified-Since",S.lastModified[f]),S.etag[f]&&T.setRequestHeader("If-None-Match",S.etag[f])),(y.data&&y.hasContent&&!1!==y.contentType||t.contentType)&&T.setRequestHeader("Content-Type",y.contentType),T.setRequestHeader("Accept",y.dataTypes[0]&&y.accepts[y.dataTypes[0]]?y.accepts[y.dataTypes[0]]+("*"!==y.dataTypes[0]?", "+It+"; q=0.01":""):y.accepts["*"]),y.headers)T.setRequestHeader(i,y.headers[i]);if(y.beforeSend&&(!1===y.beforeSend.call(v,T,y)||h))return T.abort();if(u="abort",b.add(y.complete),T.done(y.success),T.fail(y.error),c=$t(Mt,y,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,y]),h)return T;y.async&&0<y.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},y.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(y,T,n)),!i&&-1<S.inArray("script",y.dataTypes)&&S.inArray("json",y.dataTypes)<0&&(y.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(y,s,T,i),i?(y.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(S.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(S.etag[f]=u)),204===e||"HEAD"===y.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(v,[o,l,T]):x.rejectWith(v,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,y,i?o:a]),b.fireWith(v,[T,l]),g&&(m.trigger("ajaxComplete",[T,y]),--S.active||S.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],function(e,i){S[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),S.ajax(S.extend({url:e,type:i,dataType:r,data:t,success:n},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){S(this).wrapInner(n.call(this,e))}):this.each(function(){var e=S(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){S(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var _t={0:200,1223:204},zt=S.ajaxSettings.xhr();v.cors=!!zt&&"withCredentials"in zt,v.ajax=zt=!!zt,S.ajaxTransport(function(i){var o,a;if(v.cors||zt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(_t[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),S.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=S("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),v.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(v.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=yt(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&S.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return B(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=_e(v.pixelPosition,function(e,t){if(t)return t=Be(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return B(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var Gt=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=A,S.isFunction=m,S.isWindow=x,S.camelCase=X,S.type=w,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Gt,"$1")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return S});var Yt=C.jQuery,Qt=C.$;return S.noConflict=function(e){return C.$===S&&(C.$=Qt),e&&C.jQuery===S&&(C.jQuery=Yt),S},"undefined"==typeof e&&(C.jQuery=C.$=S),S});;
/*! jQuery v3.6.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,y=n.hasOwnProperty,a=y.toString,l=a.call(Object),v={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=y.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:v}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,y,s,c,v,S="sizzle"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),j=function(e,t){return e===t&&(l=!0),0},D={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",$=new RegExp(M+"+","g"),B=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&v(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!y||!y.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ve(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ye(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ve(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],y=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="<a id='"+S+"'></a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||y.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||y.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||y.push(".#.+[+~]"),e.querySelectorAll("\\\f"),y.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),y=y.length&&new RegExp(y.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),v=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&v(p,e)?-1:t==C||t.ownerDocument==p&&v(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!y||!y.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!=C&&T(e),v(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&D.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(j),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace($," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,y){var v="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===y?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=v!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(v){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l="only"===h&&!u&&"nextSibling"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[k,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[k,d]),a===e))break;return(d-=y)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace(B,"$1"));return s[S]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||"")||se.error("unsupported lang: "+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ye(function(){return[0]}),last:ye(function(e,t){return[t-1]}),eq:ye(function(e,t,n){return[n<0?n+t:n]}),even:ye(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ye(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ye(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ye(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[k,p];if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[S]||(e[S]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===k&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,y,v,e){return y&&!y[S]&&(y=Ce(y)),v&&!v[S]&&(v=Ce(v,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?v||(e?d:l||y)?[]:t:f;if(g&&g(f,p,n,r),y){i=Te(p,u),y(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(v||d){if(v){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);v(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=v?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),v?v(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(B,"$1"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace(B," ")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,y,v,m,x,r,i=[],o=[],a=A[e+" "];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[S]?i.push(a):o.push(a);(a=A(e,(y=o,m=0<(v=i).length,x=0<y.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=k+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==C||(T(o),n=!E);while(s=y[a++])if(s(o,t||C,n)){r.push(o);break}i&&(k=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=v[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+v.length&&se.uniqueSort(r)}return i&&(k=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ve(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ve(t.parentNode)||t),n},d.sortStable=S.split("").sort(j).join("")===S,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);S.find=d,S.expr=d.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=d.uniqueSort,S.text=d.getText,S.isXMLDoc=d.isXML,S.contains=d.contains,S.escapeSelector=d.escape;var h=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},T=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=S.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1<i.call(n,e)!==r}):S.filter(n,e,r)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return 1<r?S.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&k.test(e)?S(e):e||[],!1).length}});var D,q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&S(e);if(!k.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(S(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,"parentNode")},parentsUntil:function(e,t,n){return h(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return h(e,"nextSibling")},prevAll:function(e){return h(e,"previousSibling")},nextUntil:function(e,t,n){return h(e,"nextSibling",n)},prevUntil:function(e,t,n){return h(e,"previousSibling",n)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(r,i){S.fn[r]=function(e,t){var n=S.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=S.filter(t,n)),1<this.length&&(H[r]||S.uniqueSort(n),L.test(r)&&n.reverse()),this.pushStack(n)}});var P=/[^\x20\t\r\n\f]+/g;function R(e){return e}function M(e){throw e}function I(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},S.each(e.match(P)||[],function(e,t){n[t]=!0}),n):S.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){S.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return S.each(arguments,function(e,t){var n;while(-1<(n=S.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<S.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},S.extend({Deferred:function(e){var o=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return S.Deferred(function(r){S.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,R,s),l(u,o,M,s)):(u++,t.call(e,l(u,o,R,s),l(u,o,M,s),l(u,o,R,o.notifyWith))):(a!==R&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==M&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(S.Deferred.getStackHook&&(t.stackTrace=S.Deferred.getStackHook()),C.setTimeout(t))}}return S.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:R,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:R)),o[2][3].add(l(0,e,m(n)?n:M))}).promise()},promise:function(e){return null!=e?S.extend(e,a):a}},s={};return S.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=S.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(I(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)I(i[t],a(t),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&W.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){C.setTimeout(function(){throw e})};var F=S.Deferred();function $(){E.removeEventListener("DOMContentLoaded",$),C.removeEventListener("load",$),S.ready()}S.fn.ready=function(e){return F.then(e)["catch"](function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0)!==e&&0<--S.readyWait||F.resolveWith(E,[S])}}),S.ready.then=F.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(S.ready):(E.addEventListener("DOMContentLoaded",$),C.addEventListener("load",$));var B=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===w(n))for(s in i=!0,n)B(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(S(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},_=/^-ms-/,z=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function X(e){return e.replace(_,"ms-").replace(z,U)}var V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=S.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[X(t)]=n;else for(r in t)i[X(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][X(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(X):(t=X(t))in r?[t]:t.match(P)||[]).length;while(n--)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var Y=new G,Q=new G,J=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Z(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(K,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:J.test(i)?JSON.parse(i):i)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return Q.hasData(e)||Y.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),S.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=Q.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=X(r.slice(5)),Z(o,r,i[r]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){Q.set(this,n)}):B(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=Q.get(o,n))?t:void 0!==(t=Z(o,n))?t:void 0;this.each(function(){Q.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){S.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:S.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?S.queue(this[0],t):void 0===n?this:this.each(function(){var e=S.queue(this,t,n);S._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&S.dequeue(this,t)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=S.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=Y.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],re=E.documentElement,ie=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ie(e)&&"none"===S.css(e,"display")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,"")},u=s(),l=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==l&&+u)&&te.exec(S.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)S.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,S.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ue={};function le(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=Y.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ae(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ue[s])||(o=a.body.appendChild(a.createElement(s)),u=S.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ue[s]=u)))):"none"!==n&&(l[c]="none",Y.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}S.fn.extend({show:function(){return le(this,!0)},hide:function(){return le(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?S(this).show():S(this).hide()})}});var ce,fe,pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),v.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",v.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",v.option=!!ce.lastChild;var ge={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td,v.option||(ge.optgroup=ge.option=[1,"<select multiple='multiple'>","</select>"]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===w(o))S.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+S.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;S.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<S.inArray(o,r))i&&i.push(o);else if(l=ie(o),a=ye(f.appendChild(o),"script"),l&&ve(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}var be=/^([^.]*)(?:\.(.+)|)/;function we(){return!0}function Te(){return!1}function Ce(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ee(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ee(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Te;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,i,r,n)})}function Se(e,i,o){o?(Y.set(e,i,!1),S.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Y.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(S.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Y.set(this,i,r),t=o(this,i),this[i](),r!==(n=Y.get(this,i))||t?Y.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n&&n.value}else r.length&&(Y.set(this,i,{value:S.event.trigger(S.extend(r[0],S.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,i)&&S.event.add(e,i,we)}S.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=Y.get(t);if(V(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(re,i),n.guid||(n.guid=S.guid++),(u=y.events)||(u=y.events=Object.create(null)),(a=y.handle)||(a=y.handle=function(e){return"undefined"!=typeof S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(P)||[""]).length;while(l--)d=g=(s=be.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=S.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=S.event.special[d]||{},c=S.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=Y.hasData(e)&&Y.get(e);if(y&&(u=y.events)){l=(t=(t||"").match(P)||[""]).length;while(l--)if(d=g=(s=be.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=S.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,y.handle)||S.removeEvent(e,d,y.handle),delete u[d])}else for(d in u)S.event.remove(e,d+t[l],n,r,!0);S.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=S.event.fix(e),l=(Y.get(this,"events")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=S.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<S(i,this).index(l):S.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Se(t,"click",we),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Se(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,"input")&&Y.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?we:Te,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Te,isPropagationStopped:Te,isImmediatePropagationStopped:Te,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=we,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=we,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=we,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(t,e){S.event.special[t]={setup:function(){return Se(this,t,Ce),!1},trigger:function(){return Se(this,t),!0},_default:function(e){return Y.get(e.target,t)},delegateType:e}}),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){S.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||S.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),S.fn.extend({on:function(e,t,n,r){return Ee(this,e,t,n,r)},one:function(e,t,n,r){return Ee(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Te),this.each(function(){S.event.remove(this,e,n,t)})}});var ke=/<script|<style|<link/i,Ae=/checked\s*(?:[^=]|=\s*.checked.)/i,Ne=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)S.event.add(t,i,s[i][n]);Q.hasData(e)&&(o=Q.access(e),a=S.extend({},o),Q.set(t,a))}}function He(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&"string"==typeof d&&!v.checkClone&&Ae.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),He(t,r,i,o)});if(f&&(t=(e=xe(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=S.map(ye(e,"script"),De)).length;c<f;c++)u=e,c!==p&&(u=S.clone(u,!0,!0),s&&S.merge(a,ye(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,S.map(a,qe),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Y.access(u,"globalEval")&&S.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):b(u.textContent.replace(Ne,""),u,l))}return n}function Oe(e,t,n){for(var r,i=t?S.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||S.cleanData(ye(r)),r.parentNode&&(n&&ie(r)&&ve(ye(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=ie(e);if(!(v.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ye(c),r=0,i=(o=ye(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ye(e),a=a||ye(c),r=0,i=o.length;r<i;r++)Le(o[r],a[r]);else Le(e,c);return 0<(a=ye(c,"script")).length&&ve(a,!f&&ye(e,"script")),c},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Oe(this,e,!0)},remove:function(e){return Oe(this,e)},text:function(e){return B(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return He(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||je(this,e).appendChild(e)})},prepend:function(){return He(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=je(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return He(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return He(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(ye(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return B(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!ke.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ye(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return He(this,arguments,function(e){var t=this.parentNode;S.inArray(this,n)<0&&(S.cleanData(ye(this)),t&&t.replaceChild(e,this))},n)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){S.fn[e]=function(e){for(var t,n=[],r=S(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),S(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var Pe=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),Re=/^--/,Me=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},Ie=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},We=new RegExp(ne.join("|"),"i"),Fe="[\\x20\\t\\r\\n\\f]",$e=new RegExp("^"+Fe+"+|((?:^|[^\\\\])(?:\\\\.)*)"+Fe+"+$","g");function Be(e,t,n){var r,i,o,a,s=Re.test(t),u=e.style;return(n=n||Me(e))&&(a=n.getPropertyValue(t)||n[t],s&&(a=a.replace($e,"$1")),""!==a||ie(e)||(a=S.style(e,t)),!v.pixelBoxStyles()&&Pe.test(a)&&We.test(t)&&(r=u.width,i=u.minWidth,o=u.maxWidth,u.minWidth=u.maxWidth=u.width=a,a=n.width,u.width=r,u.minWidth=i,u.maxWidth=o)),void 0!==a?a+"":a}function _e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",re.appendChild(u).appendChild(l);var e=C.getComputedStyle(l);n="1%"!==e.top,s=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),re.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=E.createElement("div"),l=E.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",v.clearCloneStyle="content-box"===l.style.backgroundClip,S.extend(v,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=E.createElement("table"),t=E.createElement("tr"),n=E.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="border:1px solid",t.style.height="1px",n.style.height="9px",n.style.display="block",re.appendChild(e).appendChild(t).appendChild(n),r=C.getComputedStyle(t),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===t.offsetHeight,re.removeChild(e)),a}}))}();var ze=["Webkit","Moz","ms"],Ue=E.createElement("div").style,Xe={};function Ve(e){var t=S.cssProps[e]||Xe[e];return t||(e in Ue?e:Xe[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=ze.length;while(n--)if((e=ze[n]+t)in Ue)return e}(e)||e)}var Ge=/^(none|table(?!-c[ea]).+)/,Ye={position:"absolute",visibility:"hidden",display:"block"},Qe={letterSpacing:"0",fontWeight:"400"};function Je(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ke(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=S.css(e,n+ne[a],!0,i)),r?("content"===n&&(u-=S.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(u-=S.css(e,"border"+ne[a]+"Width",!0,i))):(u+=S.css(e,"padding"+ne[a],!0,i),"padding"!==n?u+=S.css(e,"border"+ne[a]+"Width",!0,i):s+=S.css(e,"border"+ne[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function Ze(e,t,n){var r=Me(e),i=(!v.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=i,a=Be(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Pe.test(a)){if(!n)return a;a="auto"}return(!v.boxSizingReliable()&&i||!v.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Ke(e,t,n||(i?"border":"content"),o,r,a)+"px"}function et(e,t,n,r,i){return new et.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Be(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=X(t),u=Re.test(t),l=e.style;if(u||(t=Ve(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(S.cssNumber[s]?"":"px")),v.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=X(t);return Re.test(t)||(t=Ve(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Be(e,t,r)),"normal"===i&&t in Qe&&(i=Qe[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each(["height","width"],function(e,u){S.cssHooks[u]={get:function(e,t,n){if(t)return!Ge.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Ze(e,u,n):Ie(e,Ye,function(){return Ze(e,u,n)})},set:function(e,t,n){var r,i=Me(e),o=!v.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===S.css(e,"boxSizing",!1,i),s=n?Ke(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-Ke(e,u,"border",!1,i)-.5)),s&&(r=te.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=S.css(e,u)),Je(0,t,s)}}}),S.cssHooks.marginLeft=_e(v.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Be(e,"marginLeft"))||e.getBoundingClientRect().left-Ie(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(i,o){S.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+ne[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(S.cssHooks[i+o].set=Je)}),S.fn.extend({css:function(e,t){return B(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Me(e),i=t.length;a<i;a++)o[t[a]]=S.css(e,t[a],!1,r);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,1<arguments.length)}}),((S.Tween=et).prototype={constructor:et,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var e=et.propHooks[this.prop];return e&&e.get?e.get(this):et.propHooks._default.get(this)},run:function(e){var t,n=et.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):et.propHooks._default.set(this),this}}).init.prototype=et.prototype,(et.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[Ve(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=et.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=et.prototype.init,S.fx.step={};var tt,nt,rt,it,ot=/^(?:toggle|show|hide)$/,at=/queueHooks$/;function st(){nt&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(st):C.setTimeout(st,S.fx.interval),S.fx.tick())}function ut(){return C.setTimeout(function(){tt=void 0}),tt=Date.now()}function lt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ct(e,t,n){for(var r,i=(ft.tweeners[t]||[]).concat(ft.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ft(o,e,t){var n,a,r=0,i=ft.prefilters.length,s=S.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=tt||ut(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},t),originalProperties:e,originalOptions:t,startTime:tt||ut(),duration:t.duration,tweens:[],createTween:function(e,t){var n=S.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=X(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=S.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=ft.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return S.map(c,ct,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(ft,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],ft.tweeners[n]=ft.tweeners[n]||[],ft.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),y=Y.get(e,"fxshow");for(r in n.queue||(null==(a=S._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,S.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],ot.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!y||void 0===y[r])continue;g=!0}d[r]=y&&y[r]||S.style(e,r)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=y&&y.display)&&(l=Y.get(e,"display")),"none"===(c=S.css(e,"display"))&&(l?c=l:(le([e],!0),l=e.style.display||l,c=S.css(e,"display"),le([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===S.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(y?"hidden"in y&&(g=y.hidden):y=Y.access(e,"fxshow",{display:l}),o&&(y.hidden=!g),g&&le([e],!0),p.done(function(){for(r in g||le([e]),Y.remove(e,"fxshow"),d)S.style(e,r,d[r])})),u=ct(g?y[r]:0,r,p),r in y||(y[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?ft.prefilters.unshift(e):ft.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=S.isEmptyObject(t),o=S.speed(e,n,r),a=function(){var e=ft(this,S.extend({},t),o);(i||Y.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=S.timers,r=Y.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&at.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||S.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Y.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=S.timers,o=n?n.length:0;for(t.finish=!0,S.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),S.each(["toggle","show","hide"],function(e,r){var i=S.fn[r];S.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(lt(r,!0),e,t,n)}}),S.each({slideDown:lt("show"),slideUp:lt("hide"),slideToggle:lt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){S.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(tt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),tt=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){nt||(nt=!0,st())},S.fx.stop=function(){nt=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(r,e){return r=S.fx&&S.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},rt=E.createElement("input"),it=E.createElement("select").appendChild(E.createElement("option")),rt.type="checkbox",v.checkOn=""!==rt.value,v.optSelected=it.selected,(rt=E.createElement("input")).value="t",rt.type="radio",v.radioValue="t"===rt.value;var pt,dt=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return B(this,S.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?pt:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!v.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),pt={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var a=dt[t]||S.find.attr;dt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=dt[o],dt[o]=r,r=null!=a(e,t,n)?o:null,dt[o]=i),r}});var ht=/^(?:input|select|textarea|button)$/i,gt=/^(?:a|area)$/i;function yt(e){return(e.match(P)||[]).join(" ")}function vt(e){return e.getAttribute&&e.getAttribute("class")||""}function mt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}S.fn.extend({prop:function(e,t){return B(this,S.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):ht.test(e.nodeName)||gt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),v.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(t){var e,n,r,i,o,a;return m(t)?this.each(function(e){S(this).addClass(t.call(this,e,vt(this)))}):(e=mt(t)).length?this.each(function(){if(r=vt(this),n=1===this.nodeType&&" "+yt(r)+" "){for(o=0;o<e.length;o++)i=e[o],n.indexOf(" "+i+" ")<0&&(n+=i+" ");a=yt(n),r!==a&&this.setAttribute("class",a)}}):this},removeClass:function(t){var e,n,r,i,o,a;return m(t)?this.each(function(e){S(this).removeClass(t.call(this,e,vt(this)))}):arguments.length?(e=mt(t)).length?this.each(function(){if(r=vt(this),n=1===this.nodeType&&" "+yt(r)+" "){for(o=0;o<e.length;o++){i=e[o];while(-1<n.indexOf(" "+i+" "))n=n.replace(" "+i+" "," ")}a=yt(n),r!==a&&this.setAttribute("class",a)}}):this:this.attr("class","")},toggleClass:function(t,n){var e,r,i,o,a=typeof t,s="string"===a||Array.isArray(t);return m(t)?this.each(function(e){S(this).toggleClass(t.call(this,e,vt(this),n),n)}):"boolean"==typeof n&&s?n?this.addClass(t):this.removeClass(t):(e=mt(t),this.each(function(){if(s)for(o=S(this),i=0;i<e.length;i++)r=e[i],o.hasClass(r)?o.removeClass(r):o.addClass(r);else void 0!==t&&"boolean"!==a||((r=vt(this))&&Y.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===t?"":Y.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+yt(vt(n))+" ").indexOf(t))return!0;return!1}});var xt=/\r/g;S.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,S(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=S.map(t,function(e){return null==e?"":e+""})),(r=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=S.valHooks[t.type]||S.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(xt,""):null==e?"":e:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:yt(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=S(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=S.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<S.inArray(S.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<S.inArray(S(e).val(),t)}},v.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),v.focusin="onfocusin"in C;var bt=/^(?:focusinfocus|focusoutblur)$/,wt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=y.call(e,"type")?e.type:e,h=y.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!bt.test(d+S.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[S.expando]?e:new S.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:S.makeArray(t,[e]),c=S.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,bt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Y.get(o,"events")||Object.create(null))[e.type]&&Y.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&V(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!V(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),S.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,wt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,wt),S.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),v.focusin||S.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){S.event.simulate(r,e.target,S.event.fix(e))};S.event.special[r]={setup:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r);t||e.addEventListener(n,i,!0),Y.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r)-1;t?Y.access(e,r,t):(e.removeEventListener(n,i,!0),Y.remove(e,r))}}});var Tt=C.location,Ct={guid:Date.now()},Et=/\?/;S.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||S.error("Invalid XML: "+(n?S.map(n.childNodes,function(e){return e.textContent}).join("\n"):e)),t};var St=/\[\]$/,kt=/\r?\n/g,At=/^(?:submit|button|image|reset|file)$/i,Nt=/^(?:input|select|textarea|keygen)/i;function jt(n,e,r,i){var t;if(Array.isArray(e))S.each(e,function(e,t){r||St.test(n)?i(n,t):jt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)jt(n+"["+t+"]",e[t],r,i)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){i(this.name,this.value)});else for(n in e)jt(n,e[n],t,i);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&Nt.test(this.nodeName)&&!At.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(kt,"\r\n")}}):{name:t.name,value:n.replace(kt,"\r\n")}}).get()}});var Dt=/%20/g,qt=/#.*$/,Lt=/([?&])_=[^&]*/,Ht=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ot=/^(?:GET|HEAD)$/,Pt=/^\/\//,Rt={},Mt={},It="*/".concat("*"),Wt=E.createElement("a");function Ft(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(P)||[];if(m(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function $t(t,i,o,a){var s={},u=t===Mt;function l(e){var r;return s[e]=!0,S.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function Bt(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Wt.href=Tt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Tt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Tt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":It,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Bt(Bt(e,S.ajaxSettings),t):Bt(S.ajaxSettings,e)},ajaxPrefilter:Ft(Rt),ajaxTransport:Ft(Mt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,y=S.ajaxSetup({},t),v=y.context||y,m=y.context&&(v.nodeType||v.jquery)?S(v):S.event,x=S.Deferred(),b=S.Callbacks("once memory"),w=y.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Ht.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(y.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),y.url=((e||y.url||Tt.href)+"").replace(Pt,Tt.protocol+"//"),y.type=t.method||t.type||y.method||y.type,y.dataTypes=(y.dataType||"*").toLowerCase().match(P)||[""],null==y.crossDomain){r=E.createElement("a");try{r.href=y.url,r.href=r.href,y.crossDomain=Wt.protocol+"//"+Wt.host!=r.protocol+"//"+r.host}catch(e){y.crossDomain=!0}}if(y.data&&y.processData&&"string"!=typeof y.data&&(y.data=S.param(y.data,y.traditional)),$t(Rt,y,t,T),h)return T;for(i in(g=S.event&&y.global)&&0==S.active++&&S.event.trigger("ajaxStart"),y.type=y.type.toUpperCase(),y.hasContent=!Ot.test(y.type),f=y.url.replace(qt,""),y.hasContent?y.data&&y.processData&&0===(y.contentType||"").indexOf("application/x-www-form-urlencoded")&&(y.data=y.data.replace(Dt,"+")):(o=y.url.slice(f.length),y.data&&(y.processData||"string"==typeof y.data)&&(f+=(Et.test(f)?"&":"?")+y.data,delete y.data),!1===y.cache&&(f=f.replace(Lt,"$1"),o=(Et.test(f)?"&":"?")+"_="+Ct.guid+++o),y.url=f+o),y.ifModified&&(S.lastModified[f]&&T.setRequestHeader("If-Modified-Since",S.lastModified[f]),S.etag[f]&&T.setRequestHeader("If-None-Match",S.etag[f])),(y.data&&y.hasContent&&!1!==y.contentType||t.contentType)&&T.setRequestHeader("Content-Type",y.contentType),T.setRequestHeader("Accept",y.dataTypes[0]&&y.accepts[y.dataTypes[0]]?y.accepts[y.dataTypes[0]]+("*"!==y.dataTypes[0]?", "+It+"; q=0.01":""):y.accepts["*"]),y.headers)T.setRequestHeader(i,y.headers[i]);if(y.beforeSend&&(!1===y.beforeSend.call(v,T,y)||h))return T.abort();if(u="abort",b.add(y.complete),T.done(y.success),T.fail(y.error),c=$t(Mt,y,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,y]),h)return T;y.async&&0<y.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},y.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(y,T,n)),!i&&-1<S.inArray("script",y.dataTypes)&&S.inArray("json",y.dataTypes)<0&&(y.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(y,s,T,i),i?(y.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(S.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(S.etag[f]=u)),204===e||"HEAD"===y.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(v,[o,l,T]):x.rejectWith(v,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,y,i?o:a]),b.fireWith(v,[T,l]),g&&(m.trigger("ajaxComplete",[T,y]),--S.active||S.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],function(e,i){S[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),S.ajax(S.extend({url:e,type:i,dataType:r,data:t,success:n},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){S(this).wrapInner(n.call(this,e))}):this.each(function(){var e=S(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){S(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var _t={0:200,1223:204},zt=S.ajaxSettings.xhr();v.cors=!!zt&&"withCredentials"in zt,v.ajax=zt=!!zt,S.ajaxTransport(function(i){var o,a;if(v.cors||zt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(_t[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),S.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=S("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),v.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(v.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=yt(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&S.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return B(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=_e(v.pixelPosition,function(e,t){if(t)return t=Be(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return B(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var Gt=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=A,S.isFunction=m,S.isWindow=x,S.camelCase=X,S.type=w,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Gt,"$1")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return S});var Yt=C.jQuery,Qt=C.$;return S.noConflict=function(e){return C.$===S&&(C.$=Qt),e&&C.jQuery===S&&(C.jQuery=Yt),S},"undefined"==typeof e&&(C.jQuery=C.$=S),S});;
globalVarsHandler = function () {
    return {
        getNodeId: function () {
            return $("#currentNodeId").val();
        },
        getCultureCode: function () {
            return $("#currentCultureCode").val();
        },
        getTabId: function () {
            return $("#tabId").val();
        },  
        getGoogleMapKey:function(){
            return $("#googleApiKey").val(); }
    };
}();;
/*!
 * jQuery Typeahead
 * Copyright (C) 2019 RunningCoder.org
 * Licensed under the MIT license
 *
 * @author Tom Bertrand
 * @version 2.11.0 (2019-10-31)
 * @link http://www.runningcoder.org/jquerytypeahead/
 */
!function(e){var t;"function"==typeof define&&define.amd?define("jquery-typeahead",["jquery"],function(t){return e(t)}):"object"==typeof module&&module.exports?module.exports=(void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(void 0)),e(t)):e(jQuery)}(function(j){"use strict";function r(t,e){this.rawQuery=t.val()||"",this.query=t.val()||"",this.selector=t[0].selector,this.deferred=null,this.tmpSource={},this.source={},this.dynamicGroups=[],this.hasDynamicGroups=!1,this.generatedGroupCount=0,this.groupBy="group",this.groups=[],this.searchGroups=[],this.generateGroups=[],this.requestGroups=[],this.result=[],this.tmpResult={},this.groupTemplate="",this.resultHtml=null,this.resultCount=0,this.resultCountPerGroup={},this.options=e,this.node=t,this.namespace="."+this.helper.slugify.call(this,this.selector)+".typeahead",this.isContentEditable=void 0!==this.node.attr("contenteditable")&&"false"!==this.node.attr("contenteditable"),this.container=null,this.resultContainer=null,this.item=null,this.items=null,this.comparedItems=null,this.xhr={},this.hintIndex=null,this.filters={dropdown:{},dynamic:{}},this.dropdownFilter={static:[],dynamic:[]},this.dropdownFilterAll=null,this.isDropdownEvent=!1,this.requests={},this.backdrop={},this.hint={},this.label={},this.hasDragged=!1,this.focusOnly=!1,this.displayEmptyTemplate,this.__construct()}var i,s={input:null,minLength:2,maxLength:!(window.Typeahead={version:"2.11.0"}),maxItem:8,dynamic:!1,delay:300,order:null,offset:!1,hint:!1,accent:!1,highlight:!0,multiselect:null,group:!1,groupOrder:null,maxItemPerGroup:null,dropdownFilter:!1,dynamicFilter:null,backdrop:!1,backdropOnFocus:!1,cache:!1,ttl:36e5,compression:!1,searchOnFocus:!1,blurOnTab:!0,resultContainer:null,generateOnLoad:null,mustSelectItem:!1,href:null,display:["display"],template:null,templateValue:null,groupTemplate:null,correlativeTemplate:!1,emptyTemplate:!1,cancelButton:!0,loadingAnimation:!0,asyncResult:!1,filter:!0,matcher:null,source:null,callback:{onInit:null,onReady:null,onShowLayout:null,onHideLayout:null,onSearch:null,onResult:null,onLayoutBuiltBefore:null,onLayoutBuiltAfter:null,onNavigateBefore:null,onNavigateAfter:null,onEnter:null,onLeave:null,onClickBefore:null,onClickAfter:null,onDropdownFilter:null,onSendRequest:null,onReceiveRequest:null,onPopulateSource:null,onCacheSave:null,onSubmit:null,onCancel:null},selector:{container:"typeahead__container",result:"typeahead__result",list:"typeahead__list",group:"typeahead__group",item:"typeahead__item",empty:"typeahead__empty",display:"typeahead__display",query:"typeahead__query",filter:"typeahead__filter",filterButton:"typeahead__filter-button",dropdown:"typeahead__dropdown",dropdownItem:"typeahead__dropdown-item",labelContainer:"typeahead__label-container",label:"typeahead__label",button:"typeahead__button",backdrop:"typeahead__backdrop",hint:"typeahead__hint",cancelButton:"typeahead__cancel-button"},debug:!1},o={from:"ãàáäâẽèéëêìíïîõòóöôùúüûñç",to:"aaaaaeeeeeiiiiooooouuuunc"},n=~window.navigator.appVersion.indexOf("MSIE 9."),a=~window.navigator.appVersion.indexOf("MSIE 10"),l=!!~window.navigator.userAgent.indexOf("Trident")&&~window.navigator.userAgent.indexOf("rv:11");r.prototype={_validateCacheMethod:function(t){var e;if(!0===t)t="localStorage";else if("string"==typeof t&&!~["localStorage","sessionStorage"].indexOf(t))return!1;e=void 0!==window[t];try{window[t].setItem("typeahead","typeahead"),window[t].removeItem("typeahead")}catch(t){e=!1}return e&&t||!1},extendOptions:function(){if(this.options.cache=this._validateCacheMethod(this.options.cache),this.options.compression&&("object"==typeof LZString&&this.options.cache||(this.options.compression=!1)),this.options.maxLength&&!isNaN(this.options.maxLength)||(this.options.maxLength=1/0),void 0!==this.options.maxItem&&~[0,!1].indexOf(this.options.maxItem)&&(this.options.maxItem=1/0),this.options.maxItemPerGroup&&!/^\d+$/.test(this.options.maxItemPerGroup)&&(this.options.maxItemPerGroup=null),this.options.display&&!Array.isArray(this.options.display)&&(this.options.display=[this.options.display]),this.options.multiselect&&(this.items=[],this.comparedItems=[],"string"==typeof this.options.multiselect.matchOn&&(this.options.multiselect.matchOn=[this.options.multiselect.matchOn])),this.options.group&&(Array.isArray(this.options.group)||("string"==typeof this.options.group?this.options.group={key:this.options.group}:"boolean"==typeof this.options.group&&(this.options.group={key:"group"}),this.options.group.key=this.options.group.key||"group")),this.options.highlight&&!~["any",!0].indexOf(this.options.highlight)&&(this.options.highlight=!1),this.options.dropdownFilter&&this.options.dropdownFilter instanceof Object){Array.isArray(this.options.dropdownFilter)||(this.options.dropdownFilter=[this.options.dropdownFilter]);for(var t=0,e=this.options.dropdownFilter.length;t<e;++t)this.dropdownFilter[this.options.dropdownFilter[t].value?"static":"dynamic"].push(this.options.dropdownFilter[t])}this.options.dynamicFilter&&!Array.isArray(this.options.dynamicFilter)&&(this.options.dynamicFilter=[this.options.dynamicFilter]),this.options.accent&&("object"==typeof this.options.accent?this.options.accent.from&&this.options.accent.to&&(this.options.accent.from.length,this.options.accent.to.length):this.options.accent=o),this.options.groupTemplate&&(this.groupTemplate=this.options.groupTemplate),this.options.resultContainer&&("string"==typeof this.options.resultContainer&&(this.options.resultContainer=j(this.options.resultContainer)),this.options.resultContainer instanceof j&&this.options.resultContainer[0]&&(this.resultContainer=this.options.resultContainer)),this.options.group&&this.options.group.key&&(this.groupBy=this.options.group.key),this.options.callback&&this.options.callback.onClick&&(this.options.callback.onClickBefore=this.options.callback.onClick,delete this.options.callback.onClick),this.options.callback&&this.options.callback.onNavigate&&(this.options.callback.onNavigateBefore=this.options.callback.onNavigate,delete this.options.callback.onNavigate),this.options=j.extend(!0,{},s,this.options)},unifySourceFormat:function(){var t,e,i;for(t in this.dynamicGroups=[],Array.isArray(this.options.source)&&(this.options.source={group:{data:this.options.source}}),"string"==typeof this.options.source&&(this.options.source={group:{ajax:{url:this.options.source}}}),this.options.source.ajax&&(this.options.source={group:{ajax:this.options.source.ajax}}),(this.options.source.url||this.options.source.data)&&(this.options.source={group:this.options.source}),this.options.source)if(this.options.source.hasOwnProperty(t)){if("string"==typeof(e=this.options.source[t])&&(e={ajax:{url:e}}),i=e.url||e.ajax,Array.isArray(i)?(e.ajax="string"==typeof i[0]?{url:i[0]}:i[0],e.ajax.path=e.ajax.path||i[1]||null):"object"==typeof e.url?e.ajax=e.url:"string"==typeof e.url&&(e.ajax={url:e.url}),delete e.url,!e.data&&!e.ajax)return!1;e.display&&!Array.isArray(e.display)&&(e.display=[e.display]),e.minLength="number"==typeof e.minLength?e.minLength:this.options.minLength,e.maxLength="number"==typeof e.maxLength?e.maxLength:this.options.maxLength,e.dynamic="boolean"==typeof e.dynamic||this.options.dynamic,e.minLength>e.maxLength&&(e.minLength=e.maxLength),this.options.source[t]=e,this.options.source[t].dynamic&&this.dynamicGroups.push(t),e.cache=void 0!==e.cache?this._validateCacheMethod(e.cache):this.options.cache,e.compression&&("object"==typeof LZString&&e.cache||(e.compression=!1))}return this.hasDynamicGroups=this.options.dynamic||!!this.dynamicGroups.length,!0},init:function(){this.helper.executeCallback.call(this,this.options.callback.onInit,[this.node]),this.container=this.node.closest("."+this.options.selector.container)},delegateEvents:function(){var i=this,t=["focus"+this.namespace,"input"+this.namespace,"propertychange"+this.namespace,"keydown"+this.namespace,"keyup"+this.namespace,"search"+this.namespace,"generate"+this.namespace];j("html").on("touchmove",function(){i.hasDragged=!0}).on("touchstart",function(){i.hasDragged=!1}),this.node.closest("form").on("submit",function(t){if(!i.options.mustSelectItem||!i.helper.isEmpty(i.item))return i.options.backdropOnFocus||i.hideLayout(),i.options.callback.onSubmit?i.helper.executeCallback.call(i,i.options.callback.onSubmit,[i.node,this,i.item||i.items,t]):void 0;t.preventDefault()}).on("reset",function(){setTimeout(function(){i.node.trigger("input"+i.namespace),i.hideLayout()})});var s=!1;if(this.node.attr("placeholder")&&(a||l)){var e=!0;this.node.on("focusin focusout",function(){e=!(this.value||!this.placeholder)}),this.node.on("input",function(t){e&&(t.stopImmediatePropagation(),e=!1)})}this.node.off(this.namespace).on(t.join(" "),function(t,e){switch(t.type){case"generate":i.generateSource(Object.keys(i.options.source));break;case"focus":if(i.focusOnly){i.focusOnly=!1;break}i.options.backdropOnFocus&&(i.buildBackdropLayout(),i.showLayout()),i.options.searchOnFocus&&!i.item&&(i.deferred=j.Deferred(),i.assignQuery(),i.generateSource());break;case"keydown":8===t.keyCode&&i.options.multiselect&&i.options.multiselect.cancelOnBackspace&&""===i.query&&i.items.length?i.cancelMultiselectItem(i.items.length-1,null,t):t.keyCode&&~[9,13,27,38,39,40].indexOf(t.keyCode)&&(s=!0,i.navigate(t));break;case"keyup":n&&i.node[0].value.replace(/^\s+/,"").toString().length<i.query.length&&i.node.trigger("input"+i.namespace);break;case"propertychange":if(s){s=!1;break}case"input":i.deferred=j.Deferred(),i.assignQuery(),""===i.rawQuery&&""===i.query&&(t.originalEvent=e||{},i.helper.executeCallback.call(i,i.options.callback.onCancel,[i.node,i.item,t]),i.item=null),i.options.cancelButton&&i.toggleCancelButtonVisibility(),i.options.hint&&i.hint.container&&""!==i.hint.container.val()&&0!==i.hint.container.val().indexOf(i.rawQuery)&&(i.hint.container.val(""),i.isContentEditable&&i.hint.container.text("")),i.hasDynamicGroups?i.helper.typeWatch(function(){i.generateSource()},i.options.delay):i.generateSource();break;case"search":i.searchResult(),i.buildLayout(),i.result.length||i.searchGroups.length&&i.displayEmptyTemplate?i.showLayout():i.hideLayout(),i.deferred&&i.deferred.resolve()}return i.deferred&&i.deferred.promise()}),this.options.generateOnLoad&&this.node.trigger("generate"+this.namespace)},assignQuery:function(){this.isContentEditable?this.rawQuery=this.node.text():this.rawQuery=this.node.val().toString(),this.rawQuery=this.rawQuery.replace(/^\s+/,""),this.rawQuery!==this.query&&(this.query=this.rawQuery)},filterGenerateSource:function(){if(this.searchGroups=[],this.generateGroups=[],!this.focusOnly||this.options.multiselect)for(var t in this.options.source)if(this.options.source.hasOwnProperty(t)&&this.query.length>=this.options.source[t].minLength&&this.query.length<=this.options.source[t].maxLength){if(this.filters.dropdown&&"group"===this.filters.dropdown.key&&this.filters.dropdown.value!==t)continue;if(this.searchGroups.push(t),!this.options.source[t].dynamic&&this.source[t])continue;this.generateGroups.push(t)}},generateSource:function(t){if(this.filterGenerateSource(),this.generatedGroupCount=0,Array.isArray(t)&&t.length)this.generateGroups=t;else if(!this.generateGroups.length)return void this.node.trigger("search"+this.namespace);if(this.requestGroups=[],this.options.loadingAnimation&&this.container.addClass("loading"),!this.helper.isEmpty(this.xhr)){for(var e in this.xhr)this.xhr.hasOwnProperty(e)&&this.xhr[e].abort();this.xhr={}}for(var i,s,o,n,r,a,l,h=this,c=(e=0,this.generateGroups.length);e<c;++e){if(i=this.generateGroups[e],n=(o=this.options.source[i]).cache,r=o.compression,this.options.asyncResult&&delete this.source[i],n&&(a=window[n].getItem("TYPEAHEAD_"+this.selector+":"+i))){r&&(a=LZString.decompressFromUTF16(a)),l=!1;try{(a=JSON.parse(a+"")).data&&a.ttl>(new Date).getTime()?(this.populateSource(a.data,i),l=!0):window[n].removeItem("TYPEAHEAD_"+this.selector+":"+i)}catch(t){}if(l)continue}!o.data||o.ajax?o.ajax&&(this.requests[i]||(this.requests[i]=this.generateRequestObject(i)),this.requestGroups.push(i)):"function"==typeof o.data?(s=o.data.call(this),Array.isArray(s)?h.populateSource(s,i):"function"==typeof s.promise&&function(e){j.when(s).then(function(t){t&&Array.isArray(t)&&h.populateSource(t,e)})}(i)):this.populateSource(j.extend(!0,[],o.data),i)}return this.requestGroups.length&&this.handleRequests(),this.options.asyncResult&&this.searchGroups.length!==this.generateGroups&&this.node.trigger("search"+this.namespace),!!this.generateGroups.length},generateRequestObject:function(s){var o=this,n=this.options.source[s],t={request:{url:n.ajax.url||null,dataType:"json",beforeSend:function(t,e){o.xhr[s]=t;var i=o.requests[s].callback.beforeSend||n.ajax.beforeSend;"function"==typeof i&&i.apply(null,arguments)}},callback:{beforeSend:null,done:null,fail:null,then:null,always:null},extra:{path:n.ajax.path||null,group:s},validForGroup:[s]};if("function"!=typeof n.ajax&&(n.ajax instanceof Object&&(t=this.extendXhrObject(t,n.ajax)),1<Object.keys(this.options.source).length))for(var e in this.requests)this.requests.hasOwnProperty(e)&&(this.requests[e].isDuplicated||t.request.url&&t.request.url===this.requests[e].request.url&&(this.requests[e].validForGroup.push(s),t.isDuplicated=!0,delete t.validForGroup));return t},extendXhrObject:function(t,e){return"object"==typeof e.callback&&(t.callback=e.callback,delete e.callback),"function"==typeof e.beforeSend&&(t.callback.beforeSend=e.beforeSend,delete e.beforeSend),t.request=j.extend(!0,t.request,e),"jsonp"!==t.request.dataType.toLowerCase()||t.request.jsonpCallback||(t.request.jsonpCallback="callback_"+t.extra.group),t},handleRequests:function(){var t,h=this,c=this.requestGroups.length;if(!1!==this.helper.executeCallback.call(this,this.options.callback.onSendRequest,[this.node,this.query]))for(var e=0,i=this.requestGroups.length;e<i;++e)t=this.requestGroups[e],this.requests[t].isDuplicated||function(t,r){if("function"==typeof h.options.source[t].ajax){var e=h.options.source[t].ajax.call(h,h.query);if("object"!=typeof(r=h.extendXhrObject(h.generateRequestObject(t),"object"==typeof e?e:{})).request||!r.request.url)return h.populateSource([],t);h.requests[t]=r}var a,i=!1,l={};if(~r.request.url.indexOf("{{query}}")&&(i||(r=j.extend(!0,{},r),i=!0),r.request.url=r.request.url.replace("{{query}}",encodeURIComponent(h.query))),r.request.data)for(var s in r.request.data)if(r.request.data.hasOwnProperty(s)&&~String(r.request.data[s]).indexOf("{{query}}")){i||(r=j.extend(!0,{},r),i=!0),r.request.data[s]=r.request.data[s].replace("{{query}}",h.query);break}j.ajax(r.request).done(function(t,e,i){for(var s,o=0,n=r.validForGroup.length;o<n;o++)s=r.validForGroup[o],"function"==typeof(a=h.requests[s]).callback.done&&(l[s]=a.callback.done.call(h,t,e,i))}).fail(function(t,e,i){for(var s=0,o=r.validForGroup.length;s<o;s++)(a=h.requests[r.validForGroup[s]]).callback.fail instanceof Function&&a.callback.fail.call(h,t,e,i)}).always(function(t,e,i){for(var s,o=0,n=r.validForGroup.length;o<n;o++){if(s=r.validForGroup[o],(a=h.requests[s]).callback.always instanceof Function&&a.callback.always.call(h,t,e,i),"abort"===e)return;h.populateSource(null!==t&&"function"==typeof t.promise&&[]||l[s]||t,a.extra.group,a.extra.path||a.request.path),0===(c-=1)&&h.helper.executeCallback.call(h,h.options.callback.onReceiveRequest,[h.node,h.query])}}).then(function(t,e){for(var i=0,s=r.validForGroup.length;i<s;i++)(a=h.requests[r.validForGroup[i]]).callback.then instanceof Function&&a.callback.then.call(h,t,e)})}(t,this.requests[t])},populateSource:function(i,t,e){var s=this,o=this.options.source[t],n=o.ajax&&o.data;e&&"string"==typeof e&&(i=this.helper.namespace.call(this,e,i)),Array.isArray(i)||(i=[]),n&&("function"==typeof n&&(n=n()),Array.isArray(n)&&(i=i.concat(n)));for(var r,a=o.display?"compiled"===o.display[0]?o.display[1]:o.display[0]:"compiled"===this.options.display[0]?this.options.display[1]:this.options.display[0],l=0,h=i.length;l<h;l++)null!==i[l]&&"boolean"!=typeof i[l]&&("string"==typeof i[l]&&((r={})[a]=i[l],i[l]=r),i[l].group=t);if(!this.hasDynamicGroups&&this.dropdownFilter.dynamic.length){var c,p,u={};for(l=0,h=i.length;l<h;l++)for(var d=0,f=this.dropdownFilter.dynamic.length;d<f;d++)c=this.dropdownFilter.dynamic[d].key,(p=i[l][c])&&(this.dropdownFilter.dynamic[d].value||(this.dropdownFilter.dynamic[d].value=[]),u[c]||(u[c]=[]),~u[c].indexOf(p.toLowerCase())||(u[c].push(p.toLowerCase()),this.dropdownFilter.dynamic[d].value.push(p)))}if(this.options.correlativeTemplate){var m=o.template||this.options.template,g="";if("function"==typeof m&&(m=m.call(this,"",{})),m){if(Array.isArray(this.options.correlativeTemplate))for(l=0,h=this.options.correlativeTemplate.length;l<h;l++)g+="{{"+this.options.correlativeTemplate[l]+"}} ";else g=m.replace(/<.+?>/g," ").replace(/\s{2,}/," ").trim();for(l=0,h=i.length;l<h;l++)i[l].compiled=j("<textarea />").html(g.replace(/\{\{([\w\-\.]+)(?:\|(\w+))?}}/g,function(t,e){return s.helper.namespace.call(s,e,i[l],"get","")}).trim()).text();o.display?~o.display.indexOf("compiled")||o.display.unshift("compiled"):~this.options.display.indexOf("compiled")||this.options.display.unshift("compiled")}else;}this.options.callback.onPopulateSource&&(i=this.helper.executeCallback.call(this,this.options.callback.onPopulateSource,[this.node,i,t,e])),this.tmpSource[t]=Array.isArray(i)&&i||[];var y=this.options.source[t].cache,v=this.options.source[t].compression,b=this.options.source[t].ttl||this.options.ttl;if(y&&!window[y].getItem("TYPEAHEAD_"+this.selector+":"+t)){this.options.callback.onCacheSave&&(i=this.helper.executeCallback.call(this,this.options.callback.onCacheSave,[this.node,i,t,e]));var k=JSON.stringify({data:i,ttl:(new Date).getTime()+b});v&&(k=LZString.compressToUTF16(k)),window[y].setItem("TYPEAHEAD_"+this.selector+":"+t,k)}this.incrementGeneratedGroup(t)},incrementGeneratedGroup:function(t){if(this.generatedGroupCount++,this.generatedGroupCount===this.generateGroups.length||this.options.asyncResult){this.xhr&&this.xhr[t]&&delete this.xhr[t];for(var e=0,i=this.generateGroups.length;e<i;e++)this.source[this.generateGroups[e]]=this.tmpSource[this.generateGroups[e]];this.hasDynamicGroups||this.buildDropdownItemLayout("dynamic"),this.generatedGroupCount===this.generateGroups.length&&(this.xhr={},this.options.loadingAnimation&&this.container.removeClass("loading")),this.node.trigger("search"+this.namespace)}},navigate:function(t){if(this.helper.executeCallback.call(this,this.options.callback.onNavigateBefore,[this.node,this.query,t]),27===t.keyCode)return t.preventDefault(),void(this.query.length?(this.resetInput(),this.node.trigger("input"+this.namespace,[t])):(this.node.blur(),this.hideLayout()));if(this.result.length){var e,i=this.resultContainer.find("."+this.options.selector.item).not("[disabled]"),s=i.filter(".active"),o=s[0]?i.index(s):null,n=s[0]?s.attr("data-index"):null,r=null;if(this.clearActiveItem(),this.helper.executeCallback.call(this,this.options.callback.onLeave,[this.node,null!==o&&i.eq(o)||void 0,null!==n&&this.result[n]||void 0,t]),13===t.keyCode)return t.preventDefault(),void(0<s.length?"javascript:;"===s.find("a:first")[0].href?s.find("a:first").trigger("click",t):s.find("a:first")[0].click():this.node.closest("form").trigger("submit"));if(39!==t.keyCode){9===t.keyCode?this.options.blurOnTab?this.hideLayout():0<s.length?o+1<i.length?(t.preventDefault(),r=o+1,this.addActiveItem(i.eq(r))):this.hideLayout():i.length?(t.preventDefault(),r=0,this.addActiveItem(i.first())):this.hideLayout():38===t.keyCode?(t.preventDefault(),0<s.length?0<=o-1&&(r=o-1,this.addActiveItem(i.eq(r))):i.length&&(r=i.length-1,this.addActiveItem(i.last()))):40===t.keyCode&&(t.preventDefault(),0<s.length?o+1<i.length&&(r=o+1,this.addActiveItem(i.eq(r))):i.length&&(r=0,this.addActiveItem(i.first()))),e=null!==r?i.eq(r).attr("data-index"):null,this.helper.executeCallback.call(this,this.options.callback.onEnter,[this.node,null!==r&&i.eq(r)||void 0,null!==e&&this.result[e]||void 0,t]),t.preventInputChange&&~[38,40].indexOf(t.keyCode)&&this.buildHintLayout(null!==e&&e<this.result.length?[this.result[e]]:null),this.options.hint&&this.hint.container&&this.hint.container.css("color",t.preventInputChange?this.hint.css.color:null===e&&this.hint.css.color||this.hint.container.css("background-color")||"fff");var a=null===e||t.preventInputChange?this.rawQuery:this.getTemplateValue.call(this,this.result[e]);this.node.val(a),this.isContentEditable&&this.node.text(a),this.helper.executeCallback.call(this,this.options.callback.onNavigateAfter,[this.node,i,null!==r&&i.eq(r).find("a:first")||void 0,null!==e&&this.result[e]||void 0,this.query,t])}else null!==o?i.eq(o).find("a:first")[0].click():this.options.hint&&""!==this.hint.container.val()&&this.helper.getCaret(this.node[0])>=this.query.length&&i.filter('[data-index="'+this.hintIndex+'"]').find("a:first")[0].click()}},getTemplateValue:function(i){if(i){var t=i.group&&this.options.source[i.group].templateValue||this.options.templateValue;if("function"==typeof t&&(t=t.call(this)),!t)return this.helper.namespace.call(this,i.matchedKey,i).toString();var s=this;return t.replace(/\{\{([\w\-.]+)}}/gi,function(t,e){return s.helper.namespace.call(s,e,i,"get","")})}},clearActiveItem:function(){this.resultContainer.find("."+this.options.selector.item).removeClass("active")},addActiveItem:function(t){t.addClass("active")},searchResult:function(){this.resetLayout(),!1!==this.helper.executeCallback.call(this,this.options.callback.onSearch,[this.node,this.query])&&(!this.searchGroups.length||this.options.multiselect&&this.options.multiselect.limit&&this.items.length>=this.options.multiselect.limit||this.searchResultData(),this.helper.executeCallback.call(this,this.options.callback.onResult,[this.node,this.query,this.result,this.resultCount,this.resultCountPerGroup]),this.isDropdownEvent&&(this.helper.executeCallback.call(this,this.options.callback.onDropdownFilter,[this.node,this.query,this.filters.dropdown,this.result]),this.isDropdownEvent=!1))},searchResultData:function(){var t,e,i,s,o,n,r,a,l,h,c,p=this.groupBy,u=null,d=this.query.toLowerCase(),f=this.options.maxItem,m=this.options.maxItemPerGroup,g=this.filters.dynamic&&!this.helper.isEmpty(this.filters.dynamic),y="function"==typeof this.options.matcher&&this.options.matcher;this.options.accent&&(d=this.helper.removeAccent.call(this,d));for(var v=0,b=this.searchGroups.length;v<b;++v)if(F=this.searchGroups[v],(!this.filters.dropdown||"group"!==this.filters.dropdown.key||this.filters.dropdown.value===F)&&(o=void 0!==this.options.source[F].filter?this.options.source[F].filter:this.options.filter,r="function"==typeof this.options.source[F].matcher&&this.options.source[F].matcher||y,this.source[F]))for(var k=0,w=this.source[F].length;k<w&&(!(this.resultItemCount>=f)||this.options.callback.onResult);k++)if((!g||this.dynamicFilter.validate.apply(this,[this.source[F][k]]))&&null!==(t=this.source[F][k])&&"boolean"!=typeof t&&(!this.options.multiselect||this.isMultiselectUniqueData(t))&&(!this.filters.dropdown||(t[this.filters.dropdown.key]||"").toLowerCase()===(this.filters.dropdown.value||"").toLowerCase())){if((u="group"===p?F:t[p]?t[p]:t.group)&&!this.tmpResult[u]&&(this.tmpResult[u]=[],this.resultCountPerGroup[u]=0),m&&"group"===p&&this.tmpResult[u].length>=m&&!this.options.callback.onResult)break;for(var x=0,C=(S=this.options.source[F].display||this.options.display).length;x<C;++x){if(!1!==o){if(void 0===(s=/\./.test(S[x])?this.helper.namespace.call(this,S[x],t):t[S[x]])||""===s)continue;s=this.helper.cleanStringFromScript(s)}if("function"==typeof o){if(void 0===(n=o.call(this,t,s)))break;if(!n)continue;"object"==typeof n&&(t=n)}if(~[void 0,!0].indexOf(o)){if(null===s)continue;if(i=(i=s).toString().toLowerCase(),this.options.accent&&(i=this.helper.removeAccent.call(this,i)),e=i.indexOf(d),this.options.correlativeTemplate&&"compiled"===S[x]&&e<0&&/\s/.test(d)){l=!0,c=i;for(var q=0,A=(h=d.split(" ")).length;q<A;q++)if(""!==h[q]){if(!~c.indexOf(h[q])){l=!1;break}c=c.replace(h[q],"")}}if(e<0&&!l)continue;if(this.options.offset&&0!==e)continue;if(r){if(void 0===(a=r.call(this,t,s)))break;if(!a)continue;"object"==typeof a&&(t=a)}}if(this.resultCount++,this.resultCountPerGroup[u]++,this.resultItemCount<f){if(m&&this.tmpResult[u].length>=m)break;this.tmpResult[u].push(j.extend(!0,{matchedKey:S[x]},t)),this.resultItemCount++}break}if(!this.options.callback.onResult){if(this.resultItemCount>=f)break;if(m&&this.tmpResult[u].length>=m&&"group"===p)break}}if(this.options.order){var O,S=[];for(var F in this.tmpResult)if(this.tmpResult.hasOwnProperty(F)){for(v=0,b=this.tmpResult[F].length;v<b;v++)O=this.options.source[this.tmpResult[F][v].group].display||this.options.display,~S.indexOf(O[0])||S.push(O[0]);this.tmpResult[F].sort(this.helper.sort(S,"asc"===this.options.order,function(t){return t?t.toString().toUpperCase():""}))}}var L=[],I=[];for(v=0,b=(I="function"==typeof this.options.groupOrder?this.options.groupOrder.apply(this,[this.node,this.query,this.tmpResult,this.resultCount,this.resultCountPerGroup]):Array.isArray(this.options.groupOrder)?this.options.groupOrder:"string"==typeof this.options.groupOrder&&~["asc","desc"].indexOf(this.options.groupOrder)?Object.keys(this.tmpResult).sort(this.helper.sort([],"asc"===this.options.groupOrder,function(t){return t.toString().toUpperCase()})):Object.keys(this.tmpResult)).length;v<b;v++)L=L.concat(this.tmpResult[I[v]]||[]);this.groups=JSON.parse(JSON.stringify(I)),this.result=L},buildLayout:function(){this.buildHtmlLayout(),this.buildBackdropLayout(),this.buildHintLayout(),this.options.callback.onLayoutBuiltBefore&&(this.tmpResultHtml=this.helper.executeCallback.call(this,this.options.callback.onLayoutBuiltBefore,[this.node,this.query,this.result,this.resultHtml])),this.tmpResultHtml instanceof j?this.resultContainer.html(this.tmpResultHtml):this.resultHtml instanceof j&&this.resultContainer.html(this.resultHtml),this.options.callback.onLayoutBuiltAfter&&this.helper.executeCallback.call(this,this.options.callback.onLayoutBuiltAfter,[this.node,this.query,this.result])},buildHtmlLayout:function(){if(!1!==this.options.resultContainer){var h;if(this.resultContainer||(this.resultContainer=j("<div/>",{class:this.options.selector.result}),this.container.append(this.resultContainer)),!this.result.length&&this.generatedGroupCount===this.generateGroups.length)if(this.options.multiselect&&this.options.multiselect.limit&&this.items.length>=this.options.multiselect.limit)h=this.options.multiselect.limitTemplate?"function"==typeof this.options.multiselect.limitTemplate?this.options.multiselect.limitTemplate.call(this,this.query):this.options.multiselect.limitTemplate.replace(/\{\{query}}/gi,j("<div>").text(this.helper.cleanStringFromScript(this.query)).html()):"Can't select more than "+this.items.length+" items.";else{if(!this.options.emptyTemplate||""===this.query)return;h="function"==typeof this.options.emptyTemplate?this.options.emptyTemplate.call(this,this.query):this.options.emptyTemplate.replace(/\{\{query}}/gi,j("<div>").text(this.helper.cleanStringFromScript(this.query)).html())}this.displayEmptyTemplate=!!h;var o=this.query.toLowerCase();this.options.accent&&(o=this.helper.removeAccent.call(this,o));var c=this,t=this.groupTemplate||"<ul></ul>",p=!1;this.groupTemplate?t=j(t.replace(/<([^>]+)>\{\{(.+?)}}<\/[^>]+>/g,function(t,e,i,s,o){var n="",r="group"===i?c.groups:[i];if(!c.result.length)return!0===p?"":(p=!0,"<"+e+' class="'+c.options.selector.empty+'">'+h+"</"+e+">");for(var a=0,l=r.length;a<l;++a)n+="<"+e+' data-group-template="'+r[a]+'"><ul></ul></'+e+">";return n})):(t=j(t),this.result.length||t.append(h instanceof j?h:'<li class="'+c.options.selector.empty+'">'+h+"</li>")),t.addClass(this.options.selector.list+(this.helper.isEmpty(this.result)?" empty":""));for(var e,i,n,s,r,a,l,u,d,f,m,g,y,v=this.groupTemplate&&this.result.length&&c.groups||[],b=0,k=this.result.length;b<k;++b)e=(n=this.result[b]).group,s=!this.options.multiselect&&this.options.source[n.group].href||this.options.href,u=[],d=this.options.source[n.group].display||this.options.display,this.options.group&&(e=n[this.options.group.key],this.options.group.template&&("function"==typeof this.options.group.template?i=this.options.group.template.call(this,n):"string"==typeof this.options.group.template&&(i=this.options.group.template.replace(/\{\{([\w\-\.]+)}}/gi,function(t,e){return c.helper.namespace.call(c,e,n,"get","")}))),t.find('[data-search-group="'+e+'"]')[0]||(this.groupTemplate?t.find('[data-group-template="'+e+'"] ul'):t).append(j("<li/>",{class:c.options.selector.group,html:j("<a/>",{href:"javascript:;",html:i||e,tabindex:-1}),"data-search-group":e}))),this.groupTemplate&&v.length&&~(m=v.indexOf(e||n.group))&&v.splice(m,1),r=j("<li/>",{class:c.options.selector.item+" "+c.options.selector.group+"-"+this.helper.slugify.call(this,e),disabled:!!n.disabled,"data-group":e,"data-index":b,html:j("<a/>",{href:s&&!n.disabled?(g=s,y=n,y.href=c.generateHref.call(c,g,y)):"javascript:;",html:function(){if(a=n.group&&c.options.source[n.group].template||c.options.template)"function"==typeof a&&(a=a.call(c,c.query,n)),l=a.replace(/\{\{([^\|}]+)(?:\|([^}]+))*}}/gi,function(t,e,i){var s=c.helper.cleanStringFromScript(String(c.helper.namespace.call(c,e,n,"get","")));return~(i=i&&i.split("|")||[]).indexOf("slugify")&&(s=c.helper.slugify.call(c,s)),~i.indexOf("raw")||!0===c.options.highlight&&o&&~d.indexOf(e)&&(s=c.helper.highlight.call(c,s,o.split(" "),c.options.accent)),s});else{for(var t=0,e=d.length;t<e;t++)void 0!==(f=/\./.test(d[t])?c.helper.namespace.call(c,d[t],n,"get",""):n[d[t]])&&""!==f&&u.push(f);l='<span class="'+c.options.selector.display+'">'+c.helper.cleanStringFromScript(String(u.join(" ")))+"</span>"}(!0===c.options.highlight&&o&&!a||"any"===c.options.highlight)&&(l=c.helper.highlight.call(c,l,o.split(" "),c.options.accent)),j(this).append(l)}})}),function(t,i,e){e.on("click",function(t,e){i.disabled?t.preventDefault():(e&&"object"==typeof e&&(t.originalEvent=e),c.options.mustSelectItem&&c.helper.isEmpty(i)?t.preventDefault():(c.options.multiselect||(c.item=i),!1!==c.helper.executeCallback.call(c,c.options.callback.onClickBefore,[c.node,j(this),i,t])&&(t.originalEvent&&t.originalEvent.defaultPrevented||t.isDefaultPrevented()||(c.options.multiselect?(c.query=c.rawQuery="",c.addMultiselectItemLayout(i)):(c.focusOnly=!0,c.query=c.rawQuery=c.getTemplateValue.call(c,i),c.isContentEditable&&(c.node.text(c.query),c.helper.setCaretAtEnd(c.node[0]))),c.hideLayout(),c.node.val(c.query).focus(),c.options.cancelButton&&c.toggleCancelButtonVisibility(),c.helper.executeCallback.call(c,c.options.callback.onClickAfter,[c.node,j(this),i,t])))))}),e.on("mouseenter",function(t){i.disabled||(c.clearActiveItem(),c.addActiveItem(j(this))),c.helper.executeCallback.call(c,c.options.callback.onEnter,[c.node,j(this),i,t])}),e.on("mouseleave",function(t){i.disabled||c.clearActiveItem(),c.helper.executeCallback.call(c,c.options.callback.onLeave,[c.node,j(this),i,t])})}(0,n,r),(this.groupTemplate?t.find('[data-group-template="'+e+'"] ul'):t).append(r);if(this.result.length&&v.length)for(b=0,k=v.length;b<k;++b)t.find('[data-group-template="'+v[b]+'"]').remove();this.resultHtml=t}},generateHref:function(t,o){var n=this;return"string"==typeof t?t=t.replace(/\{\{([^\|}]+)(?:\|([^}]+))*}}/gi,function(t,e,i){var s=n.helper.namespace.call(n,e,o,"get","");return~(i=i&&i.split("|")||[]).indexOf("slugify")&&(s=n.helper.slugify.call(n,s)),s}):"function"==typeof t&&(t=t.call(this,o)),t},getMultiselectComparedData:function(t){var e="";if(Array.isArray(this.options.multiselect.matchOn))for(var i=0,s=this.options.multiselect.matchOn.length;i<s;++i)e+=void 0!==t[this.options.multiselect.matchOn[i]]?t[this.options.multiselect.matchOn[i]]:"";else{var o=JSON.parse(JSON.stringify(t)),n=["group","matchedKey","compiled","href"];for(i=0,s=n.length;i<s;++i)delete o[n[i]];e=JSON.stringify(o)}return e},buildBackdropLayout:function(){this.options.backdrop&&(this.backdrop.container||(this.backdrop.css=j.extend({opacity:.6,filter:"alpha(opacity=60)",position:"fixed",top:0,right:0,bottom:0,left:0,"z-index":1040,"background-color":"#000"},this.options.backdrop),this.backdrop.container=j("<div/>",{class:this.options.selector.backdrop,css:this.backdrop.css}).insertAfter(this.container)),this.container.addClass("backdrop").css({"z-index":this.backdrop.css["z-index"]+1,position:"relative"}))},buildHintLayout:function(t){if(this.options.hint)if(this.node[0].scrollWidth>Math.ceil(this.node.innerWidth()))this.hint.container&&this.hint.container.val("");else{var e=this,i="",s=(t=t||this.result,this.query.toLowerCase());if(this.options.accent&&(s=this.helper.removeAccent.call(this,s)),this.hintIndex=null,this.searchGroups.length){if(this.hint.container||(this.hint.css=j.extend({"border-color":"transparent",position:"absolute",top:0,display:"inline","z-index":-1,float:"none",color:"silver","box-shadow":"none",cursor:"default","-webkit-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none"},this.options.hint),this.hint.container=j("<"+this.node[0].nodeName+"/>",{type:this.node.attr("type"),class:this.node.attr("class"),readonly:!0,unselectable:"on","aria-hidden":"true",tabindex:-1,click:function(){e.node.focus()}}).addClass(this.options.selector.hint).css(this.hint.css).insertAfter(this.node),this.node.parent().css({position:"relative"})),this.hint.container.css("color",this.hint.css.color),s)for(var o,n,r,a=0,l=t.length;a<l;a++)if(!t[a].disabled){n=t[a].group;for(var h=0,c=(o=this.options.source[n].display||this.options.display).length;h<c;h++)if(r=String(t[a][o[h]]).toLowerCase(),this.options.accent&&(r=this.helper.removeAccent.call(this,r)),0===r.indexOf(s)){i=String(t[a][o[h]]),this.hintIndex=a;break}if(null!==this.hintIndex)break}var p=0<i.length&&this.rawQuery+i.substring(this.query.length)||"";this.hint.container.val(p),this.isContentEditable&&this.hint.container.text(p)}}},buildDropdownLayout:function(){if(this.options.dropdownFilter){var i=this;j("<span/>",{class:this.options.selector.filter,html:function(){j(this).append(j("<button/>",{type:"button",class:i.options.selector.filterButton,style:"display: none;",click:function(){i.container.toggleClass("filter");var e=i.namespace+"-dropdown-filter";j("html").off(e),i.container.hasClass("filter")&&j("html").on("click"+e+" touchend"+e,function(t){j(t.target).closest("."+i.options.selector.filter)[0]&&j(t.target).closest(i.container)[0]||i.hasDragged||(i.container.removeClass("filter"),j("html").off(e))})}})),j(this).append(j("<ul/>",{class:i.options.selector.dropdown}))}}).insertAfter(i.container.find("."+i.options.selector.query))}},buildDropdownItemLayout:function(t){if(this.options.dropdownFilter){var e,i,o=this,n="string"==typeof this.options.dropdownFilter&&this.options.dropdownFilter||"All",r=this.container.find("."+this.options.selector.dropdown);"static"!==t||!0!==this.options.dropdownFilter&&"string"!=typeof this.options.dropdownFilter||this.dropdownFilter.static.push({key:"group",template:"{{group}}",all:n,value:Object.keys(this.options.source)});for(var s=0,a=this.dropdownFilter[t].length;s<a;s++){i=this.dropdownFilter[t][s],Array.isArray(i.value)||(i.value=[i.value]),i.all&&(this.dropdownFilterAll=i.all);for(var l=0,h=i.value.length;l<=h;l++)l===h&&s!==a-1||l===h&&s===a-1&&"static"===t&&this.dropdownFilter.dynamic.length||(e=this.dropdownFilterAll||n,i.value[l]?e=i.template?i.template.replace(new RegExp("{{"+i.key+"}}","gi"),i.value[l]):i.value[l]:this.container.find("."+o.options.selector.filterButton).html(e),function(e,i,s){r.append(j("<li/>",{class:o.options.selector.dropdownItem+" "+o.helper.slugify.call(o,i.key+"-"+(i.value[e]||n)),html:j("<a/>",{href:"javascript:;",html:s,click:function(t){t.preventDefault(),c.call(o,{key:i.key,value:i.value[e]||"*",template:s})}})}))}(l,i,e))}this.dropdownFilter[t].length&&this.container.find("."+o.options.selector.filterButton).removeAttr("style")}function c(t){"*"===t.value?delete this.filters.dropdown:this.filters.dropdown=t,this.container.removeClass("filter").find("."+this.options.selector.filterButton).html(t.template),this.isDropdownEvent=!0,this.node.trigger("input"+this.namespace),this.options.multiselect&&this.adjustInputSize(),this.node.focus()}},dynamicFilter:{isEnabled:!1,init:function(){this.options.dynamicFilter&&(this.dynamicFilter.bind.call(this),this.dynamicFilter.isEnabled=!0)},validate:function(t){var e,i,s=null,o=null;for(var n in this.filters.dynamic)if(this.filters.dynamic.hasOwnProperty(n)&&(i=~n.indexOf(".")?this.helper.namespace.call(this,n,t,"get"):t[n],"|"!==this.filters.dynamic[n].modifier||s||(s=i==this.filters.dynamic[n].value||!1),"&"===this.filters.dynamic[n].modifier)){if(i!=this.filters.dynamic[n].value){o=!1;break}o=!0}return e=s,null!==o&&!0===(e=o)&&null!==s&&(e=s),!!e},set:function(t,e){var i=t.match(/^([|&])?(.+)/);e?this.filters.dynamic[i[2]]={modifier:i[1]||"|",value:e}:delete this.filters.dynamic[i[2]],this.dynamicFilter.isEnabled&&this.generateSource()},bind:function(){for(var t,e=this,i=0,s=this.options.dynamicFilter.length;i<s;i++)"string"==typeof(t=this.options.dynamicFilter[i]).selector&&(t.selector=j(t.selector)),t.selector instanceof j&&t.selector[0]&&t.key&&function(t){t.selector.off(e.namespace).on("change"+e.namespace,function(){e.dynamicFilter.set.apply(e,[t.key,e.dynamicFilter.getValue(this)])}).trigger("change"+e.namespace)}(t)},getValue:function(t){var e;return"SELECT"===t.tagName?e=t.value:"INPUT"===t.tagName&&("checkbox"===t.type?e=t.checked&&t.getAttribute("value")||t.checked||null:"radio"===t.type&&t.checked&&(e=t.value)),e}},buildMultiselectLayout:function(){if(this.options.multiselect){var t,e=this;this.label.container=j("<span/>",{class:this.options.selector.labelContainer,"data-padding-left":parseFloat(this.node.css("padding-left"))||0,"data-padding-right":parseFloat(this.node.css("padding-right"))||0,"data-padding-top":parseFloat(this.node.css("padding-top"))||0,click:function(t){j(t.target).hasClass(e.options.selector.labelContainer)&&e.node.focus()}}),this.node.closest("."+this.options.selector.query).prepend(this.label.container),this.options.multiselect.data&&(Array.isArray(this.options.multiselect.data)?this.populateMultiselectData(this.options.multiselect.data):"function"==typeof this.options.multiselect.data&&(t=this.options.multiselect.data.call(this),Array.isArray(t)?this.populateMultiselectData(t):"function"==typeof t.promise&&j.when(t).then(function(t){t&&Array.isArray(t)&&e.populateMultiselectData(t)})))}},isMultiselectUniqueData:function(t){for(var e=!0,i=0,s=this.comparedItems.length;i<s;++i)if(this.comparedItems[i]===this.getMultiselectComparedData(t)){e=!1;break}return e},populateMultiselectData:function(t){for(var e=0,i=t.length;e<i;++e)this.addMultiselectItemLayout(t[e]);this.node.trigger("search"+this.namespace,{origin:"populateMultiselectData"})},addMultiselectItemLayout:function(t){if(this.isMultiselectUniqueData(t)){this.items.push(t),this.comparedItems.push(this.getMultiselectComparedData(t));var e,i=this.getTemplateValue(t),s=this,o=this.options.multiselect.href?"a":"span",n=j("<span/>",{class:this.options.selector.label,html:j("<"+o+"/>",{text:i,click:function(t){var e=j(this).closest("."+s.options.selector.label),i=s.label.container.find("."+s.options.selector.label).index(e);s.options.multiselect.callback&&s.helper.executeCallback.call(s,s.options.multiselect.callback.onClick,[s.node,s.items[i],t])},href:this.options.multiselect.href?(e=s.items[s.items.length-1],s.generateHref.call(s,s.options.multiselect.href,e)):null})});return n.append(j("<span/>",{class:this.options.selector.cancelButton,html:"×",click:function(t){var e=j(this).closest("."+s.options.selector.label),i=s.label.container.find("."+s.options.selector.label).index(e);s.cancelMultiselectItem(i,e,t)}})),this.label.container.append(n),this.adjustInputSize(),!0}},cancelMultiselectItem:function(t,e,i){var s=this.items[t];(e=e||this.label.container.find("."+this.options.selector.label).eq(t)).remove(),this.items.splice(t,1),this.comparedItems.splice(t,1),this.options.multiselect.callback&&this.helper.executeCallback.call(this,this.options.multiselect.callback.onCancel,[this.node,s,i]),this.adjustInputSize(),this.focusOnly=!0,this.node.focus().trigger("input"+this.namespace,{origin:"cancelMultiselectItem"})},adjustInputSize:function(){var i=this.node[0].getBoundingClientRect().width-(parseFloat(this.label.container.data("padding-right"))||0)-(parseFloat(this.label.container.css("padding-left"))||0),s=0,o=0,n=0,r=!1,a=0;this.label.container.find("."+this.options.selector.label).filter(function(t,e){0===t&&(a=j(e)[0].getBoundingClientRect().height+parseFloat(j(e).css("margin-bottom")||0)),s=j(e)[0].getBoundingClientRect().width+parseFloat(j(e).css("margin-right")||0),.7*i<n+s&&!r&&(o++,r=!0),n+s<i?n+=s:(r=!1,n=s)});var t=parseFloat(this.label.container.data("padding-left")||0)+(r?0:n),e=o*a+parseFloat(this.label.container.data("padding-top")||0);this.container.find("."+this.options.selector.query).find("input, textarea, [contenteditable], .typeahead__hint").css({paddingLeft:t,paddingTop:e})},showLayout:function(){!this.container.hasClass("result")&&(this.result.length||this.displayEmptyTemplate||this.options.backdropOnFocus)&&(function(){var e=this;j("html").off("keydown"+this.namespace).on("keydown"+this.namespace,function(t){t.keyCode&&9===t.keyCode&&setTimeout(function(){j(":focus").closest(e.container).find(e.node)[0]||e.hideLayout()},0)}),j("html").off("click"+this.namespace+" touchend"+this.namespace).on("click"+this.namespace+" touchend"+this.namespace,function(t){j(t.target).closest(e.container)[0]||j(t.target).closest("."+e.options.selector.item)[0]||t.target.className===e.options.selector.cancelButton||e.hasDragged||e.hideLayout()})}.call(this),this.container.addClass([this.result.length||this.searchGroups.length&&this.displayEmptyTemplate?"result ":"",this.options.hint&&this.searchGroups.length?"hint":"",this.options.backdrop||this.options.backdropOnFocus?"backdrop":""].join(" ")),this.helper.executeCallback.call(this,this.options.callback.onShowLayout,[this.node,this.query]))},hideLayout:function(){(this.container.hasClass("result")||this.container.hasClass("backdrop"))&&(this.container.removeClass("result hint filter"+(this.options.backdropOnFocus&&j(this.node).is(":focus")?"":" backdrop")),this.options.backdropOnFocus&&this.container.hasClass("backdrop")||(j("html").off(this.namespace),this.helper.executeCallback.call(this,this.options.callback.onHideLayout,[this.node,this.query])))},resetLayout:function(){this.result=[],this.tmpResult={},this.groups=[],this.resultCount=0,this.resultCountPerGroup={},this.resultItemCount=0,this.resultHtml=null,this.options.hint&&this.hint.container&&(this.hint.container.val(""),this.isContentEditable&&this.hint.container.text(""))},resetInput:function(){this.node.val(""),this.isContentEditable&&this.node.text(""),this.query="",this.rawQuery=""},buildCancelButtonLayout:function(){if(this.options.cancelButton){var e=this;j("<span/>",{class:this.options.selector.cancelButton,html:"×",mousedown:function(t){t.stopImmediatePropagation(),t.preventDefault(),e.resetInput(),e.node.trigger("input"+e.namespace,[t])}}).insertBefore(this.node)}},toggleCancelButtonVisibility:function(){this.container.toggleClass("cancel",!!this.query.length)},__construct:function(){this.extendOptions(),this.unifySourceFormat()&&(this.dynamicFilter.init.apply(this),this.init(),this.buildDropdownLayout(),this.buildDropdownItemLayout("static"),this.buildMultiselectLayout(),this.delegateEvents(),this.buildCancelButtonLayout(),this.helper.executeCallback.call(this,this.options.callback.onReady,[this.node]))},helper:{isEmpty:function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0},removeAccent:function(t){if("string"==typeof t){var e=o;return"object"==typeof this.options.accent&&(e=this.options.accent),t=t.toLowerCase().replace(new RegExp("["+e.from+"]","g"),function(t){return e.to[e.from.indexOf(t)]})}},slugify:function(t){return""!==(t=String(t))&&(t=(t=this.helper.removeAccent.call(this,t)).replace(/[^-a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")),t},sort:function(s,i,o){function n(t){for(var e=0,i=s.length;e<i;e++)if(void 0!==t[s[e]])return o(t[s[e]]);return t}return i=[-1,1][+!!i],function(t,e){return t=n(t),e=n(e),i*((e<t)-(t<e))}},replaceAt:function(t,e,i,s){return t.substring(0,e)+s+t.substring(e+i)},highlight:function(t,e,i){t=String(t);var s=i&&this.helper.removeAccent.call(this,t)||t,o=[];Array.isArray(e)||(e=[e]),e.sort(function(t,e){return e.length-t.length});for(var n=e.length-1;0<=n;n--)""!==e[n].trim()?e[n]=e[n].replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):e.splice(n,1);s.replace(new RegExp("(?:"+e.join("|")+")(?!([^<]+)?>)","gi"),function(t,e,i){o.push({offset:i,length:t.length})});for(n=o.length-1;0<=n;n--)t=this.helper.replaceAt(t,o[n].offset,o[n].length,"<strong>"+t.substr(o[n].offset,o[n].length)+"</strong>");return t},getCaret:function(t){var e=0;if(t.selectionStart)return t.selectionStart;if(document.selection){var i=document.selection.createRange();if(null===i)return e;var s=t.createTextRange(),o=s.duplicate();s.moveToBookmark(i.getBookmark()),o.setEndPoint("EndToStart",s),e=o.text.length}else if(window.getSelection){var n=window.getSelection();if(n.rangeCount){var r=n.getRangeAt(0);r.commonAncestorContainer.parentNode==t&&(e=r.endOffset)}}return e},setCaretAtEnd:function(t){if(void 0!==window.getSelection&&void 0!==document.createRange){var e=document.createRange();e.selectNodeContents(t),e.collapse(!1);var i=window.getSelection();i.removeAllRanges(),i.addRange(e)}else if(void 0!==document.body.createTextRange){var s=document.body.createTextRange();s.moveToElementText(t),s.collapse(!1),s.select()}},cleanStringFromScript:function(t){return"string"==typeof t&&t.replace(/<\/?(?:script|iframe)\b[^>]*>/gm,"")||t},executeCallback:function(t,e){if(t){var i;if("function"==typeof t)i=t;else if(("string"==typeof t||Array.isArray(t))&&("string"==typeof t&&(t=[t,[]]),"function"!=typeof(i=this.helper.namespace.call(this,t[0],window))))return;return i.apply(this,(t[1]||[]).concat(e||[]))}},namespace:function(t,e,i,s){if("string"!=typeof t||""===t)return!1;var o=void 0!==s?s:void 0;if(!~t.indexOf("."))return e[t]||o;for(var n=t.split("."),r=e||window,a=(i=i||"get",""),l=0,h=n.length;l<h;l++){if(void 0===r[a=n[l]]){if(~["get","delete"].indexOf(i))return void 0!==s?s:void 0;r[a]={}}if(~["set","create","delete"].indexOf(i)&&l===h-1){if("set"!==i&&"create"!==i)return delete r[a],!0;r[a]=o}r=r[a]}return r},typeWatch:(i=0,function(t,e){clearTimeout(i),i=setTimeout(t,e)})}},j.fn.typeahead=j.typeahead=function(t){return e.typeahead(this,t)};var e={typeahead:function(t,e){if(e&&e.source&&"object"==typeof e.source){if("function"==typeof t){if(!e.input)return;t=j(e.input)}if(t.length){if(void 0===t[0].value&&(t[0].value=t.text()),1===t.length)return t[0].selector=t.selector||e.input||t[0].nodeName.toLowerCase(),window.Typeahead[t[0].selector]=new r(t,e);for(var i,s={},o=0,n=t.length;o<n;++o)void 0!==s[i=t[o].nodeName.toLowerCase()]&&(i+=o),t[o].selector=i,window.Typeahead[i]=s[i]=new r(t.eq(o),e);return s}}}};return window.console=window.console||{log:function(){}},Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),"trim"in String.prototype||(String.prototype.trim=function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}),"indexOf"in Array.prototype||(Array.prototype.indexOf=function(t,e){void 0===e&&(e=0),e<0&&(e+=this.length),e<0&&(e=0);for(var i=this.length;e<i;e++)if(e in this&&this[e]===t)return e;return-1}),Object.keys||(Object.keys=function(t){var e,i=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&i.push(e);return i}),r});;
/* =========================================================
 * bootstrap-datepicker.js
 * Repo: https://github.com/uxsolutions/bootstrap-datepicker/
 * Demo: https://uxsolutions.github.io/bootstrap-datepicker/
 * Docs: https://bootstrap-datepicker.readthedocs.org/
 * =========================================================
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ========================================================= */
(function(factory){
    if (typeof define === 'function' && define.amd) {
        define(['jquery'], factory);
    } else if (typeof exports === 'object') {
        factory(require('jquery'));
    } else {
        factory(jQuery);
    }
}(function($, undefined){
	function UTCDate(){
		return new Date(Date.UTC.apply(Date, arguments));
	}
	function UTCToday(){
		var today = new Date();
		return UTCDate(today.getFullYear(), today.getMonth(), today.getDate());
	}
	function isUTCEquals(date1, date2) {
		return (
			date1.getUTCFullYear() === date2.getUTCFullYear() &&
			date1.getUTCMonth() === date2.getUTCMonth() &&
			date1.getUTCDate() === date2.getUTCDate()
		);
	}
	function alias(method, deprecationMsg){
		return function(){
			if (deprecationMsg !== undefined) {
				$.fn.datepicker.deprecated(deprecationMsg);
			}
			return this[method].apply(this, arguments);
		};
	}
	function isValidDate(d) {
		return d && !isNaN(d.getTime());
	}
	var DateArray = (function(){
		var extras = {
			get: function(i){
				return this.slice(i)[0];
			},
			contains: function(d){
				// Array.indexOf is not cross-browser;
				// $.inArray doesn't work with Dates
				var val = d && d.valueOf();
				for (var i=0, l=this.length; i < l; i++)
          // Use date arithmetic to allow dates with different times to match
          if (0 <= this[i].valueOf() - val && this[i].valueOf() - val < 1000*60*60*24)
						return i;
				return -1;
			},
			remove: function(i){
				this.splice(i,1);
			},
			replace: function(new_array){
				if (!new_array)
					return;
				if (!Array.isArray(new_array))
					new_array = [new_array];
				this.clear();
				this.push.apply(this, new_array);
			},
			clear: function(){
				this.length = 0;
			},
			copy: function(){
				var a = new DateArray();
				a.replace(this);
				return a;
			}
		};
		return function(){
			var a = [];
			a.push.apply(a, arguments);
			$.extend(a, extras);
			return a;
		};
	})();
	// Picker object
	var Datepicker = function(element, options){
		$.data(element, 'datepicker', this);
		this._events = [];
		this._secondaryEvents = [];
		this._process_options(options);
		this.dates = new DateArray();
		this.viewDate = this.o.defaultViewDate;
		this.focusDate = null;
		this.element = $(element);
		this.isInput = this.element.is('input');
		this.inputField = this.isInput ? this.element : this.element.find('input');
		this.component = this.element.hasClass('date') ? this.element.find('.add-on, .input-group-addon, .input-group-append, .input-group-prepend, .btn') : false;
		if (this.component && this.component.length === 0){
			this.component = false;
    }
		if (this.o.isInline === null){
			this.isInline = !this.component && !this.isInput;
		} else {
			this.isInline = this.o.isInline;
		}
		this.picker = $(DPGlobal.template);
		// Checking templates and inserting
		if (this._check_template(this.o.templates.leftArrow)) {
			this.picker.find('.prev').html(this.o.templates.leftArrow);
		}
		if (this._check_template(this.o.templates.rightArrow)) {
			this.picker.find('.next').html(this.o.templates.rightArrow);
		}
		this._buildEvents();
		this._attachEvents();
		if (this.isInline){
			this.picker.addClass('datepicker-inline').appendTo(this.element);
		}
		else {
			this.picker.addClass('datepicker-dropdown dropdown-menu');
		}
		if (this.o.rtl){
			this.picker.addClass('datepicker-rtl');
		}
		if (this.o.calendarWeeks) {
			this.picker.find('.datepicker-days .datepicker-switch, thead .datepicker-title, tfoot .today, tfoot .clear')
				.attr('colspan', function(i, val){
					return Number(val) + 1;
				});
		}
		this._process_options({
			startDate: this._o.startDate,
			endDate: this._o.endDate,
			daysOfWeekDisabled: this.o.daysOfWeekDisabled,
			daysOfWeekHighlighted: this.o.daysOfWeekHighlighted,
			datesDisabled: this.o.datesDisabled
		});
		this._allow_update = false;
		this.setViewMode(this.o.startView);
		this._allow_update = true;
		this.fillDow();
		this.fillMonths();
		this.update();
		if (this.isInline){
			this.show();
		}
	};
	Datepicker.prototype = {
		constructor: Datepicker,
		_resolveViewName: function(view){
			$.each(DPGlobal.viewModes, function(i, viewMode){
				if (view === i || $.inArray(view, viewMode.names) !== -1){
					view = i;
					return false;
				}
			});
			return view;
		},
		_resolveDaysOfWeek: function(daysOfWeek){
			if (!Array.isArray(daysOfWeek))
				daysOfWeek = daysOfWeek.split(/[,\s]*/);
			return $.map(daysOfWeek, Number);
		},
		_check_template: function(tmp){
			try {
				// If empty
				if (tmp === undefined || tmp === "") {
					return false;
				}
				// If no html, everything ok
				if ((tmp.match(/[<>]/g) || []).length <= 0) {
					return true;
				}
				// Checking if html is fine
				var jDom = $(tmp);
				return jDom.length > 0;
			}
			catch (ex) {
				return false;
			}
		},
		_process_options: function(opts){
			// Store raw options for reference
			this._o = $.extend({}, this._o, opts);
			// Processed options
			var o = this.o = $.extend({}, this._o);
			// Check if "de-DE" style date is available, if not language should
			// fallback to 2 letter code eg "de"
			var lang = o.language;
			if (!dates[lang]){
				lang = lang.split('-')[0];
				if (!dates[lang])
					lang = defaults.language;
			}
			o.language = lang;
			// Retrieve view index from any aliases
			o.startView = this._resolveViewName(o.startView);
			o.minViewMode = this._resolveViewName(o.minViewMode);
			o.maxViewMode = this._resolveViewName(o.maxViewMode);
			// Check view is between min and max
			o.startView = Math.max(this.o.minViewMode, Math.min(this.o.maxViewMode, o.startView));
			// true, false, or Number > 0
			if (o.multidate !== true){
				o.multidate = Number(o.multidate) || false;
				if (o.multidate !== false)
					o.multidate = Math.max(0, o.multidate);
			}
			o.multidateSeparator = String(o.multidateSeparator);
			o.weekStart %= 7;
			o.weekEnd = (o.weekStart + 6) % 7;
			var format = DPGlobal.parseFormat(o.format);
			if (o.startDate !== -Infinity){
				if (!!o.startDate){
					if (o.startDate instanceof Date)
						o.startDate = this._local_to_utc(this._zero_time(o.startDate));
					else
						o.startDate = DPGlobal.parseDate(o.startDate, format, o.language, o.assumeNearbyYear);
				}
				else {
					o.startDate = -Infinity;
				}
			}
			if (o.endDate !== Infinity){
				if (!!o.endDate){
					if (o.endDate instanceof Date)
						o.endDate = this._local_to_utc(this._zero_time(o.endDate));
					else
						o.endDate = DPGlobal.parseDate(o.endDate, format, o.language, o.assumeNearbyYear);
				}
				else {
					o.endDate = Infinity;
				}
			}
			o.daysOfWeekDisabled = this._resolveDaysOfWeek(o.daysOfWeekDisabled||[]);
			o.daysOfWeekHighlighted = this._resolveDaysOfWeek(o.daysOfWeekHighlighted||[]);
			o.datesDisabled = o.datesDisabled||[];
			if (!Array.isArray(o.datesDisabled)) {
				o.datesDisabled = o.datesDisabled.split(',');
			}
			o.datesDisabled = $.map(o.datesDisabled, function(d){
				return DPGlobal.parseDate(d, format, o.language, o.assumeNearbyYear);
			});
			var plc = String(o.orientation).toLowerCase().split(/\s+/g),
				_plc = o.orientation.toLowerCase();
			plc = $.grep(plc, function(word){
				return /^auto|left|right|top|bottom$/.test(word);
			});
			o.orientation = {x: 'auto', y: 'auto'};
			if (!_plc || _plc === 'auto')
				; // no action
			else if (plc.length === 1){
				switch (plc[0]){
					case 'top':
					case 'bottom':
						o.orientation.y = plc[0];
						break;
					case 'left':
					case 'right':
						o.orientation.x = plc[0];
						break;
				}
			}
			else {
				_plc = $.grep(plc, function(word){
					return /^left|right$/.test(word);
				});
				o.orientation.x = _plc[0] || 'auto';
				_plc = $.grep(plc, function(word){
					return /^top|bottom$/.test(word);
				});
				o.orientation.y = _plc[0] || 'auto';
			}
			if (o.defaultViewDate instanceof Date || typeof o.defaultViewDate === 'string') {
				o.defaultViewDate = DPGlobal.parseDate(o.defaultViewDate, format, o.language, o.assumeNearbyYear);
			} else if (o.defaultViewDate) {
				var year = o.defaultViewDate.year || new Date().getFullYear();
				var month = o.defaultViewDate.month || 0;
				var day = o.defaultViewDate.day || 1;
				o.defaultViewDate = UTCDate(year, month, day);
			} else {
				o.defaultViewDate = UTCToday();
			}
		},
		_applyEvents: function(evs){
			for (var i=0, el, ch, ev; i < evs.length; i++){
				el = evs[i][0];
				if (evs[i].length === 2){
					ch = undefined;
					ev = evs[i][1];
				} else if (evs[i].length === 3){
					ch = evs[i][1];
					ev = evs[i][2];
				}
				el.on(ev, ch);
			}
		},
		_unapplyEvents: function(evs){
			for (var i=0, el, ev, ch; i < evs.length; i++){
				el = evs[i][0];
				if (evs[i].length === 2){
					ch = undefined;
					ev = evs[i][1];
				} else if (evs[i].length === 3){
					ch = evs[i][1];
					ev = evs[i][2];
				}
				el.off(ev, ch);
			}
		},
		_buildEvents: function(){
            var events = {
                keyup: $.proxy(function(e){
                    if ($.inArray(e.keyCode, [27, 37, 39, 38, 40, 32, 13, 9]) === -1)
                        this.update();
                }, this),
                keydown: $.proxy(this.keydown, this),
                paste: $.proxy(this.paste, this)
            };
            if (this.o.showOnFocus === true) {
                events.focus = $.proxy(this.show, this);
            }
            if (this.isInput) { // single input
                this._events = [
                    [this.element, events]
                ];
            }
            // component: input + button
            else if (this.component && this.inputField.length) {
                this._events = [
                    // For components that are not readonly, allow keyboard nav
                    [this.inputField, events],
                    [this.component, {
                        click: $.proxy(this.show, this)
                    }]
                ];
            }
			else {
				this._events = [
					[this.element, {
						click: $.proxy(this.show, this),
						keydown: $.proxy(this.keydown, this)
					}]
				];
			}
			this._events.push(
				// Component: listen for blur on element descendants
				[this.element, '*', {
					blur: $.proxy(function(e){
						this._focused_from = e.target;
					}, this)
				}],
				// Input: listen for blur on element
				[this.element, {
					blur: $.proxy(function(e){
						this._focused_from = e.target;
					}, this)
				}]
			);
			if (this.o.immediateUpdates) {
				// Trigger input updates immediately on changed year/month
				this._events.push([this.element, {
					'changeYear changeMonth': $.proxy(function(e){
						this.update(e.date);
					}, this)
				}]);
			}
			this._secondaryEvents = [
				[this.picker, {
					click: $.proxy(this.click, this)
				}],
				[this.picker, '.prev, .next', {
					click: $.proxy(this.navArrowsClick, this)
				}],
				[this.picker, '.day:not(.disabled)', {
					click: $.proxy(this.dayCellClick, this)
				}],
				[$(window), {
					resize: $.proxy(this.place, this)
				}],
				[$(document), {
					'mousedown touchstart': $.proxy(function(e){
						// Clicked outside the datepicker, hide it
						if (!(
							this.element.is(e.target) ||
							this.element.find(e.target).length ||
							this.picker.is(e.target) ||
							this.picker.find(e.target).length ||
							this.isInline
						)){
							this.hide();
						}
					}, this)
				}]
			];
		},
		_attachEvents: function(){
			this._detachEvents();
			this._applyEvents(this._events);
		},
		_detachEvents: function(){
			this._unapplyEvents(this._events);
		},
		_attachSecondaryEvents: function(){
			this._detachSecondaryEvents();
			this._applyEvents(this._secondaryEvents);
		},
		_detachSecondaryEvents: function(){
			this._unapplyEvents(this._secondaryEvents);
		},
		_trigger: function(event, altdate){
			var date = altdate || this.dates.get(-1),
				local_date = this._utc_to_local(date);
			this.element.trigger({
				type: event,
				date: local_date,
				viewMode: this.viewMode,
				dates: $.map(this.dates, this._utc_to_local),
				format: $.proxy(function(ix, format){
					if (arguments.length === 0){
						ix = this.dates.length - 1;
						format = this.o.format;
					} else if (typeof ix === 'string'){
						format = ix;
						ix = this.dates.length - 1;
					}
					format = format || this.o.format;
					var date = this.dates.get(ix);
					return DPGlobal.formatDate(date, format, this.o.language);
				}, this)
			});
		},
		show: function(){
			if (this.inputField.is(':disabled') || (this.inputField.prop('readonly') && this.o.enableOnReadonly === false))
				return;
			if (!this.isInline)
				this.picker.appendTo(this.o.container);
			this.place();
			this.picker.show();
			this._attachSecondaryEvents();
			this._trigger('show');
			if ((window.navigator.msMaxTouchPoints || 'ontouchstart' in document) && this.o.disableTouchKeyboard) {
				$(this.element).blur();
			}
			return this;
		},
		hide: function(){
			if (this.isInline || !this.picker.is(':visible'))
				return this;
			this.focusDate = null;
			this.picker.hide().detach();
			this._detachSecondaryEvents();
			this.setViewMode(this.o.startView);
			if (this.o.forceParse && this.inputField.val())
				this.setValue();
			this._trigger('hide');
			return this;
		},
		destroy: function(){
			this.hide();
			this._detachEvents();
			this._detachSecondaryEvents();
			this.picker.remove();
			delete this.element.data().datepicker;
			if (!this.isInput){
				delete this.element.data().date;
			}
			return this;
		},
		paste: function(e){
			var dateString;
			if (e.originalEvent.clipboardData && e.originalEvent.clipboardData.types
				&& $.inArray('text/plain', e.originalEvent.clipboardData.types) !== -1) {
				dateString = e.originalEvent.clipboardData.getData('text/plain');
			} else if (window.clipboardData) {
				dateString = window.clipboardData.getData('Text');
			} else {
				return;
			}
			this.setDate(dateString);
			this.update();
			e.preventDefault();
		},
		_utc_to_local: function(utc){
			if (!utc) {
				return utc;
			}
			var local = new Date(utc.getTime() + (utc.getTimezoneOffset() * 60000));
			if (local.getTimezoneOffset() !== utc.getTimezoneOffset()) {
				local = new Date(utc.getTime() + (local.getTimezoneOffset() * 60000));
			}
			return local;
		},
		_local_to_utc: function(local){
			return local && new Date(local.getTime() - (local.getTimezoneOffset()*60000));
		},
		_zero_time: function(local){
			return local && new Date(local.getFullYear(), local.getMonth(), local.getDate());
		},
		_zero_utc_time: function(utc){
			return utc && UTCDate(utc.getUTCFullYear(), utc.getUTCMonth(), utc.getUTCDate());
		},
		getDates: function(){
			return $.map(this.dates, this._utc_to_local);
		},
		getUTCDates: function(){
			return $.map(this.dates, function(d){
				return new Date(d);
			});
		},
		getDate: function(){
			return this._utc_to_local(this.getUTCDate());
		},
		getUTCDate: function(){
			var selected_date = this.dates.get(-1);
			if (selected_date !== undefined) {
				return new Date(selected_date);
			} else {
				return null;
			}
		},
		clearDates: function(){
			this.inputField.val('');
			this._trigger('changeDate');
			this.update();
			if (this.o.autoclose) {
				this.hide();
			}
		},
		setDates: function(){
			var args = Array.isArray(arguments[0]) ? arguments[0] : arguments;
			this.update.apply(this, args);
			this._trigger('changeDate');
			this.setValue();
			return this;
		},
		setUTCDates: function(){
			var args = Array.isArray(arguments[0]) ? arguments[0] : arguments;
			this.setDates.apply(this, $.map(args, this._utc_to_local));
			return this;
		},
		setDate: alias('setDates'),
		setUTCDate: alias('setUTCDates'),
		remove: alias('destroy', 'Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead'),
		setValue: function(){
			var formatted = this.getFormattedDate();
			this.inputField.val(formatted);
			return this;
		},
		getFormattedDate: function(format){
			if (format === undefined)
				format = this.o.format;
			var lang = this.o.language;
			return $.map(this.dates, function(d){
				return DPGlobal.formatDate(d, format, lang);
			}).join(this.o.multidateSeparator);
		},
		getStartDate: function(){
			return this.o.startDate;
		},
		setStartDate: function(startDate){
			this._process_options({startDate: startDate});
			this.update();
			this.updateNavArrows();
			return this;
		},
		getEndDate: function(){
			return this.o.endDate;
		},
		setEndDate: function(endDate){
			this._process_options({endDate: endDate});
			this.update();
			this.updateNavArrows();
			return this;
		},
		setDaysOfWeekDisabled: function(daysOfWeekDisabled){
			this._process_options({daysOfWeekDisabled: daysOfWeekDisabled});
			this.update();
			return this;
		},
		setDaysOfWeekHighlighted: function(daysOfWeekHighlighted){
			this._process_options({daysOfWeekHighlighted: daysOfWeekHighlighted});
			this.update();
			return this;
		},
		setDatesDisabled: function(datesDisabled){
			this._process_options({datesDisabled: datesDisabled});
			this.update();
			return this;
		},
		place: function(){
			if (this.isInline)
				return this;
			var calendarWidth = this.picker.outerWidth(),
				calendarHeight = this.picker.outerHeight(),
				visualPadding = 10,
				container = $(this.o.container),
				windowWidth = container.width(),
				scrollTop = this.o.container === 'body' ? $(document).scrollTop() : container.scrollTop(),
				appendOffset = container.offset();
			var parentsZindex = [0];
			this.element.parents().each(function(){
				var itemZIndex = $(this).css('z-index');
				if (itemZIndex !== 'auto' && Number(itemZIndex) !== 0) parentsZindex.push(Number(itemZIndex));
			});
			var zIndex = Math.max.apply(Math, parentsZindex) + this.o.zIndexOffset;
			var offset = this.component ? this.component.parent().offset() : this.element.offset();
			var height = this.component ? this.component.outerHeight(true) : this.element.outerHeight(false);
			var width = this.component ? this.component.outerWidth(true) : this.element.outerWidth(false);
			var left = offset.left - appendOffset.left;
			var top = offset.top - appendOffset.top;
			if (this.o.container !== 'body') {
				top += scrollTop;
			}
			this.picker.removeClass(
				'datepicker-orient-top datepicker-orient-bottom '+
				'datepicker-orient-right datepicker-orient-left'
			);
			if (this.o.orientation.x !== 'auto'){
				this.picker.addClass('datepicker-orient-' + this.o.orientation.x);
				if (this.o.orientation.x === 'right')
					left -= calendarWidth - width;
			}
			// auto x orientation is best-placement: if it crosses a window
			// edge, fudge it sideways
			else {
				if (offset.left < 0) {
					// component is outside the window on the left side. Move it into visible range
					this.picker.addClass('datepicker-orient-left');
					left -= offset.left - visualPadding;
				} else if (left + calendarWidth > windowWidth) {
					// the calendar passes the widow right edge. Align it to component right side
					this.picker.addClass('datepicker-orient-right');
					left += width - calendarWidth;
				} else {
					if (this.o.rtl) {
						// Default to right
						this.picker.addClass('datepicker-orient-right');
					} else {
						// Default to left
						this.picker.addClass('datepicker-orient-left');
					}
				}
			}
			// auto y orientation is best-situation: top or bottom, no fudging,
			// decision based on which shows more of the calendar
			var yorient = this.o.orientation.y,
				top_overflow;
			if (yorient === 'auto'){
				top_overflow = -scrollTop + top - calendarHeight;
				yorient = top_overflow < 0 ? 'bottom' : 'top';
			}
			this.picker.addClass('datepicker-orient-' + yorient);
			if (yorient === 'top')
				top -= calendarHeight + parseInt(this.picker.css('padding-top'));
			else
				top += height;
			if (this.o.rtl) {
				var right = windowWidth - (left + width);
				this.picker.css({
					top: top,
					right: right,
					zIndex: zIndex
				});
			} else {
				this.picker.css({
					top: top,
					left: left,
					zIndex: zIndex
				});
			}
			return this;
		},
		_allow_update: true,
		update: function(){
			if (!this._allow_update)
				return this;
			var oldDates = this.dates.copy(),
				dates = [],
				fromArgs = false;
			if (arguments.length){
				$.each(arguments, $.proxy(function(i, date){
					if (date instanceof Date)
						date = this._local_to_utc(date);
					dates.push(date);
				}, this));
				fromArgs = true;
			} else {
				dates = this.isInput
						? this.element.val()
						: this.element.data('date') || this.inputField.val();
				if (dates && this.o.multidate)
					dates = dates.split(this.o.multidateSeparator);
				else
					dates = [dates];
				delete this.element.data().date;
			}
			dates = $.map(dates, $.proxy(function(date){
				return DPGlobal.parseDate(date, this.o.format, this.o.language, this.o.assumeNearbyYear);
			}, this));
			dates = $.grep(dates, $.proxy(function(date){
				return (
					!this.dateWithinRange(date) ||
					!date
				);
			}, this), true);
			this.dates.replace(dates);
			if (this.o.updateViewDate) {
				if (this.dates.length)
					this.viewDate = new Date(this.dates.get(-1));
				else if (this.viewDate < this.o.startDate)
					this.viewDate = new Date(this.o.startDate);
				else if (this.viewDate > this.o.endDate)
					this.viewDate = new Date(this.o.endDate);
				else
					this.viewDate = this.o.defaultViewDate;
			}
			if (fromArgs){
				// setting date by clicking
				this.setValue();
				this.element.change();
			}
			else if (this.dates.length){
				// setting date by typing
				if (String(oldDates) !== String(this.dates) && fromArgs) {
					this._trigger('changeDate');
					this.element.change();
				}
			}
			if (!this.dates.length && oldDates.length) {
				this._trigger('clearDate');
				this.element.change();
			}
			this.fill();
			return this;
		},
		fillDow: function(){
      if (this.o.showWeekDays) {
			var dowCnt = this.o.weekStart,
				html = '<tr>';
			if (this.o.calendarWeeks){
				html += '<th class="cw">&#160;</th>';
			}
			while (dowCnt < this.o.weekStart + 7){
				html += '<th class="dow';
        if ($.inArray(dowCnt, this.o.daysOfWeekDisabled) !== -1)
          html += ' disabled';
        html += '">'+dates[this.o.language].daysMin[(dowCnt++)%7]+'</th>';
			}
			html += '</tr>';
			this.picker.find('.datepicker-days thead').append(html);
      }
		},
		fillMonths: function(){
      var localDate = this._utc_to_local(this.viewDate);
			var html = '';
			var focused;
			for (var i = 0; i < 12; i++){
				focused = localDate && localDate.getMonth() === i ? ' focused' : '';
				html += '<span class="month' + focused + '">' + dates[this.o.language].monthsShort[i] + '</span>';
			}
			this.picker.find('.datepicker-months td').html(html);
		},
		setRange: function(range){
			if (!range || !range.length)
				delete this.range;
			else
				this.range = $.map(range, function(d){
					return d.valueOf();
				});
			this.fill();
		},
		getClassNames: function(date){
			var cls = [],
				year = this.viewDate.getUTCFullYear(),
				month = this.viewDate.getUTCMonth(),
				today = UTCToday();
			if (date.getUTCFullYear() < year || (date.getUTCFullYear() === year && date.getUTCMonth() < month)){
				cls.push('old');
			} else if (date.getUTCFullYear() > year || (date.getUTCFullYear() === year && date.getUTCMonth() > month)){
				cls.push('new');
			}
			if (this.focusDate && date.valueOf() === this.focusDate.valueOf())
				cls.push('focused');
			// Compare internal UTC date with UTC today, not local today
			if (this.o.todayHighlight && isUTCEquals(date, today)) {
				cls.push('today');
			}
			if (this.dates.contains(date) !== -1)
				cls.push('active');
			if (!this.dateWithinRange(date)){
				cls.push('disabled');
			}
			if (this.dateIsDisabled(date)){
				cls.push('disabled', 'disabled-date');
			}
			if ($.inArray(date.getUTCDay(), this.o.daysOfWeekHighlighted) !== -1){
				cls.push('highlighted');
			}
			if (this.range){
				if (date > this.range[0] && date < this.range[this.range.length-1]){
					cls.push('range');
				}
				if ($.inArray(date.valueOf(), this.range) !== -1){
					cls.push('selected');
				}
				if (date.valueOf() === this.range[0]){
          cls.push('range-start');
        }
        if (date.valueOf() === this.range[this.range.length-1]){
          cls.push('range-end');
        }
			}
			return cls;
		},
		_fill_yearsView: function(selector, cssClass, factor, year, startYear, endYear, beforeFn){
			var html = '';
			var step = factor / 10;
			var view = this.picker.find(selector);
			var startVal = Math.floor(year / factor) * factor;
			var endVal = startVal + step * 9;
			var focusedVal = Math.floor(this.viewDate.getFullYear() / step) * step;
			var selected = $.map(this.dates, function(d){
				return Math.floor(d.getUTCFullYear() / step) * step;
			});
			var classes, tooltip, before;
			for (var currVal = startVal - step; currVal <= endVal + step; currVal += step) {
				classes = [cssClass];
				tooltip = null;
				if (currVal === startVal - step) {
					classes.push('old');
				} else if (currVal === endVal + step) {
					classes.push('new');
				}
				if ($.inArray(currVal, selected) !== -1) {
					classes.push('active');
				}
				if (currVal < startYear || currVal > endYear) {
					classes.push('disabled');
				}
				if (currVal === focusedVal) {
				  classes.push('focused');
        }
				if (beforeFn !== $.noop) {
					before = beforeFn(new Date(currVal, 0, 1));
					if (before === undefined) {
						before = {};
					} else if (typeof before === 'boolean') {
						before = {enabled: before};
					} else if (typeof before === 'string') {
						before = {classes: before};
					}
					if (before.enabled === false) {
						classes.push('disabled');
					}
					if (before.classes) {
						classes = classes.concat(before.classes.split(/\s+/));
					}
					if (before.tooltip) {
						tooltip = before.tooltip;
					}
				}
				html += '<span class="' + classes.join(' ') + '"' + (tooltip ? ' title="' + tooltip + '"' : '') + '>' + currVal + '</span>';
			}
			view.find('.datepicker-switch').text(startVal + '-' + endVal);
			view.find('td').html(html);
		},
		fill: function(){
			var d = new Date(this.viewDate),
				year = d.getUTCFullYear(),
				month = d.getUTCMonth(),
				startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity,
				startMonth = this.o.startDate !== -Infinity ? this.o.startDate.getUTCMonth() : -Infinity,
				endYear = this.o.endDate !== Infinity ? this.o.endDate.getUTCFullYear() : Infinity,
				endMonth = this.o.endDate !== Infinity ? this.o.endDate.getUTCMonth() : Infinity,
				todaytxt = dates[this.o.language].today || dates['en'].today || '',
				cleartxt = dates[this.o.language].clear || dates['en'].clear || '',
        titleFormat = dates[this.o.language].titleFormat || dates['en'].titleFormat,
        todayDate = UTCToday(),
        titleBtnVisible = (this.o.todayBtn === true || this.o.todayBtn === 'linked') && todayDate >= this.o.startDate && todayDate <= this.o.endDate && !this.weekOfDateIsDisabled(todayDate),
				tooltip,
				before;
			if (isNaN(year) || isNaN(month))
				return;
			this.picker.find('.datepicker-days .datepicker-switch')
						.text(DPGlobal.formatDate(d, titleFormat, this.o.language));
			this.picker.find('tfoot .today')
						.text(todaytxt)
            .css('display', titleBtnVisible ? 'table-cell' : 'none');
			this.picker.find('tfoot .clear')
						.text(cleartxt)
						.css('display', this.o.clearBtn === true ? 'table-cell' : 'none');
			this.picker.find('thead .datepicker-title')
						.text(this.o.title)
						.css('display', typeof this.o.title === 'string' && this.o.title !== '' ? 'table-cell' : 'none');
			this.updateNavArrows();
			this.fillMonths();
			var prevMonth = UTCDate(year, month, 0),
				day = prevMonth.getUTCDate();
			prevMonth.setUTCDate(day - (prevMonth.getUTCDay() - this.o.weekStart + 7)%7);
			var nextMonth = new Date(prevMonth);
			if (prevMonth.getUTCFullYear() < 100){
        nextMonth.setUTCFullYear(prevMonth.getUTCFullYear());
      }
			nextMonth.setUTCDate(nextMonth.getUTCDate() + 42);
			nextMonth = nextMonth.valueOf();
			var html = [];
			var weekDay, clsName;
			while (prevMonth.valueOf() < nextMonth){
				weekDay = prevMonth.getUTCDay();
				if (weekDay === this.o.weekStart){
					html.push('<tr>');
					if (this.o.calendarWeeks){
						// ISO 8601: First week contains first thursday.
						// ISO also states week starts on Monday, but we can be more abstract here.
						var
							// Start of current week: based on weekstart/current date
							ws = new Date(+prevMonth + (this.o.weekStart - weekDay - 7) % 7 * 864e5),
							// Thursday of this week
							th = new Date(Number(ws) + (7 + 4 - ws.getUTCDay()) % 7 * 864e5),
							// First Thursday of year, year from thursday
							yth = new Date(Number(yth = UTCDate(th.getUTCFullYear(), 0, 1)) + (7 + 4 - yth.getUTCDay()) % 7 * 864e5),
							// Calendar week: ms between thursdays, div ms per day, div 7 days
							calWeek = (th - yth) / 864e5 / 7 + 1;
						html.push('<td class="cw">'+ calWeek +'</td>');
					}
				}
				clsName = this.getClassNames(prevMonth);
				clsName.push('day');
				var content = prevMonth.getUTCDate();
				if (this.o.beforeShowDay !== $.noop){
					before = this.o.beforeShowDay(this._utc_to_local(prevMonth));
					if (before === undefined)
						before = {};
					else if (typeof before === 'boolean')
						before = {enabled: before};
					else if (typeof before === 'string')
						before = {classes: before};
					if (before.enabled === false)
						clsName.push('disabled');
					if (before.classes)
						clsName = clsName.concat(before.classes.split(/\s+/));
					if (before.tooltip)
						tooltip = before.tooltip;
					if (before.content)
						content = before.content;
				}
				//Check if uniqueSort exists (supported by jquery >=1.12 and >=2.2)
				//Fallback to unique function for older jquery versions
				if (typeof $.uniqueSort === "function") {
					clsName = $.uniqueSort(clsName);
				} else {
					clsName = $.unique(clsName);
				}
				html.push('<td class="'+clsName.join(' ')+'"' + (tooltip ? ' title="'+tooltip+'"' : '') + ' data-date="' + prevMonth.getTime().toString() + '">' + content + '</td>');
				tooltip = null;
				if (weekDay === this.o.weekEnd){
					html.push('</tr>');
				}
				prevMonth.setUTCDate(prevMonth.getUTCDate() + 1);
			}
			this.picker.find('.datepicker-days tbody').html(html.join(''));
			var monthsTitle = dates[this.o.language].monthsTitle || dates['en'].monthsTitle || 'Months';
			var months = this.picker.find('.datepicker-months')
						.find('.datepicker-switch')
							.text(this.o.maxViewMode < 2 ? monthsTitle : year)
							.end()
						.find('tbody span').removeClass('active');
			$.each(this.dates, function(i, d){
				if (d.getUTCFullYear() === year)
					months.eq(d.getUTCMonth()).addClass('active');
			});
			if (year < startYear || year > endYear){
				months.addClass('disabled');
			}
			if (year === startYear){
				months.slice(0, startMonth).addClass('disabled');
			}
			if (year === endYear){
				months.slice(endMonth+1).addClass('disabled');
			}
			if (this.o.beforeShowMonth !== $.noop){
				var that = this;
				$.each(months, function(i, month){
          var moDate = new Date(year, i, 1);
          var before = that.o.beforeShowMonth(moDate);
					if (before === undefined)
						before = {};
					else if (typeof before === 'boolean')
						before = {enabled: before};
					else if (typeof before === 'string')
						before = {classes: before};
					if (before.enabled === false && !$(month).hasClass('disabled'))
					    $(month).addClass('disabled');
					if (before.classes)
					    $(month).addClass(before.classes);
					if (before.tooltip)
					    $(month).prop('title', before.tooltip);
				});
			}
			// Generating decade/years picker
			this._fill_yearsView(
				'.datepicker-years',
				'year',
				10,
				year,
				startYear,
				endYear,
				this.o.beforeShowYear
			);
			// Generating century/decades picker
			this._fill_yearsView(
				'.datepicker-decades',
				'decade',
				100,
				year,
				startYear,
				endYear,
				this.o.beforeShowDecade
			);
			// Generating millennium/centuries picker
			this._fill_yearsView(
				'.datepicker-centuries',
				'century',
				1000,
				year,
				startYear,
				endYear,
				this.o.beforeShowCentury
			);
		},
		updateNavArrows: function(){
			if (!this._allow_update)
				return;
			var d = new Date(this.viewDate),
				year = d.getUTCFullYear(),
				month = d.getUTCMonth(),
				startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity,
				startMonth = this.o.startDate !== -Infinity ? this.o.startDate.getUTCMonth() : -Infinity,
				endYear = this.o.endDate !== Infinity ? this.o.endDate.getUTCFullYear() : Infinity,
				endMonth = this.o.endDate !== Infinity ? this.o.endDate.getUTCMonth() : Infinity,
				prevIsDisabled,
				nextIsDisabled,
				factor = 1;
			switch (this.viewMode){
				case 4:
					factor *= 10;
					/* falls through */
				case 3:
					factor *= 10;
					/* falls through */
				case 2:
					factor *= 10;
					/* falls through */
				case 1:
					prevIsDisabled = Math.floor(year / factor) * factor <= startYear;
					nextIsDisabled = Math.floor(year / factor) * factor + factor > endYear;
					break;
				case 0:
					prevIsDisabled = year <= startYear && month <= startMonth;
					nextIsDisabled = year >= endYear && month >= endMonth;
					break;
			}
			this.picker.find('.prev').toggleClass('disabled', prevIsDisabled);
			this.picker.find('.next').toggleClass('disabled', nextIsDisabled);
		},
		click: function(e){
			e.preventDefault();
			e.stopPropagation();
			var target, dir, day, year, month;
			target = $(e.target);
			// Clicked on the switch
			if (target.hasClass('datepicker-switch') && this.viewMode !== this.o.maxViewMode){
				this.setViewMode(this.viewMode + 1);
			}
			// Clicked on today button
			if (target.hasClass('today') && !target.hasClass('day')){
				this.setViewMode(0);
				this._setDate(UTCToday(), this.o.todayBtn === 'linked' ? null : 'view');
			}
			// Clicked on clear button
			if (target.hasClass('clear')){
				this.clearDates();
			}
			if (!target.hasClass('disabled')){
				// Clicked on a month, year, decade, century
				if (target.hasClass('month')
						|| target.hasClass('year')
						|| target.hasClass('decade')
						|| target.hasClass('century')) {
					this.viewDate.setUTCDate(1);
					day = 1;
					if (this.viewMode === 1){
						month = target.parent().find('span').index(target);
						year = this.viewDate.getUTCFullYear();
						this.viewDate.setUTCMonth(month);
					} else {
						month = 0;
						year = Number(target.text());
						this.viewDate.setUTCFullYear(year);
					}
					this._trigger(DPGlobal.viewModes[this.viewMode - 1].e, this.viewDate);
					if (this.viewMode === this.o.minViewMode){
						this._setDate(UTCDate(year, month, day));
					} else {
						this.setViewMode(this.viewMode - 1);
						this.fill();
					}
				}
			}
			if (this.picker.is(':visible') && this._focused_from){
				this._focused_from.focus();
			}
			delete this._focused_from;
		},
		dayCellClick: function(e){
			var $target = $(e.currentTarget);
			var timestamp = $target.data('date');
			var date = new Date(timestamp);
			if (this.o.updateViewDate) {
				if (date.getUTCFullYear() !== this.viewDate.getUTCFullYear()) {
					this._trigger('changeYear', this.viewDate);
				}
				if (date.getUTCMonth() !== this.viewDate.getUTCMonth()) {
					this._trigger('changeMonth', this.viewDate);
				}
			}
			this._setDate(date);
		},
		// Clicked on prev or next
		navArrowsClick: function(e){
			var $target = $(e.currentTarget);
			var dir = $target.hasClass('prev') ? -1 : 1;
			if (this.viewMode !== 0){
				dir *= DPGlobal.viewModes[this.viewMode].navStep * 12;
			}
			this.viewDate = this.moveMonth(this.viewDate, dir);
			this._trigger(DPGlobal.viewModes[this.viewMode].e, this.viewDate);
			this.fill();
		},
		_toggle_multidate: function(date){
			var ix = this.dates.contains(date);
			if (!date){
				this.dates.clear();
			}
			if (ix !== -1){
				if (this.o.multidate === true || this.o.multidate > 1 || this.o.toggleActive){
					this.dates.remove(ix);
				}
			} else if (this.o.multidate === false) {
				this.dates.clear();
				this.dates.push(date);
			}
			else {
				this.dates.push(date);
			}
			if (typeof this.o.multidate === 'number')
				while (this.dates.length > this.o.multidate)
					this.dates.remove(0);
		},
		_setDate: function(date, which){
			if (!which || which === 'date')
				this._toggle_multidate(date && new Date(date));
			if ((!which && this.o.updateViewDate) || which === 'view')
				this.viewDate = date && new Date(date);
			this.fill();
			this.setValue();
			if (!which || which !== 'view') {
				this._trigger('changeDate');
			}
			this.inputField.trigger('change');
			if (this.o.autoclose && (!which || which === 'date')){
				this.hide();
			}
		},
		moveDay: function(date, dir){
			var newDate = new Date(date);
			newDate.setUTCDate(date.getUTCDate() + dir);
			return newDate;
		},
		moveWeek: function(date, dir){
			return this.moveDay(date, dir * 7);
		},
		moveMonth: function(date, dir){
			if (!isValidDate(date))
				return this.o.defaultViewDate;
			if (!dir)
				return date;
			var new_date = new Date(date.valueOf()),
				day = new_date.getUTCDate(),
				month = new_date.getUTCMonth(),
				mag = Math.abs(dir),
				new_month, test;
			dir = dir > 0 ? 1 : -1;
			if (mag === 1){
				test = dir === -1
					// If going back one month, make sure month is not current month
					// (eg, Mar 31 -> Feb 31 == Feb 28, not Mar 02)
					? function(){
						return new_date.getUTCMonth() === month;
					}
					// If going forward one month, make sure month is as expected
					// (eg, Jan 31 -> Feb 31 == Feb 28, not Mar 02)
					: function(){
						return new_date.getUTCMonth() !== new_month;
					};
				new_month = month + dir;
				new_date.setUTCMonth(new_month);
				// Dec -> Jan (12) or Jan -> Dec (-1) -- limit expected date to 0-11
				new_month = (new_month + 12) % 12;
			}
			else {
				// For magnitudes >1, move one month at a time...
				for (var i=0; i < mag; i++)
					// ...which might decrease the day (eg, Jan 31 to Feb 28, etc)...
					new_date = this.moveMonth(new_date, dir);
				// ...then reset the day, keeping it in the new month
				new_month = new_date.getUTCMonth();
				new_date.setUTCDate(day);
				test = function(){
					return new_month !== new_date.getUTCMonth();
				};
			}
			// Common date-resetting loop -- if date is beyond end of month, make it
			// end of month
			while (test()){
				new_date.setUTCDate(--day);
				new_date.setUTCMonth(new_month);
			}
			return new_date;
		},
		moveYear: function(date, dir){
			return this.moveMonth(date, dir*12);
		},
		moveAvailableDate: function(date, dir, fn){
			do {
				date = this[fn](date, dir);
				if (!this.dateWithinRange(date))
					return false;
				fn = 'moveDay';
			}
			while (this.dateIsDisabled(date));
			return date;
		},
		weekOfDateIsDisabled: function(date){
			return $.inArray(date.getUTCDay(), this.o.daysOfWeekDisabled) !== -1;
		},
		dateIsDisabled: function(date){
			return (
				this.weekOfDateIsDisabled(date) ||
				$.grep(this.o.datesDisabled, function(d){
					return isUTCEquals(date, d);
				}).length > 0
			);
		},
		dateWithinRange: function(date){
			return date >= this.o.startDate && date <= this.o.endDate;
		},
		keydown: function(e){
			if (!this.picker.is(':visible')){
				if (e.keyCode === 40 || e.keyCode === 27) { // allow down to re-show picker
					this.show();
					e.stopPropagation();
        }
				return;
			}
			var dateChanged = false,
				dir, newViewDate,
				focusDate = this.focusDate || this.viewDate;
			switch (e.keyCode){
				case 27: // escape
					if (this.focusDate){
						this.focusDate = null;
						this.viewDate = this.dates.get(-1) || this.viewDate;
						this.fill();
					}
					else
						this.hide();
					e.preventDefault();
					e.stopPropagation();
					break;
				case 37: // left
				case 38: // up
				case 39: // right
				case 40: // down
					if (!this.o.keyboardNavigation || this.o.daysOfWeekDisabled.length === 7)
						break;
					dir = e.keyCode === 37 || e.keyCode === 38 ? -1 : 1;
          if (this.viewMode === 0) {
  					if (e.ctrlKey){
  						newViewDate = this.moveAvailableDate(focusDate, dir, 'moveYear');
  						if (newViewDate)
  							this._trigger('changeYear', this.viewDate);
  					} else if (e.shiftKey){
  						newViewDate = this.moveAvailableDate(focusDate, dir, 'moveMonth');
  						if (newViewDate)
  							this._trigger('changeMonth', this.viewDate);
  					} else if (e.keyCode === 37 || e.keyCode === 39){
  						newViewDate = this.moveAvailableDate(focusDate, dir, 'moveDay');
  					} else if (!this.weekOfDateIsDisabled(focusDate)){
  						newViewDate = this.moveAvailableDate(focusDate, dir, 'moveWeek');
  					}
          } else if (this.viewMode === 1) {
            if (e.keyCode === 38 || e.keyCode === 40) {
              dir = dir * 4;
            }
            newViewDate = this.moveAvailableDate(focusDate, dir, 'moveMonth');
          } else if (this.viewMode === 2) {
            if (e.keyCode === 38 || e.keyCode === 40) {
              dir = dir * 4;
            }
            newViewDate = this.moveAvailableDate(focusDate, dir, 'moveYear');
          }
					if (newViewDate){
						this.focusDate = this.viewDate = newViewDate;
						this.setValue();
						this.fill();
						e.preventDefault();
					}
					break;
				case 13: // enter
					if (!this.o.forceParse)
						break;
					focusDate = this.focusDate || this.dates.get(-1) || this.viewDate;
					if (this.o.keyboardNavigation) {
						this._toggle_multidate(focusDate);
						dateChanged = true;
					}
					this.focusDate = null;
					this.viewDate = this.dates.get(-1) || this.viewDate;
					this.setValue();
					this.fill();
					if (this.picker.is(':visible')){
						e.preventDefault();
						e.stopPropagation();
						if (this.o.autoclose)
							this.hide();
					}
					break;
				case 9: // tab
					this.focusDate = null;
					this.viewDate = this.dates.get(-1) || this.viewDate;
					this.fill();
					this.hide();
					break;
			}
			if (dateChanged){
				if (this.dates.length)
					this._trigger('changeDate');
				else
					this._trigger('clearDate');
				this.inputField.trigger('change');
			}
		},
		setViewMode: function(viewMode){
			this.viewMode = viewMode;
			this.picker
				.children('div')
				.hide()
				.filter('.datepicker-' + DPGlobal.viewModes[this.viewMode].clsName)
					.show();
			this.updateNavArrows();
      this._trigger('changeViewMode', new Date(this.viewDate));
		}
	};
	var DateRangePicker = function(element, options){
		$.data(element, 'datepicker', this);
		this.element = $(element);
		this.inputs = $.map(options.inputs, function(i){
			return i.jquery ? i[0] : i;
		});
		delete options.inputs;
		this.keepEmptyValues = options.keepEmptyValues;
		delete options.keepEmptyValues;
		datepickerPlugin.call($(this.inputs), options)
			.on('changeDate', $.proxy(this.dateUpdated, this));
		this.pickers = $.map(this.inputs, function(i){
			return $.data(i, 'datepicker');
		});
		this.updateDates();
	};
	DateRangePicker.prototype = {
		updateDates: function(){
			this.dates = $.map(this.pickers, function(i){
				return i.getUTCDate();
			});
			this.updateRanges();
		},
		updateRanges: function(){
			var range = $.map(this.dates, function(d){
				return d.valueOf();
			});
			$.each(this.pickers, function(i, p){
				p.setRange(range);
			});
		},
		clearDates: function(){
			$.each(this.pickers, function(i, p){
				p.clearDates();
			});
		},
		dateUpdated: function(e){
			// `this.updating` is a workaround for preventing infinite recursion
			// between `changeDate` triggering and `setUTCDate` calling.  Until
			// there is a better mechanism.
			if (this.updating)
				return;
			this.updating = true;
			var dp = $.data(e.target, 'datepicker');
			if (dp === undefined) {
				return;
			}
			var new_date = dp.getUTCDate(),
				keep_empty_values = this.keepEmptyValues,
				i = $.inArray(e.target, this.inputs),
				j = i - 1,
				k = i + 1,
				l = this.inputs.length;
			if (i === -1)
				return;
			$.each(this.pickers, function(i, p){
				if (!p.getUTCDate() && (p === dp || !keep_empty_values))
					p.setUTCDate(new_date);
			});
			if (new_date < this.dates[j]){
				// Date being moved earlier/left
				while (j >= 0 && new_date < this.dates[j] && (this.pickers[j].element.val() || "").length > 0) {
					this.pickers[j--].setUTCDate(new_date);
				}
			} else if (new_date > this.dates[k]){
				// Date being moved later/right
				while (k < l && new_date > this.dates[k] && (this.pickers[k].element.val() || "").length > 0) {
					this.pickers[k++].setUTCDate(new_date);
				}
			}
			this.updateDates();
			delete this.updating;
		},
		destroy: function(){
			$.map(this.pickers, function(p){ p.destroy(); });
			$(this.inputs).off('changeDate', this.dateUpdated);
			delete this.element.data().datepicker;
		},
		remove: alias('destroy', 'Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead')
	};
	function opts_from_el(el, prefix){
		// Derive options from element data-attrs
		var data = $(el).data(),
			out = {}, inkey,
			replace = new RegExp('^' + prefix.toLowerCase() + '([A-Z])');
		prefix = new RegExp('^' + prefix.toLowerCase());
		function re_lower(_,a){
			return a.toLowerCase();
		}
		for (var key in data)
			if (prefix.test(key)){
				inkey = key.replace(replace, re_lower);
				out[inkey] = data[key];
			}
		return out;
	}
	function opts_from_locale(lang){
		// Derive options from locale plugins
		var out = {};
		// Check if "de-DE" style date is available, if not language should
		// fallback to 2 letter code eg "de"
		if (!dates[lang]){
			lang = lang.split('-')[0];
			if (!dates[lang])
				return;
		}
		var d = dates[lang];
		$.each(locale_opts, function(i,k){
			if (k in d)
				out[k] = d[k];
		});
		return out;
	}
	var old = $.fn.datepicker;
	var datepickerPlugin = function(option){
		var args = Array.apply(null, arguments);
		args.shift();
		var internal_return;
		this.each(function(){
			var $this = $(this),
				data = $this.data('datepicker'),
				options = typeof option === 'object' && option;
			if (!data){
				var elopts = opts_from_el(this, 'date'),
					// Preliminary otions
					xopts = $.extend({}, defaults, elopts, options),
					locopts = opts_from_locale(xopts.language),
					// Options priority: js args, data-attrs, locales, defaults
					opts = $.extend({}, defaults, locopts, elopts, options);
				if ($this.hasClass('input-daterange') || opts.inputs){
					$.extend(opts, {
						inputs: opts.inputs || $this.find('input').toArray()
					});
					data = new DateRangePicker(this, opts);
				}
				else {
					data = new Datepicker(this, opts);
				}
				$this.data('datepicker', data);
			}
			if (typeof option === 'string' && typeof data[option] === 'function'){
				internal_return = data[option].apply(data, args);
			}
		});
		if (
			internal_return === undefined ||
			internal_return instanceof Datepicker ||
			internal_return instanceof DateRangePicker
		)
			return this;
		if (this.length > 1)
			throw new Error('Using only allowed for the collection of a single element (' + option + ' function)');
		else
			return internal_return;
	};
	$.fn.datepicker = datepickerPlugin;
	var defaults = $.fn.datepicker.defaults = {
		assumeNearbyYear: false,
		autoclose: false,
		beforeShowDay: $.noop,
		beforeShowMonth: $.noop,
		beforeShowYear: $.noop,
		beforeShowDecade: $.noop,
		beforeShowCentury: $.noop,
		calendarWeeks: false,
		clearBtn: false,
		toggleActive: false,
		daysOfWeekDisabled: [],
		daysOfWeekHighlighted: [],
		datesDisabled: [],
		endDate: Infinity,
		forceParse: true,
		format: 'mm/dd/yyyy',
		isInline: null,
		keepEmptyValues: false,
		keyboardNavigation: true,
		language: 'en',
		minViewMode: 0,
		maxViewMode: 4,
		multidate: false,
		multidateSeparator: ',',
		orientation: "auto",
		rtl: false,
		startDate: -Infinity,
		startView: 0,
		todayBtn: false,
		todayHighlight: false,
		updateViewDate: true,
		weekStart: 0,
		disableTouchKeyboard: false,
		enableOnReadonly: true,
		showOnFocus: true,
		zIndexOffset: 10,
		container: 'body',
		immediateUpdates: false,
		title: '',
		templates: {
			leftArrow: '&#x00AB;',
			rightArrow: '&#x00BB;'
		},
    showWeekDays: true
	};
	var locale_opts = $.fn.datepicker.locale_opts = [
		'format',
		'rtl',
		'weekStart'
	];
	$.fn.datepicker.Constructor = Datepicker;
	var dates = $.fn.datepicker.dates = {
		en: {
			days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
			daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
			daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
			months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
			monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
			today: "Today",
			clear: "Clear",
			titleFormat: "MM yyyy"
		}
	};
	var DPGlobal = {
		viewModes: [
			{
				names: ['days', 'month'],
				clsName: 'days',
				e: 'changeMonth'
			},
			{
				names: ['months', 'year'],
				clsName: 'months',
				e: 'changeYear',
				navStep: 1
			},
			{
				names: ['years', 'decade'],
				clsName: 'years',
				e: 'changeDecade',
				navStep: 10
			},
			{
				names: ['decades', 'century'],
				clsName: 'decades',
				e: 'changeCentury',
				navStep: 100
			},
			{
				names: ['centuries', 'millennium'],
				clsName: 'centuries',
				e: 'changeMillennium',
				navStep: 1000
			}
		],
		validParts: /dd?|DD?|mm?|MM?|yy(?:yy)?/g,
		nonpunctuation: /[^ -\/:-@\u5e74\u6708\u65e5\[-`{-~\t\n\r]+/g,
		parseFormat: function(format){
			if (typeof format.toValue === 'function' && typeof format.toDisplay === 'function')
                return format;
            // IE treats \0 as a string end in inputs (truncating the value),
			// so it's a bad format delimiter, anyway
			var separators = format.replace(this.validParts, '\0').split('\0'),
				parts = format.match(this.validParts);
			if (!separators || !separators.length || !parts || parts.length === 0){
				throw new Error("Invalid date format.");
			}
			return {separators: separators, parts: parts};
		},
		parseDate: function(date, format, language, assumeNearby){
			if (!date)
				return undefined;
			if (date instanceof Date)
				return date;
			if (typeof format === 'string')
				format = DPGlobal.parseFormat(format);
			if (format.toValue)
				return format.toValue(date, format, language);
			var fn_map = {
					d: 'moveDay',
					m: 'moveMonth',
					w: 'moveWeek',
					y: 'moveYear'
				},
				dateAliases = {
					yesterday: '-1d',
					today: '+0d',
					tomorrow: '+1d'
				},
				parts, part, dir, i, fn;
			if (date in dateAliases){
				date = dateAliases[date];
			}
			if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/i.test(date)){
				parts = date.match(/([\-+]\d+)([dmwy])/gi);
				date = new Date();
				for (i=0; i < parts.length; i++){
					part = parts[i].match(/([\-+]\d+)([dmwy])/i);
					dir = Number(part[1]);
					fn = fn_map[part[2].toLowerCase()];
					date = Datepicker.prototype[fn](date, dir);
				}
				return Datepicker.prototype._zero_utc_time(date);
			}
			parts = date && date.match(this.nonpunctuation) || [];
			function applyNearbyYear(year, threshold){
				if (threshold === true)
					threshold = 10;
				// if year is 2 digits or less, than the user most likely is trying to get a recent century
				if (year < 100){
					year += 2000;
					// if the new year is more than threshold years in advance, use last century
					if (year > ((new Date()).getFullYear()+threshold)){
						year -= 100;
					}
				}
				return year;
			}
			var parsed = {},
				setters_order = ['yyyy', 'yy', 'M', 'MM', 'm', 'mm', 'd', 'dd'],
				setters_map = {
					yyyy: function(d,v){
						return d.setUTCFullYear(assumeNearby ? applyNearbyYear(v, assumeNearby) : v);
					},
					m: function(d,v){
						if (isNaN(d))
							return d;
						v -= 1;
						while (v < 0) v += 12;
						v %= 12;
						d.setUTCMonth(v);
						while (d.getUTCMonth() !== v)
							d.setUTCDate(d.getUTCDate()-1);
						return d;
					},
					d: function(d,v){
						return d.setUTCDate(v);
					}
				},
				val, filtered;
			setters_map['yy'] = setters_map['yyyy'];
			setters_map['M'] = setters_map['MM'] = setters_map['mm'] = setters_map['m'];
			setters_map['dd'] = setters_map['d'];
			date = UTCToday();
			var fparts = format.parts.slice();
			// Remove noop parts
			if (parts.length !== fparts.length){
				fparts = $(fparts).filter(function(i,p){
					return $.inArray(p, setters_order) !== -1;
				}).toArray();
			}
			// Process remainder
			function match_part(){
				var m = this.slice(0, parts[i].length),
					p = parts[i].slice(0, m.length);
				return m.toLowerCase() === p.toLowerCase();
			}
			if (parts.length === fparts.length){
				var cnt;
				for (i=0, cnt = fparts.length; i < cnt; i++){
					val = parseInt(parts[i], 10);
					part = fparts[i];
					if (isNaN(val)){
						switch (part){
							case 'MM':
								filtered = $(dates[language].months).filter(match_part);
								val = $.inArray(filtered[0], dates[language].months) + 1;
								break;
							case 'M':
								filtered = $(dates[language].monthsShort).filter(match_part);
								val = $.inArray(filtered[0], dates[language].monthsShort) + 1;
								break;
						}
					}
					parsed[part] = val;
				}
				var _date, s;
				for (i=0; i < setters_order.length; i++){
					s = setters_order[i];
					if (s in parsed && !isNaN(parsed[s])){
						_date = new Date(date);
						setters_map[s](_date, parsed[s]);
						if (!isNaN(_date))
							date = _date;
					}
				}
			}
			return date;
		},
		formatDate: function(date, format, language){
			if (!date)
				return '';
			if (typeof format === 'string')
				format = DPGlobal.parseFormat(format);
			if (format.toDisplay)
                return format.toDisplay(date, format, language);
            var val = {
				d: date.getUTCDate(),
				D: dates[language].daysShort[date.getUTCDay()],
				DD: dates[language].days[date.getUTCDay()],
				m: date.getUTCMonth() + 1,
				M: dates[language].monthsShort[date.getUTCMonth()],
				MM: dates[language].months[date.getUTCMonth()],
				yy: date.getUTCFullYear().toString().substring(2),
				yyyy: date.getUTCFullYear()
			};
			val.dd = (val.d < 10 ? '0' : '') + val.d;
			val.mm = (val.m < 10 ? '0' : '') + val.m;
			date = [];
			var seps = $.extend([], format.separators);
			for (var i=0, cnt = format.parts.length; i <= cnt; i++){
				if (seps.length)
					date.push(seps.shift());
				date.push(val[format.parts[i]]);
			}
			return date.join('');
		},
		headTemplate: '<thead>'+
			              '<tr>'+
			                '<th colspan="7" class="datepicker-title"></th>'+
			              '</tr>'+
							'<tr>'+
								'<th class="prev">'+defaults.templates.leftArrow+'</th>'+
								'<th colspan="5" class="datepicker-switch"></th>'+
								'<th class="next">'+defaults.templates.rightArrow+'</th>'+
							'</tr>'+
						'</thead>',
		contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>',
		footTemplate: '<tfoot>'+
							'<tr>'+
								'<th colspan="7" class="today"></th>'+
							'</tr>'+
							'<tr>'+
								'<th colspan="7" class="clear"></th>'+
							'</tr>'+
						'</tfoot>'
	};
	DPGlobal.template = '<div class="datepicker">'+
							'<div class="datepicker-days">'+
								'<table class="table-condensed">'+
									DPGlobal.headTemplate+
									'<tbody></tbody>'+
									DPGlobal.footTemplate+
								'</table>'+
							'</div>'+
							'<div class="datepicker-months">'+
								'<table class="table-condensed">'+
									DPGlobal.headTemplate+
									DPGlobal.contTemplate+
									DPGlobal.footTemplate+
								'</table>'+
							'</div>'+
							'<div class="datepicker-years">'+
								'<table class="table-condensed">'+
									DPGlobal.headTemplate+
									DPGlobal.contTemplate+
									DPGlobal.footTemplate+
								'</table>'+
							'</div>'+
							'<div class="datepicker-decades">'+
								'<table class="table-condensed">'+
									DPGlobal.headTemplate+
									DPGlobal.contTemplate+
									DPGlobal.footTemplate+
								'</table>'+
							'</div>'+
							'<div class="datepicker-centuries">'+
								'<table class="table-condensed">'+
									DPGlobal.headTemplate+
									DPGlobal.contTemplate+
									DPGlobal.footTemplate+
								'</table>'+
							'</div>'+
						'</div>';
	$.fn.datepicker.DPGlobal = DPGlobal;
	/* DATEPICKER NO CONFLICT
	* =================== */
	$.fn.datepicker.noConflict = function(){
		$.fn.datepicker = old;
		return this;
	};
	/* DATEPICKER VERSION
	 * =================== */
	$.fn.datepicker.version = '1.9.0';
	$.fn.datepicker.deprecated = function(msg){
		var console = window.console;
		if (console && console.warn) {
			console.warn('DEPRECATED: ' + msg);
		}
	};
	/* DATEPICKER DATA-API
	* ================== */
	$(document).on(
		'focus.datepicker.data-api click.datepicker.data-api',
		'[data-provide="datepicker"]',
		function(e){
			var $this = $(this);
			if ($this.data('datepicker'))
				return;
			e.preventDefault();
			// component click requires us to explicitly show it
			datepickerPlugin.call($this, 'show');
		}
	);
	$(function(){
		datepickerPlugin.call($('[data-provide="datepicker-inline"]'));
	});
}));;
function initMap() {
    if (document.querySelector(".js-map") == null) return;
    var markerLat = parseFloat($(".marker").attr("data-lat"));
    var markerLng = parseFloat($(".marker").attr("data-lng"));
    var markerTitle = $(".marker").attr("data-title");
    let mapOptions = {
        zoom: 16,
        center: new google.maps.LatLng(markerLat, markerLng),
        // How you would like to style the map. 
        styles: [{
                featureType: 'road',
                elementType: 'all',
                "stylers": [
                    { hue: '#00BBFF' },
                    { saturation: '13' },
                    { lightness: '50' },
                    { gamma: 0.8 },
                    { visibility: 'on' }
                ]
            },
            {
                "featureType": "road",
                "elementType": "geometry",
                "stylers": [
                    {
                        "color": "#F4F5F7"
                    }
                ]
            }
        ]
    }
    const map = new google.maps.Map(document.querySelector(".js-map"), mapOptions);
    var marker = new google.maps.Marker({
        position: new google.maps.LatLng(markerLat, markerLng),// marker location
        map: map,
        title: markerTitle
    });
    marker.setMap(map);
};
/*! lozad.js - v1.16.0 - 2020-09-06
* https://github.com/ApoorvSaxena/lozad.js
* Copyright (c) 2020 Apoorv Saxena; Licensed MIT */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.lozad=e()}(this,function(){"use strict";
  /**
   * Detect IE browser
   * @const {boolean}
   * @private
   */var g="undefined"!=typeof document&&document.documentMode,f={rootMargin:"0px",threshold:0,load:function(t){if("picture"===t.nodeName.toLowerCase()){var e=t.querySelector("img"),r=!1;null===e&&(e=document.createElement("img"),r=!0),g&&t.getAttribute("data-iesrc")&&(e.src=t.getAttribute("data-iesrc")),t.getAttribute("data-alt")&&(e.alt=t.getAttribute("data-alt")),r&&t.append(e)}if("video"===t.nodeName.toLowerCase()&&!t.getAttribute("data-src")&&t.children){for(var a=t.children,o=void 0,i=0;i<=a.length-1;i++)(o=a[i].getAttribute("data-src"))&&(a[i].src=o);t.load()}t.getAttribute("data-poster")&&(t.poster=t.getAttribute("data-poster")),t.getAttribute("data-src")&&(t.src=t.getAttribute("data-src")),t.getAttribute("data-srcset")&&t.setAttribute("srcset",t.getAttribute("data-srcset"));var n=",";if(t.getAttribute("data-background-delimiter")&&(n=t.getAttribute("data-background-delimiter")),t.getAttribute("data-background-image"))t.style.backgroundImage="url('"+t.getAttribute("data-background-image").split(n).join("'),url('")+"')";else if(t.getAttribute("data-background-image-set")){var d=t.getAttribute("data-background-image-set").split(n),u=d[0].substr(0,d[0].indexOf(" "))||d[0];// Substring before ... 1x
      u=-1===u.indexOf("url(")?"url("+u+")":u,1===d.length?t.style.backgroundImage=u:t.setAttribute("style",(t.getAttribute("style")||"")+"background-image: "+u+"; background-image: -webkit-image-set("+d+"); background-image: image-set("+d+")")}t.getAttribute("data-toggle-class")&&t.classList.toggle(t.getAttribute("data-toggle-class"))},loaded:function(){}};function A(t){t.setAttribute("data-loaded",!0)}var m=function(t){return"true"===t.getAttribute("data-loaded")},v=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document;return t instanceof Element?[t]:t instanceof NodeList?t:e.querySelectorAll(t)};return function(){var r,a,o=0<arguments.length&&void 0!==arguments[0]?arguments[0]:".lozad",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=Object.assign({},f,t),i=e.root,n=e.rootMargin,d=e.threshold,u=e.load,g=e.loaded,s=void 0;"undefined"!=typeof window&&window.IntersectionObserver&&(s=new IntersectionObserver((r=u,a=g,function(t,e){t.forEach(function(t){(0<t.intersectionRatio||t.isIntersecting)&&(e.unobserve(t.target),m(t.target)||(r(t.target),A(t.target),a(t.target)))})}),{root:i,rootMargin:n,threshold:d}));for(var c,l=v(o,i),b=0;b<l.length;b++)(c=l[b]).getAttribute("data-placeholder-background")&&(c.style.background=c.getAttribute("data-placeholder-background"));return{observe:function(){for(var t=v(o,i),e=0;e<t.length;e++)m(t[e])||(s?s.observe(t[e]):(u(t[e]),A(t[e]),g(t[e])))},triggerLoad:function(t){m(t)||(u(t),A(t),g(t))},observer:s}}});;
/*! Select2 4.1.0-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t),t}:n(jQuery)}(function(t){var e,n,s,p,r,o,h,f,g,m,y,v,i,a,_,s=((u=t&&t.fn&&t.fn.select2&&t.fn.select2.amd?t.fn.select2.amd:u)&&u.requirejs||(u?n=u:u={},g={},m={},y={},v={},i=Object.prototype.hasOwnProperty,a=[].slice,_=/\.js$/,h=function(e,t){var n,s,i=c(e),r=i[0],t=t[1];return e=i[1],r&&(n=x(r=l(r,t))),r?e=n&&n.normalize?n.normalize(e,(s=t,function(e){return l(e,s)})):l(e,t):(r=(i=c(e=l(e,t)))[0],e=i[1],r&&(n=x(r))),{f:r?r+"!"+e:e,n:e,pr:r,p:n}},f={require:function(e){return w(e)},exports:function(e){var t=g[e];return void 0!==t?t:g[e]={}},module:function(e){return{id:e,uri:"",exports:g[e],config:(t=e,function(){return y&&y.config&&y.config[t]||{}})};var t}},r=function(e,t,n,s){var i,r,o,a,l,c=[],u=typeof n,d=A(s=s||e);if("undefined"==u||"function"==u){for(t=!t.length&&n.length?["require","exports","module"]:t,a=0;a<t.length;a+=1)if("require"===(r=(o=h(t[a],d)).f))c[a]=f.require(e);else if("exports"===r)c[a]=f.exports(e),l=!0;else if("module"===r)i=c[a]=f.module(e);else if(b(g,r)||b(m,r)||b(v,r))c[a]=x(r);else{if(!o.p)throw new Error(e+" missing "+r);o.p.load(o.n,w(s,!0),function(t){return function(e){g[t]=e}}(r),{}),c[a]=g[r]}u=n?n.apply(g[e],c):void 0,e&&(i&&i.exports!==p&&i.exports!==g[e]?g[e]=i.exports:u===p&&l||(g[e]=u))}else e&&(g[e]=n)},e=n=o=function(e,t,n,s,i){if("string"==typeof e)return f[e]?f[e](t):x(h(e,A(t)).f);if(!e.splice){if((y=e).deps&&o(y.deps,y.callback),!t)return;t.splice?(e=t,t=n,n=null):e=p}return t=t||function(){},"function"==typeof n&&(n=s,s=i),s?r(p,e,t,n):setTimeout(function(){r(p,e,t,n)},4),o},o.config=function(e){return o(e)},e._defined=g,(s=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),b(g,e)||b(m,e)||(m[e]=[e,t,n])}).amd={jQuery:!0},u.requirejs=e,u.require=n,u.define=s),u.define("almond",function(){}),u.define("jquery",[],function(){var e=t||$;return null==e&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),e}),u.define("select2/utils",["jquery"],function(r){var s={};function c(e){var t,n=e.prototype,s=[];for(t in n)"function"==typeof n[t]&&"constructor"!==t&&s.push(t);return s}s.Extend=function(e,t){var n,s={}.hasOwnProperty;function i(){this.constructor=e}for(n in t)s.call(t,n)&&(e[n]=t[n]);return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},s.Decorate=function(s,i){var e=c(i),t=c(s);function r(){var e=Array.prototype.unshift,t=i.prototype.constructor.length,n=s.prototype.constructor;0<t&&(e.call(arguments,s.prototype.constructor),n=i.prototype.constructor),n.apply(this,arguments)}i.displayName=s.displayName,r.prototype=new function(){this.constructor=r};for(var n=0;n<t.length;n++){var o=t[n];r.prototype[o]=s.prototype[o]}for(var a=0;a<e.length;a++){var l=e[a];r.prototype[l]=function(e){var t=function(){};e in r.prototype&&(t=r.prototype[e]);var n=i.prototype[e];return function(){return Array.prototype.unshift.call(arguments,t),n.apply(this,arguments)}}(l)}return r};function e(){this.listeners={}}e.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},e.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1);this.listeners=this.listeners||{},0===(n=null==n?[]:n).length&&n.push({}),(n[0]._type=e)in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},e.prototype.invoke=function(e,t){for(var n=0,s=e.length;n<s;n++)e[n].apply(this,t)},s.Observable=e,s.generateChars=function(e){for(var t="",n=0;n<e;n++)t+=Math.floor(36*Math.random()).toString(36);return t},s.bind=function(e,t){return function(){e.apply(t,arguments)}},s._convertData=function(e){for(var t in e){var n=t.split("-"),s=e;if(1!==n.length){for(var i=0;i<n.length;i++){var r=n[i];(r=r.substring(0,1).toLowerCase()+r.substring(1))in s||(s[r]={}),i==n.length-1&&(s[r]=e[t]),s=s[r]}delete e[t]}}return e},s.hasScroll=function(e,t){var n=r(t),s=t.style.overflowX,i=t.style.overflowY;return(s!==i||"hidden"!==i&&"visible"!==i)&&("scroll"===s||"scroll"===i||(n.innerHeight()<t.scrollHeight||n.innerWidth()<t.scrollWidth))},s.escapeMarkup=function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},s.__cache={};var n=0;return s.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2-id");return null!=t||(t=e.id?"select2-data-"+e.id:"select2-data-"+(++n).toString()+"-"+s.generateChars(4),e.setAttribute("data-select2-id",t)),t},s.StoreData=function(e,t,n){e=s.GetUniqueElementId(e);s.__cache[e]||(s.__cache[e]={}),s.__cache[e][t]=n},s.GetData=function(e,t){var n=s.GetUniqueElementId(e);return t?s.__cache[n]&&null!=s.__cache[n][t]?s.__cache[n][t]:r(e).data(t):s.__cache[n]},s.RemoveData=function(e){var t=s.GetUniqueElementId(e);null!=s.__cache[t]&&delete s.__cache[t],e.removeAttribute("data-select2-id")},s.copyNonInternalCssClasses=function(e,t){var n=(n=e.getAttribute("class").trim().split(/\s+/)).filter(function(e){return 0===e.indexOf("select2-")}),t=(t=t.getAttribute("class").trim().split(/\s+/)).filter(function(e){return 0!==e.indexOf("select2-")}),t=n.concat(t);e.setAttribute("class",t.join(" "))},s}),u.define("select2/results",["jquery","./utils"],function(d,p){function s(e,t,n){this.$element=e,this.data=n,this.options=t,s.__super__.constructor.call(this)}return p.Extend(s,p.Observable),s.prototype.render=function(){var e=d('<ul class="select2-results__options" role="listbox"></ul>');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e},s.prototype.clear=function(){this.$results.empty()},s.prototype.displayMessage=function(e){var t=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=d('<li role="alert" aria-live="assertive" class="select2-results__option"></li>'),s=this.options.get("translations").get(e.message);n.append(t(s(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},s.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},s.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var s=e.results[n],s=this.option(s);t.push(s)}this.$results.append(t)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},s.prototype.position=function(e,t){t.find(".select2-results").append(e)},s.prototype.sort=function(e){return this.options.get("sorter")(e)},s.prototype.highlightFirstItem=function(){var e=this.$results.find(".select2-results__option--selectable"),t=e.filter(".select2-results__option--selected");(0<t.length?t:e).first().trigger("mouseenter"),this.ensureHighlightVisible()},s.prototype.setClasses=function(){var t=this;this.data.current(function(e){var s=e.map(function(e){return e.id.toString()});t.$results.find(".select2-results__option--selectable").each(function(){var e=d(this),t=p.GetData(this,"data"),n=""+t.id;null!=t.element&&t.element.selected||null==t.element&&-1<s.indexOf(n)?(this.classList.add("select2-results__option--selected"),e.attr("aria-selected","true")):(this.classList.remove("select2-results__option--selected"),e.attr("aria-selected","false"))})})},s.prototype.showLoading=function(e){this.hideLoading();e={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(e)},e=this.option(e);e.className+=" loading-results",this.$results.prepend(e)},s.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},s.prototype.option=function(e){var t=document.createElement("li");t.classList.add("select2-results__option"),t.classList.add("select2-results__option--selectable");var n,s={role:"option"},i=window.Element.prototype.matches||window.Element.prototype.msMatchesSelector||window.Element.prototype.webkitMatchesSelector;for(n in(null!=e.element&&i.call(e.element,":disabled")||null==e.element&&e.disabled)&&(s["aria-disabled"]="true",t.classList.remove("select2-results__option--selectable"),t.classList.add("select2-results__option--disabled")),null==e.id&&t.classList.remove("select2-results__option--selectable"),null!=e._resultId&&(t.id=e._resultId),e.title&&(t.title=e.title),e.children&&(s.role="group",s["aria-label"]=e.text,t.classList.remove("select2-results__option--selectable"),t.classList.add("select2-results__option--group")),s){var r=s[n];t.setAttribute(n,r)}if(e.children){var o=d(t),a=document.createElement("strong");a.className="select2-results__group",this.template(e,a);for(var l=[],c=0;c<e.children.length;c++){var u=e.children[c],u=this.option(u);l.push(u)}i=d("<ul></ul>",{class:"select2-results__options select2-results__options--nested",role:"none"});i.append(l),o.append(a),o.append(i)}else this.template(e,t);return p.StoreData(t,"data",e),t},s.prototype.bind=function(t,e){var i=this,n=t.id+"-results";this.$results.attr("id",n),t.on("results:all",function(e){i.clear(),i.append(e.data),t.isOpen()&&(i.setClasses(),i.highlightFirstItem())}),t.on("results:append",function(e){i.append(e.data),t.isOpen()&&i.setClasses()}),t.on("query",function(e){i.hideMessages(),i.showLoading(e)}),t.on("select",function(){t.isOpen()&&(i.setClasses(),i.options.get("scrollAfterSelect")&&i.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(i.setClasses(),i.options.get("scrollAfterSelect")&&i.highlightFirstItem())}),t.on("open",function(){i.$results.attr("aria-expanded","true"),i.$results.attr("aria-hidden","false"),i.setClasses(),i.ensureHighlightVisible()}),t.on("close",function(){i.$results.attr("aria-expanded","false"),i.$results.attr("aria-hidden","true"),i.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=i.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e,t=i.getHighlightedResults();0!==t.length&&(e=p.GetData(t[0],"data"),t.hasClass("select2-results__option--selected")?i.trigger("close",{}):i.trigger("select",{data:e}))}),t.on("results:previous",function(){var e,t=i.getHighlightedResults(),n=i.$results.find(".select2-results__option--selectable"),s=n.index(t);s<=0||(e=s-1,0===t.length&&(e=0),(s=n.eq(e)).trigger("mouseenter"),t=i.$results.offset().top,n=s.offset().top,s=i.$results.scrollTop()+(n-t),0===e?i.$results.scrollTop(0):n-t<0&&i.$results.scrollTop(s))}),t.on("results:next",function(){var e,t=i.getHighlightedResults(),n=i.$results.find(".select2-results__option--selectable"),s=n.index(t)+1;s>=n.length||((e=n.eq(s)).trigger("mouseenter"),t=i.$results.offset().top+i.$results.outerHeight(!1),n=e.offset().top+e.outerHeight(!1),e=i.$results.scrollTop()+n-t,0===s?i.$results.scrollTop(0):t<n&&i.$results.scrollTop(e))}),t.on("results:focus",function(e){e.element[0].classList.add("select2-results__option--highlighted"),e.element[0].setAttribute("aria-selected","true")}),t.on("results:message",function(e){i.displayMessage(e)}),d.fn.mousewheel&&this.$results.on("mousewheel",function(e){var t=i.$results.scrollTop(),n=i.$results.get(0).scrollHeight-t+e.deltaY,t=0<e.deltaY&&t-e.deltaY<=0,n=e.deltaY<0&&n<=i.$results.height();t?(i.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):n&&(i.$results.scrollTop(i.$results.get(0).scrollHeight-i.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".select2-results__option--selectable",function(e){var t=d(this),n=p.GetData(this,"data");t.hasClass("select2-results__option--selected")?i.options.get("multiple")?i.trigger("unselect",{originalEvent:e,data:n}):i.trigger("close",{}):i.trigger("select",{originalEvent:e,data:n})}),this.$results.on("mouseenter",".select2-results__option--selectable",function(e){var t=p.GetData(this,"data");i.getHighlightedResults().removeClass("select2-results__option--highlighted").attr("aria-selected","false"),i.trigger("results:focus",{data:t,element:d(this)})})},s.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},s.prototype.destroy=function(){this.$results.remove()},s.prototype.ensureHighlightVisible=function(){var e,t,n,s,i=this.getHighlightedResults();0!==i.length&&(e=this.$results.find(".select2-results__option--selectable").index(i),s=this.$results.offset().top,t=i.offset().top,n=this.$results.scrollTop()+(t-s),s=t-s,n-=2*i.outerHeight(!1),e<=2?this.$results.scrollTop(0):(s>this.$results.outerHeight()||s<0)&&this.$results.scrollTop(n))},s.prototype.template=function(e,t){var n=this.options.get("templateResult"),s=this.options.get("escapeMarkup"),e=n(e,t);null==e?t.style.display="none":"string"==typeof e?t.innerHTML=s(e):d(t).append(e)},s}),u.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),u.define("select2/selection/base",["jquery","../utils","../keys"],function(n,s,i){function r(e,t){this.$element=e,this.options=t,r.__super__.constructor.call(this)}return s.Extend(r,s.Observable),r.prototype.render=function(){var e=n('<span class="select2-selection" role="combobox"  aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=s.GetData(this.$element[0],"old-tabindex")?this._tabindex=s.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),e.attr("aria-disabled","false"),this.$selection=e},r.prototype.bind=function(e,t){var n=this,s=e.id+"-results";this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n._handleBlur(e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===i.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",s),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","false"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),n.$selection.trigger("focus"),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex),n.$selection.attr("aria-disabled","false")}),e.on("disable",function(){n.$selection.attr("tabindex","-1"),n.$selection.attr("aria-disabled","true")})},r.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||n.contains(t.$selection[0],document.activeElement)||t.trigger("blur",e)},1)},r.prototype._attachCloseHandler=function(e){n(document.body).on("mousedown.select2."+e.id,function(e){var t=n(e.target).closest(".select2");n(".select2.select2-container--open").each(function(){this!=t[0]&&s.GetData(this,"element").select2("close")})})},r.prototype._detachCloseHandler=function(e){n(document.body).off("mousedown.select2."+e.id)},r.prototype.position=function(e,t){t.find(".selection").append(e)},r.prototype.destroy=function(){this._detachCloseHandler(this.container)},r.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},r.prototype.isEnabled=function(){return!this.isDisabled()},r.prototype.isDisabled=function(){return this.options.get("disabled")},r}),u.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,s){function i(){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e[0].classList.add("select2-selection--single"),e.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},i.prototype.bind=function(t,e){var n=this;i.__super__.bind.apply(this,arguments);var s=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",s).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",s),this.$selection.attr("aria-controls",s),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),t.on("focus",function(e){t.isOpen()||n.$selection.trigger("focus")})},i.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},i.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},i.prototype.selectionContainer=function(){return e("<span></span>")},i.prototype.update=function(e){var t,n;0!==e.length?(n=e[0],t=this.$selection.find(".select2-selection__rendered"),e=this.display(n,t),t.empty().append(e),(n=n.title||n.text)?t.attr("title",n):t.removeAttr("title")):this.clear()},i}),u.define("select2/selection/multiple",["jquery","./base","../utils"],function(i,e,c){function r(e,t){r.__super__.constructor.apply(this,arguments)}return c.Extend(r,e),r.prototype.render=function(){var e=r.__super__.render.call(this);return e[0].classList.add("select2-selection--multiple"),e.html('<ul class="select2-selection__rendered"></ul>'),e},r.prototype.bind=function(e,t){var n=this;r.__super__.bind.apply(this,arguments);var s=e.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",s),this.$selection.on("click",function(e){n.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){var t;n.isDisabled()||(t=i(this).parent(),t=c.GetData(t[0],"data"),n.trigger("unselect",{originalEvent:e,data:t}))}),this.$selection.on("keydown",".select2-selection__choice__remove",function(e){n.isDisabled()||e.stopPropagation()})},r.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},r.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},r.prototype.selectionContainer=function(){return i('<li class="select2-selection__choice"><button type="button" class="select2-selection__choice__remove" tabindex="-1"><span aria-hidden="true">&times;</span></button><span class="select2-selection__choice__display"></span></li>')},r.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=this.$selection.find(".select2-selection__rendered").attr("id")+"-choice-",s=0;s<e.length;s++){var i=e[s],r=this.selectionContainer(),o=this.display(i,r),a=n+c.generateChars(4)+"-";i.id?a+=i.id:a+=c.generateChars(4),r.find(".select2-selection__choice__display").append(o).attr("id",a);var l=i.title||i.text;l&&r.attr("title",l);o=this.options.get("translations").get("removeItem"),l=r.find(".select2-selection__choice__remove");l.attr("title",o()),l.attr("aria-label",o()),l.attr("aria-describedby",a),c.StoreData(r[0],"data",i),t.push(r)}this.$selection.find(".select2-selection__rendered").append(t)}},r}),u.define("select2/selection/placeholder",[],function(){function e(e,t,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n)}return e.prototype.normalizePlaceholder=function(e,t){return t="string"==typeof t?{id:"",text:t}:t},e.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer();n.html(this.display(t)),n[0].classList.add("select2-selection__placeholder"),n[0].classList.remove("select2-selection__choice");t=t.title||t.text||n.text();return this.$selection.find(".select2-selection__rendered").attr("title",t),n},e.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id;if(1<t.length||n)return e.call(this,t);this.clear();t=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(t)},e}),u.define("select2/selection/allowClear",["jquery","../keys","../utils"],function(i,s,a){function e(){}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(e){s._handleClear(e)}),t.on("keypress",function(e){s._handleKeyboardClear(e,t)})},e.prototype._handleClear=function(e,t){if(!this.isDisabled()){var n=this.$selection.find(".select2-selection__clear");if(0!==n.length){t.stopPropagation();var s=a.GetData(n[0],"data"),i=this.$element.val();this.$element.val(this.placeholder.id);var r={data:s};if(this.trigger("clear",r),r.prevented)this.$element.val(i);else{for(var o=0;o<s.length;o++)if(r={data:s[o]},this.trigger("unselect",r),r.prevented)return void this.$element.val(i);this.$element.trigger("input").trigger("change"),this.trigger("toggle",{})}}}},e.prototype._handleKeyboardClear=function(e,t,n){n.isOpen()||t.which!=s.DELETE&&t.which!=s.BACKSPACE||this._handleClear(t)},e.prototype.update=function(e,t){var n,s;e.call(this,t),this.$selection.find(".select2-selection__clear").remove(),this.$selection[0].classList.remove("select2-selection--clearable"),0<this.$selection.find(".select2-selection__placeholder").length||0===t.length||(n=this.$selection.find(".select2-selection__rendered").attr("id"),s=this.options.get("translations").get("removeAllItems"),(e=i('<button type="button" class="select2-selection__clear" tabindex="-1"><span aria-hidden="true">&times;</span></button>')).attr("title",s()),e.attr("aria-label",s()),e.attr("aria-describedby",n),a.StoreData(e[0],"data",t),this.$selection.prepend(e),this.$selection[0].classList.add("select2-selection--clearable"))},e}),u.define("select2/selection/search",["jquery","../utils","../keys"],function(s,a,l){function e(e,t,n){e.call(this,t,n)}return e.prototype.render=function(e){var t=this.options.get("translations").get("search"),n=s('<span class="select2-search select2-search--inline"><textarea class="select2-search__field" type="search" tabindex="-1" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" ></textarea></span>');this.$searchContainer=n,this.$search=n.find("textarea"),this.$search.prop("autocomplete",this.options.get("autocomplete")),this.$search.attr("aria-label",t());e=e.call(this);return this._transferTabIndex(),e.append(this.$searchContainer),e},e.prototype.bind=function(e,t,n){var s=this,i=t.id+"-results",r=t.id+"-container";e.call(this,t,n),s.$search.attr("aria-describedby",r),t.on("open",function(){s.$search.attr("aria-controls",i),s.$search.trigger("focus")}),t.on("close",function(){s.$search.val(""),s.resizeSearch(),s.$search.removeAttr("aria-controls"),s.$search.removeAttr("aria-activedescendant"),s.$search.trigger("focus")}),t.on("enable",function(){s.$search.prop("disabled",!1),s._transferTabIndex()}),t.on("disable",function(){s.$search.prop("disabled",!0)}),t.on("focus",function(e){s.$search.trigger("focus")}),t.on("results:focus",function(e){e.data._resultId?s.$search.attr("aria-activedescendant",e.data._resultId):s.$search.removeAttr("aria-activedescendant")}),this.$selection.on("focusin",".select2-search--inline",function(e){s.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){s._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){var t;e.stopPropagation(),s.trigger("keypress",e),s._keyUpPrevented=e.isDefaultPrevented(),e.which!==l.BACKSPACE||""!==s.$search.val()||0<(t=s.$selection.find(".select2-selection__choice").last()).length&&(t=a.GetData(t[0],"data"),s.searchRemoveChoice(t),e.preventDefault())}),this.$selection.on("click",".select2-search--inline",function(e){s.$search.val()&&e.stopPropagation()});var t=document.documentMode,o=t&&t<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(e){o?s.$selection.off("input.search input.searchcheck"):s.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(e){var t;o&&"input"===e.type?s.$selection.off("input.search input.searchcheck"):(t=e.which)!=l.SHIFT&&t!=l.CTRL&&t!=l.ALT&&t!=l.TAB&&s.handleSearch(e)})},e.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},e.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},e.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.resizeSearch(),n&&this.$search.trigger("focus")},e.prototype.handleSearch=function(){var e;this.resizeSearch(),this._keyUpPrevented||(e=this.$search.val(),this.trigger("query",{term:e})),this._keyUpPrevented=!1},e.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},e.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="100%";""===this.$search.attr("placeholder")&&(e=.75*(this.$search.val().length+1)+"em"),this.$search.css("width",e)},e}),u.define("select2/selection/selectionCss",["../utils"],function(n){function e(){}return e.prototype.render=function(e){var t=e.call(this),e=this.options.get("selectionCssClass")||"";return-1!==e.indexOf(":all:")&&(e=e.replace(":all:",""),n.copyNonInternalCssClasses(t[0],this.$element[0])),t.addClass(e),t},e}),u.define("select2/selection/eventRelay",["jquery"],function(o){function e(){}return e.prototype.bind=function(e,t,n){var s=this,i=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],r=["opening","closing","selecting","unselecting","clearing"];e.call(this,t,n),t.on("*",function(e,t){var n;-1!==i.indexOf(e)&&(t=t||{},n=o.Event("select2:"+e,{params:t}),s.$element.trigger(n),-1!==r.indexOf(e)&&(t.prevented=n.isDefaultPrevented()))})},e}),u.define("select2/translation",["jquery","require"],function(t,n){function s(e){this.dict=e||{}}return s.prototype.all=function(){return this.dict},s.prototype.get=function(e){return this.dict[e]},s.prototype.extend=function(e){this.dict=t.extend({},e.all(),this.dict)},s._cache={},s.loadPath=function(e){var t;return e in s._cache||(t=n(e),s._cache[e]=t),new s(s._cache[e])},s}),u.define("select2/diacritics",[],function(){return{"Ⓐ":"A","Ａ":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","Ｂ":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","Ｃ":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","Ｄ":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","Ǳ":"DZ","Ǆ":"DZ","ǲ":"Dz","ǅ":"Dz","Ⓔ":"E","Ｅ":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","Ｆ":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","Ｇ":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","Ｈ":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","Ｉ":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","Ｊ":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","Ｋ":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","Ｌ":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","Ǉ":"LJ","ǈ":"Lj","Ⓜ":"M","Ｍ":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","Ｎ":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","Ǌ":"NJ","ǋ":"Nj","Ⓞ":"O","Ｏ":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Œ":"OE","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","Ｐ":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Ｑ":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","Ｒ":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","Ｓ":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","Ｔ":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","Ｕ":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","Ｖ":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","Ｗ":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","Ｘ":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Ｙ":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Ｚ":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","ａ":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","ｂ":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","ｃ":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","ｄ":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","ǳ":"dz","ǆ":"dz","ⓔ":"e","ｅ":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","ｆ":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","ｇ":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","ｈ":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","ｉ":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","ｊ":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","ｋ":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","ｌ":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","ǉ":"lj","ⓜ":"m","ｍ":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","ｎ":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ŉ":"n","ꞑ":"n","ꞥ":"n","ǌ":"nj","ⓞ":"o","ｏ":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","œ":"oe","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","ｐ":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","ｑ":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","ｒ":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","ｓ":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","ｔ":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","ｕ":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","ｖ":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","ｗ":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","ｘ":"x","ẋ":"x","ẍ":"x","ⓨ":"y","ｙ":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","ｚ":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ώ":"ω","ς":"σ","’":"'"}}),u.define("select2/data/base",["../utils"],function(n){function s(e,t){s.__super__.constructor.call(this)}return n.Extend(s,n.Observable),s.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},s.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},s.prototype.bind=function(e,t){},s.prototype.destroy=function(){},s.prototype.generateResultId=function(e,t){e=e.id+"-result-";return e+=n.generateChars(4),null!=t.id?e+="-"+t.id.toString():e+="-"+n.generateChars(4),e},s}),u.define("select2/data/select",["./base","../utils","jquery"],function(e,a,l){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return a.Extend(n,e),n.prototype.current=function(e){var t=this;e(Array.prototype.map.call(this.$element[0].querySelectorAll(":checked"),function(e){return t.item(l(e))}))},n.prototype.select=function(i){var e,r=this;if(i.selected=!0,null!=i.element&&"option"===i.element.tagName.toLowerCase())return i.element.selected=!0,void this.$element.trigger("input").trigger("change");this.$element.prop("multiple")?this.current(function(e){var t=[];(i=[i]).push.apply(i,e);for(var n=0;n<i.length;n++){var s=i[n].id;-1===t.indexOf(s)&&t.push(s)}r.$element.val(t),r.$element.trigger("input").trigger("change")}):(e=i.id,this.$element.val(e),this.$element.trigger("input").trigger("change"))},n.prototype.unselect=function(i){var r=this;if(this.$element.prop("multiple")){if(i.selected=!1,null!=i.element&&"option"===i.element.tagName.toLowerCase())return i.element.selected=!1,void this.$element.trigger("input").trigger("change");this.current(function(e){for(var t=[],n=0;n<e.length;n++){var s=e[n].id;s!==i.id&&-1===t.indexOf(s)&&t.push(s)}r.$element.val(t),r.$element.trigger("input").trigger("change")})}},n.prototype.bind=function(e,t){var n=this;(this.container=e).on("select",function(e){n.select(e.data)}),e.on("unselect",function(e){n.unselect(e.data)})},n.prototype.destroy=function(){this.$element.find("*").each(function(){a.RemoveData(this)})},n.prototype.query=function(t,e){var n=[],s=this;this.$element.children().each(function(){var e;"option"!==this.tagName.toLowerCase()&&"optgroup"!==this.tagName.toLowerCase()||(e=l(this),e=s.item(e),null!==(e=s.matches(t,e))&&n.push(e))}),e({results:n})},n.prototype.addOptions=function(e){this.$element.append(e)},n.prototype.option=function(e){var t;e.children?(t=document.createElement("optgroup")).label=e.text:void 0!==(t=document.createElement("option")).textContent?t.textContent=e.text:t.innerText=e.text,void 0!==e.id&&(t.value=e.id),e.disabled&&(t.disabled=!0),e.selected&&(t.selected=!0),e.title&&(t.title=e.title);e=this._normalizeItem(e);return e.element=t,a.StoreData(t,"data",e),l(t)},n.prototype.item=function(e){var t={};if(null!=(t=a.GetData(e[0],"data")))return t;var n=e[0];if("option"===n.tagName.toLowerCase())t={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if("optgroup"===n.tagName.toLowerCase()){t={text:e.prop("label"),children:[],title:e.prop("title")};for(var s=e.children("option"),i=[],r=0;r<s.length;r++){var o=l(s[r]),o=this.item(o);i.push(o)}t.children=i}return(t=this._normalizeItem(t)).element=e[0],a.StoreData(e[0],"data",t),t},n.prototype._normalizeItem=function(e){e!==Object(e)&&(e={id:e,text:e});return null!=(e=l.extend({},{text:""},e)).id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),l.extend({},{selected:!1,disabled:!1},e)},n.prototype.matches=function(e,t){return this.options.get("matcher")(e,t)},n}),u.define("select2/data/array",["./select","../utils","jquery"],function(e,t,c){function s(e,t){this._dataToConvert=t.get("data")||[],s.__super__.constructor.call(this,e,t)}return t.Extend(s,e),s.prototype.bind=function(e,t){s.__super__.bind.call(this,e,t),this.addOptions(this.convertToOptions(this._dataToConvert))},s.prototype.select=function(n){var e=this.$element.find("option").filter(function(e,t){return t.value==n.id.toString()});0===e.length&&(e=this.option(n),this.addOptions(e)),s.__super__.select.call(this,n)},s.prototype.convertToOptions=function(e){var t=this,n=this.$element.find("option"),s=n.map(function(){return t.item(c(this)).id}).get(),i=[];for(var r=0;r<e.length;r++){var o,a,l=this._normalizeItem(e[r]);0<=s.indexOf(l.id)?(o=n.filter(function(e){return function(){return c(this).val()==e.id}}(l)),a=this.item(o),a=c.extend(!0,{},l,a),a=this.option(a),o.replaceWith(a)):(a=this.option(l),l.children&&(l=this.convertToOptions(l.children),a.append(l)),i.push(a))}return i},s}),u.define("select2/data/ajax",["./array","../utils","jquery"],function(e,t,r){function n(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),n.__super__.constructor.call(this,e,t)}return t.Extend(n,e),n.prototype._applyDefaults=function(e){var t={data:function(e){return r.extend({},e,{q:e.term})},transport:function(e,t,n){e=r.ajax(e);return e.then(t),e.fail(n),e}};return r.extend({},t,e,!0)},n.prototype.processResults=function(e){return e},n.prototype.query=function(t,n){var s=this;null!=this._request&&("function"==typeof this._request.abort&&this._request.abort(),this._request=null);var i=r.extend({type:"GET"},this.ajaxOptions);function e(){var e=i.transport(i,function(e){e=s.processResults(e,t);s.options.get("debug")&&window.console&&console.error&&(e&&e.results&&Array.isArray(e.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),n(e)},function(){"status"in e&&(0===e.status||"0"===e.status)||s.trigger("results:message",{message:"errorLoading"})});s._request=e}"function"==typeof i.url&&(i.url=i.url.call(this.$element,t)),"function"==typeof i.data&&(i.data=i.data.call(this.$element,t)),this.ajaxOptions.delay&&null!=t.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(e,this.ajaxOptions.delay)):e()},n}),u.define("select2/data/tags",["jquery"],function(t){function e(e,t,n){var s=n.get("tags"),i=n.get("createTag");void 0!==i&&(this.createTag=i);i=n.get("insertTag");if(void 0!==i&&(this.insertTag=i),e.call(this,t,n),Array.isArray(s))for(var r=0;r<s.length;r++){var o=s[r],o=this._normalizeItem(o),o=this.option(o);this.$element.append(o)}}return e.prototype.query=function(e,c,u){var d=this;this._removeOldTags(),null!=c.term&&null==c.page?e.call(this,c,function e(t,n){for(var s=t.results,i=0;i<s.length;i++){var r=s[i],o=null!=r.children&&!e({results:r.children},!0);if((r.text||"").toUpperCase()===(c.term||"").toUpperCase()||o)return!n&&(t.data=s,void u(t))}if(n)return!0;var a,l=d.createTag(c);null!=l&&((a=d.option(l)).attr("data-select2-tag","true"),d.addOptions([a]),d.insertTag(s,l)),t.results=s,u(t)}):e.call(this,c,u)},e.prototype.createTag=function(e,t){if(null==t.term)return null;t=t.term.trim();return""===t?null:{id:t,text:t}},e.prototype.insertTag=function(e,t,n){t.unshift(n)},e.prototype._removeOldTags=function(e){this.$element.find("option[data-select2-tag]").each(function(){this.selected||t(this).remove()})},e}),u.define("select2/data/tokenizer",["jquery"],function(c){function e(e,t,n){var s=n.get("tokenizer");void 0!==s&&(this.tokenizer=s),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(".select2-search__field")},e.prototype.query=function(e,t,n){var s=this;t.term=t.term||"";var i=this.tokenizer(t,this.options,function(e){var t,n=s._normalizeItem(e);s.$element.find("option").filter(function(){return c(this).val()===n.id}).length||((t=s.option(n)).attr("data-select2-tag",!0),s._removeOldTags(),s.addOptions([t])),t=n,s.trigger("select",{data:t})});i.term!==t.term&&(this.$search.length&&(this.$search.val(i.term),this.$search.trigger("focus")),t.term=i.term),e.call(this,t,n)},e.prototype.tokenizer=function(e,t,n,s){for(var i=n.get("tokenSeparators")||[],r=t.term,o=0,a=this.createTag||function(e){return{id:e.term,text:e.term}};o<r.length;){var l=r[o];-1!==i.indexOf(l)?(l=r.substr(0,o),null!=(l=a(c.extend({},t,{term:l})))?(s(l),r=r.substr(o+1)||"",o=0):o++):o++}return{term:r}},e}),u.define("select2/data/minimumInputLength",[],function(){function e(e,t,n){this.minimumInputLength=n.get("minimumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",t.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),u.define("select2/data/maximumInputLength",[],function(){function e(e,t,n){this.maximumInputLength=n.get("maximumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",0<this.maximumInputLength&&t.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),u.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on("select",function(){s._checkIfMaximumSelected()})},e.prototype.query=function(e,t,n){var s=this;this._checkIfMaximumSelected(function(){e.call(s,t,n)})},e.prototype._checkIfMaximumSelected=function(e,t){var n=this;this.current(function(e){e=null!=e?e.length:0;0<n.maximumSelectionLength&&e>=n.maximumSelectionLength?n.trigger("results:message",{message:"maximumSelected",args:{maximum:n.maximumSelectionLength}}):t&&t()})},e}),u.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('<span class="select2-dropdown"><span class="select2-results"></span></span>');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),u.define("select2/dropdown/search",["jquery"],function(r){function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get("translations").get("search"),e=r('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></span>');return this.$searchContainer=e,this.$search=e.find("input"),this.$search.prop("autocomplete",this.options.get("autocomplete")),this.$search.attr("aria-label",n()),t.prepend(e),t},e.prototype.bind=function(e,t,n){var s=this,i=t.id+"-results";e.call(this,t,n),this.$search.on("keydown",function(e){s.trigger("keypress",e),s._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){r(this).off("keyup")}),this.$search.on("keyup input",function(e){s.handleSearch(e)}),t.on("open",function(){s.$search.attr("tabindex",0),s.$search.attr("aria-controls",i),s.$search.trigger("focus"),window.setTimeout(function(){s.$search.trigger("focus")},0)}),t.on("close",function(){s.$search.attr("tabindex",-1),s.$search.removeAttr("aria-controls"),s.$search.removeAttr("aria-activedescendant"),s.$search.val(""),s.$search.trigger("blur")}),t.on("focus",function(){t.isOpen()||s.$search.trigger("focus")}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(s.showSearch(e)?s.$searchContainer[0].classList.remove("select2-search--hide"):s.$searchContainer[0].classList.add("select2-search--hide"))}),t.on("results:focus",function(e){e.data._resultId?s.$search.attr("aria-activedescendant",e.data._resultId):s.$search.removeAttr("aria-activedescendant")})},e.prototype.handleSearch=function(e){var t;this._keyUpPrevented||(t=this.$search.val(),this.trigger("query",{term:t})),this._keyUpPrevented=!1},e.prototype.showSearch=function(e,t){return!0},e}),u.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,s){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,s)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return t="string"==typeof t?{id:"",text:t}:t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),s=t.length-1;0<=s;s--){var i=t[s];this.placeholder.id===i.id&&n.splice(s,1)}return n},e}),u.define("select2/dropdown/infiniteScroll",["jquery"],function(n){function e(e,t,n,s){this.lastParams={},e.call(this,t,n,s),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on("query",function(e){s.lastParams=e,s.loading=!0}),t.on("query:append",function(e){s.lastParams=e,s.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=n.contains(document.documentElement,this.$loadingMore[0]);!this.loading&&e&&(e=this.$results.offset().top+this.$results.outerHeight(!1),this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=e+50&&this.loadMore())},e.prototype.loadMore=function(){this.loading=!0;var e=n.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=n('<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),u.define("select2/dropdown/attachBody",["jquery","../utils"],function(u,o){function e(e,t,n){this.$dropdownParent=u(n.get("dropdownParent")||document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on("open",function(){s._showDropdown(),s._attachPositioningHandler(t),s._bindContainerResultHandlers(t)}),t.on("close",function(){s._hideDropdown(),s._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t[0].classList.remove("select2"),t[0].classList.add("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=u("<span></span>"),e=e.call(this);return t.append(e),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._bindContainerResultHandlers=function(e,t){var n;this._containerResultsHandlersBound||(n=this,t.on("results:all",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:append",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:message",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("select",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("unselect",function(){n._positionDropdown(),n._resizeDropdown()}),this._containerResultsHandlersBound=!0)},e.prototype._attachPositioningHandler=function(e,t){var n=this,s="scroll.select2."+t.id,i="resize.select2."+t.id,r="orientationchange.select2."+t.id,t=this.$container.parents().filter(o.hasScroll);t.each(function(){o.StoreData(this,"select2-scroll-position",{x:u(this).scrollLeft(),y:u(this).scrollTop()})}),t.on(s,function(e){var t=o.GetData(this,"select2-scroll-position");u(this).scrollTop(t.y)}),u(window).on(s+" "+i+" "+r,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,s="resize.select2."+t.id,t="orientationchange.select2."+t.id;this.$container.parents().filter(o.hasScroll).off(n),u(window).off(n+" "+s+" "+t)},e.prototype._positionDropdown=function(){var e=u(window),t=this.$dropdown[0].classList.contains("select2-dropdown--above"),n=this.$dropdown[0].classList.contains("select2-dropdown--below"),s=null,i=this.$container.offset();i.bottom=i.top+this.$container.outerHeight(!1);var r={height:this.$container.outerHeight(!1)};r.top=i.top,r.bottom=i.top+r.height;var o=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=a<i.top-o,e=l>i.bottom+o,a={left:i.left,top:r.bottom},l=this.$dropdownParent;"static"===l.css("position")&&(l=l.offsetParent());i={top:0,left:0};(u.contains(document.body,l[0])||l[0].isConnected)&&(i=l.offset()),a.top-=i.top,a.left-=i.left,t||n||(s="below"),e||!c||t?!c&&e&&t&&(s="below"):s="above",("above"==s||t&&"below"!==s)&&(a.top=r.top-i.top-o),null!=s&&(this.$dropdown[0].classList.remove("select2-dropdown--below"),this.$dropdown[0].classList.remove("select2-dropdown--above"),this.$dropdown[0].classList.add("select2-dropdown--"+s),this.$container[0].classList.remove("select2-container--below"),this.$container[0].classList.remove("select2-container--above"),this.$container[0].classList.add("select2-container--"+s)),this.$dropdownContainer.css(a)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),u.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,s){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,s)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,s=0;s<t.length;s++){var i=t[s];i.children?n+=e(i.children):n++}return n}(t.data.results)<this.minimumResultsForSearch)&&e.call(this,t)},e}),u.define("select2/dropdown/selectOnClose",["../utils"],function(s){function e(){}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on("close",function(e){s._handleSelectOnClose(e)})},e.prototype._handleSelectOnClose=function(e,t){if(t&&null!=t.originalSelect2Event){var n=t.originalSelect2Event;if("select"===n._type||"unselect"===n._type)return}n=this.getHighlightedResults();n.length<1||(null!=(n=s.GetData(n[0],"data")).element&&n.element.selected||null==n.element&&n.selected||this.trigger("select",{data:n}))},e}),u.define("select2/dropdown/closeOnSelect",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on("select",function(e){s._selectTriggered(e)}),t.on("unselect",function(e){s._selectTriggered(e)})},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&(n.ctrlKey||n.metaKey)||this.trigger("close",{originalEvent:n,originalSelect2Event:t})},e}),u.define("select2/dropdown/dropdownCss",["../utils"],function(n){function e(){}return e.prototype.render=function(e){var t=e.call(this),e=this.options.get("dropdownCssClass")||"";return-1!==e.indexOf(":all:")&&(e=e.replace(":all:",""),n.copyNonInternalCssClasses(t[0],this.$element[0])),t.addClass(e),t},e}),u.define("select2/dropdown/tagsSearchHighlight",["../utils"],function(s){function e(){}return e.prototype.highlightFirstItem=function(e){var t=this.$results.find(".select2-results__option--selectable:not(.select2-results__option--selected)");if(0<t.length){var n=t.first(),t=s.GetData(n[0],"data").element;if(t&&t.getAttribute&&"true"===t.getAttribute("data-select2-tag"))return void n.trigger("mouseenter")}e.call(this)},e}),u.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,e="Please delete "+t+" character";return 1!=t&&(e+="s"),e},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"},removeAllItems:function(){return"Remove all items"},removeItem:function(){return"Remove item"},search:function(){return"Search"}}}),u.define("select2/defaults",["jquery","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/selectionCss","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./dropdown/dropdownCss","./dropdown/tagsSearchHighlight","./i18n/en"],function(l,r,o,a,c,u,d,p,h,f,g,t,m,y,v,_,b,$,w,x,A,D,S,E,O,C,L,T,q,I,e){function n(){this.reset()}return n.prototype.apply=function(e){var t;null==(e=l.extend(!0,{},this.defaults,e)).dataAdapter&&(null!=e.ajax?e.dataAdapter=v:null!=e.data?e.dataAdapter=y:e.dataAdapter=m,0<e.minimumInputLength&&(e.dataAdapter=f.Decorate(e.dataAdapter,$)),0<e.maximumInputLength&&(e.dataAdapter=f.Decorate(e.dataAdapter,w)),0<e.maximumSelectionLength&&(e.dataAdapter=f.Decorate(e.dataAdapter,x)),e.tags&&(e.dataAdapter=f.Decorate(e.dataAdapter,_)),null==e.tokenSeparators&&null==e.tokenizer||(e.dataAdapter=f.Decorate(e.dataAdapter,b))),null==e.resultsAdapter&&(e.resultsAdapter=r,null!=e.ajax&&(e.resultsAdapter=f.Decorate(e.resultsAdapter,E)),null!=e.placeholder&&(e.resultsAdapter=f.Decorate(e.resultsAdapter,S)),e.selectOnClose&&(e.resultsAdapter=f.Decorate(e.resultsAdapter,L)),e.tags&&(e.resultsAdapter=f.Decorate(e.resultsAdapter,I))),null==e.dropdownAdapter&&(e.multiple?e.dropdownAdapter=A:(t=f.Decorate(A,D),e.dropdownAdapter=t),0!==e.minimumResultsForSearch&&(e.dropdownAdapter=f.Decorate(e.dropdownAdapter,C)),e.closeOnSelect&&(e.dropdownAdapter=f.Decorate(e.dropdownAdapter,T)),null!=e.dropdownCssClass&&(e.dropdownAdapter=f.Decorate(e.dropdownAdapter,q)),e.dropdownAdapter=f.Decorate(e.dropdownAdapter,O)),null==e.selectionAdapter&&(e.multiple?e.selectionAdapter=a:e.selectionAdapter=o,null!=e.placeholder&&(e.selectionAdapter=f.Decorate(e.selectionAdapter,c)),e.allowClear&&(e.selectionAdapter=f.Decorate(e.selectionAdapter,u)),e.multiple&&(e.selectionAdapter=f.Decorate(e.selectionAdapter,d)),null!=e.selectionCssClass&&(e.selectionAdapter=f.Decorate(e.selectionAdapter,p)),e.selectionAdapter=f.Decorate(e.selectionAdapter,h)),e.language=this._resolveLanguage(e.language),e.language.push("en");for(var n=[],s=0;s<e.language.length;s++){var i=e.language[s];-1===n.indexOf(i)&&n.push(i)}return e.language=n,e.translations=this._processTranslations(e.language,e.debug),e},n.prototype.reset=function(){function a(e){return e.replace(/[^\u0000-\u007E]/g,function(e){return t[e]||e})}this.defaults={amdLanguageBase:"./i18n/",autocomplete:"off",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:f.escapeMarkup,language:{},matcher:function e(t,n){if(null==t.term||""===t.term.trim())return n;if(n.children&&0<n.children.length){for(var s=l.extend(!0,{},n),i=n.children.length-1;0<=i;i--)null==e(t,n.children[i])&&s.children.splice(i,1);return 0<s.children.length?s:e(t,s)}var r=a(n.text).toUpperCase(),o=a(t.term).toUpperCase();return-1<r.indexOf(o)?n:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,scrollAfterSelect:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},n.prototype.applyFromElement=function(e,t){var n=e.language,s=this.defaults.language,i=t.prop("lang"),t=t.closest("[lang]").prop("lang"),t=Array.prototype.concat.call(this._resolveLanguage(i),this._resolveLanguage(n),this._resolveLanguage(s),this._resolveLanguage(t));return e.language=t,e},n.prototype._resolveLanguage=function(e){if(!e)return[];if(l.isEmptyObject(e))return[];if(l.isPlainObject(e))return[e];for(var t,n=Array.isArray(e)?e:[e],s=[],i=0;i<n.length;i++)s.push(n[i]),"string"==typeof n[i]&&0<n[i].indexOf("-")&&(t=n[i].split("-")[0],s.push(t));return s},n.prototype._processTranslations=function(e,t){for(var n=new g,s=0;s<e.length;s++){var i=new g,r=e[s];if("string"==typeof r)try{i=g.loadPath(r)}catch(e){try{r=this.defaults.amdLanguageBase+r,i=g.loadPath(r)}catch(e){t&&window.console&&console.warn&&console.warn('Select2: The language file for "'+r+'" could not be automatically loaded. A fallback will be used instead.')}}else i=l.isPlainObject(r)?new g(r):r;n.extend(i)}return n},n.prototype.set=function(e,t){var n={};n[l.camelCase(e)]=t;n=f._convertData(n);l.extend(!0,this.defaults,n)},new n}),u.define("select2/options",["jquery","./defaults","./utils"],function(c,n,u){function e(e,t){this.options=e,null!=t&&this.fromElement(t),null!=t&&(this.options=n.applyFromElement(this.options,t)),this.options=n.apply(this.options)}return e.prototype.fromElement=function(e){var t=["select2"];null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.autocomplete&&e.prop("autocomplete")&&(this.options.autocomplete=e.prop("autocomplete")),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),u.GetData(e[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),u.StoreData(e[0],"data",u.GetData(e[0],"select2Tags")),u.StoreData(e[0],"tags",!0)),u.GetData(e[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),e.attr("ajax--url",u.GetData(e[0],"ajaxUrl")),u.StoreData(e[0],"ajax-Url",u.GetData(e[0],"ajaxUrl")));var n={};function s(e,t){return t.toUpperCase()}for(var i=0;i<e[0].attributes.length;i++){var r=e[0].attributes[i].name,o="data-";r.substr(0,o.length)==o&&(r=r.substring(o.length),o=u.GetData(e[0],r),n[r.replace(/-([a-z])/g,s)]=o)}c.fn.jquery&&"1."==c.fn.jquery.substr(0,2)&&e[0].dataset&&(n=c.extend(!0,{},e[0].dataset,n));var a,l=c.extend(!0,{},u.GetData(e[0]),n);for(a in l=u._convertData(l))-1<t.indexOf(a)||(c.isPlainObject(this.options[a])?c.extend(this.options[a],l[a]):this.options[a]=l[a]);return this},e.prototype.get=function(e){return this.options[e]},e.prototype.set=function(e,t){this.options[e]=t},e}),u.define("select2/core",["jquery","./options","./utils","./keys"],function(t,i,r,s){var o=function(e,t){null!=r.GetData(e[0],"select2")&&r.GetData(e[0],"select2").destroy(),this.$element=e,this.id=this._generateId(e),t=t||{},this.options=new i(t,e),o.__super__.constructor.call(this);var n=e.attr("tabindex")||0;r.StoreData(e[0],"old-tabindex",n),e.attr("tabindex","-1");t=this.options.get("dataAdapter");this.dataAdapter=new t(e,this.options);n=this.render();this._placeContainer(n);t=this.options.get("selectionAdapter");this.selection=new t(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,n);t=this.options.get("dropdownAdapter");this.dropdown=new t(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,n);n=this.options.get("resultsAdapter");this.results=new n(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var s=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){s.trigger("selection:update",{data:e})}),e[0].classList.add("select2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),r.StoreData(e[0],"select2",this),e.data("select2",this)};return r.Extend(o,r.Observable),o.prototype._generateId=function(e){return"select2-"+(null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+r.generateChars(2):r.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},o.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},o.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var s=this._resolveWidth(e,"style");return null!=s?s:this._resolveWidth(e,"element")}if("element"==t){s=e.outerWidth(!1);return s<=0?"auto":s+"px"}if("style"!=t)return"computedstyle"!=t?t:window.getComputedStyle(e[0]).width;e=e.attr("style");if("string"!=typeof e)return null;for(var i=e.split(";"),r=0,o=i.length;r<o;r+=1){var a=i[r].replace(/\s/g,"").match(n);if(null!==a&&1<=a.length)return a[1]}return null},o.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},o.prototype._registerDomEvents=function(){var t=this;this.$element.on("change.select2",function(){t.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})}),this.$element.on("focus.select2",function(e){t.trigger("focus",e)}),this._syncA=r.bind(this._syncAttributes,this),this._syncS=r.bind(this._syncSubtree,this),this._observer=new window.MutationObserver(function(e){t._syncA(),t._syncS(e)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})},o.prototype._registerDataEvents=function(){var n=this;this.dataAdapter.on("*",function(e,t){n.trigger(e,t)})},o.prototype._registerSelectionEvents=function(){var n=this,s=["toggle","focus"];this.selection.on("toggle",function(){n.toggleDropdown()}),this.selection.on("focus",function(e){n.focus(e)}),this.selection.on("*",function(e,t){-1===s.indexOf(e)&&n.trigger(e,t)})},o.prototype._registerDropdownEvents=function(){var n=this;this.dropdown.on("*",function(e,t){n.trigger(e,t)})},o.prototype._registerResultsEvents=function(){var n=this;this.results.on("*",function(e,t){n.trigger(e,t)})},o.prototype._registerEvents=function(){var n=this;this.on("open",function(){n.$container[0].classList.add("select2-container--open")}),this.on("close",function(){n.$container[0].classList.remove("select2-container--open")}),this.on("enable",function(){n.$container[0].classList.remove("select2-container--disabled")}),this.on("disable",function(){n.$container[0].classList.add("select2-container--disabled")}),this.on("blur",function(){n.$container[0].classList.remove("select2-container--focus")}),this.on("query",function(t){n.isOpen()||n.trigger("open",{}),this.dataAdapter.query(t,function(e){n.trigger("results:all",{data:e,query:t})})}),this.on("query:append",function(t){this.dataAdapter.query(t,function(e){n.trigger("results:append",{data:e,query:t})})}),this.on("keypress",function(e){var t=e.which;n.isOpen()?t===s.ESC||t===s.UP&&e.altKey?(n.close(e),e.preventDefault()):t===s.ENTER||t===s.TAB?(n.trigger("results:select",{}),e.preventDefault()):t===s.SPACE&&e.ctrlKey?(n.trigger("results:toggle",{}),e.preventDefault()):t===s.UP?(n.trigger("results:previous",{}),e.preventDefault()):t===s.DOWN&&(n.trigger("results:next",{}),e.preventDefault()):(t===s.ENTER||t===s.SPACE||t===s.DOWN&&e.altKey)&&(n.open(),e.preventDefault())})},o.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.isDisabled()?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},o.prototype._isChangeMutation=function(e){var t=this;if(e.addedNodes&&0<e.addedNodes.length){for(var n=0;n<e.addedNodes.length;n++)if(e.addedNodes[n].selected)return!0}else{if(e.removedNodes&&0<e.removedNodes.length)return!0;if(Array.isArray(e))return e.some(function(e){return t._isChangeMutation(e)})}return!1},o.prototype._syncSubtree=function(e){var e=this._isChangeMutation(e),t=this;e&&this.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})},o.prototype.trigger=function(e,t){var n=o.__super__.trigger,s={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===t&&(t={}),e in s){var i=s[e],s={prevented:!1,name:e,args:t};if(n.call(this,i,s),s.prevented)return void(t.prevented=!0)}n.call(this,e,t)},o.prototype.toggleDropdown=function(){this.isDisabled()||(this.isOpen()?this.close():this.open())},o.prototype.open=function(){this.isOpen()||this.isDisabled()||this.trigger("query",{})},o.prototype.close=function(e){this.isOpen()&&this.trigger("close",{originalEvent:e})},o.prototype.isEnabled=function(){return!this.isDisabled()},o.prototype.isDisabled=function(){return this.options.get("disabled")},o.prototype.isOpen=function(){return this.$container[0].classList.contains("select2-container--open")},o.prototype.hasFocus=function(){return this.$container[0].classList.contains("select2-container--focus")},o.prototype.focus=function(e){this.hasFocus()||(this.$container[0].classList.add("select2-container--focus"),this.trigger("focus",{}))},o.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.');e=!(e=null==e||0===e.length?[!0]:e)[0];this.$element.prop("disabled",e)},o.prototype.data=function(){this.options.get("debug")&&0<arguments.length&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var t=[];return this.dataAdapter.current(function(e){t=e}),t},o.prototype.val=function(e){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==e||0===e.length)return this.$element.val();e=e[0];Array.isArray(e)&&(e=e.map(function(e){return e.toString()})),this.$element.val(e).trigger("input").trigger("change")},o.prototype.destroy=function(){r.RemoveData(this.$container[0]),this.$container.remove(),this._observer.disconnect(),this._observer=null,this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",r.GetData(this.$element[0],"old-tabindex")),this.$element[0].classList.remove("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),r.RemoveData(this.$element[0]),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},o.prototype.render=function(){var e=t('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container[0].classList.add("select2-container--"+this.options.get("theme")),r.StoreData(e[0],"element",this.$element),e},o}),u.define("jquery-mousewheel",["jquery"],function(e){return e}),u.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],function(i,e,r,t,o){var a;return null==i.fn.select2&&(a=["open","close","destroy"],i.fn.select2=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var e=i.extend(!0,{},t);new r(i(this),e)}),this;if("string"!=typeof t)throw new Error("Invalid arguments for Select2: "+t);var n,s=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=o.GetData(this,"select2");null==e&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),n=e[t].apply(e,s)}),-1<a.indexOf(t)?this:n}),null==i.fn.select2.defaults&&(i.fn.select2.defaults=t),r}),{define:u.define,require:u.require});function b(e,t){return i.call(e,t)}function l(e,t){var n,s,i,r,o,a,l,c,u,d,p=t&&t.split("/"),h=y.map,f=h&&h["*"]||{};if(e){for(t=(e=e.split("/")).length-1,y.nodeIdCompat&&_.test(e[t])&&(e[t]=e[t].replace(_,"")),"."===e[0].charAt(0)&&p&&(e=p.slice(0,p.length-1).concat(e)),c=0;c<e.length;c++)"."===(d=e[c])?(e.splice(c,1),--c):".."===d&&(0===c||1===c&&".."===e[2]||".."===e[c-1]||0<c&&(e.splice(c-1,2),c-=2));e=e.join("/")}if((p||f)&&h){for(c=(n=e.split("/")).length;0<c;--c){if(s=n.slice(0,c).join("/"),p)for(u=p.length;0<u;--u)if(i=h[p.slice(0,u).join("/")],i=i&&i[s]){r=i,o=c;break}if(r)break;!a&&f&&f[s]&&(a=f[s],l=c)}!r&&a&&(r=a,o=l),r&&(n.splice(0,o,r),e=n.join("/"))}return e}function w(t,n){return function(){var e=a.call(arguments,0);return"string"!=typeof e[0]&&1===e.length&&e.push(null),o.apply(p,e.concat([t,n]))}}function x(e){var t;if(b(m,e)&&(t=m[e],delete m[e],v[e]=!0,r.apply(p,t)),!b(g,e)&&!b(v,e))throw new Error("No "+e);return g[e]}function c(e){var t,n=e?e.indexOf("!"):-1;return-1<n&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function A(e){return e?c(e):[]}var u=s.require("jquery.select2");return t.fn.select2.amd=s,u});;
/**
 * Swiper 8.4.5
 * Most modern mobile touch slider and framework with hardware accelerated transitions
 * https://swiperjs.com
 *
 * Copyright 2014-2022 Vladimir Kharlampidi
 *
 * Released under the MIT License
 *
 * Released on: November 21, 2022
 */
!function (e, t) {"object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).Swiper = t();}(this, (function () {
  "use strict";
  function e (e) {return null !== e && "object" == typeof e && "constructor" in e && e.constructor === Object;}
  function t (s, a) {void 0 === s && (s = {}), void 0 === a && (a = {}), Object.keys(a).forEach((i => {void 0 === s[i] ? s[i] = a[i] : e(a[i]) && e(s[i]) && Object.keys(a[i]).length > 0 && t(s[i], a[i]);}));}
  const s = {
    body: {},
    addEventListener () {},
    removeEventListener () {},
    activeElement: { blur () {}, nodeName: "" },
    querySelector: () => null,
    querySelectorAll: () => [],
    getElementById: () => null,
    createEvent: () => ({ initEvent () {} }),
    createElement: () => ({
      children: [],
      childNodes: [],
      style: {},
      setAttribute () {},
      getElementsByTagName: () => []
    }),
    createElementNS: () => ({}),
    importNode: () => null,
    location: { hash: "", host: "", hostname: "", href: "", origin: "", pathname: "", protocol: "", search: "" }
  };
  function a () {
    const e = "undefined" != typeof document ? document : {};
    return t(e, s), e;
  }
  const i = {
    document: s,
    navigator: { userAgent: "" },
    location: { hash: "", host: "", hostname: "", href: "", origin: "", pathname: "", protocol: "", search: "" },
    history: { replaceState () {}, pushState () {}, go () {}, back () {} },
    CustomEvent: function () {return this;},
    addEventListener () {},
    removeEventListener () {},
    getComputedStyle: () => ({ getPropertyValue: () => "" }),
    Image () {},
    Date () {},
    screen: {},
    setTimeout () {},
    clearTimeout () {},
    matchMedia: () => ({}),
    requestAnimationFrame: e => "undefined" == typeof setTimeout ? (e(), null) : setTimeout(e, 0),
    cancelAnimationFrame (e) {"undefined" != typeof setTimeout && clearTimeout(e);}
  };
  function r () {
    const e = "undefined" != typeof window ? window : {};
    return t(e, i), e;
  }
  class n extends Array {
    constructor (e) {
      "number" == typeof e ? super(e) : (super(...e || []), function (e) {
        const t = e.__proto__;
        Object.defineProperty(e, "__proto__", { get: () => t, set (e) {t.__proto__ = e;} });
      }(this));
    }
  }
  function l (e) {
    void 0 === e && (e = []);
    const t = [];
    return e.forEach((e => {Array.isArray(e) ? t.push(...l(e)) : t.push(e);})), t;
  }
  function o (e, t) {return Array.prototype.filter.call(e, t);}
  function d (e, t) {
    const s = r(), i = a();
    let l = [];
    if (!t && e instanceof n) return e;
    if (!e) return new n(l);
    if ("string" == typeof e) {
      const s = e.trim();
      if (s.indexOf("<") >= 0 && s.indexOf(">") >= 0) {
        let e = "div";
        0 === s.indexOf("<li") && (e = "ul"), 0 === s.indexOf("<tr") && (e = "tbody"), 0 !== s.indexOf("<td") && 0 !== s.indexOf("<th") || (e = "tr"), 0 === s.indexOf("<tbody") && (e = "table"), 0 === s.indexOf("<option") && (e = "select");
        const t = i.createElement(e);
        t.innerHTML = s;
        for (let e = 0; e < t.childNodes.length; e += 1) l.push(t.childNodes[e]);
      } else l = function (e, t) {
        if ("string" != typeof e) return [e];
        const s = [], a = t.querySelectorAll(e);
        for (let e = 0; e < a.length; e += 1) s.push(a[e]);
        return s;
      }(e.trim(), t || i);
    } else if (e.nodeType || e === s || e === i) l.push(e); else if (Array.isArray(e)) {
      if (e instanceof n) return e;
      l = e;
    }
    return new n(function (e) {
      const t = [];
      for (let s = 0; s < e.length; s += 1) -1 === t.indexOf(e[s]) && t.push(e[s]);
      return t;
    }(l));
  }
  d.fn = n.prototype;
  const c = {
    addClass: function () {
      for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++) t[s] = arguments[s];
      const a = l(t.map((e => e.split(" "))));
      return this.forEach((e => {e.classList.add(...a);})), this;
    },
    removeClass: function () {
      for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++) t[s] = arguments[s];
      const a = l(t.map((e => e.split(" "))));
      return this.forEach((e => {e.classList.remove(...a);})), this;
    },
    hasClass: function () {
      for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++) t[s] = arguments[s];
      const a = l(t.map((e => e.split(" "))));
      return o(this, (e => a.filter((t => e.classList.contains(t))).length > 0)).length > 0;
    },
    toggleClass: function () {
      for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++) t[s] = arguments[s];
      const a = l(t.map((e => e.split(" "))));
      this.forEach((e => {a.forEach((t => {e.classList.toggle(t);}));}));
    },
    attr: function (e, t) {
      if (1 === arguments.length && "string" == typeof e) return this[0] ? this[0].getAttribute(e) : void 0;
      for (let s = 0; s < this.length; s += 1) if (2 === arguments.length) this[s].setAttribute(e, t); else for (const t in e) this[s][t] = e[t], this[s].setAttribute(t, e[t]);
      return this;
    },
    removeAttr: function (e) {
      for (let t = 0; t < this.length; t += 1) this[t].removeAttribute(e);
      return this;
    },
    transform: function (e) {
      for (let t = 0; t < this.length; t += 1) this[t].style.transform = e;
      return this;
    },
    transition: function (e) {
      for (let t = 0; t < this.length; t += 1) this[t].style.transitionDuration = "string" != typeof e ? `${e}ms` : e;
      return this;
    },
    on: function () {
      for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++) t[s] = arguments[s];
      let [a, i, r, n] = t;
      function l (e) {
        const t = e.target;
        if (!t) return;
        const s = e.target.dom7EventData || [];
        if (s.indexOf(e) < 0 && s.unshift(e), d(t).is(i)) r.apply(t, s); else {
          const e = d(t).parents();
          for (let t = 0; t < e.length; t += 1) d(e[t]).is(i) && r.apply(e[t], s);
        }
      }
      function o (e) {
        const t = e && e.target && e.target.dom7EventData || [];
        t.indexOf(e) < 0 && t.unshift(e), r.apply(this, t);
      }
      "function" == typeof t[1] && ([a, r, n] = t, i = void 0), n || (n = !1);
      const c = a.split(" ");
      let p;
      for (let e = 0; e < this.length; e += 1) {
        const t = this[e];
        if (i) for (p = 0; p < c.length; p += 1) {
          const e = c[p];
          t.dom7LiveListeners || (t.dom7LiveListeners = {}), t.dom7LiveListeners[e] || (t.dom7LiveListeners[e] = []), t.dom7LiveListeners[e].push({
            listener: r,
            proxyListener: l
          }), t.addEventListener(e, l, n);
        } else for (p = 0; p < c.length; p += 1) {
          const e = c[p];
          t.dom7Listeners || (t.dom7Listeners = {}), t.dom7Listeners[e] || (t.dom7Listeners[e] = []), t.dom7Listeners[e].push({
            listener: r,
            proxyListener: o
          }), t.addEventListener(e, o, n);
        }
      }
      return this;
    },
    off: function () {
      for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++) t[s] = arguments[s];
      let [a, i, r, n] = t;
      "function" == typeof t[1] && ([a, r, n] = t, i = void 0), n || (n = !1);
      const l = a.split(" ");
      for (let e = 0; e < l.length; e += 1) {
        const t = l[e];
        for (let e = 0; e < this.length; e += 1) {
          const s = this[e];
          let a;
          if (!i && s.dom7Listeners ? a = s.dom7Listeners[t] : i && s.dom7LiveListeners && (a = s.dom7LiveListeners[t]), a && a.length) for (let e = a.length - 1; e >= 0; e -= 1) {
            const i = a[e];
            r && i.listener === r || r && i.listener && i.listener.dom7proxy && i.listener.dom7proxy === r ? (s.removeEventListener(t, i.proxyListener, n), a.splice(e, 1)) : r || (s.removeEventListener(t, i.proxyListener, n), a.splice(e, 1));
          }
        }
      }
      return this;
    },
    trigger: function () {
      const e = r();
      for (var t = arguments.length, s = new Array(t), a = 0; a < t; a++) s[a] = arguments[a];
      const i = s[0].split(" "), n = s[1];
      for (let t = 0; t < i.length; t += 1) {
        const a = i[t];
        for (let t = 0; t < this.length; t += 1) {
          const i = this[t];
          if (e.CustomEvent) {
            const t = new e.CustomEvent(a, { detail: n, bubbles: !0, cancelable: !0 });
            i.dom7EventData = s.filter(((e, t) => t > 0)), i.dispatchEvent(t), i.dom7EventData = [], delete i.dom7EventData;
          }
        }
      }
      return this;
    },
    transitionEnd: function (e) {
      const t = this;
      return e && t.on("transitionend", (function s (a) {a.target === this && (e.call(this, a), t.off("transitionend", s));})), this;
    },
    outerWidth: function (e) {
      if (this.length > 0) {
        if (e) {
          const e = this.styles();
          return this[0].offsetWidth + parseFloat(e.getPropertyValue("margin-right")) + parseFloat(e.getPropertyValue("margin-left"));
        }
        return this[0].offsetWidth;
      }
      return null;
    },
    outerHeight: function (e) {
      if (this.length > 0) {
        if (e) {
          const e = this.styles();
          return this[0].offsetHeight + parseFloat(e.getPropertyValue("margin-top")) + parseFloat(e.getPropertyValue("margin-bottom"));
        }
        return this[0].offsetHeight;
      }
      return null;
    },
    styles: function () {
      const e = r();
      return this[0] ? e.getComputedStyle(this[0], null) : {};
    },
    offset: function () {
      if (this.length > 0) {
        const e = r(), t = a(), s = this[0], i = s.getBoundingClientRect(), n = t.body,
          l = s.clientTop || n.clientTop || 0, o = s.clientLeft || n.clientLeft || 0,
          d = s === e ? e.scrollY : s.scrollTop, c = s === e ? e.scrollX : s.scrollLeft;
        return { top: i.top + d - l, left: i.left + c - o };
      }
      return null;
    },
    css: function (e, t) {
      const s = r();
      let a;
      if (1 === arguments.length) {
        if ("string" != typeof e) {
          for (a = 0; a < this.length; a += 1) for (const t in e) this[a].style[t] = e[t];
          return this;
        }
        if (this[0]) return s.getComputedStyle(this[0], null).getPropertyValue(e);
      }
      if (2 === arguments.length && "string" == typeof e) {
        for (a = 0; a < this.length; a += 1) this[a].style[e] = t;
        return this;
      }
      return this;
    },
    each: function (e) {return e ? (this.forEach(((t, s) => {e.apply(t, [t, s]);})), this) : this;},
    html: function (e) {
      if (void 0 === e) return this[0] ? this[0].innerHTML : null;
      for (let t = 0; t < this.length; t += 1) this[t].innerHTML = e;
      return this;
    },
    text: function (e) {
      if (void 0 === e) return this[0] ? this[0].textContent.trim() : null;
      for (let t = 0; t < this.length; t += 1) this[t].textContent = e;
      return this;
    },
    is: function (e) {
      const t = r(), s = a(), i = this[0];
      let l, o;
      if (!i || void 0 === e) return !1;
      if ("string" == typeof e) {
        if (i.matches) return i.matches(e);
        if (i.webkitMatchesSelector) return i.webkitMatchesSelector(e);
        if (i.msMatchesSelector) return i.msMatchesSelector(e);
        for (l = d(e), o = 0; o < l.length; o += 1) if (l[o] === i) return !0;
        return !1;
      }
      if (e === s) return i === s;
      if (e === t) return i === t;
      if (e.nodeType || e instanceof n) {
        for (l = e.nodeType ? [e] : e, o = 0; o < l.length; o += 1) if (l[o] === i) return !0;
        return !1;
      }
      return !1;
    },
    index: function () {
      let e, t = this[0];
      if (t) {
        for (e = 0; null !== (t = t.previousSibling);) 1 === t.nodeType && (e += 1);
        return e;
      }
    },
    eq: function (e) {
      if (void 0 === e) return this;
      const t = this.length;
      if (e > t - 1) return d([]);
      if (e < 0) {
        const s = t + e;
        return d(s < 0 ? [] : [this[s]]);
      }
      return d([this[e]]);
    },
    append: function () {
      let e;
      const t = a();
      for (let s = 0; s < arguments.length; s += 1) {
        e = s < 0 || arguments.length <= s ? void 0 : arguments[s];
        for (let s = 0; s < this.length; s += 1) if ("string" == typeof e) {
          const a = t.createElement("div");
          for (a.innerHTML = e; a.firstChild;) this[s].appendChild(a.firstChild);
        } else if (e instanceof n) for (let t = 0; t < e.length; t += 1) this[s].appendChild(e[t]); else this[s].appendChild(e);
      }
      return this;
    },
    prepend: function (e) {
      const t = a();
      let s, i;
      for (s = 0; s < this.length; s += 1) if ("string" == typeof e) {
        const a = t.createElement("div");
        for (a.innerHTML = e, i = a.childNodes.length - 1; i >= 0; i -= 1) this[s].insertBefore(a.childNodes[i], this[s].childNodes[0]);
      } else if (e instanceof n) for (i = 0; i < e.length; i += 1) this[s].insertBefore(e[i], this[s].childNodes[0]); else this[s].insertBefore(e, this[s].childNodes[0]);
      return this;
    },
    next: function (e) {return this.length > 0 ? e ? this[0].nextElementSibling && d(this[0].nextElementSibling).is(e) ? d([this[0].nextElementSibling]) : d([]) : this[0].nextElementSibling ? d([this[0].nextElementSibling]) : d([]) : d([]);},
    nextAll: function (e) {
      const t = [];
      let s = this[0];
      if (!s) return d([]);
      for (; s.nextElementSibling;) {
        const a = s.nextElementSibling;
        e ? d(a).is(e) && t.push(a) : t.push(a), s = a;
      }
      return d(t);
    },
    prev: function (e) {
      if (this.length > 0) {
        const t = this[0];
        return e ? t.previousElementSibling && d(t.previousElementSibling).is(e) ? d([t.previousElementSibling]) : d([]) : t.previousElementSibling ? d([t.previousElementSibling]) : d([]);
      }
      return d([]);
    },
    prevAll: function (e) {
      const t = [];
      let s = this[0];
      if (!s) return d([]);
      for (; s.previousElementSibling;) {
        const a = s.previousElementSibling;
        e ? d(a).is(e) && t.push(a) : t.push(a), s = a;
      }
      return d(t);
    },
    parent: function (e) {
      const t = [];
      for (let s = 0; s < this.length; s += 1) null !== this[s].parentNode && (e ? d(this[s].parentNode).is(e) && t.push(this[s].parentNode) : t.push(this[s].parentNode));
      return d(t);
    },
    parents: function (e) {
      const t = [];
      for (let s = 0; s < this.length; s += 1) {
        let a = this[s].parentNode;
        for (; a;) e ? d(a).is(e) && t.push(a) : t.push(a), a = a.parentNode;
      }
      return d(t);
    },
    closest: function (e) {
      let t = this;
      return void 0 === e ? d([]) : (t.is(e) || (t = t.parents(e).eq(0)), t);
    },
    find: function (e) {
      const t = [];
      for (let s = 0; s < this.length; s += 1) {
        const a = this[s].querySelectorAll(e);
        for (let e = 0; e < a.length; e += 1) t.push(a[e]);
      }
      return d(t);
    },
    children: function (e) {
      const t = [];
      for (let s = 0; s < this.length; s += 1) {
        const a = this[s].children;
        for (let s = 0; s < a.length; s += 1) e && !d(a[s]).is(e) || t.push(a[s]);
      }
      return d(t);
    },
    filter: function (e) {return d(o(this, e));},
    remove: function () {
      for (let e = 0; e < this.length; e += 1) this[e].parentNode && this[e].parentNode.removeChild(this[e]);
      return this;
    }
  };
  function p (e, t) {return void 0 === t && (t = 0), setTimeout(e, t);}
  function u () {return Date.now();}
  function h (e, t) {
    void 0 === t && (t = "x");
    const s = r();
    let a, i, n;
    const l = function (e) {
      const t = r();
      let s;
      return t.getComputedStyle && (s = t.getComputedStyle(e, null)), !s && e.currentStyle && (s = e.currentStyle), s || (s = e.style), s;
    }(e);
    return s.WebKitCSSMatrix ? (i = l.transform || l.webkitTransform, i.split(",").length > 6 && (i = i.split(", ").map((e => e.replace(",", "."))).join(", ")), n = new s.WebKitCSSMatrix("none" === i ? "" : i)) : (n = l.MozTransform || l.OTransform || l.MsTransform || l.msTransform || l.transform || l.getPropertyValue("transform").replace("translate(", "matrix(1, 0, 0, 1,"), a = n.toString().split(",")), "x" === t && (i = s.WebKitCSSMatrix ? n.m41 : 16 === a.length ? parseFloat(a[12]) : parseFloat(a[4])), "y" === t && (i = s.WebKitCSSMatrix ? n.m42 : 16 === a.length ? parseFloat(a[13]) : parseFloat(a[5])), i || 0;
  }
  function m (e) {return "object" == typeof e && null !== e && e.constructor && "Object" === Object.prototype.toString.call(e).slice(8, -1);}
  function f (e) {return "undefined" != typeof window && void 0 !== window.HTMLElement ? e instanceof HTMLElement : e && (1 === e.nodeType || 11 === e.nodeType);}
  function g () {
    const e = Object(arguments.length <= 0 ? void 0 : arguments[0]), t = ["__proto__", "constructor", "prototype"];
    for (let s = 1; s < arguments.length; s += 1) {
      const a = s < 0 || arguments.length <= s ? void 0 : arguments[s];
      if (null != a && !f(a)) {
        const s = Object.keys(Object(a)).filter((e => t.indexOf(e) < 0));
        for (let t = 0, i = s.length; t < i; t += 1) {
          const i = s[t], r = Object.getOwnPropertyDescriptor(a, i);
          void 0 !== r && r.enumerable && (m(e[i]) && m(a[i]) ? a[i].__swiper__ ? e[i] = a[i] : g(e[i], a[i]) : !m(e[i]) && m(a[i]) ? (e[i] = {}, a[i].__swiper__ ? e[i] = a[i] : g(e[i], a[i])) : e[i] = a[i]);
        }
      }
    }
    return e;
  }
  function v (e, t, s) {e.style.setProperty(t, s);}
  function w (e) {
    let { swiper: t, targetPosition: s, side: a } = e;
    const i = r(), n = -t.translate;
    let l, o = null;
    const d = t.params.speed;
    t.wrapperEl.style.scrollSnapType = "none", i.cancelAnimationFrame(t.cssModeFrameID);
    const c = s > n ? "next" : "prev", p = (e, t) => "next" === c && e >= t || "prev" === c && e <= t, u = () => {
      l = (new Date).getTime(), null === o && (o = l);
      const e = Math.max(Math.min((l - o) / d, 1), 0), r = .5 - Math.cos(e * Math.PI) / 2;
      let c = n + r * (s - n);
      if (p(c, s) && (c = s), t.wrapperEl.scrollTo({ [a]: c }), p(c, s)) return t.wrapperEl.style.overflow = "hidden", t.wrapperEl.style.scrollSnapType = "", setTimeout((() => {t.wrapperEl.style.overflow = "", t.wrapperEl.scrollTo({ [a]: c });})), void i.cancelAnimationFrame(t.cssModeFrameID);
      t.cssModeFrameID = i.requestAnimationFrame(u);
    };
    u();
  }
  let b, x, y;
  function E () {
    return b || (b = function () {
      const e = r(), t = a();
      return {
        smoothScroll: t.documentElement && "scrollBehavior" in t.documentElement.style,
        touch: !!("ontouchstart" in e || e.DocumentTouch && t instanceof e.DocumentTouch),
        passiveListener: function () {
          let t = !1;
          try {
            const s = Object.defineProperty({}, "passive", { get () {t = !0;} });
            e.addEventListener("testPassiveListener", null, s);
          } catch (e) {}
          return t;
        }(),
        gestures: "ongesturestart" in e
      };
    }()), b;
  }
  function C (e) {
    return void 0 === e && (e = {}), x || (x = function (e) {
      let { userAgent: t } = void 0 === e ? {} : e;
      const s = E(), a = r(), i = a.navigator.platform, n = t || a.navigator.userAgent, l = { ios: !1, android: !1 },
        o = a.screen.width, d = a.screen.height, c = n.match(/(Android);?[\s\/]+([\d.]+)?/);
      let p = n.match(/(iPad).*OS\s([\d_]+)/);
      const u = n.match(/(iPod)(.*OS\s([\d_]+))?/), h = !p && n.match(/(iPhone\sOS|iOS)\s([\d_]+)/), m = "Win32" === i;
      let f = "MacIntel" === i;
      return !p && f && s.touch && ["1024x1366", "1366x1024", "834x1194", "1194x834", "834x1112", "1112x834", "768x1024", "1024x768", "820x1180", "1180x820", "810x1080", "1080x810"].indexOf(`${o}x${d}`) >= 0 && (p = n.match(/(Version)\/([\d.]+)/), p || (p = [0, 1, "13_0_0"]), f = !1), c && !m && (l.os = "android", l.android = !0), (p || h || u) && (l.os = "ios", l.ios = !0), l;
    }(e)), x;
  }
  function T () {
    return y || (y = function () {
      const e = r();
      return {
        isSafari: function () {
          const t = e.navigator.userAgent.toLowerCase();
          return t.indexOf("safari") >= 0 && t.indexOf("chrome") < 0 && t.indexOf("android") < 0;
        }(), isWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(e.navigator.userAgent)
      };
    }()), y;
  }
  Object.keys(c).forEach((e => {Object.defineProperty(d.fn, e, { value: c[e], writable: !0 });}));
  var $ = {
    on (e, t, s) {
      const a = this;
      if (!a.eventsListeners || a.destroyed) return a;
      if ("function" != typeof t) return a;
      const i = s ? "unshift" : "push";
      return e.split(" ").forEach((e => {a.eventsListeners[e] || (a.eventsListeners[e] = []), a.eventsListeners[e][i](t);})), a;
    }, once (e, t, s) {
      const a = this;
      if (!a.eventsListeners || a.destroyed) return a;
      if ("function" != typeof t) return a;
      function i () {
        a.off(e, i), i.__emitterProxy && delete i.__emitterProxy;
        for (var s = arguments.length, r = new Array(s), n = 0; n < s; n++) r[n] = arguments[n];
        t.apply(a, r);
      }
      return i.__emitterProxy = t, a.on(e, i, s);
    }, onAny (e, t) {
      const s = this;
      if (!s.eventsListeners || s.destroyed) return s;
      if ("function" != typeof e) return s;
      const a = t ? "unshift" : "push";
      return s.eventsAnyListeners.indexOf(e) < 0 && s.eventsAnyListeners[a](e), s;
    }, offAny (e) {
      const t = this;
      if (!t.eventsListeners || t.destroyed) return t;
      if (!t.eventsAnyListeners) return t;
      const s = t.eventsAnyListeners.indexOf(e);
      return s >= 0 && t.eventsAnyListeners.splice(s, 1), t;
    }, off (e, t) {
      const s = this;
      return !s.eventsListeners || s.destroyed ? s : s.eventsListeners ? (e.split(" ").forEach((e => {void 0 === t ? s.eventsListeners[e] = [] : s.eventsListeners[e] && s.eventsListeners[e].forEach(((a, i) => {(a === t || a.__emitterProxy && a.__emitterProxy === t) && s.eventsListeners[e].splice(i, 1);}));})), s) : s;
    }, emit () {
      const e = this;
      if (!e.eventsListeners || e.destroyed) return e;
      if (!e.eventsListeners) return e;
      let t, s, a;
      for (var i = arguments.length, r = new Array(i), n = 0; n < i; n++) r[n] = arguments[n];
      "string" == typeof r[0] || Array.isArray(r[0]) ? (t = r[0], s = r.slice(1, r.length), a = e) : (t = r[0].events, s = r[0].data, a = r[0].context || e), s.unshift(a);
      return (Array.isArray(t) ? t : t.split(" ")).forEach((t => {e.eventsAnyListeners && e.eventsAnyListeners.length && e.eventsAnyListeners.forEach((e => {e.apply(a, [t, ...s]);})), e.eventsListeners && e.eventsListeners[t] && e.eventsListeners[t].forEach((e => {e.apply(a, s);}));})), e;
    }
  };
  var S = {
    updateSize: function () {
      const e = this;
      let t, s;
      const a = e.$el;
      t = void 0 !== e.params.width && null !== e.params.width ? e.params.width : a[0].clientWidth, s = void 0 !== e.params.height && null !== e.params.height ? e.params.height : a[0].clientHeight, 0 === t && e.isHorizontal() || 0 === s && e.isVertical() || (t = t - parseInt(a.css("padding-left") || 0, 10) - parseInt(a.css("padding-right") || 0, 10), s = s - parseInt(a.css("padding-top") || 0, 10) - parseInt(a.css("padding-bottom") || 0, 10), Number.isNaN(t) && (t = 0), Number.isNaN(s) && (s = 0), Object.assign(e, {
        width: t,
        height: s,
        size: e.isHorizontal() ? t : s
      }));
    },
    updateSlides: function () {
      const e = this;
      function t (t) {
        return e.isHorizontal() ? t : {
          width: "height",
          "margin-top": "margin-left",
          "margin-bottom ": "margin-right",
          "margin-left": "margin-top",
          "margin-right": "margin-bottom",
          "padding-left": "padding-top",
          "padding-right": "padding-bottom",
          marginRight: "marginBottom"
        }[t];
      }
      function s (e, s) {return parseFloat(e.getPropertyValue(t(s)) || 0);}
      const a = e.params, { $wrapperEl: i, size: r, rtlTranslate: n, wrongRTL: l } = e,
        o = e.virtual && a.virtual.enabled, d = o ? e.virtual.slides.length : e.slides.length,
        c = i.children(`.${e.params.slideClass}`), p = o ? e.virtual.slides.length : c.length;
      let u = [];
      const h = [], m = [];
      let f = a.slidesOffsetBefore;
      "function" == typeof f && (f = a.slidesOffsetBefore.call(e));
      let g = a.slidesOffsetAfter;
      "function" == typeof g && (g = a.slidesOffsetAfter.call(e));
      const w = e.snapGrid.length, b = e.slidesGrid.length;
      let x = a.spaceBetween, y = -f, E = 0, C = 0;
      if (void 0 === r) return;
      "string" == typeof x && x.indexOf("%") >= 0 && (x = parseFloat(x.replace("%", "")) / 100 * r), e.virtualSize = -x, n ? c.css({
        marginLeft: "",
        marginBottom: "",
        marginTop: ""
      }) : c.css({
        marginRight: "",
        marginBottom: "",
        marginTop: ""
      }), a.centeredSlides && a.cssMode && (v(e.wrapperEl, "--swiper-centered-offset-before", ""), v(e.wrapperEl, "--swiper-centered-offset-after", ""));
      const T = a.grid && a.grid.rows > 1 && e.grid;
      let $;
      T && e.grid.initSlides(p);
      const S = "auto" === a.slidesPerView && a.breakpoints && Object.keys(a.breakpoints).filter((e => void 0 !== a.breakpoints[e].slidesPerView)).length > 0;
      for (let i = 0; i < p; i += 1) {
        $ = 0;
        const n = c.eq(i);
        if (T && e.grid.updateSlide(i, n, p, t), "none" !== n.css("display")) {
          if ("auto" === a.slidesPerView) {
            S && (c[i].style[t("width")] = "");
            const r = getComputedStyle(n[0]), l = n[0].style.transform, o = n[0].style.webkitTransform;
            if (l && (n[0].style.transform = "none"), o && (n[0].style.webkitTransform = "none"), a.roundLengths) $ = e.isHorizontal() ? n.outerWidth(!0) : n.outerHeight(!0); else {
              const e = s(r, "width"), t = s(r, "padding-left"), a = s(r, "padding-right"), i = s(r, "margin-left"),
                l = s(r, "margin-right"), o = r.getPropertyValue("box-sizing");
              if (o && "border-box" === o) $ = e + i + l; else {
                const { clientWidth: s, offsetWidth: r } = n[0];
                $ = e + t + a + i + l + (r - s);
              }
            }
            l && (n[0].style.transform = l), o && (n[0].style.webkitTransform = o), a.roundLengths && ($ = Math.floor($));
          } else $ = (r - (a.slidesPerView - 1) * x) / a.slidesPerView, a.roundLengths && ($ = Math.floor($)), c[i] && (c[i].style[t("width")] = `${$}px`);
          c[i] && (c[i].swiperSlideSize = $), m.push($), a.centeredSlides ? (y = y + $ / 2 + E / 2 + x, 0 === E && 0 !== i && (y = y - r / 2 - x), 0 === i && (y = y - r / 2 - x), Math.abs(y) < .001 && (y = 0), a.roundLengths && (y = Math.floor(y)), C % a.slidesPerGroup == 0 && u.push(y), h.push(y)) : (a.roundLengths && (y = Math.floor(y)), (C - Math.min(e.params.slidesPerGroupSkip, C)) % e.params.slidesPerGroup == 0 && u.push(y), h.push(y), y = y + $ + x), e.virtualSize += $ + x, E = $, C += 1;
        }
      }
      if (e.virtualSize = Math.max(e.virtualSize, r) + g, n && l && ("slide" === a.effect || "coverflow" === a.effect) && i.css({ width: `${e.virtualSize + a.spaceBetween}px` }), a.setWrapperSize && i.css({ [t("width")]: `${e.virtualSize + a.spaceBetween}px` }), T && e.grid.updateWrapperSize($, u, t), !a.centeredSlides) {
        const t = [];
        for (let s = 0; s < u.length; s += 1) {
          let i = u[s];
          a.roundLengths && (i = Math.floor(i)), u[s] <= e.virtualSize - r && t.push(i);
        }
        u = t, Math.floor(e.virtualSize - r) - Math.floor(u[u.length - 1]) > 1 && u.push(e.virtualSize - r);
      }
      if (0 === u.length && (u = [0]), 0 !== a.spaceBetween) {
        const s = e.isHorizontal() && n ? "marginLeft" : t("marginRight");
        c.filter(((e, t) => !a.cssMode || t !== c.length - 1)).css({ [s]: `${x}px` });
      }
      if (a.centeredSlides && a.centeredSlidesBounds) {
        let e = 0;
        m.forEach((t => {e += t + (a.spaceBetween ? a.spaceBetween : 0);})), e -= a.spaceBetween;
        const t = e - r;
        u = u.map((e => e < 0 ? -f : e > t ? t + g : e));
      }
      if (a.centerInsufficientSlides) {
        let e = 0;
        if (m.forEach((t => {e += t + (a.spaceBetween ? a.spaceBetween : 0);})), e -= a.spaceBetween, e < r) {
          const t = (r - e) / 2;
          u.forEach(((e, s) => {u[s] = e - t;})), h.forEach(((e, s) => {h[s] = e + t;}));
        }
      }
      if (Object.assign(e, {
        slides: c,
        snapGrid: u,
        slidesGrid: h,
        slidesSizesGrid: m
      }), a.centeredSlides && a.cssMode && !a.centeredSlidesBounds) {
        v(e.wrapperEl, "--swiper-centered-offset-before", -u[0] + "px"), v(e.wrapperEl, "--swiper-centered-offset-after", e.size / 2 - m[m.length - 1] / 2 + "px");
        const t = -e.snapGrid[0], s = -e.slidesGrid[0];
        e.snapGrid = e.snapGrid.map((e => e + t)), e.slidesGrid = e.slidesGrid.map((e => e + s));
      }
      if (p !== d && e.emit("slidesLengthChange"), u.length !== w && (e.params.watchOverflow && e.checkOverflow(), e.emit("snapGridLengthChange")), h.length !== b && e.emit("slidesGridLengthChange"), a.watchSlidesProgress && e.updateSlidesOffset(), !(o || a.cssMode || "slide" !== a.effect && "fade" !== a.effect)) {
        const t = `${a.containerModifierClass}backface-hidden`, s = e.$el.hasClass(t);
        p <= a.maxBackfaceHiddenSlides ? s || e.$el.addClass(t) : s && e.$el.removeClass(t);
      }
    },
    updateAutoHeight: function (e) {
      const t = this, s = [], a = t.virtual && t.params.virtual.enabled;
      let i, r = 0;
      "number" == typeof e ? t.setTransition(e) : !0 === e && t.setTransition(t.params.speed);
      const n = e => a ? t.slides.filter((t => parseInt(t.getAttribute("data-swiper-slide-index"), 10) === e))[0] : t.slides.eq(e)[0];
      if ("auto" !== t.params.slidesPerView && t.params.slidesPerView > 1) if (t.params.centeredSlides) (t.visibleSlides || d([])).each((e => {s.push(e);})); else for (i = 0; i < Math.ceil(t.params.slidesPerView); i += 1) {
        const e = t.activeIndex + i;
        if (e > t.slides.length && !a) break;
        s.push(n(e));
      } else s.push(n(t.activeIndex));
      for (i = 0; i < s.length; i += 1) if (void 0 !== s[i]) {
        const e = s[i].offsetHeight;
        r = e > r ? e : r;
      }
      (r || 0 === r) && t.$wrapperEl.css("height", `${r}px`);
    },
    updateSlidesOffset: function () {
      const e = this, t = e.slides;
      for (let s = 0; s < t.length; s += 1) t[s].swiperSlideOffset = e.isHorizontal() ? t[s].offsetLeft : t[s].offsetTop;
    },
    updateSlidesProgress: function (e) {
      void 0 === e && (e = this && this.translate || 0);
      const t = this, s = t.params, { slides: a, rtlTranslate: i, snapGrid: r } = t;
      if (0 === a.length) return;
      void 0 === a[0].swiperSlideOffset && t.updateSlidesOffset();
      let n = -e;
      i && (n = e), a.removeClass(s.slideVisibleClass), t.visibleSlidesIndexes = [], t.visibleSlides = [];
      for (let e = 0; e < a.length; e += 1) {
        const l = a[e];
        let o = l.swiperSlideOffset;
        s.cssMode && s.centeredSlides && (o -= a[0].swiperSlideOffset);
        const d = (n + (s.centeredSlides ? t.minTranslate() : 0) - o) / (l.swiperSlideSize + s.spaceBetween),
          c = (n - r[0] + (s.centeredSlides ? t.minTranslate() : 0) - o) / (l.swiperSlideSize + s.spaceBetween),
          p = -(n - o), u = p + t.slidesSizesGrid[e];
        (p >= 0 && p < t.size - 1 || u > 1 && u <= t.size || p <= 0 && u >= t.size) && (t.visibleSlides.push(l), t.visibleSlidesIndexes.push(e), a.eq(e).addClass(s.slideVisibleClass)), l.progress = i ? -d : d, l.originalProgress = i ? -c : c;
      }
      t.visibleSlides = d(t.visibleSlides);
    },
    updateProgress: function (e) {
      const t = this;
      if (void 0 === e) {
        const s = t.rtlTranslate ? -1 : 1;
        e = t && t.translate && t.translate * s || 0;
      }
      const s = t.params, a = t.maxTranslate() - t.minTranslate();
      let { progress: i, isBeginning: r, isEnd: n } = t;
      const l = r, o = n;
      0 === a ? (i = 0, r = !0, n = !0) : (i = (e - t.minTranslate()) / a, r = i <= 0, n = i >= 1), Object.assign(t, {
        progress: i,
        isBeginning: r,
        isEnd: n
      }), (s.watchSlidesProgress || s.centeredSlides && s.autoHeight) && t.updateSlidesProgress(e), r && !l && t.emit("reachBeginning toEdge"), n && !o && t.emit("reachEnd toEdge"), (l && !r || o && !n) && t.emit("fromEdge"), t.emit("progress", i);
    },
    updateSlidesClasses: function () {
      const e = this, { slides: t, params: s, $wrapperEl: a, activeIndex: i, realIndex: r } = e,
        n = e.virtual && s.virtual.enabled;
      let l;
      t.removeClass(`${s.slideActiveClass} ${s.slideNextClass} ${s.slidePrevClass} ${s.slideDuplicateActiveClass} ${s.slideDuplicateNextClass} ${s.slideDuplicatePrevClass}`), l = n ? e.$wrapperEl.find(`.${s.slideClass}[data-swiper-slide-index="${i}"]`) : t.eq(i), l.addClass(s.slideActiveClass), s.loop && (l.hasClass(s.slideDuplicateClass) ? a.children(`.${s.slideClass}:not(.${s.slideDuplicateClass})[data-swiper-slide-index="${r}"]`).addClass(s.slideDuplicateActiveClass) : a.children(`.${s.slideClass}.${s.slideDuplicateClass}[data-swiper-slide-index="${r}"]`).addClass(s.slideDuplicateActiveClass));
      let o = l.nextAll(`.${s.slideClass}`).eq(0).addClass(s.slideNextClass);
      s.loop && 0 === o.length && (o = t.eq(0), o.addClass(s.slideNextClass));
      let d = l.prevAll(`.${s.slideClass}`).eq(0).addClass(s.slidePrevClass);
      s.loop && 0 === d.length && (d = t.eq(-1), d.addClass(s.slidePrevClass)), s.loop && (o.hasClass(s.slideDuplicateClass) ? a.children(`.${s.slideClass}:not(.${s.slideDuplicateClass})[data-swiper-slide-index="${o.attr("data-swiper-slide-index")}"]`).addClass(s.slideDuplicateNextClass) : a.children(`.${s.slideClass}.${s.slideDuplicateClass}[data-swiper-slide-index="${o.attr("data-swiper-slide-index")}"]`).addClass(s.slideDuplicateNextClass), d.hasClass(s.slideDuplicateClass) ? a.children(`.${s.slideClass}:not(.${s.slideDuplicateClass})[data-swiper-slide-index="${d.attr("data-swiper-slide-index")}"]`).addClass(s.slideDuplicatePrevClass) : a.children(`.${s.slideClass}.${s.slideDuplicateClass}[data-swiper-slide-index="${d.attr("data-swiper-slide-index")}"]`).addClass(s.slideDuplicatePrevClass)), e.emitSlidesClasses();
    },
    updateActiveIndex: function (e) {
      const t = this,
        s = t.rtlTranslate ? t.translate : -t.translate, { slidesGrid: a, snapGrid: i, params: r, activeIndex: n, realIndex: l, snapIndex: o } = t;
      let d, c = e;
      if (void 0 === c) {
        for (let e = 0; e < a.length; e += 1) void 0 !== a[e + 1] ? s >= a[e] && s < a[e + 1] - (a[e + 1] - a[e]) / 2 ? c = e : s >= a[e] && s < a[e + 1] && (c = e + 1) : s >= a[e] && (c = e);
        r.normalizeSlideIndex && (c < 0 || void 0 === c) && (c = 0);
      }
      if (i.indexOf(s) >= 0) d = i.indexOf(s); else {
        const e = Math.min(r.slidesPerGroupSkip, c);
        d = e + Math.floor((c - e) / r.slidesPerGroup);
      }
      if (d >= i.length && (d = i.length - 1), c === n) return void (d !== o && (t.snapIndex = d, t.emit("snapIndexChange")));
      const p = parseInt(t.slides.eq(c).attr("data-swiper-slide-index") || c, 10);
      Object.assign(t, {
        snapIndex: d,
        realIndex: p,
        previousIndex: n,
        activeIndex: c
      }), t.emit("activeIndexChange"), t.emit("snapIndexChange"), l !== p && t.emit("realIndexChange"), (t.initialized || t.params.runCallbacksOnInit) && t.emit("slideChange");
    },
    updateClickedSlide: function (e) {
      const t = this, s = t.params, a = d(e).closest(`.${s.slideClass}`)[0];
      let i, r = !1;
      if (a) for (let e = 0; e < t.slides.length; e += 1) if (t.slides[e] === a) {
        r = !0, i = e;
        break;
      }
      if (!a || !r) return t.clickedSlide = void 0, void (t.clickedIndex = void 0);
      t.clickedSlide = a, t.virtual && t.params.virtual.enabled ? t.clickedIndex = parseInt(d(a).attr("data-swiper-slide-index"), 10) : t.clickedIndex = i, s.slideToClickedSlide && void 0 !== t.clickedIndex && t.clickedIndex !== t.activeIndex && t.slideToClickedSlide();
    }
  };
  var M = {
    getTranslate: function (e) {
      void 0 === e && (e = this.isHorizontal() ? "x" : "y");
      const { params: t, rtlTranslate: s, translate: a, $wrapperEl: i } = this;
      if (t.virtualTranslate) return s ? -a : a;
      if (t.cssMode) return a;
      let r = h(i[0], e);
      return s && (r = -r), r || 0;
    },
    setTranslate: function (e, t) {
      const s = this, { rtlTranslate: a, params: i, $wrapperEl: r, wrapperEl: n, progress: l } = s;
      let o, d = 0, c = 0;
      s.isHorizontal() ? d = a ? -e : e : c = e, i.roundLengths && (d = Math.floor(d), c = Math.floor(c)), i.cssMode ? n[s.isHorizontal() ? "scrollLeft" : "scrollTop"] = s.isHorizontal() ? -d : -c : i.virtualTranslate || r.transform(`translate3d(${d}px, ${c}px, 0px)`), s.previousTranslate = s.translate, s.translate = s.isHorizontal() ? d : c;
      const p = s.maxTranslate() - s.minTranslate();
      o = 0 === p ? 0 : (e - s.minTranslate()) / p, o !== l && s.updateProgress(e), s.emit("setTranslate", s.translate, t);
    },
    minTranslate: function () {return -this.snapGrid[0];},
    maxTranslate: function () {return -this.snapGrid[this.snapGrid.length - 1];},
    translateTo: function (e, t, s, a, i) {
      void 0 === e && (e = 0), void 0 === t && (t = this.params.speed), void 0 === s && (s = !0), void 0 === a && (a = !0);
      const r = this, { params: n, wrapperEl: l } = r;
      if (r.animating && n.preventInteractionOnTransition) return !1;
      const o = r.minTranslate(), d = r.maxTranslate();
      let c;
      if (c = a && e > o ? o : a && e < d ? d : e, r.updateProgress(c), n.cssMode) {
        const e = r.isHorizontal();
        if (0 === t) l[e ? "scrollLeft" : "scrollTop"] = -c; else {
          if (!r.support.smoothScroll) return w({
            swiper: r,
            targetPosition: -c,
            side: e ? "left" : "top"
          }), !0;
          l.scrollTo({ [e ? "left" : "top"]: -c, behavior: "smooth" });
        }
        return !0;
      }
      return 0 === t ? (r.setTransition(0), r.setTranslate(c), s && (r.emit("beforeTransitionStart", t, i), r.emit("transitionEnd"))) : (r.setTransition(t), r.setTranslate(c), s && (r.emit("beforeTransitionStart", t, i), r.emit("transitionStart")), r.animating || (r.animating = !0, r.onTranslateToWrapperTransitionEnd || (r.onTranslateToWrapperTransitionEnd = function (e) {r && !r.destroyed && e.target === this && (r.$wrapperEl[0].removeEventListener("transitionend", r.onTranslateToWrapperTransitionEnd), r.$wrapperEl[0].removeEventListener("webkitTransitionEnd", r.onTranslateToWrapperTransitionEnd), r.onTranslateToWrapperTransitionEnd = null, delete r.onTranslateToWrapperTransitionEnd, s && r.emit("transitionEnd"));}), r.$wrapperEl[0].addEventListener("transitionend", r.onTranslateToWrapperTransitionEnd), r.$wrapperEl[0].addEventListener("webkitTransitionEnd", r.onTranslateToWrapperTransitionEnd))), !0;
    }
  };
  function P (e) {
    let { swiper: t, runCallbacks: s, direction: a, step: i } = e;
    const { activeIndex: r, previousIndex: n } = t;
    let l = a;
    if (l || (l = r > n ? "next" : r < n ? "prev" : "reset"), t.emit(`transition${i}`), s && r !== n) {
      if ("reset" === l) return void t.emit(`slideResetTransition${i}`);
      t.emit(`slideChangeTransition${i}`), "next" === l ? t.emit(`slideNextTransition${i}`) : t.emit(`slidePrevTransition${i}`);
    }
  }
  var k = {
    slideTo: function (e, t, s, a, i) {
      if (void 0 === e && (e = 0), void 0 === t && (t = this.params.speed), void 0 === s && (s = !0), "number" != typeof e && "string" != typeof e) throw new Error(`The 'index' argument cannot have type other than 'number' or 'string'. [${typeof e}] given.`);
      if ("string" == typeof e) {
        const t = parseInt(e, 10);
        if (!isFinite(t)) throw new Error(`The passed-in 'index' (string) couldn't be converted to 'number'. [${e}] given.`);
        e = t;
      }
      const r = this;
      let n = e;
      n < 0 && (n = 0);
      const { params: l, snapGrid: o, slidesGrid: d, previousIndex: c, activeIndex: p, rtlTranslate: u, wrapperEl: h, enabled: m } = r;
      if (r.animating && l.preventInteractionOnTransition || !m && !a && !i) return !1;
      const f = Math.min(r.params.slidesPerGroupSkip, n);
      let g = f + Math.floor((n - f) / r.params.slidesPerGroup);
      g >= o.length && (g = o.length - 1);
      const v = -o[g];
      if (l.normalizeSlideIndex) for (let e = 0; e < d.length; e += 1) {
        const t = -Math.floor(100 * v), s = Math.floor(100 * d[e]), a = Math.floor(100 * d[e + 1]);
        void 0 !== d[e + 1] ? t >= s && t < a - (a - s) / 2 ? n = e : t >= s && t < a && (n = e + 1) : t >= s && (n = e);
      }
      if (r.initialized && n !== p) {
        if (!r.allowSlideNext && v < r.translate && v < r.minTranslate()) return !1;
        if (!r.allowSlidePrev && v > r.translate && v > r.maxTranslate() && (p || 0) !== n) return !1;
      }
      let b;
      if (n !== (c || 0) && s && r.emit("beforeSlideChangeStart"), r.updateProgress(v), b = n > p ? "next" : n < p ? "prev" : "reset", u && -v === r.translate || !u && v === r.translate) return r.updateActiveIndex(n), l.autoHeight && r.updateAutoHeight(), r.updateSlidesClasses(), "slide" !== l.effect && r.setTranslate(v), "reset" !== b && (r.transitionStart(s, b), r.transitionEnd(s, b)), !1;
      if (l.cssMode) {
        const e = r.isHorizontal(), s = u ? v : -v;
        if (0 === t) {
          const t = r.virtual && r.params.virtual.enabled;
          t && (r.wrapperEl.style.scrollSnapType = "none", r._immediateVirtual = !0), h[e ? "scrollLeft" : "scrollTop"] = s, t && requestAnimationFrame((() => {r.wrapperEl.style.scrollSnapType = "", r._swiperImmediateVirtual = !1;}));
        } else {
          if (!r.support.smoothScroll) return w({ swiper: r, targetPosition: s, side: e ? "left" : "top" }), !0;
          h.scrollTo({ [e ? "left" : "top"]: s, behavior: "smooth" });
        }
        return !0;
      }
      return r.setTransition(t), r.setTranslate(v), r.updateActiveIndex(n), r.updateSlidesClasses(), r.emit("beforeTransitionStart", t, a), r.transitionStart(s, b), 0 === t ? r.transitionEnd(s, b) : r.animating || (r.animating = !0, r.onSlideToWrapperTransitionEnd || (r.onSlideToWrapperTransitionEnd = function (e) {r && !r.destroyed && e.target === this && (r.$wrapperEl[0].removeEventListener("transitionend", r.onSlideToWrapperTransitionEnd), r.$wrapperEl[0].removeEventListener("webkitTransitionEnd", r.onSlideToWrapperTransitionEnd), r.onSlideToWrapperTransitionEnd = null, delete r.onSlideToWrapperTransitionEnd, r.transitionEnd(s, b));}), r.$wrapperEl[0].addEventListener("transitionend", r.onSlideToWrapperTransitionEnd), r.$wrapperEl[0].addEventListener("webkitTransitionEnd", r.onSlideToWrapperTransitionEnd)), !0;
    },
    slideToLoop: function (e, t, s, a) {
      if (void 0 === e && (e = 0), void 0 === t && (t = this.params.speed), void 0 === s && (s = !0), "string" == typeof e) {
        const t = parseInt(e, 10);
        if (!isFinite(t)) throw new Error(`The passed-in 'index' (string) couldn't be converted to 'number'. [${e}] given.`);
        e = t;
      }
      const i = this;
      let r = e;
      return i.params.loop && (r += i.loopedSlides), i.slideTo(r, t, s, a);
    },
    slideNext: function (e, t, s) {
      void 0 === e && (e = this.params.speed), void 0 === t && (t = !0);
      const a = this, { animating: i, enabled: r, params: n } = a;
      if (!r) return a;
      let l = n.slidesPerGroup;
      "auto" === n.slidesPerView && 1 === n.slidesPerGroup && n.slidesPerGroupAuto && (l = Math.max(a.slidesPerViewDynamic("current", !0), 1));
      const o = a.activeIndex < n.slidesPerGroupSkip ? 1 : l;
      if (n.loop) {
        if (i && n.loopPreventsSlide) return !1;
        a.loopFix(), a._clientLeft = a.$wrapperEl[0].clientLeft;
      }
      return n.rewind && a.isEnd ? a.slideTo(0, e, t, s) : a.slideTo(a.activeIndex + o, e, t, s);
    },
    slidePrev: function (e, t, s) {
      void 0 === e && (e = this.params.speed), void 0 === t && (t = !0);
      const a = this, { params: i, animating: r, snapGrid: n, slidesGrid: l, rtlTranslate: o, enabled: d } = a;
      if (!d) return a;
      if (i.loop) {
        if (r && i.loopPreventsSlide) return !1;
        a.loopFix(), a._clientLeft = a.$wrapperEl[0].clientLeft;
      }
      function c (e) {return e < 0 ? -Math.floor(Math.abs(e)) : Math.floor(e);}
      const p = c(o ? a.translate : -a.translate), u = n.map((e => c(e)));
      let h = n[u.indexOf(p) - 1];
      if (void 0 === h && i.cssMode) {
        let e;
        n.forEach(((t, s) => {p >= t && (e = s);})), void 0 !== e && (h = n[e > 0 ? e - 1 : e]);
      }
      let m = 0;
      if (void 0 !== h && (m = l.indexOf(h), m < 0 && (m = a.activeIndex - 1), "auto" === i.slidesPerView && 1 === i.slidesPerGroup && i.slidesPerGroupAuto && (m = m - a.slidesPerViewDynamic("previous", !0) + 1, m = Math.max(m, 0))), i.rewind && a.isBeginning) {
        const i = a.params.virtual && a.params.virtual.enabled && a.virtual ? a.virtual.slides.length - 1 : a.slides.length - 1;
        return a.slideTo(i, e, t, s);
      }
      return a.slideTo(m, e, t, s);
    },
    slideReset: function (e, t, s) {return void 0 === e && (e = this.params.speed), void 0 === t && (t = !0), this.slideTo(this.activeIndex, e, t, s);},
    slideToClosest: function (e, t, s, a) {
      void 0 === e && (e = this.params.speed), void 0 === t && (t = !0), void 0 === a && (a = .5);
      const i = this;
      let r = i.activeIndex;
      const n = Math.min(i.params.slidesPerGroupSkip, r), l = n + Math.floor((r - n) / i.params.slidesPerGroup),
        o = i.rtlTranslate ? i.translate : -i.translate;
      if (o >= i.snapGrid[l]) {
        const e = i.snapGrid[l];
        o - e > (i.snapGrid[l + 1] - e) * a && (r += i.params.slidesPerGroup);
      } else {
        const e = i.snapGrid[l - 1];
        o - e <= (i.snapGrid[l] - e) * a && (r -= i.params.slidesPerGroup);
      }
      return r = Math.max(r, 0), r = Math.min(r, i.slidesGrid.length - 1), i.slideTo(r, e, t, s);
    },
    slideToClickedSlide: function () {
      const e = this, { params: t, $wrapperEl: s } = e,
        a = "auto" === t.slidesPerView ? e.slidesPerViewDynamic() : t.slidesPerView;
      let i, r = e.clickedIndex;
      if (t.loop) {
        if (e.animating) return;
        i = parseInt(d(e.clickedSlide).attr("data-swiper-slide-index"), 10), t.centeredSlides ? r < e.loopedSlides - a / 2 || r > e.slides.length - e.loopedSlides + a / 2 ? (e.loopFix(), r = s.children(`.${t.slideClass}[data-swiper-slide-index="${i}"]:not(.${t.slideDuplicateClass})`).eq(0).index(), p((() => {e.slideTo(r);}))) : e.slideTo(r) : r > e.slides.length - a ? (e.loopFix(), r = s.children(`.${t.slideClass}[data-swiper-slide-index="${i}"]:not(.${t.slideDuplicateClass})`).eq(0).index(), p((() => {e.slideTo(r);}))) : e.slideTo(r);
      } else e.slideTo(r);
    }
  };
  var z = {
    loopCreate: function () {
      const e = this, t = a(), { params: s, $wrapperEl: i } = e,
        r = i.children().length > 0 ? d(i.children()[0].parentNode) : i;
      r.children(`.${s.slideClass}.${s.slideDuplicateClass}`).remove();
      let n = r.children(`.${s.slideClass}`);
      if (s.loopFillGroupWithBlank) {
        const e = s.slidesPerGroup - n.length % s.slidesPerGroup;
        if (e !== s.slidesPerGroup) {
          for (let a = 0; a < e; a += 1) {
            const e = d(t.createElement("div")).addClass(`${s.slideClass} ${s.slideBlankClass}`);
            r.append(e);
          }
          n = r.children(`.${s.slideClass}`);
        }
      }
      "auto" !== s.slidesPerView || s.loopedSlides || (s.loopedSlides = n.length), e.loopedSlides = Math.ceil(parseFloat(s.loopedSlides || s.slidesPerView, 10)), e.loopedSlides += s.loopAdditionalSlides, e.loopedSlides > n.length && e.params.loopedSlidesLimit && (e.loopedSlides = n.length);
      const l = [], o = [];
      n.each(((e, t) => {d(e).attr("data-swiper-slide-index", t);}));
      for (let t = 0; t < e.loopedSlides; t += 1) {
        const e = t - Math.floor(t / n.length) * n.length;
        o.push(n.eq(e)[0]), l.unshift(n.eq(n.length - e - 1)[0]);
      }
      for (let e = 0; e < o.length; e += 1) r.append(d(o[e].cloneNode(!0)).addClass(s.slideDuplicateClass));
      for (let e = l.length - 1; e >= 0; e -= 1) r.prepend(d(l[e].cloneNode(!0)).addClass(s.slideDuplicateClass));
    }, loopFix: function () {
      const e = this;
      e.emit("beforeLoopFix");
      const { activeIndex: t, slides: s, loopedSlides: a, allowSlidePrev: i, allowSlideNext: r, snapGrid: n, rtlTranslate: l } = e;
      let o;
      e.allowSlidePrev = !0, e.allowSlideNext = !0;
      const d = -n[t] - e.getTranslate();
      if (t < a) {
        o = s.length - 3 * a + t, o += a;
        e.slideTo(o, 0, !1, !0) && 0 !== d && e.setTranslate((l ? -e.translate : e.translate) - d);
      } else if (t >= s.length - a) {
        o = -s.length + t + a, o += a;
        e.slideTo(o, 0, !1, !0) && 0 !== d && e.setTranslate((l ? -e.translate : e.translate) - d);
      }
      e.allowSlidePrev = i, e.allowSlideNext = r, e.emit("loopFix");
    }, loopDestroy: function () {
      const { $wrapperEl: e, params: t, slides: s } = this;
      e.children(`.${t.slideClass}.${t.slideDuplicateClass},.${t.slideClass}.${t.slideBlankClass}`).remove(), s.removeAttr("data-swiper-slide-index");
    }
  };
  function L (e) {
    const t = this, s = a(), i = r(), n = t.touchEventsData, { params: l, touches: o, enabled: c } = t;
    if (!c) return;
    if (t.animating && l.preventInteractionOnTransition) return;
    !t.animating && l.cssMode && l.loop && t.loopFix();
    let p = e;
    p.originalEvent && (p = p.originalEvent);
    let h = d(p.target);
    if ("wrapper" === l.touchEventsTarget && !h.closest(t.wrapperEl).length) return;
    if (n.isTouchEvent = "touchstart" === p.type, !n.isTouchEvent && "which" in p && 3 === p.which) return;
    if (!n.isTouchEvent && "button" in p && p.button > 0) return;
    if (n.isTouched && n.isMoved) return;
    const m = !!l.noSwipingClass && "" !== l.noSwipingClass, f = e.composedPath ? e.composedPath() : e.path;
    m && p.target && p.target.shadowRoot && f && (h = d(f[0]));
    const g = l.noSwipingSelector ? l.noSwipingSelector : `.${l.noSwipingClass}`,
      v = !(!p.target || !p.target.shadowRoot);
    if (l.noSwiping && (v ? function (e, t) {
      return void 0 === t && (t = this), function t (s) {
        if (!s || s === a() || s === r()) return null;
        s.assignedSlot && (s = s.assignedSlot);
        const i = s.closest(e);
        return i || s.getRootNode ? i || t(s.getRootNode().host) : null;
      }(t);
    }(g, h[0]) : h.closest(g)[0])) return void (t.allowClick = !0);
    if (l.swipeHandler && !h.closest(l.swipeHandler)[0]) return;
    o.currentX = "touchstart" === p.type ? p.targetTouches[0].pageX : p.pageX, o.currentY = "touchstart" === p.type ? p.targetTouches[0].pageY : p.pageY;
    const w = o.currentX, b = o.currentY, x = l.edgeSwipeDetection || l.iOSEdgeSwipeDetection,
      y = l.edgeSwipeThreshold || l.iOSEdgeSwipeThreshold;
    if (x && (w <= y || w >= i.innerWidth - y)) {
      if ("prevent" !== x) return;
      e.preventDefault();
    }
    if (Object.assign(n, {
      isTouched: !0,
      isMoved: !1,
      allowTouchCallbacks: !0,
      isScrolling: void 0,
      startMoving: void 0
    }), o.startX = w, o.startY = b, n.touchStartTime = u(), t.allowClick = !0, t.updateSize(), t.swipeDirection = void 0, l.threshold > 0 && (n.allowThresholdMove = !1), "touchstart" !== p.type) {
      let e = !0;
      h.is(n.focusableElements) && (e = !1, "SELECT" === h[0].nodeName && (n.isTouched = !1)), s.activeElement && d(s.activeElement).is(n.focusableElements) && s.activeElement !== h[0] && s.activeElement.blur();
      const a = e && t.allowTouchMove && l.touchStartPreventDefault;
      !l.touchStartForcePreventDefault && !a || h[0].isContentEditable || p.preventDefault();
    }
    t.params.freeMode && t.params.freeMode.enabled && t.freeMode && t.animating && !l.cssMode && t.freeMode.onTouchStart(), t.emit("touchStart", p);
  }
  function O (e) {
    const t = a(), s = this, i = s.touchEventsData, { params: r, touches: n, rtlTranslate: l, enabled: o } = s;
    if (!o) return;
    let c = e;
    if (c.originalEvent && (c = c.originalEvent), !i.isTouched) return void (i.startMoving && i.isScrolling && s.emit("touchMoveOpposite", c));
    if (i.isTouchEvent && "touchmove" !== c.type) return;
    const p = "touchmove" === c.type && c.targetTouches && (c.targetTouches[0] || c.changedTouches[0]),
      h = "touchmove" === c.type ? p.pageX : c.pageX, m = "touchmove" === c.type ? p.pageY : c.pageY;
    if (c.preventedByNestedSwiper) return n.startX = h, void (n.startY = m);
    if (!s.allowTouchMove) return d(c.target).is(i.focusableElements) || (s.allowClick = !1), void (i.isTouched && (Object.assign(n, {
      startX: h,
      startY: m,
      currentX: h,
      currentY: m
    }), i.touchStartTime = u()));
    if (i.isTouchEvent && r.touchReleaseOnEdges && !r.loop) if (s.isVertical()) {if (m < n.startY && s.translate <= s.maxTranslate() || m > n.startY && s.translate >= s.minTranslate()) return i.isTouched = !1, void (i.isMoved = !1);} else if (h < n.startX && s.translate <= s.maxTranslate() || h > n.startX && s.translate >= s.minTranslate()) return;
    if (i.isTouchEvent && t.activeElement && c.target === t.activeElement && d(c.target).is(i.focusableElements)) return i.isMoved = !0, void (s.allowClick = !1);
    if (i.allowTouchCallbacks && s.emit("touchMove", c), c.targetTouches && c.targetTouches.length > 1) return;
    n.currentX = h, n.currentY = m;
    const f = n.currentX - n.startX, g = n.currentY - n.startY;
    if (s.params.threshold && Math.sqrt(f ** 2 + g ** 2) < s.params.threshold) return;
    if (void 0 === i.isScrolling) {
      let e;
      s.isHorizontal() && n.currentY === n.startY || s.isVertical() && n.currentX === n.startX ? i.isScrolling = !1 : f * f + g * g >= 25 && (e = 180 * Math.atan2(Math.abs(g), Math.abs(f)) / Math.PI, i.isScrolling = s.isHorizontal() ? e > r.touchAngle : 90 - e > r.touchAngle);
    }
    if (i.isScrolling && s.emit("touchMoveOpposite", c), void 0 === i.startMoving && (n.currentX === n.startX && n.currentY === n.startY || (i.startMoving = !0)), i.isScrolling) return void (i.isTouched = !1);
    if (!i.startMoving) return;
    s.allowClick = !1, !r.cssMode && c.cancelable && c.preventDefault(), r.touchMoveStopPropagation && !r.nested && c.stopPropagation(), i.isMoved || (r.loop && !r.cssMode && s.loopFix(), i.startTranslate = s.getTranslate(), s.setTransition(0), s.animating && s.$wrapperEl.trigger("webkitTransitionEnd transitionend"), i.allowMomentumBounce = !1, !r.grabCursor || !0 !== s.allowSlideNext && !0 !== s.allowSlidePrev || s.setGrabCursor(!0), s.emit("sliderFirstMove", c)), s.emit("sliderMove", c), i.isMoved = !0;
    let v = s.isHorizontal() ? f : g;
    n.diff = v, v *= r.touchRatio, l && (v = -v), s.swipeDirection = v > 0 ? "prev" : "next", i.currentTranslate = v + i.startTranslate;
    let w = !0, b = r.resistanceRatio;
    if (r.touchReleaseOnEdges && (b = 0), v > 0 && i.currentTranslate > s.minTranslate() ? (w = !1, r.resistance && (i.currentTranslate = s.minTranslate() - 1 + (-s.minTranslate() + i.startTranslate + v) ** b)) : v < 0 && i.currentTranslate < s.maxTranslate() && (w = !1, r.resistance && (i.currentTranslate = s.maxTranslate() + 1 - (s.maxTranslate() - i.startTranslate - v) ** b)), w && (c.preventedByNestedSwiper = !0), !s.allowSlideNext && "next" === s.swipeDirection && i.currentTranslate < i.startTranslate && (i.currentTranslate = i.startTranslate), !s.allowSlidePrev && "prev" === s.swipeDirection && i.currentTranslate > i.startTranslate && (i.currentTranslate = i.startTranslate), s.allowSlidePrev || s.allowSlideNext || (i.currentTranslate = i.startTranslate), r.threshold > 0) {
      if (!(Math.abs(v) > r.threshold || i.allowThresholdMove)) return void (i.currentTranslate = i.startTranslate);
      if (!i.allowThresholdMove) return i.allowThresholdMove = !0, n.startX = n.currentX, n.startY = n.currentY, i.currentTranslate = i.startTranslate, void (n.diff = s.isHorizontal() ? n.currentX - n.startX : n.currentY - n.startY);
    }
    r.followFinger && !r.cssMode && ((r.freeMode && r.freeMode.enabled && s.freeMode || r.watchSlidesProgress) && (s.updateActiveIndex(), s.updateSlidesClasses()), s.params.freeMode && r.freeMode.enabled && s.freeMode && s.freeMode.onTouchMove(), s.updateProgress(i.currentTranslate), s.setTranslate(i.currentTranslate));
  }
  function I (e) {
    const t = this, s = t.touchEventsData, { params: a, touches: i, rtlTranslate: r, slidesGrid: n, enabled: l } = t;
    if (!l) return;
    let o = e;
    if (o.originalEvent && (o = o.originalEvent), s.allowTouchCallbacks && t.emit("touchEnd", o), s.allowTouchCallbacks = !1, !s.isTouched) return s.isMoved && a.grabCursor && t.setGrabCursor(!1), s.isMoved = !1, void (s.startMoving = !1);
    a.grabCursor && s.isMoved && s.isTouched && (!0 === t.allowSlideNext || !0 === t.allowSlidePrev) && t.setGrabCursor(!1);
    const d = u(), c = d - s.touchStartTime;
    if (t.allowClick) {
      const e = o.path || o.composedPath && o.composedPath();
      t.updateClickedSlide(e && e[0] || o.target), t.emit("tap click", o), c < 300 && d - s.lastClickTime < 300 && t.emit("doubleTap doubleClick", o);
    }
    if (s.lastClickTime = u(), p((() => {t.destroyed || (t.allowClick = !0);})), !s.isTouched || !s.isMoved || !t.swipeDirection || 0 === i.diff || s.currentTranslate === s.startTranslate) return s.isTouched = !1, s.isMoved = !1, void (s.startMoving = !1);
    let h;
    if (s.isTouched = !1, s.isMoved = !1, s.startMoving = !1, h = a.followFinger ? r ? t.translate : -t.translate : -s.currentTranslate, a.cssMode) return;
    if (t.params.freeMode && a.freeMode.enabled) return void t.freeMode.onTouchEnd({ currentPos: h });
    let m = 0, f = t.slidesSizesGrid[0];
    for (let e = 0; e < n.length; e += e < a.slidesPerGroupSkip ? 1 : a.slidesPerGroup) {
      const t = e < a.slidesPerGroupSkip - 1 ? 1 : a.slidesPerGroup;
      void 0 !== n[e + t] ? h >= n[e] && h < n[e + t] && (m = e, f = n[e + t] - n[e]) : h >= n[e] && (m = e, f = n[n.length - 1] - n[n.length - 2]);
    }
    let g = null, v = null;
    a.rewind && (t.isBeginning ? v = t.params.virtual && t.params.virtual.enabled && t.virtual ? t.virtual.slides.length - 1 : t.slides.length - 1 : t.isEnd && (g = 0));
    const w = (h - n[m]) / f, b = m < a.slidesPerGroupSkip - 1 ? 1 : a.slidesPerGroup;
    if (c > a.longSwipesMs) {
      if (!a.longSwipes) return void t.slideTo(t.activeIndex);
      "next" === t.swipeDirection && (w >= a.longSwipesRatio ? t.slideTo(a.rewind && t.isEnd ? g : m + b) : t.slideTo(m)), "prev" === t.swipeDirection && (w > 1 - a.longSwipesRatio ? t.slideTo(m + b) : null !== v && w < 0 && Math.abs(w) > a.longSwipesRatio ? t.slideTo(v) : t.slideTo(m));
    } else {
      if (!a.shortSwipes) return void t.slideTo(t.activeIndex);
      t.navigation && (o.target === t.navigation.nextEl || o.target === t.navigation.prevEl) ? o.target === t.navigation.nextEl ? t.slideTo(m + b) : t.slideTo(m) : ("next" === t.swipeDirection && t.slideTo(null !== g ? g : m + b), "prev" === t.swipeDirection && t.slideTo(null !== v ? v : m));
    }
  }
  function A () {
    const e = this, { params: t, el: s } = e;
    if (s && 0 === s.offsetWidth) return;
    t.breakpoints && e.setBreakpoint();
    const { allowSlideNext: a, allowSlidePrev: i, snapGrid: r } = e;
    e.allowSlideNext = !0, e.allowSlidePrev = !0, e.updateSize(), e.updateSlides(), e.updateSlidesClasses(), ("auto" === t.slidesPerView || t.slidesPerView > 1) && e.isEnd && !e.isBeginning && !e.params.centeredSlides ? e.slideTo(e.slides.length - 1, 0, !1, !0) : e.slideTo(e.activeIndex, 0, !1, !0), e.autoplay && e.autoplay.running && e.autoplay.paused && e.autoplay.run(), e.allowSlidePrev = i, e.allowSlideNext = a, e.params.watchOverflow && r !== e.snapGrid && e.checkOverflow();
  }
  function D (e) {
    const t = this;
    t.enabled && (t.allowClick || (t.params.preventClicks && e.preventDefault(), t.params.preventClicksPropagation && t.animating && (e.stopPropagation(), e.stopImmediatePropagation())));
  }
  function G () {
    const e = this, { wrapperEl: t, rtlTranslate: s, enabled: a } = e;
    if (!a) return;
    let i;
    e.previousTranslate = e.translate, e.isHorizontal() ? e.translate = -t.scrollLeft : e.translate = -t.scrollTop, 0 === e.translate && (e.translate = 0), e.updateActiveIndex(), e.updateSlidesClasses();
    const r = e.maxTranslate() - e.minTranslate();
    i = 0 === r ? 0 : (e.translate - e.minTranslate()) / r, i !== e.progress && e.updateProgress(s ? -e.translate : e.translate), e.emit("setTranslate", e.translate, !1);
  }
  let N = !1;
  function B () {}
  const H = (e, t) => {
    const s = a(), { params: i, touchEvents: r, el: n, wrapperEl: l, device: o, support: d } = e, c = !!i.nested,
      p = "on" === t ? "addEventListener" : "removeEventListener", u = t;
    if (d.touch) {
      const t = !("touchstart" !== r.start || !d.passiveListener || !i.passiveListeners) && {
        passive: !0,
        capture: !1
      };
      n[p](r.start, e.onTouchStart, t), n[p](r.move, e.onTouchMove, d.passiveListener ? {
        passive: !1,
        capture: c
      } : c), n[p](r.end, e.onTouchEnd, t), r.cancel && n[p](r.cancel, e.onTouchEnd, t);
    } else n[p](r.start, e.onTouchStart, !1), s[p](r.move, e.onTouchMove, c), s[p](r.end, e.onTouchEnd, !1);
    (i.preventClicks || i.preventClicksPropagation) && n[p]("click", e.onClick, !0), i.cssMode && l[p]("scroll", e.onScroll), i.updateOnWindowResize ? e[u](o.ios || o.android ? "resize orientationchange observerUpdate" : "resize observerUpdate", A, !0) : e[u]("observerUpdate", A, !0);
  };
  var X = {
    attachEvents: function () {
      const e = this, t = a(), { params: s, support: i } = e;
      e.onTouchStart = L.bind(e), e.onTouchMove = O.bind(e), e.onTouchEnd = I.bind(e), s.cssMode && (e.onScroll = G.bind(e)), e.onClick = D.bind(e), i.touch && !N && (t.addEventListener("touchstart", B), N = !0), H(e, "on");
    }, detachEvents: function () {H(this, "off");}
  };
  const Y = (e, t) => e.grid && t.grid && t.grid.rows > 1;
  var R = {
    addClasses: function () {
      const e = this, { classNames: t, params: s, rtl: a, $el: i, device: r, support: n } = e, l = function (e, t) {
        const s = [];
        return e.forEach((e => {"object" == typeof e ? Object.keys(e).forEach((a => {e[a] && s.push(t + a);})) : "string" == typeof e && s.push(t + e);})), s;
      }(["initialized", s.direction, { "pointer-events": !n.touch }, { "free-mode": e.params.freeMode && s.freeMode.enabled }, { autoheight: s.autoHeight }, { rtl: a }, { grid: s.grid && s.grid.rows > 1 }, { "grid-column": s.grid && s.grid.rows > 1 && "column" === s.grid.fill }, { android: r.android }, { ios: r.ios }, { "css-mode": s.cssMode }, { centered: s.cssMode && s.centeredSlides }, { "watch-progress": s.watchSlidesProgress }], s.containerModifierClass);
      t.push(...l), i.addClass([...t].join(" ")), e.emitContainerClasses();
    }, removeClasses: function () {
      const { $el: e, classNames: t } = this;
      e.removeClass(t.join(" ")), this.emitContainerClasses();
    }
  };
  var W = {
    init: !0,
    direction: "horizontal",
    touchEventsTarget: "wrapper",
    initialSlide: 0,
    speed: 300,
    cssMode: !1,
    updateOnWindowResize: !0,
    resizeObserver: !0,
    nested: !1,
    createElements: !1,
    enabled: !0,
    focusableElements: "input, select, option, textarea, button, video, label",
    width: null,
    height: null,
    preventInteractionOnTransition: !1,
    userAgent: null,
    url: null,
    edgeSwipeDetection: !1,
    edgeSwipeThreshold: 20,
    autoHeight: !1,
    setWrapperSize: !1,
    virtualTranslate: !1,
    effect: "slide",
    breakpoints: void 0,
    breakpointsBase: "window",
    spaceBetween: 0,
    slidesPerView: 1,
    slidesPerGroup: 1,
    slidesPerGroupSkip: 0,
    slidesPerGroupAuto: !1,
    centeredSlides: !1,
    centeredSlidesBounds: !1,
    slidesOffsetBefore: 0,
    slidesOffsetAfter: 0,
    normalizeSlideIndex: !0,
    centerInsufficientSlides: !1,
    watchOverflow: !0,
    roundLengths: !1,
    touchRatio: 1,
    touchAngle: 45,
    simulateTouch: !0,
    shortSwipes: !0,
    longSwipes: !0,
    longSwipesRatio: .5,
    longSwipesMs: 300,
    followFinger: !0,
    allowTouchMove: !0,
    threshold: 0,
    touchMoveStopPropagation: !1,
    touchStartPreventDefault: !0,
    touchStartForcePreventDefault: !1,
    touchReleaseOnEdges: !1,
    uniqueNavElements: !0,
    resistance: !0,
    resistanceRatio: .85,
    watchSlidesProgress: !1,
    grabCursor: !1,
    preventClicks: !0,
    preventClicksPropagation: !0,
    slideToClickedSlide: !1,
    preloadImages: !0,
    updateOnImagesReady: !0,
    loop: !1,
    loopAdditionalSlides: 0,
    loopedSlides: null,
    loopedSlidesLimit: !0,
    loopFillGroupWithBlank: !1,
    loopPreventsSlide: !0,
    rewind: !1,
    allowSlidePrev: !0,
    allowSlideNext: !0,
    swipeHandler: null,
    noSwiping: !0,
    noSwipingClass: "swiper-no-swiping",
    noSwipingSelector: null,
    passiveListeners: !0,
    maxBackfaceHiddenSlides: 10,
    containerModifierClass: "swiper-",
    slideClass: "swiper-slide",
    slideBlankClass: "swiper-slide-invisible-blank",
    slideActiveClass: "swiper-slide-active",
    slideDuplicateActiveClass: "swiper-slide-duplicate-active",
    slideVisibleClass: "swiper-slide-visible",
    slideDuplicateClass: "swiper-slide-duplicate",
    slideNextClass: "swiper-slide-next",
    slideDuplicateNextClass: "swiper-slide-duplicate-next",
    slidePrevClass: "swiper-slide-prev",
    slideDuplicatePrevClass: "swiper-slide-duplicate-prev",
    wrapperClass: "swiper-wrapper",
    runCallbacksOnInit: !0,
    _emitClasses: !1
  };
  function q (e, t) {
    return function (s) {
      void 0 === s && (s = {});
      const a = Object.keys(s)[0], i = s[a];
      "object" == typeof i && null !== i ? (["navigation", "pagination", "scrollbar"].indexOf(a) >= 0 && !0 === e[a] && (e[a] = { auto: !0 }), a in e && "enabled" in i ? (!0 === e[a] && (e[a] = { enabled: !0 }), "object" != typeof e[a] || "enabled" in e[a] || (e[a].enabled = !0), e[a] || (e[a] = { enabled: !1 }), g(t, s)) : g(t, s)) : g(t, s);
    };
  }
  const j = {
    eventsEmitter: $,
    update: S,
    translate: M,
    transition: {
      setTransition: function (e, t) {
        const s = this;
        s.params.cssMode || s.$wrapperEl.transition(e), s.emit("setTransition", e, t);
      }, transitionStart: function (e, t) {
        void 0 === e && (e = !0);
        const s = this, { params: a } = s;
        a.cssMode || (a.autoHeight && s.updateAutoHeight(), P({
          swiper: s,
          runCallbacks: e,
          direction: t,
          step: "Start"
        }));
      }, transitionEnd: function (e, t) {
        void 0 === e && (e = !0);
        const s = this, { params: a } = s;
        s.animating = !1, a.cssMode || (s.setTransition(0), P({
          swiper: s,
          runCallbacks: e,
          direction: t,
          step: "End"
        }));
      }
    },
    slide: k,
    loop: z,
    grabCursor: {
      setGrabCursor: function (e) {
        const t = this;
        if (t.support.touch || !t.params.simulateTouch || t.params.watchOverflow && t.isLocked || t.params.cssMode) return;
        const s = "container" === t.params.touchEventsTarget ? t.el : t.wrapperEl;
        s.style.cursor = "move", s.style.cursor = e ? "grabbing" : "grab";
      }, unsetGrabCursor: function () {
        const e = this;
        e.support.touch || e.params.watchOverflow && e.isLocked || e.params.cssMode || (e["container" === e.params.touchEventsTarget ? "el" : "wrapperEl"].style.cursor = "");
      }
    },
    events: X,
    breakpoints: {
      setBreakpoint: function () {
        const e = this, { activeIndex: t, initialized: s, loopedSlides: a = 0, params: i, $el: r } = e,
          n = i.breakpoints;
        if (!n || n && 0 === Object.keys(n).length) return;
        const l = e.getBreakpoint(n, e.params.breakpointsBase, e.el);
        if (!l || e.currentBreakpoint === l) return;
        const o = (l in n ? n[l] : void 0) || e.originalParams, d = Y(e, i), c = Y(e, o), p = i.enabled;
        d && !c ? (r.removeClass(`${i.containerModifierClass}grid ${i.containerModifierClass}grid-column`), e.emitContainerClasses()) : !d && c && (r.addClass(`${i.containerModifierClass}grid`), (o.grid.fill && "column" === o.grid.fill || !o.grid.fill && "column" === i.grid.fill) && r.addClass(`${i.containerModifierClass}grid-column`), e.emitContainerClasses()), ["navigation", "pagination", "scrollbar"].forEach((t => {
          const s = i[t] && i[t].enabled, a = o[t] && o[t].enabled;
          s && !a && e[t].disable(), !s && a && e[t].enable();
        }));
        const u = o.direction && o.direction !== i.direction, h = i.loop && (o.slidesPerView !== i.slidesPerView || u);
        u && s && e.changeDirection(), g(e.params, o);
        const m = e.params.enabled;
        Object.assign(e, {
          allowTouchMove: e.params.allowTouchMove,
          allowSlideNext: e.params.allowSlideNext,
          allowSlidePrev: e.params.allowSlidePrev
        }), p && !m ? e.disable() : !p && m && e.enable(), e.currentBreakpoint = l, e.emit("_beforeBreakpoint", o), h && s && (e.loopDestroy(), e.loopCreate(), e.updateSlides(), e.slideTo(t - a + e.loopedSlides, 0, !1)), e.emit("breakpoint", o);
      }, getBreakpoint: function (e, t, s) {
        if (void 0 === t && (t = "window"), !e || "container" === t && !s) return;
        let a = !1;
        const i = r(), n = "window" === t ? i.innerHeight : s.clientHeight, l = Object.keys(e).map((e => {
          if ("string" == typeof e && 0 === e.indexOf("@")) {
            const t = parseFloat(e.substr(1));
            return { value: n * t, point: e };
          }
          return { value: e, point: e };
        }));
        l.sort(((e, t) => parseInt(e.value, 10) - parseInt(t.value, 10)));
        for (let e = 0; e < l.length; e += 1) {
          const { point: r, value: n } = l[e];
          "window" === t ? i.matchMedia(`(min-width: ${n}px)`).matches && (a = r) : n <= s.clientWidth && (a = r);
        }
        return a || "max";
      }
    },
    checkOverflow: {
      checkOverflow: function () {
        const e = this, { isLocked: t, params: s } = e, { slidesOffsetBefore: a } = s;
        if (a) {
          const t = e.slides.length - 1, s = e.slidesGrid[t] + e.slidesSizesGrid[t] + 2 * a;
          e.isLocked = e.size > s;
        } else e.isLocked = 1 === e.snapGrid.length;
        !0 === s.allowSlideNext && (e.allowSlideNext = !e.isLocked), !0 === s.allowSlidePrev && (e.allowSlidePrev = !e.isLocked), t && t !== e.isLocked && (e.isEnd = !1), t !== e.isLocked && e.emit(e.isLocked ? "lock" : "unlock");
      }
    },
    classes: R,
    images: {
      loadImage: function (e, t, s, a, i, n) {
        const l = r();
        let o;
        function c () {n && n();}
        d(e).parent("picture")[0] || e.complete && i ? c() : t ? (o = new l.Image, o.onload = c, o.onerror = c, a && (o.sizes = a), s && (o.srcset = s), t && (o.src = t)) : c();
      }, preloadImages: function () {
        const e = this;
        function t () {null != e && e && !e.destroyed && (void 0 !== e.imagesLoaded && (e.imagesLoaded += 1), e.imagesLoaded === e.imagesToLoad.length && (e.params.updateOnImagesReady && e.update(), e.emit("imagesReady")));}
        e.imagesToLoad = e.$el.find("img");
        for (let s = 0; s < e.imagesToLoad.length; s += 1) {
          const a = e.imagesToLoad[s];
          e.loadImage(a, a.currentSrc || a.getAttribute("src"), a.srcset || a.getAttribute("srcset"), a.sizes || a.getAttribute("sizes"), !0, t);
        }
      }
    }
  }, _ = {};
  class V {
    constructor () {
      let e, t;
      for (var s = arguments.length, a = new Array(s), i = 0; i < s; i++) a[i] = arguments[i];
      if (1 === a.length && a[0].constructor && "Object" === Object.prototype.toString.call(a[0]).slice(8, -1) ? t = a[0] : [e, t] = a, t || (t = {}), t = g({}, t), e && !t.el && (t.el = e), t.el && d(t.el).length > 1) {
        const e = [];
        return d(t.el).each((s => {
          const a = g({}, t, { el: s });
          e.push(new V(a));
        })), e;
      }
      const r = this;
      r.__swiper__ = !0, r.support = E(), r.device = C({ userAgent: t.userAgent }), r.browser = T(), r.eventsListeners = {}, r.eventsAnyListeners = [], r.modules = [...r.__modules__], t.modules && Array.isArray(t.modules) && r.modules.push(...t.modules);
      const n = {};
      r.modules.forEach((e => {
        e({
          swiper: r,
          extendParams: q(t, n),
          on: r.on.bind(r),
          once: r.once.bind(r),
          off: r.off.bind(r),
          emit: r.emit.bind(r)
        });
      }));
      const l = g({}, W, n);
      return r.params = g({}, l, _, t), r.originalParams = g({}, r.params), r.passedParams = g({}, t), r.params && r.params.on && Object.keys(r.params.on).forEach((e => {r.on(e, r.params.on[e]);})), r.params && r.params.onAny && r.onAny(r.params.onAny), r.$ = d, Object.assign(r, {
        enabled: r.params.enabled,
        el: e,
        classNames: [],
        slides: d(),
        slidesGrid: [],
        snapGrid: [],
        slidesSizesGrid: [],
        isHorizontal: () => "horizontal" === r.params.direction,
        isVertical: () => "vertical" === r.params.direction,
        activeIndex: 0,
        realIndex: 0,
        isBeginning: !0,
        isEnd: !1,
        translate: 0,
        previousTranslate: 0,
        progress: 0,
        velocity: 0,
        animating: !1,
        allowSlideNext: r.params.allowSlideNext,
        allowSlidePrev: r.params.allowSlidePrev,
        touchEvents: function () {
          const e = ["touchstart", "touchmove", "touchend", "touchcancel"],
            t = ["pointerdown", "pointermove", "pointerup"];
          return r.touchEventsTouch = {
            start: e[0],
            move: e[1],
            end: e[2],
            cancel: e[3]
          }, r.touchEventsDesktop = {
            start: t[0],
            move: t[1],
            end: t[2]
          }, r.support.touch || !r.params.simulateTouch ? r.touchEventsTouch : r.touchEventsDesktop;
        }(),
        touchEventsData: {
          isTouched: void 0,
          isMoved: void 0,
          allowTouchCallbacks: void 0,
          touchStartTime: void 0,
          isScrolling: void 0,
          currentTranslate: void 0,
          startTranslate: void 0,
          allowThresholdMove: void 0,
          focusableElements: r.params.focusableElements,
          lastClickTime: u(),
          clickTimeout: void 0,
          velocities: [],
          allowMomentumBounce: void 0,
          isTouchEvent: void 0,
          startMoving: void 0
        },
        allowClick: !0,
        allowTouchMove: r.params.allowTouchMove,
        touches: { startX: 0, startY: 0, currentX: 0, currentY: 0, diff: 0 },
        imagesToLoad: [],
        imagesLoaded: 0
      }), r.emit("_swiper"), r.params.init && r.init(), r;
    }
    enable () {
      const e = this;
      e.enabled || (e.enabled = !0, e.params.grabCursor && e.setGrabCursor(), e.emit("enable"));
    }
    disable () {
      const e = this;
      e.enabled && (e.enabled = !1, e.params.grabCursor && e.unsetGrabCursor(), e.emit("disable"));
    }
    setProgress (e, t) {
      const s = this;
      e = Math.min(Math.max(e, 0), 1);
      const a = s.minTranslate(), i = (s.maxTranslate() - a) * e + a;
      s.translateTo(i, void 0 === t ? 0 : t), s.updateActiveIndex(), s.updateSlidesClasses();
    }
    emitContainerClasses () {
      const e = this;
      if (!e.params._emitClasses || !e.el) return;
      const t = e.el.className.split(" ").filter((t => 0 === t.indexOf("swiper") || 0 === t.indexOf(e.params.containerModifierClass)));
      e.emit("_containerClasses", t.join(" "));
    }
    getSlideClasses (e) {
      const t = this;
      return t.destroyed ? "" : e.className.split(" ").filter((e => 0 === e.indexOf("swiper-slide") || 0 === e.indexOf(t.params.slideClass))).join(" ");
    }
    emitSlidesClasses () {
      const e = this;
      if (!e.params._emitClasses || !e.el) return;
      const t = [];
      e.slides.each((s => {
        const a = e.getSlideClasses(s);
        t.push({ slideEl: s, classNames: a }), e.emit("_slideClass", s, a);
      })), e.emit("_slideClasses", t);
    }
    slidesPerViewDynamic (e, t) {
      void 0 === e && (e = "current"), void 0 === t && (t = !1);
      const { params: s, slides: a, slidesGrid: i, slidesSizesGrid: r, size: n, activeIndex: l } = this;
      let o = 1;
      if (s.centeredSlides) {
        let e, t = a[l].swiperSlideSize;
        for (let s = l + 1; s < a.length; s += 1) a[s] && !e && (t += a[s].swiperSlideSize, o += 1, t > n && (e = !0));
        for (let s = l - 1; s >= 0; s -= 1) a[s] && !e && (t += a[s].swiperSlideSize, o += 1, t > n && (e = !0));
      } else if ("current" === e) for (let e = l + 1; e < a.length; e += 1) {(t ? i[e] + r[e] - i[l] < n : i[e] - i[l] < n) && (o += 1);} else for (let e = l - 1; e >= 0; e -= 1) {i[l] - i[e] < n && (o += 1);}
      return o;
    }
    update () {
      const e = this;
      if (!e || e.destroyed) return;
      const { snapGrid: t, params: s } = e;
      function a () {
        const t = e.rtlTranslate ? -1 * e.translate : e.translate,
          s = Math.min(Math.max(t, e.maxTranslate()), e.minTranslate());
        e.setTranslate(s), e.updateActiveIndex(), e.updateSlidesClasses();
      }
      let i;
      s.breakpoints && e.setBreakpoint(), e.updateSize(), e.updateSlides(), e.updateProgress(), e.updateSlidesClasses(), e.params.freeMode && e.params.freeMode.enabled ? (a(), e.params.autoHeight && e.updateAutoHeight()) : (i = ("auto" === e.params.slidesPerView || e.params.slidesPerView > 1) && e.isEnd && !e.params.centeredSlides ? e.slideTo(e.slides.length - 1, 0, !1, !0) : e.slideTo(e.activeIndex, 0, !1, !0), i || a()), s.watchOverflow && t !== e.snapGrid && e.checkOverflow(), e.emit("update");
    }
    changeDirection (e, t) {
      void 0 === t && (t = !0);
      const s = this, a = s.params.direction;
      return e || (e = "horizontal" === a ? "vertical" : "horizontal"), e === a || "horizontal" !== e && "vertical" !== e || (s.$el.removeClass(`${s.params.containerModifierClass}${a}`).addClass(`${s.params.containerModifierClass}${e}`), s.emitContainerClasses(), s.params.direction = e, s.slides.each((t => {"vertical" === e ? t.style.width = "" : t.style.height = "";})), s.emit("changeDirection"), t && s.update()), s;
    }
    changeLanguageDirection (e) {
      const t = this;
      t.rtl && "rtl" === e || !t.rtl && "ltr" === e || (t.rtl = "rtl" === e, t.rtlTranslate = "horizontal" === t.params.direction && t.rtl, t.rtl ? (t.$el.addClass(`${t.params.containerModifierClass}rtl`), t.el.dir = "rtl") : (t.$el.removeClass(`${t.params.containerModifierClass}rtl`), t.el.dir = "ltr"), t.update());
    }
    mount (e) {
      const t = this;
      if (t.mounted) return !0;
      const s = d(e || t.params.el);
      if (!(e = s[0])) return !1;
      e.swiper = t;
      const i = () => `.${(t.params.wrapperClass || "").trim().split(" ").join(".")}`;
      let r = (() => {
        if (e && e.shadowRoot && e.shadowRoot.querySelector) {
          const t = d(e.shadowRoot.querySelector(i()));
          return t.children = e => s.children(e), t;
        }
        return s.children ? s.children(i()) : d(s).children(i());
      })();
      if (0 === r.length && t.params.createElements) {
        const e = a().createElement("div");
        r = d(e), e.className = t.params.wrapperClass, s.append(e), s.children(`.${t.params.slideClass}`).each((e => {r.append(e);}));
      }
      return Object.assign(t, {
        $el: s,
        el: e,
        $wrapperEl: r,
        wrapperEl: r[0],
        mounted: !0,
        rtl: "rtl" === e.dir.toLowerCase() || "rtl" === s.css("direction"),
        rtlTranslate: "horizontal" === t.params.direction && ("rtl" === e.dir.toLowerCase() || "rtl" === s.css("direction")),
        wrongRTL: "-webkit-box" === r.css("display")
      }), !0;
    }
    init (e) {
      const t = this;
      if (t.initialized) return t;
      return !1 === t.mount(e) || (t.emit("beforeInit"), t.params.breakpoints && t.setBreakpoint(), t.addClasses(), t.params.loop && t.loopCreate(), t.updateSize(), t.updateSlides(), t.params.watchOverflow && t.checkOverflow(), t.params.grabCursor && t.enabled && t.setGrabCursor(), t.params.preloadImages && t.preloadImages(), t.params.loop ? t.slideTo(t.params.initialSlide + t.loopedSlides, 0, t.params.runCallbacksOnInit, !1, !0) : t.slideTo(t.params.initialSlide, 0, t.params.runCallbacksOnInit, !1, !0), t.attachEvents(), t.initialized = !0, t.emit("init"), t.emit("afterInit")), t;
    }
    destroy (e, t) {
      void 0 === e && (e = !0), void 0 === t && (t = !0);
      const s = this, { params: a, $el: i, $wrapperEl: r, slides: n } = s;
      return void 0 === s.params || s.destroyed || (s.emit("beforeDestroy"), s.initialized = !1, s.detachEvents(), a.loop && s.loopDestroy(), t && (s.removeClasses(), i.removeAttr("style"), r.removeAttr("style"), n && n.length && n.removeClass([a.slideVisibleClass, a.slideActiveClass, a.slideNextClass, a.slidePrevClass].join(" ")).removeAttr("style").removeAttr("data-swiper-slide-index")), s.emit("destroy"), Object.keys(s.eventsListeners).forEach((e => {s.off(e);})), !1 !== e && (s.$el[0].swiper = null, function (e) {
        const t = e;
        Object.keys(t).forEach((e => {
          try {t[e] = null;} catch (e) {}
          try {delete t[e];} catch (e) {}
        }));
      }(s)), s.destroyed = !0), null;
    }
    static extendDefaults (e) {g(_, e);}
    static get extendedDefaults () {return _;}
    static get defaults () {return W;}
    static installModule (e) {
      V.prototype.__modules__ || (V.prototype.__modules__ = []);
      const t = V.prototype.__modules__;
      "function" == typeof e && t.indexOf(e) < 0 && t.push(e);
    }
    static use (e) {return Array.isArray(e) ? (e.forEach((e => V.installModule(e))), V) : (V.installModule(e), V);}
  }
  function F (e, t, s, i) {
    const r = a();
    return e.params.createElements && Object.keys(i).forEach((a => {
      if (!s[a] && !0 === s.auto) {
        let n = e.$el.children(`.${i[a]}`)[0];
        n || (n = r.createElement("div"), n.className = i[a], e.$el.append(n)), s[a] = n, t[a] = n;
      }
    })), s;
  }
  function U (e) {return void 0 === e && (e = ""), `.${e.trim().replace(/([\.:!\/])/g, "\\$1").replace(/ /g, ".")}`;}
  function K (e) {
    const t = this, { $wrapperEl: s, params: a } = t;
    if (a.loop && t.loopDestroy(), "object" == typeof e && "length" in e) for (let t = 0; t < e.length; t += 1) e[t] && s.append(e[t]); else s.append(e);
    a.loop && t.loopCreate(), a.observer || t.update();
  }
  function Z (e) {
    const t = this, { params: s, $wrapperEl: a, activeIndex: i } = t;
    s.loop && t.loopDestroy();
    let r = i + 1;
    if ("object" == typeof e && "length" in e) {
      for (let t = 0; t < e.length; t += 1) e[t] && a.prepend(e[t]);
      r = i + e.length;
    } else a.prepend(e);
    s.loop && t.loopCreate(), s.observer || t.update(), t.slideTo(r, 0, !1);
  }
  function Q (e, t) {
    const s = this, { $wrapperEl: a, params: i, activeIndex: r } = s;
    let n = r;
    i.loop && (n -= s.loopedSlides, s.loopDestroy(), s.slides = a.children(`.${i.slideClass}`));
    const l = s.slides.length;
    if (e <= 0) return void s.prependSlide(t);
    if (e >= l) return void s.appendSlide(t);
    let o = n > e ? n + 1 : n;
    const d = [];
    for (let t = l - 1; t >= e; t -= 1) {
      const e = s.slides.eq(t);
      e.remove(), d.unshift(e);
    }
    if ("object" == typeof t && "length" in t) {
      for (let e = 0; e < t.length; e += 1) t[e] && a.append(t[e]);
      o = n > e ? n + t.length : n;
    } else a.append(t);
    for (let e = 0; e < d.length; e += 1) a.append(d[e]);
    i.loop && s.loopCreate(), i.observer || s.update(), i.loop ? s.slideTo(o + s.loopedSlides, 0, !1) : s.slideTo(o, 0, !1);
  }
  function J (e) {
    const t = this, { params: s, $wrapperEl: a, activeIndex: i } = t;
    let r = i;
    s.loop && (r -= t.loopedSlides, t.loopDestroy(), t.slides = a.children(`.${s.slideClass}`));
    let n, l = r;
    if ("object" == typeof e && "length" in e) {
      for (let s = 0; s < e.length; s += 1) n = e[s], t.slides[n] && t.slides.eq(n).remove(), n < l && (l -= 1);
      l = Math.max(l, 0);
    } else n = e, t.slides[n] && t.slides.eq(n).remove(), n < l && (l -= 1), l = Math.max(l, 0);
    s.loop && t.loopCreate(), s.observer || t.update(), s.loop ? t.slideTo(l + t.loopedSlides, 0, !1) : t.slideTo(l, 0, !1);
  }
  function ee () {
    const e = this, t = [];
    for (let s = 0; s < e.slides.length; s += 1) t.push(s);
    e.removeSlide(t);
  }
  function te (e) {
    const { effect: t, swiper: s, on: a, setTranslate: i, setTransition: r, overwriteParams: n, perspective: l, recreateShadows: o, getEffectParams: d } = e;
    let c;
    a("beforeInit", (() => {
      if (s.params.effect !== t) return;
      s.classNames.push(`${s.params.containerModifierClass}${t}`), l && l() && s.classNames.push(`${s.params.containerModifierClass}3d`);
      const e = n ? n() : {};
      Object.assign(s.params, e), Object.assign(s.originalParams, e);
    })), a("setTranslate", (() => {s.params.effect === t && i();})), a("setTransition", ((e, a) => {s.params.effect === t && r(a);})), a("transitionEnd", (() => {
      if (s.params.effect === t && o) {
        if (!d || !d().slideShadows) return;
        s.slides.each((e => {s.$(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").remove();})), o();
      }
    })), a("virtualUpdate", (() => {s.params.effect === t && (s.slides.length || (c = !0), requestAnimationFrame((() => {c && s.slides && s.slides.length && (i(), c = !1);})));}));
  }
  function se (e, t) {
    return e.transformEl ? t.find(e.transformEl).css({
      "backface-visibility": "hidden",
      "-webkit-backface-visibility": "hidden"
    }) : t;
  }
  function ae (e) {
    let { swiper: t, duration: s, transformEl: a, allSlides: i } = e;
    const { slides: r, activeIndex: n, $wrapperEl: l } = t;
    if (t.params.virtualTranslate && 0 !== s) {
      let e, s = !1;
      e = i ? a ? r.find(a) : r : a ? r.eq(n).find(a) : r.eq(n), e.transitionEnd((() => {
        if (s) return;
        if (!t || t.destroyed) return;
        s = !0, t.animating = !1;
        const e = ["webkitTransitionEnd", "transitionend"];
        for (let t = 0; t < e.length; t += 1) l.trigger(e[t]);
      }));
    }
  }
  function ie (e, t, s) {
    const a = "swiper-slide-shadow" + (s ? `-${s}` : ""), i = e.transformEl ? t.find(e.transformEl) : t;
    let r = i.children(`.${a}`);
    return r.length || (r = d(`<div class="swiper-slide-shadow${s ? `-${s}` : ""}"></div>`), i.append(r)), r;
  }
  Object.keys(j).forEach((e => {Object.keys(j[e]).forEach((t => {V.prototype[t] = j[e][t];}));})), V.use([function (e) {
    let { swiper: t, on: s, emit: a } = e;
    const i = r();
    let n = null, l = null;
    const o = () => {t && !t.destroyed && t.initialized && (a("beforeResize"), a("resize"));},
      d = () => {t && !t.destroyed && t.initialized && a("orientationchange");};
    s("init", (() => {
      t.params.resizeObserver && void 0 !== i.ResizeObserver ? t && !t.destroyed && t.initialized && (n = new ResizeObserver((e => {
        l = i.requestAnimationFrame((() => {
          const { width: s, height: a } = t;
          let i = s, r = a;
          e.forEach((e => {
            let { contentBoxSize: s, contentRect: a, target: n } = e;
            n && n !== t.el || (i = a ? a.width : (s[0] || s).inlineSize, r = a ? a.height : (s[0] || s).blockSize);
          })), i === s && r === a || o();
        }));
      })), n.observe(t.el)) : (i.addEventListener("resize", o), i.addEventListener("orientationchange", d));
    })), s("destroy", (() => {l && i.cancelAnimationFrame(l), n && n.unobserve && t.el && (n.unobserve(t.el), n = null), i.removeEventListener("resize", o), i.removeEventListener("orientationchange", d);}));
  }, function (e) {
    let { swiper: t, extendParams: s, on: a, emit: i } = e;
    const n = [], l = r(), o = function (e, t) {
      void 0 === t && (t = {});
      const s = new (l.MutationObserver || l.WebkitMutationObserver)((e => {
        if (1 === e.length) return void i("observerUpdate", e[0]);
        const t = function () {i("observerUpdate", e[0]);};
        l.requestAnimationFrame ? l.requestAnimationFrame(t) : l.setTimeout(t, 0);
      }));
      s.observe(e, {
        attributes: void 0 === t.attributes || t.attributes,
        childList: void 0 === t.childList || t.childList,
        characterData: void 0 === t.characterData || t.characterData
      }), n.push(s);
    };
    s({
      observer: !1,
      observeParents: !1,
      observeSlideChildren: !1
    }), a("init", (() => {
      if (t.params.observer) {
        if (t.params.observeParents) {
          const e = t.$el.parents();
          for (let t = 0; t < e.length; t += 1) o(e[t]);
        }
        o(t.$el[0], { childList: t.params.observeSlideChildren }), o(t.$wrapperEl[0], { attributes: !1 });
      }
    })), a("destroy", (() => {n.forEach((e => {e.disconnect();})), n.splice(0, n.length);}));
  }]);
  const re = [function (e) {
    let t, { swiper: s, extendParams: a, on: i, emit: r } = e;
    function n (e, t) {
      const a = s.params.virtual;
      if (a.cache && s.virtual.cache[t]) return s.virtual.cache[t];
      const i = a.renderSlide ? d(a.renderSlide.call(s, e, t)) : d(`<div class="${s.params.slideClass}" data-swiper-slide-index="${t}">${e}</div>`);
      return i.attr("data-swiper-slide-index") || i.attr("data-swiper-slide-index", t), a.cache && (s.virtual.cache[t] = i), i;
    }
    function l (e) {
      const { slidesPerView: t, slidesPerGroup: a, centeredSlides: i } = s.params, { addSlidesBefore: l, addSlidesAfter: o } = s.params.virtual, { from: d, to: c, slides: p, slidesGrid: u, offset: h } = s.virtual;
      s.params.cssMode || s.updateActiveIndex();
      const m = s.activeIndex || 0;
      let f, g, v;
      f = s.rtlTranslate ? "right" : s.isHorizontal() ? "left" : "top", i ? (g = Math.floor(t / 2) + a + o, v = Math.floor(t / 2) + a + l) : (g = t + (a - 1) + o, v = a + l);
      const w = Math.max((m || 0) - v, 0), b = Math.min((m || 0) + g, p.length - 1),
        x = (s.slidesGrid[w] || 0) - (s.slidesGrid[0] || 0);
      function y () {s.updateSlides(), s.updateProgress(), s.updateSlidesClasses(), s.lazy && s.params.lazy.enabled && s.lazy.load(), r("virtualUpdate");}
      if (Object.assign(s.virtual, {
        from: w,
        to: b,
        offset: x,
        slidesGrid: s.slidesGrid
      }), d === w && c === b && !e) return s.slidesGrid !== u && x !== h && s.slides.css(f, `${x}px`), s.updateProgress(), void r("virtualUpdate");
      if (s.params.virtual.renderExternal) return s.params.virtual.renderExternal.call(s, {
        offset: x,
        from: w,
        to: b,
        slides: function () {
          const e = [];
          for (let t = w; t <= b; t += 1) e.push(p[t]);
          return e;
        }()
      }), void (s.params.virtual.renderExternalUpdate ? y() : r("virtualUpdate"));
      const E = [], C = [];
      if (e) s.$wrapperEl.find(`.${s.params.slideClass}`).remove(); else for (let e = d; e <= c; e += 1) (e < w || e > b) && s.$wrapperEl.find(`.${s.params.slideClass}[data-swiper-slide-index="${e}"]`).remove();
      for (let t = 0; t < p.length; t += 1) t >= w && t <= b && (void 0 === c || e ? C.push(t) : (t > c && C.push(t), t < d && E.push(t)));
      C.forEach((e => {s.$wrapperEl.append(n(p[e], e));})), E.sort(((e, t) => t - e)).forEach((e => {s.$wrapperEl.prepend(n(p[e], e));})), s.$wrapperEl.children(".swiper-slide").css(f, `${x}px`), y();
    }
    a({
      virtual: {
        enabled: !1,
        slides: [],
        cache: !0,
        renderSlide: null,
        renderExternal: null,
        renderExternalUpdate: !0,
        addSlidesBefore: 0,
        addSlidesAfter: 0
      }
    }), s.virtual = {
      cache: {},
      from: void 0,
      to: void 0,
      slides: [],
      offset: 0,
      slidesGrid: []
    }, i("beforeInit", (() => {s.params.virtual.enabled && (s.virtual.slides = s.params.virtual.slides, s.classNames.push(`${s.params.containerModifierClass}virtual`), s.params.watchSlidesProgress = !0, s.originalParams.watchSlidesProgress = !0, s.params.initialSlide || l());})), i("setTranslate", (() => {s.params.virtual.enabled && (s.params.cssMode && !s._immediateVirtual ? (clearTimeout(t), t = setTimeout((() => {l();}), 100)) : l());})), i("init update resize", (() => {s.params.virtual.enabled && s.params.cssMode && v(s.wrapperEl, "--swiper-virtual-size", `${s.virtualSize}px`);})), Object.assign(s.virtual, {
      appendSlide: function (e) {
        if ("object" == typeof e && "length" in e) for (let t = 0; t < e.length; t += 1) e[t] && s.virtual.slides.push(e[t]); else s.virtual.slides.push(e);
        l(!0);
      },
      prependSlide: function (e) {
        const t = s.activeIndex;
        let a = t + 1, i = 1;
        if (Array.isArray(e)) {
          for (let t = 0; t < e.length; t += 1) e[t] && s.virtual.slides.unshift(e[t]);
          a = t + e.length, i = e.length;
        } else s.virtual.slides.unshift(e);
        if (s.params.virtual.cache) {
          const e = s.virtual.cache, t = {};
          Object.keys(e).forEach((s => {
            const a = e[s], r = a.attr("data-swiper-slide-index");
            r && a.attr("data-swiper-slide-index", parseInt(r, 10) + i), t[parseInt(s, 10) + i] = a;
          })), s.virtual.cache = t;
        }
        l(!0), s.slideTo(a, 0);
      },
      removeSlide: function (e) {
        if (null == e) return;
        let t = s.activeIndex;
        if (Array.isArray(e)) for (let a = e.length - 1; a >= 0; a -= 1) s.virtual.slides.splice(e[a], 1), s.params.virtual.cache && delete s.virtual.cache[e[a]], e[a] < t && (t -= 1), t = Math.max(t, 0); else s.virtual.slides.splice(e, 1), s.params.virtual.cache && delete s.virtual.cache[e], e < t && (t -= 1), t = Math.max(t, 0);
        l(!0), s.slideTo(t, 0);
      },
      removeAllSlides: function () {s.virtual.slides = [], s.params.virtual.cache && (s.virtual.cache = {}), l(!0), s.slideTo(0, 0);},
      update: l
    });
  }, function (e) {
    let { swiper: t, extendParams: s, on: i, emit: n } = e;
    const l = a(), o = r();
    function c (e) {
      if (!t.enabled) return;
      const { rtlTranslate: s } = t;
      let a = e;
      a.originalEvent && (a = a.originalEvent);
      const i = a.keyCode || a.charCode, r = t.params.keyboard.pageUpDown, d = r && 33 === i, c = r && 34 === i,
        p = 37 === i, u = 39 === i, h = 38 === i, m = 40 === i;
      if (!t.allowSlideNext && (t.isHorizontal() && u || t.isVertical() && m || c)) return !1;
      if (!t.allowSlidePrev && (t.isHorizontal() && p || t.isVertical() && h || d)) return !1;
      if (!(a.shiftKey || a.altKey || a.ctrlKey || a.metaKey || l.activeElement && l.activeElement.nodeName && ("input" === l.activeElement.nodeName.toLowerCase() || "textarea" === l.activeElement.nodeName.toLowerCase()))) {
        if (t.params.keyboard.onlyInViewport && (d || c || p || u || h || m)) {
          let e = !1;
          if (t.$el.parents(`.${t.params.slideClass}`).length > 0 && 0 === t.$el.parents(`.${t.params.slideActiveClass}`).length) return;
          const a = t.$el, i = a[0].clientWidth, r = a[0].clientHeight, n = o.innerWidth, l = o.innerHeight,
            d = t.$el.offset();
          s && (d.left -= t.$el[0].scrollLeft);
          const c = [[d.left, d.top], [d.left + i, d.top], [d.left, d.top + r], [d.left + i, d.top + r]];
          for (let t = 0; t < c.length; t += 1) {
            const s = c[t];
            if (s[0] >= 0 && s[0] <= n && s[1] >= 0 && s[1] <= l) {
              if (0 === s[0] && 0 === s[1]) continue;
              e = !0;
            }
          }
          if (!e) return;
        }
        t.isHorizontal() ? ((d || c || p || u) && (a.preventDefault ? a.preventDefault() : a.returnValue = !1), ((c || u) && !s || (d || p) && s) && t.slideNext(), ((d || p) && !s || (c || u) && s) && t.slidePrev()) : ((d || c || h || m) && (a.preventDefault ? a.preventDefault() : a.returnValue = !1), (c || m) && t.slideNext(), (d || h) && t.slidePrev()), n("keyPress", i);
      }
    }
    function p () {t.keyboard.enabled || (d(l).on("keydown", c), t.keyboard.enabled = !0);}
    function u () {t.keyboard.enabled && (d(l).off("keydown", c), t.keyboard.enabled = !1);}
    t.keyboard = { enabled: !1 }, s({
      keyboard: {
        enabled: !1,
        onlyInViewport: !0,
        pageUpDown: !0
      }
    }), i("init", (() => {t.params.keyboard.enabled && p();})), i("destroy", (() => {t.keyboard.enabled && u();})), Object.assign(t.keyboard, {
      enable: p,
      disable: u
    });
  }, function (e) {
    let { swiper: t, extendParams: s, on: a, emit: i } = e;
    const n = r();
    let l;
    s({
      mousewheel: {
        enabled: !1,
        releaseOnEdges: !1,
        invert: !1,
        forceToAxis: !1,
        sensitivity: 1,
        eventsTarget: "container",
        thresholdDelta: null,
        thresholdTime: null
      }
    }), t.mousewheel = { enabled: !1 };
    let o, c = u();
    const h = [];
    function m () {t.enabled && (t.mouseEntered = !0);}
    function f () {t.enabled && (t.mouseEntered = !1);}
    function g (e) {return !(t.params.mousewheel.thresholdDelta && e.delta < t.params.mousewheel.thresholdDelta) && (!(t.params.mousewheel.thresholdTime && u() - c < t.params.mousewheel.thresholdTime) && (e.delta >= 6 && u() - c < 60 || (e.direction < 0 ? t.isEnd && !t.params.loop || t.animating || (t.slideNext(), i("scroll", e.raw)) : t.isBeginning && !t.params.loop || t.animating || (t.slidePrev(), i("scroll", e.raw)), c = (new n.Date).getTime(), !1)));}
    function v (e) {
      let s = e, a = !0;
      if (!t.enabled) return;
      const r = t.params.mousewheel;
      t.params.cssMode && s.preventDefault();
      let n = t.$el;
      if ("container" !== t.params.mousewheel.eventsTarget && (n = d(t.params.mousewheel.eventsTarget)), !t.mouseEntered && !n[0].contains(s.target) && !r.releaseOnEdges) return !0;
      s.originalEvent && (s = s.originalEvent);
      let c = 0;
      const m = t.rtlTranslate ? -1 : 1, f = function (e) {
        let t = 0, s = 0, a = 0, i = 0;
        return "detail" in e && (s = e.detail), "wheelDelta" in e && (s = -e.wheelDelta / 120), "wheelDeltaY" in e && (s = -e.wheelDeltaY / 120), "wheelDeltaX" in e && (t = -e.wheelDeltaX / 120), "axis" in e && e.axis === e.HORIZONTAL_AXIS && (t = s, s = 0), a = 10 * t, i = 10 * s, "deltaY" in e && (i = e.deltaY), "deltaX" in e && (a = e.deltaX), e.shiftKey && !a && (a = i, i = 0), (a || i) && e.deltaMode && (1 === e.deltaMode ? (a *= 40, i *= 40) : (a *= 800, i *= 800)), a && !t && (t = a < 1 ? -1 : 1), i && !s && (s = i < 1 ? -1 : 1), {
          spinX: t,
          spinY: s,
          pixelX: a,
          pixelY: i
        };
      }(s);
      if (r.forceToAxis) if (t.isHorizontal()) {
        if (!(Math.abs(f.pixelX) > Math.abs(f.pixelY))) return !0;
        c = -f.pixelX * m;
      } else {
        if (!(Math.abs(f.pixelY) > Math.abs(f.pixelX))) return !0;
        c = -f.pixelY;
      } else c = Math.abs(f.pixelX) > Math.abs(f.pixelY) ? -f.pixelX * m : -f.pixelY;
      if (0 === c) return !0;
      r.invert && (c = -c);
      let v = t.getTranslate() + c * r.sensitivity;
      if (v >= t.minTranslate() && (v = t.minTranslate()), v <= t.maxTranslate() && (v = t.maxTranslate()), a = !!t.params.loop || !(v === t.minTranslate() || v === t.maxTranslate()), a && t.params.nested && s.stopPropagation(), t.params.freeMode && t.params.freeMode.enabled) {
        const e = { time: u(), delta: Math.abs(c), direction: Math.sign(c) },
          a = o && e.time < o.time + 500 && e.delta <= o.delta && e.direction === o.direction;
        if (!a) {
          o = void 0, t.params.loop && t.loopFix();
          let n = t.getTranslate() + c * r.sensitivity;
          const d = t.isBeginning, u = t.isEnd;
          if (n >= t.minTranslate() && (n = t.minTranslate()), n <= t.maxTranslate() && (n = t.maxTranslate()), t.setTransition(0), t.setTranslate(n), t.updateProgress(), t.updateActiveIndex(), t.updateSlidesClasses(), (!d && t.isBeginning || !u && t.isEnd) && t.updateSlidesClasses(), t.params.freeMode.sticky) {
            clearTimeout(l), l = void 0, h.length >= 15 && h.shift();
            const s = h.length ? h[h.length - 1] : void 0, a = h[0];
            if (h.push(e), s && (e.delta > s.delta || e.direction !== s.direction)) h.splice(0); else if (h.length >= 15 && e.time - a.time < 500 && a.delta - e.delta >= 1 && e.delta <= 6) {
              const s = c > 0 ? .8 : .2;
              o = e, h.splice(0), l = p((() => {t.slideToClosest(t.params.speed, !0, void 0, s);}), 0);
            }
            l || (l = p((() => {o = e, h.splice(0), t.slideToClosest(t.params.speed, !0, void 0, .5);}), 500));
          }
          if (a || i("scroll", s), t.params.autoplay && t.params.autoplayDisableOnInteraction && t.autoplay.stop(), n === t.minTranslate() || n === t.maxTranslate()) return !0;
        }
      } else {
        const s = { time: u(), delta: Math.abs(c), direction: Math.sign(c), raw: e };
        h.length >= 2 && h.shift();
        const a = h.length ? h[h.length - 1] : void 0;
        if (h.push(s), a ? (s.direction !== a.direction || s.delta > a.delta || s.time > a.time + 150) && g(s) : g(s), function (e) {
          const s = t.params.mousewheel;
          if (e.direction < 0) {if (t.isEnd && !t.params.loop && s.releaseOnEdges) return !0;} else if (t.isBeginning && !t.params.loop && s.releaseOnEdges) return !0;
          return !1;
        }(s)) return !0;
      }
      return s.preventDefault ? s.preventDefault() : s.returnValue = !1, !1;
    }
    function w (e) {
      let s = t.$el;
      "container" !== t.params.mousewheel.eventsTarget && (s = d(t.params.mousewheel.eventsTarget)), s[e]("mouseenter", m), s[e]("mouseleave", f), s[e]("wheel", v);
    }
    function b () {return t.params.cssMode ? (t.wrapperEl.removeEventListener("wheel", v), !0) : !t.mousewheel.enabled && (w("on"), t.mousewheel.enabled = !0, !0);}
    function x () {return t.params.cssMode ? (t.wrapperEl.addEventListener(event, v), !0) : !!t.mousewheel.enabled && (w("off"), t.mousewheel.enabled = !1, !0);}
    a("init", (() => {!t.params.mousewheel.enabled && t.params.cssMode && x(), t.params.mousewheel.enabled && b();})), a("destroy", (() => {t.params.cssMode && b(), t.mousewheel.enabled && x();})), Object.assign(t.mousewheel, {
      enable: b,
      disable: x
    });
  }, function (e) {
    let { swiper: t, extendParams: s, on: a, emit: i } = e;
    function r (e) {
      let s;
      return e && (s = d(e), t.params.uniqueNavElements && "string" == typeof e && s.length > 1 && 1 === t.$el.find(e).length && (s = t.$el.find(e))), s;
    }
    function n (e, s) {
      const a = t.params.navigation;
      e && e.length > 0 && (e[s ? "addClass" : "removeClass"](a.disabledClass), e[0] && "BUTTON" === e[0].tagName && (e[0].disabled = s), t.params.watchOverflow && t.enabled && e[t.isLocked ? "addClass" : "removeClass"](a.lockClass));
    }
    function l () {
      if (t.params.loop) return;
      const { $nextEl: e, $prevEl: s } = t.navigation;
      n(s, t.isBeginning && !t.params.rewind), n(e, t.isEnd && !t.params.rewind);
    }
    function o (e) {e.preventDefault(), (!t.isBeginning || t.params.loop || t.params.rewind) && (t.slidePrev(), i("navigationPrev"));}
    function c (e) {e.preventDefault(), (!t.isEnd || t.params.loop || t.params.rewind) && (t.slideNext(), i("navigationNext"));}
    function p () {
      const e = t.params.navigation;
      if (t.params.navigation = F(t, t.originalParams.navigation, t.params.navigation, {
        nextEl: "swiper-button-next",
        prevEl: "swiper-button-prev"
      }), !e.nextEl && !e.prevEl) return;
      const s = r(e.nextEl), a = r(e.prevEl);
      s && s.length > 0 && s.on("click", c), a && a.length > 0 && a.on("click", o), Object.assign(t.navigation, {
        $nextEl: s,
        nextEl: s && s[0],
        $prevEl: a,
        prevEl: a && a[0]
      }), t.enabled || (s && s.addClass(e.lockClass), a && a.addClass(e.lockClass));
    }
    function u () {
      const { $nextEl: e, $prevEl: s } = t.navigation;
      e && e.length && (e.off("click", c), e.removeClass(t.params.navigation.disabledClass)), s && s.length && (s.off("click", o), s.removeClass(t.params.navigation.disabledClass));
    }
    s({
      navigation: {
        nextEl: null,
        prevEl: null,
        hideOnClick: !1,
        disabledClass: "swiper-button-disabled",
        hiddenClass: "swiper-button-hidden",
        lockClass: "swiper-button-lock",
        navigationDisabledClass: "swiper-navigation-disabled"
      }
    }), t.navigation = {
      nextEl: null,
      $nextEl: null,
      prevEl: null,
      $prevEl: null
    }, a("init", (() => {!1 === t.params.navigation.enabled ? h() : (p(), l());})), a("toEdge fromEdge lock unlock", (() => {l();})), a("destroy", (() => {u();})), a("enable disable", (() => {
      const { $nextEl: e, $prevEl: s } = t.navigation;
      e && e[t.enabled ? "removeClass" : "addClass"](t.params.navigation.lockClass), s && s[t.enabled ? "removeClass" : "addClass"](t.params.navigation.lockClass);
    })), a("click", ((e, s) => {
      const { $nextEl: a, $prevEl: r } = t.navigation, n = s.target;
      if (t.params.navigation.hideOnClick && !d(n).is(r) && !d(n).is(a)) {
        if (t.pagination && t.params.pagination && t.params.pagination.clickable && (t.pagination.el === n || t.pagination.el.contains(n))) return;
        let e;
        a ? e = a.hasClass(t.params.navigation.hiddenClass) : r && (e = r.hasClass(t.params.navigation.hiddenClass)), i(!0 === e ? "navigationShow" : "navigationHide"), a && a.toggleClass(t.params.navigation.hiddenClass), r && r.toggleClass(t.params.navigation.hiddenClass);
      }
    }));
    const h = () => {t.$el.addClass(t.params.navigation.navigationDisabledClass), u();};
    Object.assign(t.navigation, {
      enable: () => {t.$el.removeClass(t.params.navigation.navigationDisabledClass), p(), l();},
      disable: h,
      update: l,
      init: p,
      destroy: u
    });
  }, function (e) {
    let { swiper: t, extendParams: s, on: a, emit: i } = e;
    const r = "swiper-pagination";
    let n;
    s({
      pagination: {
        el: null,
        bulletElement: "span",
        clickable: !1,
        hideOnClick: !1,
        renderBullet: null,
        renderProgressbar: null,
        renderFraction: null,
        renderCustom: null,
        progressbarOpposite: !1,
        type: "bullets",
        dynamicBullets: !1,
        dynamicMainBullets: 1,
        formatFractionCurrent: e => e,
        formatFractionTotal: e => e,
        bulletClass: `${r}-bullet`,
        bulletActiveClass: `${r}-bullet-active`,
        modifierClass: `${r}-`,
        currentClass: `${r}-current`,
        totalClass: `${r}-total`,
        hiddenClass: `${r}-hidden`,
        progressbarFillClass: `${r}-progressbar-fill`,
        progressbarOppositeClass: `${r}-progressbar-opposite`,
        clickableClass: `${r}-clickable`,
        lockClass: `${r}-lock`,
        horizontalClass: `${r}-horizontal`,
        verticalClass: `${r}-vertical`,
        paginationDisabledClass: `${r}-disabled`
      }
    }), t.pagination = { el: null, $el: null, bullets: [] };
    let l = 0;
    function o () {return !t.params.pagination.el || !t.pagination.el || !t.pagination.$el || 0 === t.pagination.$el.length;}
    function c (e, s) {
      const { bulletActiveClass: a } = t.params.pagination;
      e[s]().addClass(`${a}-${s}`)[s]().addClass(`${a}-${s}-${s}`);
    }
    function p () {
      const e = t.rtl, s = t.params.pagination;
      if (o()) return;
      const a = t.virtual && t.params.virtual.enabled ? t.virtual.slides.length : t.slides.length, r = t.pagination.$el;
      let p;
      const u = t.params.loop ? Math.ceil((a - 2 * t.loopedSlides) / t.params.slidesPerGroup) : t.snapGrid.length;
      if (t.params.loop ? (p = Math.ceil((t.activeIndex - t.loopedSlides) / t.params.slidesPerGroup), p > a - 1 - 2 * t.loopedSlides && (p -= a - 2 * t.loopedSlides), p > u - 1 && (p -= u), p < 0 && "bullets" !== t.params.paginationType && (p = u + p)) : p = void 0 !== t.snapIndex ? t.snapIndex : t.activeIndex || 0, "bullets" === s.type && t.pagination.bullets && t.pagination.bullets.length > 0) {
        const a = t.pagination.bullets;
        let i, o, u;
        if (s.dynamicBullets && (n = a.eq(0)[t.isHorizontal() ? "outerWidth" : "outerHeight"](!0), r.css(t.isHorizontal() ? "width" : "height", n * (s.dynamicMainBullets + 4) + "px"), s.dynamicMainBullets > 1 && void 0 !== t.previousIndex && (l += p - (t.previousIndex - t.loopedSlides || 0), l > s.dynamicMainBullets - 1 ? l = s.dynamicMainBullets - 1 : l < 0 && (l = 0)), i = Math.max(p - l, 0), o = i + (Math.min(a.length, s.dynamicMainBullets) - 1), u = (o + i) / 2), a.removeClass(["", "-next", "-next-next", "-prev", "-prev-prev", "-main"].map((e => `${s.bulletActiveClass}${e}`)).join(" ")), r.length > 1) a.each((e => {
          const t = d(e), a = t.index();
          a === p && t.addClass(s.bulletActiveClass), s.dynamicBullets && (a >= i && a <= o && t.addClass(`${s.bulletActiveClass}-main`), a === i && c(t, "prev"), a === o && c(t, "next"));
        })); else {
          const e = a.eq(p), r = e.index();
          if (e.addClass(s.bulletActiveClass), s.dynamicBullets) {
            const e = a.eq(i), n = a.eq(o);
            for (let e = i; e <= o; e += 1) a.eq(e).addClass(`${s.bulletActiveClass}-main`);
            if (t.params.loop) if (r >= a.length) {
              for (let e = s.dynamicMainBullets; e >= 0; e -= 1) a.eq(a.length - e).addClass(`${s.bulletActiveClass}-main`);
              a.eq(a.length - s.dynamicMainBullets - 1).addClass(`${s.bulletActiveClass}-prev`);
            } else c(e, "prev"), c(n, "next"); else c(e, "prev"), c(n, "next");
          }
        }
        if (s.dynamicBullets) {
          const i = Math.min(a.length, s.dynamicMainBullets + 4), r = (n * i - n) / 2 - u * n, l = e ? "right" : "left";
          a.css(t.isHorizontal() ? l : "top", `${r}px`);
        }
      }
      if ("fraction" === s.type && (r.find(U(s.currentClass)).text(s.formatFractionCurrent(p + 1)), r.find(U(s.totalClass)).text(s.formatFractionTotal(u))), "progressbar" === s.type) {
        let e;
        e = s.progressbarOpposite ? t.isHorizontal() ? "vertical" : "horizontal" : t.isHorizontal() ? "horizontal" : "vertical";
        const a = (p + 1) / u;
        let i = 1, n = 1;
        "horizontal" === e ? i = a : n = a, r.find(U(s.progressbarFillClass)).transform(`translate3d(0,0,0) scaleX(${i}) scaleY(${n})`).transition(t.params.speed);
      }
      "custom" === s.type && s.renderCustom ? (r.html(s.renderCustom(t, p + 1, u)), i("paginationRender", r[0])) : i("paginationUpdate", r[0]), t.params.watchOverflow && t.enabled && r[t.isLocked ? "addClass" : "removeClass"](s.lockClass);
    }
    function u () {
      const e = t.params.pagination;
      if (o()) return;
      const s = t.virtual && t.params.virtual.enabled ? t.virtual.slides.length : t.slides.length, a = t.pagination.$el;
      let r = "";
      if ("bullets" === e.type) {
        let i = t.params.loop ? Math.ceil((s - 2 * t.loopedSlides) / t.params.slidesPerGroup) : t.snapGrid.length;
        t.params.freeMode && t.params.freeMode.enabled && !t.params.loop && i > s && (i = s);
        for (let s = 0; s < i; s += 1) e.renderBullet ? r += e.renderBullet.call(t, s, e.bulletClass) : r += `<${e.bulletElement} class="${e.bulletClass}"></${e.bulletElement}>`;
        a.html(r), t.pagination.bullets = a.find(U(e.bulletClass));
      }
      "fraction" === e.type && (r = e.renderFraction ? e.renderFraction.call(t, e.currentClass, e.totalClass) : `<span class="${e.currentClass}"></span> / <span class="${e.totalClass}"></span>`, a.html(r)), "progressbar" === e.type && (r = e.renderProgressbar ? e.renderProgressbar.call(t, e.progressbarFillClass) : `<span class="${e.progressbarFillClass}"></span>`, a.html(r)), "custom" !== e.type && i("paginationRender", t.pagination.$el[0]);
    }
    function h () {
      t.params.pagination = F(t, t.originalParams.pagination, t.params.pagination, { el: "swiper-pagination" });
      const e = t.params.pagination;
      if (!e.el) return;
      let s = d(e.el);
      0 !== s.length && (t.params.uniqueNavElements && "string" == typeof e.el && s.length > 1 && (s = t.$el.find(e.el), s.length > 1 && (s = s.filter((e => d(e).parents(".swiper")[0] === t.el)))), "bullets" === e.type && e.clickable && s.addClass(e.clickableClass), s.addClass(e.modifierClass + e.type), s.addClass(t.isHorizontal() ? e.horizontalClass : e.verticalClass), "bullets" === e.type && e.dynamicBullets && (s.addClass(`${e.modifierClass}${e.type}-dynamic`), l = 0, e.dynamicMainBullets < 1 && (e.dynamicMainBullets = 1)), "progressbar" === e.type && e.progressbarOpposite && s.addClass(e.progressbarOppositeClass), e.clickable && s.on("click", U(e.bulletClass), (function (e) {
        e.preventDefault();
        let s = d(this).index() * t.params.slidesPerGroup;
        t.params.loop && (s += t.loopedSlides), t.slideTo(s);
      })), Object.assign(t.pagination, { $el: s, el: s[0] }), t.enabled || s.addClass(e.lockClass));
    }
    function m () {
      const e = t.params.pagination;
      if (o()) return;
      const s = t.pagination.$el;
      s.removeClass(e.hiddenClass), s.removeClass(e.modifierClass + e.type), s.removeClass(t.isHorizontal() ? e.horizontalClass : e.verticalClass), t.pagination.bullets && t.pagination.bullets.removeClass && t.pagination.bullets.removeClass(e.bulletActiveClass), e.clickable && s.off("click", U(e.bulletClass));
    }
    a("init", (() => {!1 === t.params.pagination.enabled ? f() : (h(), u(), p());})), a("activeIndexChange", (() => {(t.params.loop || void 0 === t.snapIndex) && p();})), a("snapIndexChange", (() => {t.params.loop || p();})), a("slidesLengthChange", (() => {t.params.loop && (u(), p());})), a("snapGridLengthChange", (() => {t.params.loop || (u(), p());})), a("destroy", (() => {m();})), a("enable disable", (() => {
      const { $el: e } = t.pagination;
      e && e[t.enabled ? "removeClass" : "addClass"](t.params.pagination.lockClass);
    })), a("lock unlock", (() => {p();})), a("click", ((e, s) => {
      const a = s.target, { $el: r } = t.pagination;
      if (t.params.pagination.el && t.params.pagination.hideOnClick && r && r.length > 0 && !d(a).hasClass(t.params.pagination.bulletClass)) {
        if (t.navigation && (t.navigation.nextEl && a === t.navigation.nextEl || t.navigation.prevEl && a === t.navigation.prevEl)) return;
        const e = r.hasClass(t.params.pagination.hiddenClass);
        i(!0 === e ? "paginationShow" : "paginationHide"), r.toggleClass(t.params.pagination.hiddenClass);
      }
    }));
    const f = () => {t.$el.addClass(t.params.pagination.paginationDisabledClass), t.pagination.$el && t.pagination.$el.addClass(t.params.pagination.paginationDisabledClass), m();};
    Object.assign(t.pagination, {
      enable: () => {t.$el.removeClass(t.params.pagination.paginationDisabledClass), t.pagination.$el && t.pagination.$el.removeClass(t.params.pagination.paginationDisabledClass), h(), u(), p();},
      disable: f,
      render: u,
      update: p,
      init: h,
      destroy: m
    });
  }, function (e) {
    let { swiper: t, extendParams: s, on: i, emit: r } = e;
    const n = a();
    let l, o, c, u, h = !1, m = null, f = null;
    function g () {
      if (!t.params.scrollbar.el || !t.scrollbar.el) return;
      const { scrollbar: e, rtlTranslate: s, progress: a } = t, { $dragEl: i, $el: r } = e, n = t.params.scrollbar;
      let l = o, d = (c - o) * a;
      s ? (d = -d, d > 0 ? (l = o - d, d = 0) : -d + o > c && (l = c + d)) : d < 0 ? (l = o + d, d = 0) : d + o > c && (l = c - d), t.isHorizontal() ? (i.transform(`translate3d(${d}px, 0, 0)`), i[0].style.width = `${l}px`) : (i.transform(`translate3d(0px, ${d}px, 0)`), i[0].style.height = `${l}px`), n.hide && (clearTimeout(m), r[0].style.opacity = 1, m = setTimeout((() => {r[0].style.opacity = 0, r.transition(400);}), 1e3));
    }
    function v () {
      if (!t.params.scrollbar.el || !t.scrollbar.el) return;
      const { scrollbar: e } = t, { $dragEl: s, $el: a } = e;
      s[0].style.width = "", s[0].style.height = "", c = t.isHorizontal() ? a[0].offsetWidth : a[0].offsetHeight, u = t.size / (t.virtualSize + t.params.slidesOffsetBefore - (t.params.centeredSlides ? t.snapGrid[0] : 0)), o = "auto" === t.params.scrollbar.dragSize ? c * u : parseInt(t.params.scrollbar.dragSize, 10), t.isHorizontal() ? s[0].style.width = `${o}px` : s[0].style.height = `${o}px`, a[0].style.display = u >= 1 ? "none" : "", t.params.scrollbar.hide && (a[0].style.opacity = 0), t.params.watchOverflow && t.enabled && e.$el[t.isLocked ? "addClass" : "removeClass"](t.params.scrollbar.lockClass);
    }
    function w (e) {return t.isHorizontal() ? "touchstart" === e.type || "touchmove" === e.type ? e.targetTouches[0].clientX : e.clientX : "touchstart" === e.type || "touchmove" === e.type ? e.targetTouches[0].clientY : e.clientY;}
    function b (e) {
      const { scrollbar: s, rtlTranslate: a } = t, { $el: i } = s;
      let r;
      r = (w(e) - i.offset()[t.isHorizontal() ? "left" : "top"] - (null !== l ? l : o / 2)) / (c - o), r = Math.max(Math.min(r, 1), 0), a && (r = 1 - r);
      const n = t.minTranslate() + (t.maxTranslate() - t.minTranslate()) * r;
      t.updateProgress(n), t.setTranslate(n), t.updateActiveIndex(), t.updateSlidesClasses();
    }
    function x (e) {
      const s = t.params.scrollbar, { scrollbar: a, $wrapperEl: i } = t, { $el: n, $dragEl: o } = a;
      h = !0, l = e.target === o[0] || e.target === o ? w(e) - e.target.getBoundingClientRect()[t.isHorizontal() ? "left" : "top"] : null, e.preventDefault(), e.stopPropagation(), i.transition(100), o.transition(100), b(e), clearTimeout(f), n.transition(0), s.hide && n.css("opacity", 1), t.params.cssMode && t.$wrapperEl.css("scroll-snap-type", "none"), r("scrollbarDragStart", e);
    }
    function y (e) {
      const { scrollbar: s, $wrapperEl: a } = t, { $el: i, $dragEl: n } = s;
      h && (e.preventDefault ? e.preventDefault() : e.returnValue = !1, b(e), a.transition(0), i.transition(0), n.transition(0), r("scrollbarDragMove", e));
    }
    function E (e) {
      const s = t.params.scrollbar, { scrollbar: a, $wrapperEl: i } = t, { $el: n } = a;
      h && (h = !1, t.params.cssMode && (t.$wrapperEl.css("scroll-snap-type", ""), i.transition("")), s.hide && (clearTimeout(f), f = p((() => {n.css("opacity", 0), n.transition(400);}), 1e3)), r("scrollbarDragEnd", e), s.snapOnRelease && t.slideToClosest());
    }
    function C (e) {
      const { scrollbar: s, touchEventsTouch: a, touchEventsDesktop: i, params: r, support: l } = t, o = s.$el;
      if (!o) return;
      const d = o[0], c = !(!l.passiveListener || !r.passiveListeners) && { passive: !1, capture: !1 },
        p = !(!l.passiveListener || !r.passiveListeners) && { passive: !0, capture: !1 };
      if (!d) return;
      const u = "on" === e ? "addEventListener" : "removeEventListener";
      l.touch ? (d[u](a.start, x, c), d[u](a.move, y, c), d[u](a.end, E, p)) : (d[u](i.start, x, c), n[u](i.move, y, c), n[u](i.end, E, p));
    }
    function T () {
      const { scrollbar: e, $el: s } = t;
      t.params.scrollbar = F(t, t.originalParams.scrollbar, t.params.scrollbar, { el: "swiper-scrollbar" });
      const a = t.params.scrollbar;
      if (!a.el) return;
      let i = d(a.el);
      t.params.uniqueNavElements && "string" == typeof a.el && i.length > 1 && 1 === s.find(a.el).length && (i = s.find(a.el)), i.addClass(t.isHorizontal() ? a.horizontalClass : a.verticalClass);
      let r = i.find(`.${t.params.scrollbar.dragClass}`);
      0 === r.length && (r = d(`<div class="${t.params.scrollbar.dragClass}"></div>`), i.append(r)), Object.assign(e, {
        $el: i,
        el: i[0],
        $dragEl: r,
        dragEl: r[0]
      }), a.draggable && t.params.scrollbar.el && t.scrollbar.el && C("on"), i && i[t.enabled ? "removeClass" : "addClass"](t.params.scrollbar.lockClass);
    }
    function $ () {
      const e = t.params.scrollbar, s = t.scrollbar.$el;
      s && s.removeClass(t.isHorizontal() ? e.horizontalClass : e.verticalClass), t.params.scrollbar.el && t.scrollbar.el && C("off");
    }
    s({
      scrollbar: {
        el: null,
        dragSize: "auto",
        hide: !1,
        draggable: !1,
        snapOnRelease: !0,
        lockClass: "swiper-scrollbar-lock",
        dragClass: "swiper-scrollbar-drag",
        scrollbarDisabledClass: "swiper-scrollbar-disabled",
        horizontalClass: "swiper-scrollbar-horizontal",
        verticalClass: "swiper-scrollbar-vertical"
      }
    }), t.scrollbar = {
      el: null,
      dragEl: null,
      $el: null,
      $dragEl: null
    }, i("init", (() => {!1 === t.params.scrollbar.enabled ? S() : (T(), v(), g());})), i("update resize observerUpdate lock unlock", (() => {v();})), i("setTranslate", (() => {g();})), i("setTransition", ((e, s) => {!function (e) {t.params.scrollbar.el && t.scrollbar.el && t.scrollbar.$dragEl.transition(e);}(s);})), i("enable disable", (() => {
      const { $el: e } = t.scrollbar;
      e && e[t.enabled ? "removeClass" : "addClass"](t.params.scrollbar.lockClass);
    })), i("destroy", (() => {$();}));
    const S = () => {t.$el.addClass(t.params.scrollbar.scrollbarDisabledClass), t.scrollbar.$el && t.scrollbar.$el.addClass(t.params.scrollbar.scrollbarDisabledClass), $();};
    Object.assign(t.scrollbar, {
      enable: () => {t.$el.removeClass(t.params.scrollbar.scrollbarDisabledClass), t.scrollbar.$el && t.scrollbar.$el.removeClass(t.params.scrollbar.scrollbarDisabledClass), T(), v(), g();},
      disable: S,
      updateSize: v,
      setTranslate: g,
      init: T,
      destroy: $
    });
  }, function (e) {
    let { swiper: t, extendParams: s, on: a } = e;
    s({ parallax: { enabled: !1 } });
    const i = (e, s) => {
      const { rtl: a } = t, i = d(e), r = a ? -1 : 1, n = i.attr("data-swiper-parallax") || "0";
      let l = i.attr("data-swiper-parallax-x"), o = i.attr("data-swiper-parallax-y");
      const c = i.attr("data-swiper-parallax-scale"), p = i.attr("data-swiper-parallax-opacity");
      if (l || o ? (l = l || "0", o = o || "0") : t.isHorizontal() ? (l = n, o = "0") : (o = n, l = "0"), l = l.indexOf("%") >= 0 ? parseInt(l, 10) * s * r + "%" : l * s * r + "px", o = o.indexOf("%") >= 0 ? parseInt(o, 10) * s + "%" : o * s + "px", null != p) {
        const e = p - (p - 1) * (1 - Math.abs(s));
        i[0].style.opacity = e;
      }
      if (null == c) i.transform(`translate3d(${l}, ${o}, 0px)`); else {
        const e = c - (c - 1) * (1 - Math.abs(s));
        i.transform(`translate3d(${l}, ${o}, 0px) scale(${e})`);
      }
    }, r = () => {
      const { $el: e, slides: s, progress: a, snapGrid: r } = t;
      e.children("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]").each((e => {i(e, a);})), s.each(((e, s) => {
        let n = e.progress;
        t.params.slidesPerGroup > 1 && "auto" !== t.params.slidesPerView && (n += Math.ceil(s / 2) - a * (r.length - 1)), n = Math.min(Math.max(n, -1), 1), d(e).find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]").each((e => {i(e, n);}));
      }));
    };
    a("beforeInit", (() => {t.params.parallax.enabled && (t.params.watchSlidesProgress = !0, t.originalParams.watchSlidesProgress = !0);})), a("init", (() => {t.params.parallax.enabled && r();})), a("setTranslate", (() => {t.params.parallax.enabled && r();})), a("setTransition", ((e, s) => {
      t.params.parallax.enabled && function (e) {
        void 0 === e && (e = t.params.speed);
        const { $el: s } = t;
        s.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]").each((t => {
          const s = d(t);
          let a = parseInt(s.attr("data-swiper-parallax-duration"), 10) || e;
          0 === e && (a = 0), s.transition(a);
        }));
      }(s);
    }));
  }, function (e) {
    let { swiper: t, extendParams: s, on: a, emit: i } = e;
    const n = r();
    s({
      zoom: {
        enabled: !1,
        maxRatio: 3,
        minRatio: 1,
        toggle: !0,
        containerClass: "swiper-zoom-container",
        zoomedSlideClass: "swiper-slide-zoomed"
      }
    }), t.zoom = { enabled: !1 };
    let l, o, c, p = 1, u = !1;
    const m = {
      $slideEl: void 0,
      slideWidth: void 0,
      slideHeight: void 0,
      $imageEl: void 0,
      $imageWrapEl: void 0,
      maxRatio: 3
    }, f = {
      isTouched: void 0,
      isMoved: void 0,
      currentX: void 0,
      currentY: void 0,
      minX: void 0,
      minY: void 0,
      maxX: void 0,
      maxY: void 0,
      width: void 0,
      height: void 0,
      startX: void 0,
      startY: void 0,
      touchesStart: {},
      touchesCurrent: {}
    }, g = { x: void 0, y: void 0, prevPositionX: void 0, prevPositionY: void 0, prevTime: void 0 };
    let v = 1;
    function w (e) {
      if (e.targetTouches.length < 2) return 1;
      const t = e.targetTouches[0].pageX, s = e.targetTouches[0].pageY, a = e.targetTouches[1].pageX,
        i = e.targetTouches[1].pageY;
      return Math.sqrt((a - t) ** 2 + (i - s) ** 2);
    }
    function b (e) {
      const s = t.support, a = t.params.zoom;
      if (o = !1, c = !1, !s.gestures) {
        if ("touchstart" !== e.type || "touchstart" === e.type && e.targetTouches.length < 2) return;
        o = !0, m.scaleStart = w(e);
      }
      m.$slideEl && m.$slideEl.length || (m.$slideEl = d(e.target).closest(`.${t.params.slideClass}`), 0 === m.$slideEl.length && (m.$slideEl = t.slides.eq(t.activeIndex)), m.$imageEl = m.$slideEl.find(`.${a.containerClass}`).eq(0).find("picture, img, svg, canvas, .swiper-zoom-target").eq(0), m.$imageWrapEl = m.$imageEl.parent(`.${a.containerClass}`), m.maxRatio = m.$imageWrapEl.attr("data-swiper-zoom") || a.maxRatio, 0 !== m.$imageWrapEl.length) ? (m.$imageEl && m.$imageEl.transition(0), u = !0) : m.$imageEl = void 0;
    }
    function x (e) {
      const s = t.support, a = t.params.zoom, i = t.zoom;
      if (!s.gestures) {
        if ("touchmove" !== e.type || "touchmove" === e.type && e.targetTouches.length < 2) return;
        c = !0, m.scaleMove = w(e);
      }
      m.$imageEl && 0 !== m.$imageEl.length ? (s.gestures ? i.scale = e.scale * p : i.scale = m.scaleMove / m.scaleStart * p, i.scale > m.maxRatio && (i.scale = m.maxRatio - 1 + (i.scale - m.maxRatio + 1) ** .5), i.scale < a.minRatio && (i.scale = a.minRatio + 1 - (a.minRatio - i.scale + 1) ** .5), m.$imageEl.transform(`translate3d(0,0,0) scale(${i.scale})`)) : "gesturechange" === e.type && b(e);
    }
    function y (e) {
      const s = t.device, a = t.support, i = t.params.zoom, r = t.zoom;
      if (!a.gestures) {
        if (!o || !c) return;
        if ("touchend" !== e.type || "touchend" === e.type && e.changedTouches.length < 2 && !s.android) return;
        o = !1, c = !1;
      }
      m.$imageEl && 0 !== m.$imageEl.length && (r.scale = Math.max(Math.min(r.scale, m.maxRatio), i.minRatio), m.$imageEl.transition(t.params.speed).transform(`translate3d(0,0,0) scale(${r.scale})`), p = r.scale, u = !1, 1 === r.scale && (m.$slideEl = void 0));
    }
    function E (e) {
      const s = t.zoom;
      if (!m.$imageEl || 0 === m.$imageEl.length) return;
      if (t.allowClick = !1, !f.isTouched || !m.$slideEl) return;
      f.isMoved || (f.width = m.$imageEl[0].offsetWidth, f.height = m.$imageEl[0].offsetHeight, f.startX = h(m.$imageWrapEl[0], "x") || 0, f.startY = h(m.$imageWrapEl[0], "y") || 0, m.slideWidth = m.$slideEl[0].offsetWidth, m.slideHeight = m.$slideEl[0].offsetHeight, m.$imageWrapEl.transition(0));
      const a = f.width * s.scale, i = f.height * s.scale;
      if (!(a < m.slideWidth && i < m.slideHeight)) {
        if (f.minX = Math.min(m.slideWidth / 2 - a / 2, 0), f.maxX = -f.minX, f.minY = Math.min(m.slideHeight / 2 - i / 2, 0), f.maxY = -f.minY, f.touchesCurrent.x = "touchmove" === e.type ? e.targetTouches[0].pageX : e.pageX, f.touchesCurrent.y = "touchmove" === e.type ? e.targetTouches[0].pageY : e.pageY, !f.isMoved && !u) {
          if (t.isHorizontal() && (Math.floor(f.minX) === Math.floor(f.startX) && f.touchesCurrent.x < f.touchesStart.x || Math.floor(f.maxX) === Math.floor(f.startX) && f.touchesCurrent.x > f.touchesStart.x)) return void (f.isTouched = !1);
          if (!t.isHorizontal() && (Math.floor(f.minY) === Math.floor(f.startY) && f.touchesCurrent.y < f.touchesStart.y || Math.floor(f.maxY) === Math.floor(f.startY) && f.touchesCurrent.y > f.touchesStart.y)) return void (f.isTouched = !1);
        }
        e.cancelable && e.preventDefault(), e.stopPropagation(), f.isMoved = !0, f.currentX = f.touchesCurrent.x - f.touchesStart.x + f.startX, f.currentY = f.touchesCurrent.y - f.touchesStart.y + f.startY, f.currentX < f.minX && (f.currentX = f.minX + 1 - (f.minX - f.currentX + 1) ** .8), f.currentX > f.maxX && (f.currentX = f.maxX - 1 + (f.currentX - f.maxX + 1) ** .8), f.currentY < f.minY && (f.currentY = f.minY + 1 - (f.minY - f.currentY + 1) ** .8), f.currentY > f.maxY && (f.currentY = f.maxY - 1 + (f.currentY - f.maxY + 1) ** .8), g.prevPositionX || (g.prevPositionX = f.touchesCurrent.x), g.prevPositionY || (g.prevPositionY = f.touchesCurrent.y), g.prevTime || (g.prevTime = Date.now()), g.x = (f.touchesCurrent.x - g.prevPositionX) / (Date.now() - g.prevTime) / 2, g.y = (f.touchesCurrent.y - g.prevPositionY) / (Date.now() - g.prevTime) / 2, Math.abs(f.touchesCurrent.x - g.prevPositionX) < 2 && (g.x = 0), Math.abs(f.touchesCurrent.y - g.prevPositionY) < 2 && (g.y = 0), g.prevPositionX = f.touchesCurrent.x, g.prevPositionY = f.touchesCurrent.y, g.prevTime = Date.now(), m.$imageWrapEl.transform(`translate3d(${f.currentX}px, ${f.currentY}px,0)`);
      }
    }
    function C () {
      const e = t.zoom;
      m.$slideEl && t.previousIndex !== t.activeIndex && (m.$imageEl && m.$imageEl.transform("translate3d(0,0,0) scale(1)"), m.$imageWrapEl && m.$imageWrapEl.transform("translate3d(0,0,0)"), e.scale = 1, p = 1, m.$slideEl = void 0, m.$imageEl = void 0, m.$imageWrapEl = void 0);
    }
    function T (e) {
      const s = t.zoom, a = t.params.zoom;
      if (m.$slideEl || (e && e.target && (m.$slideEl = d(e.target).closest(`.${t.params.slideClass}`)), m.$slideEl || (t.params.virtual && t.params.virtual.enabled && t.virtual ? m.$slideEl = t.$wrapperEl.children(`.${t.params.slideActiveClass}`) : m.$slideEl = t.slides.eq(t.activeIndex)), m.$imageEl = m.$slideEl.find(`.${a.containerClass}`).eq(0).find("picture, img, svg, canvas, .swiper-zoom-target").eq(0), m.$imageWrapEl = m.$imageEl.parent(`.${a.containerClass}`)), !m.$imageEl || 0 === m.$imageEl.length || !m.$imageWrapEl || 0 === m.$imageWrapEl.length) return;
      let i, r, l, o, c, u, h, g, v, w, b, x, y, E, C, T, $, S;
      t.params.cssMode && (t.wrapperEl.style.overflow = "hidden", t.wrapperEl.style.touchAction = "none"), m.$slideEl.addClass(`${a.zoomedSlideClass}`), void 0 === f.touchesStart.x && e ? (i = "touchend" === e.type ? e.changedTouches[0].pageX : e.pageX, r = "touchend" === e.type ? e.changedTouches[0].pageY : e.pageY) : (i = f.touchesStart.x, r = f.touchesStart.y), s.scale = m.$imageWrapEl.attr("data-swiper-zoom") || a.maxRatio, p = m.$imageWrapEl.attr("data-swiper-zoom") || a.maxRatio, e ? ($ = m.$slideEl[0].offsetWidth, S = m.$slideEl[0].offsetHeight, l = m.$slideEl.offset().left + n.scrollX, o = m.$slideEl.offset().top + n.scrollY, c = l + $ / 2 - i, u = o + S / 2 - r, v = m.$imageEl[0].offsetWidth, w = m.$imageEl[0].offsetHeight, b = v * s.scale, x = w * s.scale, y = Math.min($ / 2 - b / 2, 0), E = Math.min(S / 2 - x / 2, 0), C = -y, T = -E, h = c * s.scale, g = u * s.scale, h < y && (h = y), h > C && (h = C), g < E && (g = E), g > T && (g = T)) : (h = 0, g = 0), m.$imageWrapEl.transition(300).transform(`translate3d(${h}px, ${g}px,0)`), m.$imageEl.transition(300).transform(`translate3d(0,0,0) scale(${s.scale})`);
    }
    function $ () {
      const e = t.zoom, s = t.params.zoom;
      m.$slideEl || (t.params.virtual && t.params.virtual.enabled && t.virtual ? m.$slideEl = t.$wrapperEl.children(`.${t.params.slideActiveClass}`) : m.$slideEl = t.slides.eq(t.activeIndex), m.$imageEl = m.$slideEl.find(`.${s.containerClass}`).eq(0).find("picture, img, svg, canvas, .swiper-zoom-target").eq(0), m.$imageWrapEl = m.$imageEl.parent(`.${s.containerClass}`)), m.$imageEl && 0 !== m.$imageEl.length && m.$imageWrapEl && 0 !== m.$imageWrapEl.length && (t.params.cssMode && (t.wrapperEl.style.overflow = "", t.wrapperEl.style.touchAction = ""), e.scale = 1, p = 1, m.$imageWrapEl.transition(300).transform("translate3d(0,0,0)"), m.$imageEl.transition(300).transform("translate3d(0,0,0) scale(1)"), m.$slideEl.removeClass(`${s.zoomedSlideClass}`), m.$slideEl = void 0);
    }
    function S (e) {
      const s = t.zoom;
      s.scale && 1 !== s.scale ? $() : T(e);
    }
    function M () {
      const e = t.support;
      return {
        passiveListener: !("touchstart" !== t.touchEvents.start || !e.passiveListener || !t.params.passiveListeners) && {
          passive: !0,
          capture: !1
        }, activeListenerWithCapture: !e.passiveListener || { passive: !1, capture: !0 }
      };
    }
    function P () {return `.${t.params.slideClass}`;}
    function k (e) {
      const { passiveListener: s } = M(), a = P();
      t.$wrapperEl[e]("gesturestart", a, b, s), t.$wrapperEl[e]("gesturechange", a, x, s), t.$wrapperEl[e]("gestureend", a, y, s);
    }
    function z () {l || (l = !0, k("on"));}
    function L () {l && (l = !1, k("off"));}
    function O () {
      const e = t.zoom;
      if (e.enabled) return;
      e.enabled = !0;
      const s = t.support, { passiveListener: a, activeListenerWithCapture: i } = M(), r = P();
      s.gestures ? (t.$wrapperEl.on(t.touchEvents.start, z, a), t.$wrapperEl.on(t.touchEvents.end, L, a)) : "touchstart" === t.touchEvents.start && (t.$wrapperEl.on(t.touchEvents.start, r, b, a), t.$wrapperEl.on(t.touchEvents.move, r, x, i), t.$wrapperEl.on(t.touchEvents.end, r, y, a), t.touchEvents.cancel && t.$wrapperEl.on(t.touchEvents.cancel, r, y, a)), t.$wrapperEl.on(t.touchEvents.move, `.${t.params.zoom.containerClass}`, E, i);
    }
    function I () {
      const e = t.zoom;
      if (!e.enabled) return;
      const s = t.support;
      e.enabled = !1;
      const { passiveListener: a, activeListenerWithCapture: i } = M(), r = P();
      s.gestures ? (t.$wrapperEl.off(t.touchEvents.start, z, a), t.$wrapperEl.off(t.touchEvents.end, L, a)) : "touchstart" === t.touchEvents.start && (t.$wrapperEl.off(t.touchEvents.start, r, b, a), t.$wrapperEl.off(t.touchEvents.move, r, x, i), t.$wrapperEl.off(t.touchEvents.end, r, y, a), t.touchEvents.cancel && t.$wrapperEl.off(t.touchEvents.cancel, r, y, a)), t.$wrapperEl.off(t.touchEvents.move, `.${t.params.zoom.containerClass}`, E, i);
    }
    Object.defineProperty(t.zoom, "scale", {
      get: () => v,
      set (e) {
        if (v !== e) {
          const t = m.$imageEl ? m.$imageEl[0] : void 0, s = m.$slideEl ? m.$slideEl[0] : void 0;
          i("zoomChange", e, t, s);
        }
        v = e;
      }
    }), a("init", (() => {t.params.zoom.enabled && O();})), a("destroy", (() => {I();})), a("touchStart", ((e, s) => {
      t.zoom.enabled && function (e) {
        const s = t.device;
        m.$imageEl && 0 !== m.$imageEl.length && (f.isTouched || (s.android && e.cancelable && e.preventDefault(), f.isTouched = !0, f.touchesStart.x = "touchstart" === e.type ? e.targetTouches[0].pageX : e.pageX, f.touchesStart.y = "touchstart" === e.type ? e.targetTouches[0].pageY : e.pageY));
      }(s);
    })), a("touchEnd", ((e, s) => {
      t.zoom.enabled && function () {
        const e = t.zoom;
        if (!m.$imageEl || 0 === m.$imageEl.length) return;
        if (!f.isTouched || !f.isMoved) return f.isTouched = !1, void (f.isMoved = !1);
        f.isTouched = !1, f.isMoved = !1;
        let s = 300, a = 300;
        const i = g.x * s, r = f.currentX + i, n = g.y * a, l = f.currentY + n;
        0 !== g.x && (s = Math.abs((r - f.currentX) / g.x)), 0 !== g.y && (a = Math.abs((l - f.currentY) / g.y));
        const o = Math.max(s, a);
        f.currentX = r, f.currentY = l;
        const d = f.width * e.scale, c = f.height * e.scale;
        f.minX = Math.min(m.slideWidth / 2 - d / 2, 0), f.maxX = -f.minX, f.minY = Math.min(m.slideHeight / 2 - c / 2, 0), f.maxY = -f.minY, f.currentX = Math.max(Math.min(f.currentX, f.maxX), f.minX), f.currentY = Math.max(Math.min(f.currentY, f.maxY), f.minY), m.$imageWrapEl.transition(o).transform(`translate3d(${f.currentX}px, ${f.currentY}px,0)`);
      }();
    })), a("doubleTap", ((e, s) => {!t.animating && t.params.zoom.enabled && t.zoom.enabled && t.params.zoom.toggle && S(s);})), a("transitionEnd", (() => {t.zoom.enabled && t.params.zoom.enabled && C();})), a("slideChange", (() => {t.zoom.enabled && t.params.zoom.enabled && t.params.cssMode && C();})), Object.assign(t.zoom, {
      enable: O,
      disable: I,
      in: T,
      out: $,
      toggle: S
    });
  }, function (e) {
    let { swiper: t, extendParams: s, on: a, emit: i } = e;
    s({
      lazy: {
        checkInView: !1,
        enabled: !1,
        loadPrevNext: !1,
        loadPrevNextAmount: 1,
        loadOnTransitionStart: !1,
        scrollingElement: "",
        elementClass: "swiper-lazy",
        loadingClass: "swiper-lazy-loading",
        loadedClass: "swiper-lazy-loaded",
        preloaderClass: "swiper-lazy-preloader"
      }
    }), t.lazy = {};
    let n = !1, l = !1;
    function o (e, s) {
      void 0 === s && (s = !0);
      const a = t.params.lazy;
      if (void 0 === e) return;
      if (0 === t.slides.length) return;
      const r = t.virtual && t.params.virtual.enabled ? t.$wrapperEl.children(`.${t.params.slideClass}[data-swiper-slide-index="${e}"]`) : t.slides.eq(e),
        n = r.find(`.${a.elementClass}:not(.${a.loadedClass}):not(.${a.loadingClass})`);
      !r.hasClass(a.elementClass) || r.hasClass(a.loadedClass) || r.hasClass(a.loadingClass) || n.push(r[0]), 0 !== n.length && n.each((e => {
        const n = d(e);
        n.addClass(a.loadingClass);
        const l = n.attr("data-background"), c = n.attr("data-src"), p = n.attr("data-srcset"),
          u = n.attr("data-sizes"), h = n.parent("picture");
        t.loadImage(n[0], c || l, p, u, !1, (() => {
          if (null != t && t && (!t || t.params) && !t.destroyed) {
            if (l ? (n.css("background-image", `url("${l}")`), n.removeAttr("data-background")) : (p && (n.attr("srcset", p), n.removeAttr("data-srcset")), u && (n.attr("sizes", u), n.removeAttr("data-sizes")), h.length && h.children("source").each((e => {
              const t = d(e);
              t.attr("data-srcset") && (t.attr("srcset", t.attr("data-srcset")), t.removeAttr("data-srcset"));
            })), c && (n.attr("src", c), n.removeAttr("data-src"))), n.addClass(a.loadedClass).removeClass(a.loadingClass), r.find(`.${a.preloaderClass}`).remove(), t.params.loop && s) {
              const e = r.attr("data-swiper-slide-index");
              if (r.hasClass(t.params.slideDuplicateClass)) {o(t.$wrapperEl.children(`[data-swiper-slide-index="${e}"]:not(.${t.params.slideDuplicateClass})`).index(), !1);} else {o(t.$wrapperEl.children(`.${t.params.slideDuplicateClass}[data-swiper-slide-index="${e}"]`).index(), !1);}
            }
            i("lazyImageReady", r[0], n[0]), t.params.autoHeight && t.updateAutoHeight();
          }
        })), i("lazyImageLoad", r[0], n[0]);
      }));
    }
    function c () {
      const { $wrapperEl: e, params: s, slides: a, activeIndex: i } = t, r = t.virtual && s.virtual.enabled, n = s.lazy;
      let c = s.slidesPerView;
      function p (t) {
        if (r) {if (e.children(`.${s.slideClass}[data-swiper-slide-index="${t}"]`).length) return !0;} else if (a[t]) return !0;
        return !1;
      }
      function u (e) {return r ? d(e).attr("data-swiper-slide-index") : d(e).index();}
      if ("auto" === c && (c = 0), l || (l = !0), t.params.watchSlidesProgress) e.children(`.${s.slideVisibleClass}`).each((e => {o(r ? d(e).attr("data-swiper-slide-index") : d(e).index());})); else if (c > 1) for (let e = i; e < i + c; e += 1) p(e) && o(e); else o(i);
      if (n.loadPrevNext) if (c > 1 || n.loadPrevNextAmount && n.loadPrevNextAmount > 1) {
        const e = n.loadPrevNextAmount, t = Math.ceil(c), s = Math.min(i + t + Math.max(e, t), a.length),
          r = Math.max(i - Math.max(t, e), 0);
        for (let e = i + t; e < s; e += 1) p(e) && o(e);
        for (let e = r; e < i; e += 1) p(e) && o(e);
      } else {
        const t = e.children(`.${s.slideNextClass}`);
        t.length > 0 && o(u(t));
        const a = e.children(`.${s.slidePrevClass}`);
        a.length > 0 && o(u(a));
      }
    }
    function p () {
      const e = r();
      if (!t || t.destroyed) return;
      const s = t.params.lazy.scrollingElement ? d(t.params.lazy.scrollingElement) : d(e), a = s[0] === e,
        i = a ? e.innerWidth : s[0].offsetWidth, l = a ? e.innerHeight : s[0].offsetHeight,
        o = t.$el.offset(), { rtlTranslate: u } = t;
      let h = !1;
      u && (o.left -= t.$el[0].scrollLeft);
      const m = [[o.left, o.top], [o.left + t.width, o.top], [o.left, o.top + t.height], [o.left + t.width, o.top + t.height]];
      for (let e = 0; e < m.length; e += 1) {
        const t = m[e];
        if (t[0] >= 0 && t[0] <= i && t[1] >= 0 && t[1] <= l) {
          if (0 === t[0] && 0 === t[1]) continue;
          h = !0;
        }
      }
      const f = !("touchstart" !== t.touchEvents.start || !t.support.passiveListener || !t.params.passiveListeners) && {
        passive: !0,
        capture: !1
      };
      h ? (c(), s.off("scroll", p, f)) : n || (n = !0, s.on("scroll", p, f));
    }
    a("beforeInit", (() => {t.params.lazy.enabled && t.params.preloadImages && (t.params.preloadImages = !1);})), a("init", (() => {t.params.lazy.enabled && (t.params.lazy.checkInView ? p() : c());})), a("scroll", (() => {t.params.freeMode && t.params.freeMode.enabled && !t.params.freeMode.sticky && c();})), a("scrollbarDragMove resize _freeModeNoMomentumRelease", (() => {t.params.lazy.enabled && (t.params.lazy.checkInView ? p() : c());})), a("transitionStart", (() => {t.params.lazy.enabled && (t.params.lazy.loadOnTransitionStart || !t.params.lazy.loadOnTransitionStart && !l) && (t.params.lazy.checkInView ? p() : c());})), a("transitionEnd", (() => {t.params.lazy.enabled && !t.params.lazy.loadOnTransitionStart && (t.params.lazy.checkInView ? p() : c());})), a("slideChange", (() => {
      const { lazy: e, cssMode: s, watchSlidesProgress: a, touchReleaseOnEdges: i, resistanceRatio: r } = t.params;
      e.enabled && (s || a && (i || 0 === r)) && c();
    })), a("destroy", (() => {t.$el && t.$el.find(`.${t.params.lazy.loadingClass}`).removeClass(t.params.lazy.loadingClass);})), Object.assign(t.lazy, {
      load: c,
      loadInSlide: o
    });
  }, function (e) {
    let { swiper: t, extendParams: s, on: a } = e;
    function i (e, t) {
      const s = function () {
        let e, t, s;
        return (a, i) => {
          for (t = -1, e = a.length; e - t > 1;) s = e + t >> 1, a[s] <= i ? t = s : e = s;
          return e;
        };
      }();
      let a, i;
      return this.x = e, this.y = t, this.lastIndex = e.length - 1, this.interpolate = function (e) {return e ? (i = s(this.x, e), a = i - 1, (e - this.x[a]) * (this.y[i] - this.y[a]) / (this.x[i] - this.x[a]) + this.y[a]) : 0;}, this;
    }
    function r () {t.controller.control && t.controller.spline && (t.controller.spline = void 0, delete t.controller.spline);}
    s({
      controller: {
        control: void 0,
        inverse: !1,
        by: "slide"
      }
    }), t.controller = { control: void 0 }, a("beforeInit", (() => {t.controller.control = t.params.controller.control;})), a("update", (() => {r();})), a("resize", (() => {r();})), a("observerUpdate", (() => {r();})), a("setTranslate", ((e, s, a) => {t.controller.control && t.controller.setTranslate(s, a);})), a("setTransition", ((e, s, a) => {t.controller.control && t.controller.setTransition(s, a);})), Object.assign(t.controller, {
      setTranslate: function (e, s) {
        const a = t.controller.control;
        let r, n;
        const l = t.constructor;
        function o (e) {
          const s = t.rtlTranslate ? -t.translate : t.translate;
          "slide" === t.params.controller.by && (!function (e) {t.controller.spline || (t.controller.spline = t.params.loop ? new i(t.slidesGrid, e.slidesGrid) : new i(t.snapGrid, e.snapGrid));}(e), n = -t.controller.spline.interpolate(-s)), n && "container" !== t.params.controller.by || (r = (e.maxTranslate() - e.minTranslate()) / (t.maxTranslate() - t.minTranslate()), n = (s - t.minTranslate()) * r + e.minTranslate()), t.params.controller.inverse && (n = e.maxTranslate() - n), e.updateProgress(n), e.setTranslate(n, t), e.updateActiveIndex(), e.updateSlidesClasses();
        }
        if (Array.isArray(a)) for (let e = 0; e < a.length; e += 1) a[e] !== s && a[e] instanceof l && o(a[e]); else a instanceof l && s !== a && o(a);
      }, setTransition: function (e, s) {
        const a = t.constructor, i = t.controller.control;
        let r;
        function n (s) {s.setTransition(e, t), 0 !== e && (s.transitionStart(), s.params.autoHeight && p((() => {s.updateAutoHeight();})), s.$wrapperEl.transitionEnd((() => {i && (s.params.loop && "slide" === t.params.controller.by && s.loopFix(), s.transitionEnd());})));}
        if (Array.isArray(i)) for (r = 0; r < i.length; r += 1) i[r] !== s && i[r] instanceof a && n(i[r]); else i instanceof a && s !== i && n(i);
      }
    });
  }, function (e) {
    let { swiper: t, extendParams: s, on: a } = e;
    s({
      a11y: {
        enabled: !0,
        notificationClass: "swiper-notification",
        prevSlideMessage: "Previous slide",
        nextSlideMessage: "Next slide",
        firstSlideMessage: "This is the first slide",
        lastSlideMessage: "This is the last slide",
        paginationBulletMessage: "Go to slide {{index}}",
        slideLabelMessage: "{{index}} / {{slidesLength}}",
        containerMessage: null,
        containerRoleDescriptionMessage: null,
        itemRoleDescriptionMessage: null,
        slideRole: "group",
        id: null
      }
    }), t.a11y = { clicked: !1 };
    let i = null;
    function r (e) {
      const t = i;
      0 !== t.length && (t.html(""), t.html(e));
    }
    function n (e) {}
    function l (e) {}
    function o (e, t) {e.attr("role", t);}
    function c (e, t) {e.attr("aria-roledescription", t);}
    function p (e, t) {}
    function u (e) {e.attr("aria-disabled", !0);}
    function h (e) {e.attr("aria-disabled", !1);}
    function m (e) {
      if (13 !== e.keyCode && 32 !== e.keyCode) return;
      const s = t.params.a11y, a = d(e.target);
      t.navigation && t.navigation.$nextEl && a.is(t.navigation.$nextEl) && (t.isEnd && !t.params.loop || t.slideNext(), t.isEnd ? r(s.lastSlideMessage) : r(s.nextSlideMessage)), t.navigation && t.navigation.$prevEl && a.is(t.navigation.$prevEl) && (t.isBeginning && !t.params.loop || t.slidePrev(), t.isBeginning ? r(s.firstSlideMessage) : r(s.prevSlideMessage)), t.pagination && a.is(U(t.params.pagination.bulletClass)) && a[0].click();
    }
    function f () {return t.pagination && t.pagination.bullets && t.pagination.bullets.length;}
    function g () {return f() && t.params.pagination.clickable;}
    const v = (e, t, s) => {n(e), "BUTTON" !== e[0].tagName && (o(e, "button"), e.on("keydown", m)), p(e, s), function (e, t) {e.attr("aria-controls", t);}(e, t);},
      w = () => {t.a11y.clicked = !0;},
      b = () => {requestAnimationFrame((() => {requestAnimationFrame((() => {t.destroyed || (t.a11y.clicked = !1);}));}));},
      x = e => {
        if (t.a11y.clicked) return;
        const s = e.target.closest(`.${t.params.slideClass}`);
        if (!s || !t.slides.includes(s)) return;
        const a = t.slides.indexOf(s) === t.activeIndex,
          i = t.params.watchSlidesProgress && t.visibleSlides && t.visibleSlides.includes(s);
        a || i || e.sourceCapabilities && e.sourceCapabilities.firesTouchEvents || (t.isHorizontal() ? t.el.scrollLeft = 0 : t.el.scrollTop = 0, t.slideTo(t.slides.indexOf(s), 0));
      }, y = () => {
        const e = t.params.a11y;
        e.itemRoleDescriptionMessage && c(d(t.slides), e.itemRoleDescriptionMessage), e.slideRole && o(d(t.slides), e.slideRole);
        const s = t.params.loop ? t.slides.filter((e => !e.classList.contains(t.params.slideDuplicateClass))).length : t.slides.length;
        e.slideLabelMessage && t.slides.each(((a, i) => {
          const r = d(a), n = t.params.loop ? parseInt(r.attr("data-swiper-slide-index"), 10) : i;
          p(r, e.slideLabelMessage.replace(/\{\{index\}\}/, n + 1).replace(/\{\{slidesLength\}\}/, s));
        }));
      }, E = () => {
        const e = t.params.a11y;
        t.$el.append(i);
        const s = t.$el;
        e.containerRoleDescriptionMessage && c(s, e.containerRoleDescriptionMessage), e.containerMessage && p(s, e.containerMessage);
        const a = t.$wrapperEl,
          r = e.id || a.attr("id") || `swiper-wrapper-${n = 16,void 0===n&&(n=16),"x".repeat(n).replace(/x/g,(()=>Math.round(16*Math.random()).toString(16)))}`;
        var n;
        const l = t.params.autoplay && t.params.autoplay.enabled ? "off" : "polite";
        var o;
        let d, u;
        o = r, a.attr("id", o), function (e, t) {e.attr("aria-live", t);}(a, l), y(), t.navigation && t.navigation.$nextEl && (d = t.navigation.$nextEl), t.navigation && t.navigation.$prevEl && (u = t.navigation.$prevEl), d && d.length && v(d, r, e.nextSlideMessage), u && u.length && v(u, r, e.prevSlideMessage), g() && t.pagination.$el.on("keydown", U(t.params.pagination.bulletClass), m), t.$el.on("focus", x, !0), t.$el.on("pointerdown", w, !0), t.$el.on("pointerup", b, !0);
      };
    a("beforeInit", (() => {i = d(`<span class="${t.params.a11y.notificationClass}" aria-live="assertive" aria-atomic="true"></span>`);})), a("afterInit", (() => {t.params.a11y.enabled && E();})), a("slidesLengthChange snapGridLengthChange slidesGridLengthChange", (() => {t.params.a11y.enabled && y();})), a("fromEdge toEdge afterInit lock unlock", (() => {
      t.params.a11y.enabled && function () {
        if (t.params.loop || t.params.rewind || !t.navigation) return;
        const { $nextEl: e, $prevEl: s } = t.navigation;
        s && s.length > 0 && (t.isBeginning ? (u(s), l(s)) : (h(s), n(s))), e && e.length > 0 && (t.isEnd ? (u(e), l(e)) : (h(e), n(e)));
      }();
    })), a("paginationUpdate", (() => {
      t.params.a11y.enabled && function () {
        const e = t.params.a11y;
        f() && t.pagination.bullets.each((s => {
          const a = d(s);
          t.params.pagination.clickable && (n(a), t.params.pagination.renderBullet || (o(a, "button"), p(a, e.paginationBulletMessage.replace(/\{\{index\}\}/, a.index() + 1)))), a.is(`.${t.params.pagination.bulletActiveClass}`) ? a.attr("aria-current", "true") : a.removeAttr("aria-current");
        }));
      }();
    })), a("destroy", (() => {
      t.params.a11y.enabled && function () {
        let e, s;
        i && i.length > 0 && i.remove(), t.navigation && t.navigation.$nextEl && (e = t.navigation.$nextEl), t.navigation && t.navigation.$prevEl && (s = t.navigation.$prevEl), e && e.off("keydown", m), s && s.off("keydown", m), g() && t.pagination.$el.off("keydown", U(t.params.pagination.bulletClass), m), t.$el.off("focus", x, !0), t.$el.off("pointerdown", w, !0), t.$el.off("pointerup", b, !0);
      }();
    }));
  }, function (e) {
    let { swiper: t, extendParams: s, on: a } = e;
    s({ history: { enabled: !1, root: "", replaceState: !1, key: "slides", keepQuery: !1 } });
    let i = !1, n = {};
    const l = e => e.toString().replace(/\s+/g, "-").replace(/[^\w-]+/g, "").replace(/--+/g, "-").replace(/^-+/, "").replace(/-+$/, ""),
      o = e => {
        const t = r();
        let s;
        s = e ? new URL(e) : t.location;
        const a = s.pathname.slice(1).split("/").filter((e => "" !== e)), i = a.length;
        return { key: a[i - 2], value: a[i - 1] };
      }, d = (e, s) => {
        const a = r();
        if (!i || !t.params.history.enabled) return;
        let n;
        n = t.params.url ? new URL(t.params.url) : a.location;
        const o = t.slides.eq(s);
        let d = l(o.attr("data-history"));
        if (t.params.history.root.length > 0) {
          let s = t.params.history.root;
          "/" === s[s.length - 1] && (s = s.slice(0, s.length - 1)), d = `${s}/${e}/${d}`;
        } else n.pathname.includes(e) || (d = `${e}/${d}`);
        t.params.history.keepQuery && (d += n.search);
        const c = a.history.state;
        c && c.value === d || (t.params.history.replaceState ? a.history.replaceState({ value: d }, null, d) : a.history.pushState({ value: d }, null, d));
      }, c = (e, s, a) => {
        if (s) for (let i = 0, r = t.slides.length; i < r; i += 1) {
          const r = t.slides.eq(i);
          if (l(r.attr("data-history")) === s && !r.hasClass(t.params.slideDuplicateClass)) {
            const s = r.index();
            t.slideTo(s, e, a);
          }
        } else t.slideTo(0, e, a);
      }, p = () => {n = o(t.params.url), c(t.params.speed, n.value, !1);};
    a("init", (() => {
      t.params.history.enabled && (() => {
        const e = r();
        if (t.params.history) {
          if (!e.history || !e.history.pushState) return t.params.history.enabled = !1, void (t.params.hashNavigation.enabled = !0);
          i = !0, n = o(t.params.url), (n.key || n.value) && (c(0, n.value, t.params.runCallbacksOnInit), t.params.history.replaceState || e.addEventListener("popstate", p));
        }
      })();
    })), a("destroy", (() => {
      t.params.history.enabled && (() => {
        const e = r();
        t.params.history.replaceState || e.removeEventListener("popstate", p);
      })();
    })), a("transitionEnd _freeModeNoMomentumRelease", (() => {i && d(t.params.history.key, t.activeIndex);})), a("slideChange", (() => {i && t.params.cssMode && d(t.params.history.key, t.activeIndex);}));
  }, function (e) {
    let { swiper: t, extendParams: s, emit: i, on: n } = e, l = !1;
    const o = a(), c = r();
    s({ hashNavigation: { enabled: !1, replaceState: !1, watchState: !1 } });
    const p = () => {
      i("hashChange");
      const e = o.location.hash.replace("#", "");
      if (e !== t.slides.eq(t.activeIndex).attr("data-hash")) {
        const s = t.$wrapperEl.children(`.${t.params.slideClass}[data-hash="${e}"]`).index();
        if (void 0 === s) return;
        t.slideTo(s);
      }
    }, u = () => {
      if (l && t.params.hashNavigation.enabled) if (t.params.hashNavigation.replaceState && c.history && c.history.replaceState) c.history.replaceState(null, null, `#${t.slides.eq(t.activeIndex).attr("data-hash")}` || ""), i("hashSet"); else {
        const e = t.slides.eq(t.activeIndex), s = e.attr("data-hash") || e.attr("data-history");
        o.location.hash = s || "", i("hashSet");
      }
    };
    n("init", (() => {
      t.params.hashNavigation.enabled && (() => {
        if (!t.params.hashNavigation.enabled || t.params.history && t.params.history.enabled) return;
        l = !0;
        const e = o.location.hash.replace("#", "");
        if (e) {
          const s = 0;
          for (let a = 0, i = t.slides.length; a < i; a += 1) {
            const i = t.slides.eq(a);
            if ((i.attr("data-hash") || i.attr("data-history")) === e && !i.hasClass(t.params.slideDuplicateClass)) {
              const e = i.index();
              t.slideTo(e, s, t.params.runCallbacksOnInit, !0);
            }
          }
        }
        t.params.hashNavigation.watchState && d(c).on("hashchange", p);
      })();
    })), n("destroy", (() => {t.params.hashNavigation.enabled && t.params.hashNavigation.watchState && d(c).off("hashchange", p);})), n("transitionEnd _freeModeNoMomentumRelease", (() => {l && u();})), n("slideChange", (() => {l && t.params.cssMode && u();}));
  }, function (e) {
    let t, { swiper: s, extendParams: i, on: r, emit: n } = e;
    function l () {
      if (!s.size) return s.autoplay.running = !1, void (s.autoplay.paused = !1);
      const e = s.slides.eq(s.activeIndex);
      let a = s.params.autoplay.delay;
      e.attr("data-swiper-autoplay") && (a = e.attr("data-swiper-autoplay") || s.params.autoplay.delay), clearTimeout(t), t = p((() => {
        let e;
        s.params.autoplay.reverseDirection ? s.params.loop ? (s.loopFix(), e = s.slidePrev(s.params.speed, !0, !0), n("autoplay")) : s.isBeginning ? s.params.autoplay.stopOnLastSlide ? d() : (e = s.slideTo(s.slides.length - 1, s.params.speed, !0, !0), n("autoplay")) : (e = s.slidePrev(s.params.speed, !0, !0), n("autoplay")) : s.params.loop ? (s.loopFix(), e = s.slideNext(s.params.speed, !0, !0), n("autoplay")) : s.isEnd ? s.params.autoplay.stopOnLastSlide ? d() : (e = s.slideTo(0, s.params.speed, !0, !0), n("autoplay")) : (e = s.slideNext(s.params.speed, !0, !0), n("autoplay")), (s.params.cssMode && s.autoplay.running || !1 === e) && l();
      }), a);
    }
    function o () {return void 0 === t && (!s.autoplay.running && (s.autoplay.running = !0, n("autoplayStart"), l(), !0));}
    function d () {return !!s.autoplay.running && (void 0 !== t && (t && (clearTimeout(t), t = void 0), s.autoplay.running = !1, n("autoplayStop"), !0));}
    function c (e) {s.autoplay.running && (s.autoplay.paused || (t && clearTimeout(t), s.autoplay.paused = !0, 0 !== e && s.params.autoplay.waitForTransition ? ["transitionend", "webkitTransitionEnd"].forEach((e => {s.$wrapperEl[0].addEventListener(e, h);})) : (s.autoplay.paused = !1, l())));}
    function u () {
      const e = a();
      "hidden" === e.visibilityState && s.autoplay.running && c(), "visible" === e.visibilityState && s.autoplay.paused && (l(), s.autoplay.paused = !1);
    }
    function h (e) {s && !s.destroyed && s.$wrapperEl && e.target === s.$wrapperEl[0] && (["transitionend", "webkitTransitionEnd"].forEach((e => {s.$wrapperEl[0].removeEventListener(e, h);})), s.autoplay.paused = !1, s.autoplay.running ? l() : d());}
    function m () {s.params.autoplay.disableOnInteraction ? d() : (n("autoplayPause"), c()), ["transitionend", "webkitTransitionEnd"].forEach((e => {s.$wrapperEl[0].removeEventListener(e, h);}));}
    function f () {s.params.autoplay.disableOnInteraction || (s.autoplay.paused = !1, n("autoplayResume"), l());}
    s.autoplay = { running: !1, paused: !1 }, i({
      autoplay: {
        enabled: !1,
        delay: 3e3,
        waitForTransition: !0,
        disableOnInteraction: !0,
        stopOnLastSlide: !1,
        reverseDirection: !1,
        pauseOnMouseEnter: !1
      }
    }), r("init", (() => {
      if (s.params.autoplay.enabled) {
        o();
        a().addEventListener("visibilitychange", u), s.params.autoplay.pauseOnMouseEnter && (s.$el.on("mouseenter", m), s.$el.on("mouseleave", f));
      }
    })), r("beforeTransitionStart", ((e, t, a) => {s.autoplay.running && (a || !s.params.autoplay.disableOnInteraction ? s.autoplay.pause(t) : d());})), r("sliderFirstMove", (() => {s.autoplay.running && (s.params.autoplay.disableOnInteraction ? d() : c());})), r("touchEnd", (() => {s.params.cssMode && s.autoplay.paused && !s.params.autoplay.disableOnInteraction && l();})), r("destroy", (() => {
      s.$el.off("mouseenter", m), s.$el.off("mouseleave", f), s.autoplay.running && d();
      a().removeEventListener("visibilitychange", u);
    })), Object.assign(s.autoplay, { pause: c, run: l, start: o, stop: d });
  }, function (e) {
    let { swiper: t, extendParams: s, on: a } = e;
    s({
      thumbs: {
        swiper: null,
        multipleActiveThumbs: !0,
        autoScrollOffset: 0,
        slideThumbActiveClass: "swiper-slide-thumb-active",
        thumbsContainerClass: "swiper-thumbs"
      }
    });
    let i = !1, r = !1;
    function n () {
      const e = t.thumbs.swiper;
      if (!e || e.destroyed) return;
      const s = e.clickedIndex, a = e.clickedSlide;
      if (a && d(a).hasClass(t.params.thumbs.slideThumbActiveClass)) return;
      if (null == s) return;
      let i;
      if (i = e.params.loop ? parseInt(d(e.clickedSlide).attr("data-swiper-slide-index"), 10) : s, t.params.loop) {
        let e = t.activeIndex;
        t.slides.eq(e).hasClass(t.params.slideDuplicateClass) && (t.loopFix(), t._clientLeft = t.$wrapperEl[0].clientLeft, e = t.activeIndex);
        const s = t.slides.eq(e).prevAll(`[data-swiper-slide-index="${i}"]`).eq(0).index(),
          a = t.slides.eq(e).nextAll(`[data-swiper-slide-index="${i}"]`).eq(0).index();
        i = void 0 === s ? a : void 0 === a ? s : a - e < e - s ? a : s;
      }
      t.slideTo(i);
    }
    function l () {
      const { thumbs: e } = t.params;
      if (i) return !1;
      i = !0;
      const s = t.constructor;
      if (e.swiper instanceof s) t.thumbs.swiper = e.swiper, Object.assign(t.thumbs.swiper.originalParams, {
        watchSlidesProgress: !0,
        slideToClickedSlide: !1
      }), Object.assign(t.thumbs.swiper.params, {
        watchSlidesProgress: !0,
        slideToClickedSlide: !1
      }); else if (m(e.swiper)) {
        const a = Object.assign({}, e.swiper);
        Object.assign(a, { watchSlidesProgress: !0, slideToClickedSlide: !1 }), t.thumbs.swiper = new s(a), r = !0;
      }
      return t.thumbs.swiper.$el.addClass(t.params.thumbs.thumbsContainerClass), t.thumbs.swiper.on("tap", n), !0;
    }
    function o (e) {
      const s = t.thumbs.swiper;
      if (!s || s.destroyed) return;
      const a = "auto" === s.params.slidesPerView ? s.slidesPerViewDynamic() : s.params.slidesPerView;
      let i = 1;
      const r = t.params.thumbs.slideThumbActiveClass;
      if (t.params.slidesPerView > 1 && !t.params.centeredSlides && (i = t.params.slidesPerView), t.params.thumbs.multipleActiveThumbs || (i = 1), i = Math.floor(i), s.slides.removeClass(r), s.params.loop || s.params.virtual && s.params.virtual.enabled) for (let e = 0; e < i; e += 1) s.$wrapperEl.children(`[data-swiper-slide-index="${t.realIndex + e}"]`).addClass(r); else for (let e = 0; e < i; e += 1) s.slides.eq(t.realIndex + e).addClass(r);
      const n = t.params.thumbs.autoScrollOffset, l = n && !s.params.loop;
      if (t.realIndex !== s.realIndex || l) {
        let i, r, o = s.activeIndex;
        if (s.params.loop) {
          s.slides.eq(o).hasClass(s.params.slideDuplicateClass) && (s.loopFix(), s._clientLeft = s.$wrapperEl[0].clientLeft, o = s.activeIndex);
          const e = s.slides.eq(o).prevAll(`[data-swiper-slide-index="${t.realIndex}"]`).eq(0).index(),
            a = s.slides.eq(o).nextAll(`[data-swiper-slide-index="${t.realIndex}"]`).eq(0).index();
          i = void 0 === e ? a : void 0 === a ? e : a - o == o - e ? s.params.slidesPerGroup > 1 ? a : o : a - o < o - e ? a : e, r = t.activeIndex > t.previousIndex ? "next" : "prev";
        } else i = t.realIndex, r = i > t.previousIndex ? "next" : "prev";
        l && (i += "next" === r ? n : -1 * n), s.visibleSlidesIndexes && s.visibleSlidesIndexes.indexOf(i) < 0 && (s.params.centeredSlides ? i = i > o ? i - Math.floor(a / 2) + 1 : i + Math.floor(a / 2) - 1 : i > o && s.params.slidesPerGroup, s.slideTo(i, e ? 0 : void 0));
      }
    }
    t.thumbs = { swiper: null }, a("beforeInit", (() => {
      const { thumbs: e } = t.params;
      e && e.swiper && (l(), o(!0));
    })), a("slideChange update resize observerUpdate", (() => {o();})), a("setTransition", ((e, s) => {
      const a = t.thumbs.swiper;
      a && !a.destroyed && a.setTransition(s);
    })), a("beforeDestroy", (() => {
      const e = t.thumbs.swiper;
      e && !e.destroyed && r && e.destroy();
    })), Object.assign(t.thumbs, { init: l, update: o });
  }, function (e) {
    let { swiper: t, extendParams: s, emit: a, once: i } = e;
    s({
      freeMode: {
        enabled: !1,
        momentum: !0,
        momentumRatio: 1,
        momentumBounce: !0,
        momentumBounceRatio: 1,
        momentumVelocityRatio: 1,
        sticky: !1,
        minimumVelocity: .02
      }
    }), Object.assign(t, {
      freeMode: {
        onTouchStart: function () {
          const e = t.getTranslate();
          t.setTranslate(e), t.setTransition(0), t.touchEventsData.velocities.length = 0, t.freeMode.onTouchEnd({ currentPos: t.rtl ? t.translate : -t.translate });
        }, onTouchMove: function () {
          const { touchEventsData: e, touches: s } = t;
          0 === e.velocities.length && e.velocities.push({
            position: s[t.isHorizontal() ? "startX" : "startY"],
            time: e.touchStartTime
          }), e.velocities.push({ position: s[t.isHorizontal() ? "currentX" : "currentY"], time: u() });
        }, onTouchEnd: function (e) {
          let { currentPos: s } = e;
          const { params: r, $wrapperEl: n, rtlTranslate: l, snapGrid: o, touchEventsData: d } = t,
            c = u() - d.touchStartTime;
          if (s < -t.minTranslate()) t.slideTo(t.activeIndex); else if (s > -t.maxTranslate()) t.slides.length < o.length ? t.slideTo(o.length - 1) : t.slideTo(t.slides.length - 1); else {
            if (r.freeMode.momentum) {
              if (d.velocities.length > 1) {
                const e = d.velocities.pop(), s = d.velocities.pop(), a = e.position - s.position, i = e.time - s.time;
                t.velocity = a / i, t.velocity /= 2, Math.abs(t.velocity) < r.freeMode.minimumVelocity && (t.velocity = 0), (i > 150 || u() - e.time > 300) && (t.velocity = 0);
              } else t.velocity = 0;
              t.velocity *= r.freeMode.momentumVelocityRatio, d.velocities.length = 0;
              let e = 1e3 * r.freeMode.momentumRatio;
              const s = t.velocity * e;
              let c = t.translate + s;
              l && (c = -c);
              let p, h = !1;
              const m = 20 * Math.abs(t.velocity) * r.freeMode.momentumBounceRatio;
              let f;
              if (c < t.maxTranslate()) r.freeMode.momentumBounce ? (c + t.maxTranslate() < -m && (c = t.maxTranslate() - m), p = t.maxTranslate(), h = !0, d.allowMomentumBounce = !0) : c = t.maxTranslate(), r.loop && r.centeredSlides && (f = !0); else if (c > t.minTranslate()) r.freeMode.momentumBounce ? (c - t.minTranslate() > m && (c = t.minTranslate() + m), p = t.minTranslate(), h = !0, d.allowMomentumBounce = !0) : c = t.minTranslate(), r.loop && r.centeredSlides && (f = !0); else if (r.freeMode.sticky) {
                let e;
                for (let t = 0; t < o.length; t += 1) if (o[t] > -c) {
                  e = t;
                  break;
                }
                c = Math.abs(o[e] - c) < Math.abs(o[e - 1] - c) || "next" === t.swipeDirection ? o[e] : o[e - 1], c = -c;
              }
              if (f && i("transitionEnd", (() => {t.loopFix();})), 0 !== t.velocity) {
                if (e = l ? Math.abs((-c - t.translate) / t.velocity) : Math.abs((c - t.translate) / t.velocity), r.freeMode.sticky) {
                  const s = Math.abs((l ? -c : c) - t.translate), a = t.slidesSizesGrid[t.activeIndex];
                  e = s < a ? r.speed : s < 2 * a ? 1.5 * r.speed : 2.5 * r.speed;
                }
              } else if (r.freeMode.sticky) return void t.slideToClosest();
              r.freeMode.momentumBounce && h ? (t.updateProgress(p), t.setTransition(e), t.setTranslate(c), t.transitionStart(!0, t.swipeDirection), t.animating = !0, n.transitionEnd((() => {t && !t.destroyed && d.allowMomentumBounce && (a("momentumBounce"), t.setTransition(r.speed), setTimeout((() => {t.setTranslate(p), n.transitionEnd((() => {t && !t.destroyed && t.transitionEnd();}));}), 0));}))) : t.velocity ? (a("_freeModeNoMomentumRelease"), t.updateProgress(c), t.setTransition(e), t.setTranslate(c), t.transitionStart(!0, t.swipeDirection), t.animating || (t.animating = !0, n.transitionEnd((() => {t && !t.destroyed && t.transitionEnd();})))) : t.updateProgress(c), t.updateActiveIndex(), t.updateSlidesClasses();
            } else {
              if (r.freeMode.sticky) return void t.slideToClosest();
              r.freeMode && a("_freeModeNoMomentumRelease");
            }
            (!r.freeMode.momentum || c >= r.longSwipesMs) && (t.updateProgress(), t.updateActiveIndex(), t.updateSlidesClasses());
          }
        }
      }
    });
  }, function (e) {
    let t, s, a, { swiper: i, extendParams: r } = e;
    r({ grid: { rows: 1, fill: "column" } }), i.grid = {
      initSlides: e => {
        const { slidesPerView: r } = i.params, { rows: n, fill: l } = i.params.grid;
        s = t / n, a = Math.floor(e / n), t = Math.floor(e / n) === e / n ? e : Math.ceil(e / n) * n, "auto" !== r && "row" === l && (t = Math.max(t, r * n));
      },
      updateSlide: (e, r, n, l) => {
        const { slidesPerGroup: o, spaceBetween: d } = i.params, { rows: c, fill: p } = i.params.grid;
        let u, h, m;
        if ("row" === p && o > 1) {
          const s = Math.floor(e / (o * c)), a = e - c * o * s,
            i = 0 === s ? o : Math.min(Math.ceil((n - s * c * o) / c), o);
          m = Math.floor(a / i), h = a - m * i + s * o, u = h + m * t / c, r.css({ "-webkit-order": u, order: u });
        } else "column" === p ? (h = Math.floor(e / c), m = e - h * c, (h > a || h === a && m === c - 1) && (m += 1, m >= c && (m = 0, h += 1))) : (m = Math.floor(e / s), h = e - m * s);
        r.css(l("margin-top"), 0 !== m ? d && `${d}px` : "");
      },
      updateWrapperSize: (e, s, a) => {
        const { spaceBetween: r, centeredSlides: n, roundLengths: l } = i.params, { rows: o } = i.params.grid;
        if (i.virtualSize = (e + r) * t, i.virtualSize = Math.ceil(i.virtualSize / o) - r, i.$wrapperEl.css({ [a("width")]: `${i.virtualSize + r}px` }), n) {
          s.splice(0, s.length);
          const e = [];
          for (let t = 0; t < s.length; t += 1) {
            let a = s[t];
            l && (a = Math.floor(a)), s[t] < i.virtualSize + s[0] && e.push(a);
          }
          s.push(...e);
        }
      }
    };
  }, function (e) {
    let { swiper: t } = e;
    Object.assign(t, {
      appendSlide: K.bind(t),
      prependSlide: Z.bind(t),
      addSlide: Q.bind(t),
      removeSlide: J.bind(t),
      removeAllSlides: ee.bind(t)
    });
  }, function (e) {
    let { swiper: t, extendParams: s, on: a } = e;
    s({ fadeEffect: { crossFade: !1, transformEl: null } }), te({
      effect: "fade",
      swiper: t,
      on: a,
      setTranslate: () => {
        const { slides: e } = t, s = t.params.fadeEffect;
        for (let a = 0; a < e.length; a += 1) {
          const e = t.slides.eq(a);
          let i = -e[0].swiperSlideOffset;
          t.params.virtualTranslate || (i -= t.translate);
          let r = 0;
          t.isHorizontal() || (r = i, i = 0);
          const n = t.params.fadeEffect.crossFade ? Math.max(1 - Math.abs(e[0].progress), 0) : 1 + Math.min(Math.max(e[0].progress, -1), 0);
          se(s, e).css({ opacity: n }).transform(`translate3d(${i}px, ${r}px, 0px)`);
        }
      },
      setTransition: e => {
        const { transformEl: s } = t.params.fadeEffect;
        (s ? t.slides.find(s) : t.slides).transition(e), ae({ swiper: t, duration: e, transformEl: s, allSlides: !0 });
      },
      overwriteParams: () => ({
        slidesPerView: 1,
        slidesPerGroup: 1,
        watchSlidesProgress: !0,
        spaceBetween: 0,
        virtualTranslate: !t.params.cssMode
      })
    });
  }, function (e) {
    let { swiper: t, extendParams: s, on: a } = e;
    s({ cubeEffect: { slideShadows: !0, shadow: !0, shadowOffset: 20, shadowScale: .94 } });
    const i = (e, t, s) => {
      let a = s ? e.find(".swiper-slide-shadow-left") : e.find(".swiper-slide-shadow-top"),
        i = s ? e.find(".swiper-slide-shadow-right") : e.find(".swiper-slide-shadow-bottom");
      0 === a.length && (a = d(`<div class="swiper-slide-shadow-${s ? "left" : "top"}"></div>`), e.append(a)), 0 === i.length && (i = d(`<div class="swiper-slide-shadow-${s ? "right" : "bottom"}"></div>`), e.append(i)), a.length && (a[0].style.opacity = Math.max(-t, 0)), i.length && (i[0].style.opacity = Math.max(t, 0));
    };
    te({
      effect: "cube",
      swiper: t,
      on: a,
      setTranslate: () => {
        const { $el: e, $wrapperEl: s, slides: a, width: r, height: n, rtlTranslate: l, size: o, browser: c } = t,
          p = t.params.cubeEffect, u = t.isHorizontal(), h = t.virtual && t.params.virtual.enabled;
        let m, f = 0;
        p.shadow && (u ? (m = s.find(".swiper-cube-shadow"), 0 === m.length && (m = d("<div class=\"swiper-cube-shadow\"></div>"), s.append(m)), m.css({ height: `${r}px` })) : (m = e.find(".swiper-cube-shadow"), 0 === m.length && (m = d("<div class=\"swiper-cube-shadow\"></div>"), e.append(m))));
        for (let e = 0; e < a.length; e += 1) {
          const t = a.eq(e);
          let s = e;
          h && (s = parseInt(t.attr("data-swiper-slide-index"), 10));
          let r = 90 * s, n = Math.floor(r / 360);
          l && (r = -r, n = Math.floor(-r / 360));
          const d = Math.max(Math.min(t[0].progress, 1), -1);
          let c = 0, m = 0, g = 0;
          s % 4 == 0 ? (c = 4 * -n * o, g = 0) : (s - 1) % 4 == 0 ? (c = 0, g = 4 * -n * o) : (s - 2) % 4 == 0 ? (c = o + 4 * n * o, g = o) : (s - 3) % 4 == 0 && (c = -o, g = 3 * o + 4 * o * n), l && (c = -c), u || (m = c, c = 0);
          const v = `rotateX(${u ? 0 : -r}deg) rotateY(${u ? r : 0}deg) translate3d(${c}px, ${m}px, ${g}px)`;
          d <= 1 && d > -1 && (f = 90 * s + 90 * d, l && (f = 90 * -s - 90 * d)), t.transform(v), p.slideShadows && i(t, d, u);
        }
        if (s.css({
          "-webkit-transform-origin": `50% 50% -${o / 2}px`,
          "transform-origin": `50% 50% -${o / 2}px`
        }), p.shadow) if (u) m.transform(`translate3d(0px, ${r / 2 + p.shadowOffset}px, ${-r / 2}px) rotateX(90deg) rotateZ(0deg) scale(${p.shadowScale})`); else {
          const e = Math.abs(f) - 90 * Math.floor(Math.abs(f) / 90),
            t = 1.5 - (Math.sin(2 * e * Math.PI / 360) / 2 + Math.cos(2 * e * Math.PI / 360) / 2), s = p.shadowScale,
            a = p.shadowScale / t, i = p.shadowOffset;
          m.transform(`scale3d(${s}, 1, ${a}) translate3d(0px, ${n / 2 + i}px, ${-n / 2 / a}px) rotateX(-90deg)`);
        }
        const g = c.isSafari || c.isWebView ? -o / 2 : 0;
        s.transform(`translate3d(0px,0,${g}px) rotateX(${t.isHorizontal() ? 0 : f}deg) rotateY(${t.isHorizontal() ? -f : 0}deg)`), s[0].style.setProperty("--swiper-cube-translate-z", `${g}px`);
      },
      setTransition: e => {
        const { $el: s, slides: a } = t;
        a.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e), t.params.cubeEffect.shadow && !t.isHorizontal() && s.find(".swiper-cube-shadow").transition(e);
      },
      recreateShadows: () => {
        const e = t.isHorizontal();
        t.slides.each((t => {
          const s = Math.max(Math.min(t.progress, 1), -1);
          i(d(t), s, e);
        }));
      },
      getEffectParams: () => t.params.cubeEffect,
      perspective: () => !0,
      overwriteParams: () => ({
        slidesPerView: 1,
        slidesPerGroup: 1,
        watchSlidesProgress: !0,
        resistanceRatio: 0,
        spaceBetween: 0,
        centeredSlides: !1,
        virtualTranslate: !0
      })
    });
  }, function (e) {
    let { swiper: t, extendParams: s, on: a } = e;
    s({ flipEffect: { slideShadows: !0, limitRotation: !0, transformEl: null } });
    const i = (e, s, a) => {
      let i = t.isHorizontal() ? e.find(".swiper-slide-shadow-left") : e.find(".swiper-slide-shadow-top"),
        r = t.isHorizontal() ? e.find(".swiper-slide-shadow-right") : e.find(".swiper-slide-shadow-bottom");
      0 === i.length && (i = ie(a, e, t.isHorizontal() ? "left" : "top")), 0 === r.length && (r = ie(a, e, t.isHorizontal() ? "right" : "bottom")), i.length && (i[0].style.opacity = Math.max(-s, 0)), r.length && (r[0].style.opacity = Math.max(s, 0));
    };
    te({
      effect: "flip",
      swiper: t,
      on: a,
      setTranslate: () => {
        const { slides: e, rtlTranslate: s } = t, a = t.params.flipEffect;
        for (let r = 0; r < e.length; r += 1) {
          const n = e.eq(r);
          let l = n[0].progress;
          t.params.flipEffect.limitRotation && (l = Math.max(Math.min(n[0].progress, 1), -1));
          const o = n[0].swiperSlideOffset;
          let d = -180 * l, c = 0, p = t.params.cssMode ? -o - t.translate : -o, u = 0;
          t.isHorizontal() ? s && (d = -d) : (u = p, p = 0, c = -d, d = 0), n[0].style.zIndex = -Math.abs(Math.round(l)) + e.length, a.slideShadows && i(n, l, a);
          const h = `translate3d(${p}px, ${u}px, 0px) rotateX(${c}deg) rotateY(${d}deg)`;
          se(a, n).transform(h);
        }
      },
      setTransition: e => {
        const { transformEl: s } = t.params.flipEffect;
        (s ? t.slides.find(s) : t.slides).transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e), ae({
          swiper: t,
          duration: e,
          transformEl: s
        });
      },
      recreateShadows: () => {
        const e = t.params.flipEffect;
        t.slides.each((s => {
          const a = d(s);
          let r = a[0].progress;
          t.params.flipEffect.limitRotation && (r = Math.max(Math.min(s.progress, 1), -1)), i(a, r, e);
        }));
      },
      getEffectParams: () => t.params.flipEffect,
      perspective: () => !0,
      overwriteParams: () => ({
        slidesPerView: 1,
        slidesPerGroup: 1,
        watchSlidesProgress: !0,
        spaceBetween: 0,
        virtualTranslate: !t.params.cssMode
      })
    });
  }, function (e) {
    let { swiper: t, extendParams: s, on: a } = e;
    s({
      coverflowEffect: {
        rotate: 50,
        stretch: 0,
        depth: 100,
        scale: 1,
        modifier: 1,
        slideShadows: !0,
        transformEl: null
      }
    }), te({
      effect: "coverflow", swiper: t, on: a, setTranslate: () => {
        const { width: e, height: s, slides: a, slidesSizesGrid: i } = t, r = t.params.coverflowEffect,
          n = t.isHorizontal(), l = t.translate, o = n ? e / 2 - l : s / 2 - l, d = n ? r.rotate : -r.rotate,
          c = r.depth;
        for (let e = 0, t = a.length; e < t; e += 1) {
          const t = a.eq(e), s = i[e], l = (o - t[0].swiperSlideOffset - s / 2) / s,
            p = "function" == typeof r.modifier ? r.modifier(l) : l * r.modifier;
          let u = n ? d * p : 0, h = n ? 0 : d * p, m = -c * Math.abs(p), f = r.stretch;
          "string" == typeof f && -1 !== f.indexOf("%") && (f = parseFloat(r.stretch) / 100 * s);
          let g = n ? 0 : f * p, v = n ? f * p : 0, w = 1 - (1 - r.scale) * Math.abs(p);
          Math.abs(v) < .001 && (v = 0), Math.abs(g) < .001 && (g = 0), Math.abs(m) < .001 && (m = 0), Math.abs(u) < .001 && (u = 0), Math.abs(h) < .001 && (h = 0), Math.abs(w) < .001 && (w = 0);
          const b = `translate3d(${v}px,${g}px,${m}px)  rotateX(${h}deg) rotateY(${u}deg) scale(${w})`;
          if (se(r, t).transform(b), t[0].style.zIndex = 1 - Math.abs(Math.round(p)), r.slideShadows) {
            let e = n ? t.find(".swiper-slide-shadow-left") : t.find(".swiper-slide-shadow-top"),
              s = n ? t.find(".swiper-slide-shadow-right") : t.find(".swiper-slide-shadow-bottom");
            0 === e.length && (e = ie(r, t, n ? "left" : "top")), 0 === s.length && (s = ie(r, t, n ? "right" : "bottom")), e.length && (e[0].style.opacity = p > 0 ? p : 0), s.length && (s[0].style.opacity = -p > 0 ? -p : 0);
          }
        }
      }, setTransition: e => {
        const { transformEl: s } = t.params.coverflowEffect;
        (s ? t.slides.find(s) : t.slides).transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e);
      }, perspective: () => !0, overwriteParams: () => ({ watchSlidesProgress: !0 })
    });
  }, function (e) {
    let { swiper: t, extendParams: s, on: a } = e;
    s({
      creativeEffect: {
        transformEl: null,
        limitProgress: 1,
        shadowPerProgress: !1,
        progressMultiplier: 1,
        perspective: !0,
        prev: { translate: [0, 0, 0], rotate: [0, 0, 0], opacity: 1, scale: 1 },
        next: { translate: [0, 0, 0], rotate: [0, 0, 0], opacity: 1, scale: 1 }
      }
    });
    const i = e => "string" == typeof e ? e : `${e}px`;
    te({
      effect: "creative",
      swiper: t,
      on: a,
      setTranslate: () => {
        const { slides: e, $wrapperEl: s, slidesSizesGrid: a } = t,
          r = t.params.creativeEffect, { progressMultiplier: n } = r, l = t.params.centeredSlides;
        if (l) {
          const e = a[0] / 2 - t.params.slidesOffsetBefore || 0;
          s.transform(`translateX(calc(50% - ${e}px))`);
        }
        for (let s = 0; s < e.length; s += 1) {
          const a = e.eq(s), o = a[0].progress,
            d = Math.min(Math.max(a[0].progress, -r.limitProgress), r.limitProgress);
          let c = d;
          l || (c = Math.min(Math.max(a[0].originalProgress, -r.limitProgress), r.limitProgress));
          const p = a[0].swiperSlideOffset, u = [t.params.cssMode ? -p - t.translate : -p, 0, 0], h = [0, 0, 0];
          let m = !1;
          t.isHorizontal() || (u[1] = u[0], u[0] = 0);
          let f = { translate: [0, 0, 0], rotate: [0, 0, 0], scale: 1, opacity: 1 };
          d < 0 ? (f = r.next, m = !0) : d > 0 && (f = r.prev, m = !0), u.forEach(((e, t) => {u[t] = `calc(${e}px + (${i(f.translate[t])} * ${Math.abs(d * n)}))`;})), h.forEach(((e, t) => {h[t] = f.rotate[t] * Math.abs(d * n);})), a[0].style.zIndex = -Math.abs(Math.round(o)) + e.length;
          const g = u.join(", "), v = `rotateX(${h[0]}deg) rotateY(${h[1]}deg) rotateZ(${h[2]}deg)`,
            w = c < 0 ? `scale(${1 + (1 - f.scale) * c * n})` : `scale(${1 - (1 - f.scale) * c * n})`,
            b = c < 0 ? 1 + (1 - f.opacity) * c * n : 1 - (1 - f.opacity) * c * n, x = `translate3d(${g}) ${v} ${w}`;
          if (m && f.shadow || !m) {
            let e = a.children(".swiper-slide-shadow");
            if (0 === e.length && f.shadow && (e = ie(r, a)), e.length) {
              const t = r.shadowPerProgress ? d * (1 / r.limitProgress) : d;
              e[0].style.opacity = Math.min(Math.max(Math.abs(t), 0), 1);
            }
          }
          const y = se(r, a);
          y.transform(x).css({ opacity: b }), f.origin && y.css("transform-origin", f.origin);
        }
      },
      setTransition: e => {
        const { transformEl: s } = t.params.creativeEffect;
        (s ? t.slides.find(s) : t.slides).transition(e).find(".swiper-slide-shadow").transition(e), ae({
          swiper: t,
          duration: e,
          transformEl: s,
          allSlides: !0
        });
      },
      perspective: () => t.params.creativeEffect.perspective,
      overwriteParams: () => ({ watchSlidesProgress: !0, virtualTranslate: !t.params.cssMode })
    });
  }, function (e) {
    let { swiper: t, extendParams: s, on: a } = e;
    s({ cardsEffect: { slideShadows: !0, transformEl: null, rotate: !0, perSlideRotate: 2, perSlideOffset: 8 } }), te({
      effect: "cards",
      swiper: t,
      on: a,
      setTranslate: () => {
        const { slides: e, activeIndex: s } = t,
          a = t.params.cardsEffect, { startTranslate: i, isTouched: r } = t.touchEventsData, n = t.translate;
        for (let l = 0; l < e.length; l += 1) {
          const o = e.eq(l), d = o[0].progress, c = Math.min(Math.max(d, -4), 4);
          let p = o[0].swiperSlideOffset;
          t.params.centeredSlides && !t.params.cssMode && t.$wrapperEl.transform(`translateX(${t.minTranslate()}px)`), t.params.centeredSlides && t.params.cssMode && (p -= e[0].swiperSlideOffset);
          let u = t.params.cssMode ? -p - t.translate : -p, h = 0;
          const m = -100 * Math.abs(c);
          let f = 1, g = -a.perSlideRotate * c, v = a.perSlideOffset - .75 * Math.abs(c);
          const w = t.virtual && t.params.virtual.enabled ? t.virtual.from + l : l,
            b = (w === s || w === s - 1) && c > 0 && c < 1 && (r || t.params.cssMode) && n < i,
            x = (w === s || w === s + 1) && c < 0 && c > -1 && (r || t.params.cssMode) && n > i;
          if (b || x) {
            const e = (1 - Math.abs((Math.abs(c) - .5) / .5)) ** .5;
            g += -28 * c * e, f += -.5 * e, v += 96 * e, h = -25 * e * Math.abs(c) + "%";
          }
          if (u = c < 0 ? `calc(${u}px + (${v * Math.abs(c)}%))` : c > 0 ? `calc(${u}px + (-${v * Math.abs(c)}%))` : `${u}px`, !t.isHorizontal()) {
            const e = h;
            h = u, u = e;
          }
          const y = c < 0 ? "" + (1 + (1 - f) * c) : "" + (1 - (1 - f) * c),
            E = `\n        translate3d(${u}, ${h}, ${m}px)\n        rotateZ(${a.rotate ? g : 0}deg)\n        scale(${y})\n      `;
          if (a.slideShadows) {
            let e = o.find(".swiper-slide-shadow");
            0 === e.length && (e = ie(a, o)), e.length && (e[0].style.opacity = Math.min(Math.max((Math.abs(c) - .5) / .5, 0), 1));
          }
          o[0].style.zIndex = -Math.abs(Math.round(d)) + e.length;
          se(a, o).transform(E);
        }
      },
      setTransition: e => {
        const { transformEl: s } = t.params.cardsEffect;
        (s ? t.slides.find(s) : t.slides).transition(e).find(".swiper-slide-shadow").transition(e), ae({
          swiper: t,
          duration: e,
          transformEl: s
        });
      },
      perspective: () => !0,
      overwriteParams: () => ({ watchSlidesProgress: !0, virtualTranslate: !t.params.cssMode })
    });
  }];
  return V.use(re), V;
}));
//# sourceMappingURL=/Scripts/modules/swiper-bundle.min.js.map;;
!function(e,t){if("function"==typeof define&&define.amd)define("Parallax",["module"],t);else if("undefined"!=typeof exports)t(module);else{var n={exports:{}};t(n),e.Parallax=n.exports}}(this,function(e){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var t=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}();function r(e,t){var n=void 0;return n="string"==typeof e?(t||document).querySelectorAll(e):e,Array.prototype.slice.call(n)}function s(e){return void 0===e}var n,o=function(o){o=o||{};var a={},h=Array.prototype.slice;return Object.defineProperties(o,{on:{value:function(e,t){return"function"==typeof t&&(a[e]=a[e]||[]).push(t),o},enumerable:!1,writable:!1,configurable:!1},off:{value:function(e,t){if("*"!=e||t)if(t)for(var n,i=a[e],r=0;n=i&&i[r];++r)n==t&&i.splice(r--,1);else delete a[e];else a={};return o},enumerable:!1,writable:!1,configurable:!1},one:{value:function(t,n){return o.on(t,function e(){o.off(t,e),n.apply(o,arguments)})},enumerable:!1,writable:!1,configurable:!1},trigger:{value:function(e){var t,n,i,r=arguments.length-1,s=new Array(r);for(i=0;i<r;i++)s[i]=arguments[i+1];for(t=h.call(a[e]||[],0),i=0;n=t[i];++i)n.apply(o,s);return a["*"]&&"*"!=e&&o.trigger.apply(o,["*",e].concat(s)),o},enumerable:!1,writable:!1,configurable:!1}}),o},a=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||function(e){setTimeout(e,1e3/60)},h=function(){function e(){i(this,e),o(this),this.resizeTimer=null,this.tick=!1,this.bind()}return t(e,[{key:"bind",value:function(){var e=this;return window.addEventListener("scroll",function(){return e.scroll()},!0),window.addEventListener("mousewheel",function(){return e.scroll()},!0),window.addEventListener("touchmove",function(){return e.scroll()},!0),window.addEventListener("resize",function(){return e.resize()},!0),window.addEventListener("orientationchange",function(){return e.resize()},!0),window.onload=function(){return e.scroll()},this}},{key:"scroll",value:function(){var e=this;return this.tick||(this.tick=!this.tick,a(function(){return e.update()})),this}},{key:"update",value:function(){return this.trigger("scroll",this.scrollTop),this.tick=!this.tick,this}},{key:"resize",value:function(){var e=this;return this.resizeTimer&&clearTimeout(this.resizeTimer),this.resizeTimer=setTimeout(function(){return e.trigger("resize",e.size)},20),this}},{key:"scrollTop",get:function(){var e=(window.pageYOffset||document.scrollTop)-(document.clientTop||0);return window.isNaN(e)?0:e}},{key:"height",get:function(){return window.innerHeight}},{key:"width",get:function(){return window.innerWidth}},{key:"size",get:function(){return{width:this.width,height:this.height}}}]),e}(),l=function(e,t){for(var n=["ms","o","Moz","webkit"],i=n.length;i--;){var r=n[i],s=r?r+t[0].toUpperCase()+t.substr(1):t.toLowerCase()+t.substr(1);if(s in e)return s}return""}(document.createElement("div").style,"transform"),u=((n=document.createElement("div")).style[l]="matrix(1, 0, 0, 1, 0, 0)",/matrix/g.test(n.style.cssText)),c=function(){function n(e,t){i(this,n),o(this),this.opts=t,this.element=e,this.wrapper=e.parentNode,this.isLoaded=!1,this.initial=e.cloneNode(!0)}return t(n,[{key:"load",value:function(){var e=this,t=void 0!==this.element.complete,n=void 0!==this.element.oncanplay;return t&&!this.element.complete?this.element.onload=function(){return e.onElementLoaded()}:n&&!this.element.oncanplay?this.element.onload=this.element.oncanplay=function(){return e.onElementLoaded()}:this.onElementLoaded(),this}},{key:"destroy",value:function(){this.element.parentNode.replaceChild(this.initial,this.element),this.off("*")}},{key:"onElementLoaded",value:function(){return this.isLoaded=!0,this.update(),this.element.style.willChange="transform",this.trigger("loaded",this.element),this}},{key:"update",value:function(){var e,t,n=(this.element.naturalWidth||this.element.width||this.element.offsetWidth)/(this.element.naturalHeight||this.element.height||this.element.offsetHeight),i=this.size,r=void 0,s=void 0;return(r=i.width/n<=i.height?(s=i.height*n,i.height):(s=i.width,i.width/n))<=i.height+i.height*this.opts.safeHeight&&(s+=s*this.opts.safeHeight,r+=r*this.opts.safeHeight),e=-~~((r-i.height)/2),t=-~~((s-i.width)/2),this.element.width=s,this.element.height=r,this.element.style.top=e+"px",this.element.style.left=t+"px",this}},{key:"draw",value:function(e){var t=e.scrollTop,n=(e.width,e.height),i=this.size,r=~~(((this.offset.top+i.height*this.opts.center+n/2-t)/n-1)*(this.element.height/i.height/2*this.opts.intensity)*10);return this.element.style[l]=u?"matrix(1,0,0,1, 0, "+-r+")":"translate(0, "+-r+"px)",this}},{key:"bounds",get:function(){return this.wrapper.getBoundingClientRect()}},{key:"offset",get:function(){return{top:this.wrapper.offsetTop,left:this.wrapper.offsetLeft}}},{key:"size",get:function(){var e=this.bounds;return{height:0|e.height,width:0|e.width}}}]),n}(),f=void 0,d=function(){function n(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return i(this,n),o(this),this.opts=t,this.selector=e,this.canvases=[],this.bound=!1,null!==e&&this.add(e),f||(f=new h),this}return t(n,[{key:"init",value:function(){if(this.bound)throw"The parallax instance has already been initialized";return this.canvases.length||null===this.selector?(this.elementsLoaded=0,this.bind()):console.warn('No elements were found with the selector "'+this.selector+'"'),this}},{key:"bind",value:function(){var i=this;return this._onResize=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return i.resize.apply(i,t)},this._onScroll=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return i.scroll.apply(i,t)},f.on("resize",this._onResize),f.on("scroll",this._onScroll),this.canvases.forEach(function(e){e.one("loaded",function(){return i.onCanvasLoaded(e)}),e.load()}),this.bound=!0,this}},{key:"refresh",value:function(){return this._onResize(f.size),this._onScroll(f.scrollTop),this}},{key:"onCanvasLoaded",value:function(e){return this.trigger("element:loaded",e.element,e),this.elementsLoaded++,e.draw(f),this.elementsLoaded==this.canvases.length&&this.trigger("elements:loaded"),this}},{key:"scroll",value:function(e){for(var t=this.opts.offsetYBounds,n=f,i=n.height,r=n.width,s=this.canvases.length;s--;){var o=this.canvases[s],a=o.size.height,h=o.offset;o.isLoaded&&e+f.height+t>h.top&&h.top+a>e-t&&(o.draw({height:i,scrollTop:e,width:r}),this.trigger("draw",o.element))}return this.trigger("update",e),this}},{key:"add",value:function(e){var t=this,n=this.createCanvases(r(e));return this.bound&&n.forEach(function(e){e.one("loaded",function(){return t.onCanvasLoaded(e)}),e.load()}),this.canvases=this.canvases.concat(n),this}},{key:"remove",value:function(e){var n=this;return r(e).forEach(function(e){for(var t=n.canvases.length;t--;)if(e==n.canvases[t].element){n.canvases[t].destroy(),n.canvases.splice(t,1);break}}),this}},{key:"destroy",value:function(){return this.off("*"),this.canvases=[],f.off("resize",this._onResize).off("scroll",this._onScroll),this}},{key:"resize",value:function(e){for(var t=this.canvases.length;t--;){var n=this.canvases[t];if(!n.isLoaded)return;n.update().draw(f)}return this.trigger("resize"),this}},{key:"createCanvases",value:function(e){var r=this;return e.map(function(e){var t,n,i=(t=e,n?t.dataset[n]||t.getAttribute("data-"+n):t.dataset||Array.prototype.slice.call(t.attributes).reduce(function(e,t){var n;return/data-/.test(t.name)&&(e[(n=t.name,n.replace(/-(\w)/g,function(e,t){return t.toUpperCase()}))]=t.value),e},{}));return new c(e,{intensity:s(i.intensity)?r.opts.intensity:+i.intensity,center:s(i.center)?r.opts.center:+i.center,safeHeight:s(i.safeHeight)?r.opts.safeHeight:+i.safeHeight})})}},{key:"opts",set:function(e){this._defaults={offsetYBounds:50,intensity:30,center:.5,safeHeight:.15},function(e){for(var t=void 0,n=arguments,i=1;i<n.length;++i)if(t=n[i])for(var r in t)e[r]=t[r]}(this._defaults,e)},get:function(){return this._defaults}}]),n}();e.exports=d});;
/*!
 * Masonry PACKAGED v4.2.2
 * Cascading grid layout library
 * https://masonry.desandro.com
 * MIT License
 * by David DeSandro
 */
!function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,r,a){function h(t,e,n){var o,r="$()."+i+'("'+e+'")';return t.each(function(t,h){var u=a.data(h,i);if(!u)return void s(i+" not initialized. Cannot call methods, i.e. "+r);var d=u[e];if(!d||"_"==e.charAt(0))return void s(r+" is not a valid method");var l=d.apply(u,n);o=void 0===o?l:o}),void 0!==o?o:t}function u(t,e){t.each(function(t,n){var o=a.data(n,i);o?(o.option(e),o._init()):(o=new r(n,e),a.data(n,i,o))})}a=a||e||t.jQuery,a&&(r.prototype.option||(r.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=o.call(arguments,1);return h(this,t,e)}return u(this,t),this},n(a))}function n(t){!t||t&&t.bridget||(t.bridget=i)}var o=Array.prototype.slice,r=t.console,s="undefined"==typeof r?function(){}:function(t){r.error(t)};return n(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var n=this._onceEvents&&this._onceEvents[t],o=0;o<i.length;o++){var r=i[o],s=n&&n[r];s&&(this.off(t,r),delete n[r]),r.apply(this,e)}return this}},e.allOff=function(){delete this._events,delete this._onceEvents},t}),function(t,e){"function"==typeof define&&define.amd?define("get-size/get-size",e):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,function(){"use strict";function t(t){var e=parseFloat(t),i=-1==t.indexOf("%")&&!isNaN(e);return i&&e}function e(){}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;u>e;e++){var i=h[e];t[i]=0}return t}function n(t){var e=getComputedStyle(t);return e||a("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),e}function o(){if(!d){d=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var o=n(e);s=200==Math.round(t(o.width)),r.isBoxSizeOuter=s,i.removeChild(e)}}function r(e){if(o(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var r=n(e);if("none"==r.display)return i();var a={};a.width=e.offsetWidth,a.height=e.offsetHeight;for(var d=a.isBorderBox="border-box"==r.boxSizing,l=0;u>l;l++){var c=h[l],f=r[c],m=parseFloat(f);a[c]=isNaN(m)?0:m}var p=a.paddingLeft+a.paddingRight,g=a.paddingTop+a.paddingBottom,y=a.marginLeft+a.marginRight,v=a.marginTop+a.marginBottom,_=a.borderLeftWidth+a.borderRightWidth,z=a.borderTopWidth+a.borderBottomWidth,E=d&&s,b=t(r.width);b!==!1&&(a.width=b+(E?0:p+_));var x=t(r.height);return x!==!1&&(a.height=x+(E?0:g+z)),a.innerWidth=a.width-(p+_),a.innerHeight=a.height-(g+z),a.outerWidth=a.width+y,a.outerHeight=a.height+v,a}}var s,a="undefined"==typeof console?e:function(t){console.error(t)},h=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],u=h.length,d=!1;return r}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;i<e.length;i++){var n=e[i],o=n+"MatchesSelector";if(t[o])return o}}();return function(e,i){return e[t](i)}}),function(t,e){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("desandro-matches-selector")):t.fizzyUIUtils=e(t,t.matchesSelector)}(window,function(t,e){var i={};i.extend=function(t,e){for(var i in e)t[i]=e[i];return t},i.modulo=function(t,e){return(t%e+e)%e};var n=Array.prototype.slice;i.makeArray=function(t){if(Array.isArray(t))return t;if(null===t||void 0===t)return[];var e="object"==typeof t&&"number"==typeof t.length;return e?n.call(t):[t]},i.removeFrom=function(t,e){var i=t.indexOf(e);-1!=i&&t.splice(i,1)},i.getParent=function(t,i){for(;t.parentNode&&t!=document.body;)if(t=t.parentNode,e(t,i))return t},i.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},i.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},i.filterFindElements=function(t,n){t=i.makeArray(t);var o=[];return t.forEach(function(t){if(t instanceof HTMLElement){if(!n)return void o.push(t);e(t,n)&&o.push(t);for(var i=t.querySelectorAll(n),r=0;r<i.length;r++)o.push(i[r])}}),o},i.debounceMethod=function(t,e,i){i=i||100;var n=t.prototype[e],o=e+"Timeout";t.prototype[e]=function(){var t=this[o];clearTimeout(t);var e=arguments,r=this;this[o]=setTimeout(function(){n.apply(r,e),delete r[o]},i)}},i.docReady=function(t){var e=document.readyState;"complete"==e||"interactive"==e?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},i.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var o=t.console;return i.htmlInit=function(e,n){i.docReady(function(){var r=i.toDashed(n),s="data-"+r,a=document.querySelectorAll("["+s+"]"),h=document.querySelectorAll(".js-"+r),u=i.makeArray(a).concat(i.makeArray(h)),d=s+"-options",l=t.jQuery;u.forEach(function(t){var i,r=t.getAttribute(s)||t.getAttribute(d);try{i=r&&JSON.parse(r)}catch(a){return void(o&&o.error("Error parsing "+s+" on "+t.className+": "+a))}var h=new e(t,i);l&&l.data(t,n,h)})})},i}),function(t,e){"function"==typeof define&&define.amd?define("outlayer/item",["ev-emitter/ev-emitter","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("ev-emitter"),require("get-size")):(t.Outlayer={},t.Outlayer.Item=e(t.EvEmitter,t.getSize))}(window,function(t,e){"use strict";function i(t){for(var e in t)return!1;return e=null,!0}function n(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}function o(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}var r=document.documentElement.style,s="string"==typeof r.transition?"transition":"WebkitTransition",a="string"==typeof r.transform?"transform":"WebkitTransform",h={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[s],u={transform:a,transition:s,transitionDuration:s+"Duration",transitionProperty:s+"Property",transitionDelay:s+"Delay"},d=n.prototype=Object.create(t.prototype);d.constructor=n,d._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},d.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},d.getSize=function(){this.size=e(this.element)},d.css=function(t){var e=this.element.style;for(var i in t){var n=u[i]||i;e[n]=t[i]}},d.getPosition=function(){var t=getComputedStyle(this.element),e=this.layout._getOption("originLeft"),i=this.layout._getOption("originTop"),n=t[e?"left":"right"],o=t[i?"top":"bottom"],r=parseFloat(n),s=parseFloat(o),a=this.layout.size;-1!=n.indexOf("%")&&(r=r/100*a.width),-1!=o.indexOf("%")&&(s=s/100*a.height),r=isNaN(r)?0:r,s=isNaN(s)?0:s,r-=e?a.paddingLeft:a.paddingRight,s-=i?a.paddingTop:a.paddingBottom,this.position.x=r,this.position.y=s},d.layoutPosition=function(){var t=this.layout.size,e={},i=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop"),o=i?"paddingLeft":"paddingRight",r=i?"left":"right",s=i?"right":"left",a=this.position.x+t[o];e[r]=this.getXValue(a),e[s]="";var h=n?"paddingTop":"paddingBottom",u=n?"top":"bottom",d=n?"bottom":"top",l=this.position.y+t[h];e[u]=this.getYValue(l),e[d]="",this.css(e),this.emitEvent("layout",[this])},d.getXValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!e?t/this.layout.size.width*100+"%":t+"px"},d.getYValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&e?t/this.layout.size.height*100+"%":t+"px"},d._transitionTo=function(t,e){this.getPosition();var i=this.position.x,n=this.position.y,o=t==this.position.x&&e==this.position.y;if(this.setPosition(t,e),o&&!this.isTransitioning)return void this.layoutPosition();var r=t-i,s=e-n,a={};a.transform=this.getTranslate(r,s),this.transition({to:a,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},d.getTranslate=function(t,e){var i=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop");return t=i?t:-t,e=n?e:-e,"translate3d("+t+"px, "+e+"px, 0)"},d.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},d.moveTo=d._transitionTo,d.setPosition=function(t,e){this.position.x=parseFloat(t),this.position.y=parseFloat(e)},d._nonTransition=function(t){this.css(t.to),t.isCleaning&&this._removeStyles(t.to);for(var e in t.onTransitionEnd)t.onTransitionEnd[e].call(this)},d.transition=function(t){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(t);var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var n=this.element.offsetHeight;n=null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0};var l="opacity,"+o(a);d.enableTransition=function(){if(!this.isTransitioning){var t=this.layout.options.transitionDuration;t="number"==typeof t?t+"ms":t,this.css({transitionProperty:l,transitionDuration:t,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(h,this,!1)}},d.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},d.onotransitionend=function(t){this.ontransitionend(t)};var c={"-webkit-transform":"transform"};d.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,n=c[t.propertyName]||t.propertyName;if(delete e.ingProperties[n],i(e.ingProperties)&&this.disableTransition(),n in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[n]),n in e.onEnd){var o=e.onEnd[n];o.call(this),delete e.onEnd[n]}this.emitEvent("transitionEnd",[this])}},d.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(h,this,!1),this.isTransitioning=!1},d._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var f={transitionProperty:"",transitionDuration:"",transitionDelay:""};return d.removeTransitionStyles=function(){this.css(f)},d.stagger=function(t){t=isNaN(t)?0:t,this.staggerDelay=t+"ms"},d.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},d.remove=function(){return s&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",function(){this.removeElem()}),void this.hide()):void this.removeElem()},d.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("visibleStyle");e[i]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:e})},d.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},d.getHideRevealTransitionEndProperty=function(t){var e=this.layout.options[t];if(e.opacity)return"opacity";for(var i in e)return i},d.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("hiddenStyle");e[i]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:e})},d.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},d.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},n}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("outlayer/outlayer",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(i,n,o,r){return e(t,i,n,o,r)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):t.Outlayer=e(t,t.EvEmitter,t.getSize,t.fizzyUIUtils,t.Outlayer.Item)}(window,function(t,e,i,n,o){"use strict";function r(t,e){var i=n.getQueryElement(t);if(!i)return void(h&&h.error("Bad element for "+this.constructor.namespace+": "+(i||t)));this.element=i,u&&(this.$element=u(this.element)),this.options=n.extend({},this.constructor.defaults),this.option(e);var o=++l;this.element.outlayerGUID=o,c[o]=this,this._create();var r=this._getOption("initLayout");r&&this.layout()}function s(t){function e(){t.apply(this,arguments)}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}function a(t){if("number"==typeof t)return t;var e=t.match(/(^\d*\.?\d*)(\w*)/),i=e&&e[1],n=e&&e[2];if(!i.length)return 0;i=parseFloat(i);var o=m[n]||1;return i*o}var h=t.console,u=t.jQuery,d=function(){},l=0,c={};r.namespace="outlayer",r.Item=o,r.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var f=r.prototype;n.extend(f,e.prototype),f.option=function(t){n.extend(this.options,t)},f._getOption=function(t){var e=this.constructor.compatOptions[t];return e&&void 0!==this.options[e]?this.options[e]:this.options[t]},r.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},f._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),n.extend(this.element.style,this.options.containerStyle);var t=this._getOption("resize");t&&this.bindResize()},f.reloadItems=function(){this.items=this._itemize(this.element.children)},f._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,n=[],o=0;o<e.length;o++){var r=e[o],s=new i(r,this);n.push(s)}return n},f._filterFindItemElements=function(t){return n.filterFindElements(t,this.options.itemSelector)},f.getItemElements=function(){return this.items.map(function(t){return t.element})},f.layout=function(){this._resetLayout(),this._manageStamps();var t=this._getOption("layoutInstant"),e=void 0!==t?t:!this._isLayoutInited;this.layoutItems(this.items,e),this._isLayoutInited=!0},f._init=f.layout,f._resetLayout=function(){this.getSize()},f.getSize=function(){this.size=i(this.element)},f._getMeasurement=function(t,e){var n,o=this.options[t];o?("string"==typeof o?n=this.element.querySelector(o):o instanceof HTMLElement&&(n=o),this[t]=n?i(n)[e]:o):this[t]=0},f.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},f._getItemsForLayout=function(t){return t.filter(function(t){return!t.isIgnored})},f._layoutItems=function(t,e){if(this._emitCompleteOnItems("layout",t),t&&t.length){var i=[];t.forEach(function(t){var n=this._getItemLayoutPosition(t);n.item=t,n.isInstant=e||t.isLayoutInstant,i.push(n)},this),this._processLayoutQueue(i)}},f._getItemLayoutPosition=function(){return{x:0,y:0}},f._processLayoutQueue=function(t){this.updateStagger(),t.forEach(function(t,e){this._positionItem(t.item,t.x,t.y,t.isInstant,e)},this)},f.updateStagger=function(){var t=this.options.stagger;return null===t||void 0===t?void(this.stagger=0):(this.stagger=a(t),this.stagger)},f._positionItem=function(t,e,i,n,o){n?t.goTo(e,i):(t.stagger(o*this.stagger),t.moveTo(e,i))},f._postLayout=function(){this.resizeContainer()},f.resizeContainer=function(){var t=this._getOption("resizeContainer");if(t){var e=this._getContainerSize();e&&(this._setContainerMeasure(e.width,!0),this._setContainerMeasure(e.height,!1))}},f._getContainerSize=d,f._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},f._emitCompleteOnItems=function(t,e){function i(){o.dispatchEvent(t+"Complete",null,[e])}function n(){s++,s==r&&i()}var o=this,r=e.length;if(!e||!r)return void i();var s=0;e.forEach(function(e){e.once(t,n)})},f.dispatchEvent=function(t,e,i){var n=e?[e].concat(i):i;if(this.emitEvent(t,n),u)if(this.$element=this.$element||u(this.element),e){var o=u.Event(e);o.type=t,this.$element.trigger(o,i)}else this.$element.trigger(t,i)},f.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},f.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},f.stamp=function(t){t=this._find(t),t&&(this.stamps=this.stamps.concat(t),t.forEach(this.ignore,this))},f.unstamp=function(t){t=this._find(t),t&&t.forEach(function(t){n.removeFrom(this.stamps,t),this.unignore(t)},this)},f._find=function(t){return t?("string"==typeof t&&(t=this.element.querySelectorAll(t)),t=n.makeArray(t)):void 0},f._manageStamps=function(){this.stamps&&this.stamps.length&&(this._getBoundingRect(),this.stamps.forEach(this._manageStamp,this))},f._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},f._manageStamp=d,f._getElementOffset=function(t){var e=t.getBoundingClientRect(),n=this._boundingRect,o=i(t),r={left:e.left-n.left-o.marginLeft,top:e.top-n.top-o.marginTop,right:n.right-e.right-o.marginRight,bottom:n.bottom-e.bottom-o.marginBottom};return r},f.handleEvent=n.handleEvent,f.bindResize=function(){t.addEventListener("resize",this),this.isResizeBound=!0},f.unbindResize=function(){t.removeEventListener("resize",this),this.isResizeBound=!1},f.onresize=function(){this.resize()},n.debounceMethod(r,"onresize",100),f.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},f.needsResizeLayout=function(){var t=i(this.element),e=this.size&&t;return e&&t.innerWidth!==this.size.innerWidth},f.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},f.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},f.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},f.reveal=function(t){if(this._emitCompleteOnItems("reveal",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.reveal()})}},f.hide=function(t){if(this._emitCompleteOnItems("hide",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.hide()})}},f.revealItemElements=function(t){var e=this.getItems(t);this.reveal(e)},f.hideItemElements=function(t){var e=this.getItems(t);this.hide(e)},f.getItem=function(t){for(var e=0;e<this.items.length;e++){var i=this.items[e];if(i.element==t)return i}},f.getItems=function(t){t=n.makeArray(t);var e=[];return t.forEach(function(t){var i=this.getItem(t);i&&e.push(i)},this),e},f.remove=function(t){var e=this.getItems(t);this._emitCompleteOnItems("remove",e),e&&e.length&&e.forEach(function(t){t.remove(),n.removeFrom(this.items,t)},this)},f.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="",this.items.forEach(function(t){t.destroy()}),this.unbindResize();var e=this.element.outlayerGUID;delete c[e],delete this.element.outlayerGUID,u&&u.removeData(this.element,this.constructor.namespace)},r.data=function(t){t=n.getQueryElement(t);var e=t&&t.outlayerGUID;return e&&c[e]},r.create=function(t,e){var i=s(r);return i.defaults=n.extend({},r.defaults),n.extend(i.defaults,e),i.compatOptions=n.extend({},r.compatOptions),i.namespace=t,i.data=r.data,i.Item=s(o),n.htmlInit(i,t),u&&u.bridget&&u.bridget(t,i),i};var m={ms:1,s:1e3};return r.Item=o,r}),function(t,e){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("outlayer"),require("get-size")):t.Masonry=e(t.Outlayer,t.getSize)}(window,function(t,e){var i=t.create("masonry");i.compatOptions.fitWidth="isFitWidth";var n=i.prototype;return n._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns(),this.colYs=[];for(var t=0;t<this.cols;t++)this.colYs.push(0);this.maxY=0,this.horizontalColIndex=0},n.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],i=t&&t.element;this.columnWidth=i&&e(i).outerWidth||this.containerWidth}var n=this.columnWidth+=this.gutter,o=this.containerWidth+this.gutter,r=o/n,s=n-o%n,a=s&&1>s?"round":"floor";r=Math[a](r),this.cols=Math.max(r,1)},n.getContainerWidth=function(){var t=this._getOption("fitWidth"),i=t?this.element.parentNode:this.element,n=e(i);this.containerWidth=n&&n.innerWidth},n._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,i=e&&1>e?"round":"ceil",n=Math[i](t.size.outerWidth/this.columnWidth);n=Math.min(n,this.cols);for(var o=this.options.horizontalOrder?"_getHorizontalColPosition":"_getTopColPosition",r=this[o](n,t),s={x:this.columnWidth*r.col,y:r.y},a=r.y+t.size.outerHeight,h=n+r.col,u=r.col;h>u;u++)this.colYs[u]=a;return s},n._getTopColPosition=function(t){var e=this._getTopColGroup(t),i=Math.min.apply(Math,e);return{col:e.indexOf(i),y:i}},n._getTopColGroup=function(t){if(2>t)return this.colYs;for(var e=[],i=this.cols+1-t,n=0;i>n;n++)e[n]=this._getColGroupY(n,t);return e},n._getColGroupY=function(t,e){if(2>e)return this.colYs[t];var i=this.colYs.slice(t,t+e);return Math.max.apply(Math,i)},n._getHorizontalColPosition=function(t,e){var i=this.horizontalColIndex%this.cols,n=t>1&&i+t>this.cols;i=n?0:i;var o=e.size.outerWidth&&e.size.outerHeight;return this.horizontalColIndex=o?i+t:this.horizontalColIndex,{col:i,y:this._getColGroupY(i,t)}},n._manageStamp=function(t){var i=e(t),n=this._getElementOffset(t),o=this._getOption("originLeft"),r=o?n.left:n.right,s=r+i.outerWidth,a=Math.floor(r/this.columnWidth);a=Math.max(0,a);var h=Math.floor(s/this.columnWidth);h-=s%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var u=this._getOption("originTop"),d=(u?n.top:n.bottom)+i.outerHeight,l=a;h>=l;l++)this.colYs[l]=Math.max(d,this.colYs[l])},n._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},n._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},n.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},i});;
/*!
 * wavesurfer.js 6.4.0 (2022-11-05)
 * https://wavesurfer-js.org
 * @license BSD-3-Clause
 */
(function webpackUniversalModuleDefinition(root, factory) {
  if(typeof exports === 'object' && typeof module === 'object')
    module.exports = factory();
  else if(typeof define === 'function' && define.amd)
    define("WaveSurfer", [], factory);
  else if(typeof exports === 'object')
    exports["WaveSurfer"] = factory();
  else
    root["WaveSurfer"] = factory();
})(self, () => {
  return /******/ (() => { // webpackBootstrap
    /******/ 	var __webpack_modules__ = ({
      /***/ "./src/drawer.canvasentry.js":
      /*!***********************************!*\
  !*** ./src/drawer.canvasentry.js ***!
  \***********************************/
      /***/ ((module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", ({
          value: true
        }));
        exports["default"] = void 0;
        var _style = _interopRequireDefault(__webpack_require__(/*! ./util/style */ "./src/util/style.js"));
        var _getId = _interopRequireDefault(__webpack_require__(/*! ./util/get-id */ "./src/util/get-id.js"));
        function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
        function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } }
        function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
        /**
         * The `CanvasEntry` class represents an element consisting of a wave `canvas`
         * and an (optional) progress wave `canvas`.
         *
         * The `MultiCanvas` renderer uses one or more `CanvasEntry` instances to
         * render a waveform, depending on the zoom level.
         */
        var CanvasEntry = /*#__PURE__*/function () {
          function CanvasEntry() {
            _classCallCheck(this, CanvasEntry);
            /**
             * The wave node
             *
             * @type {HTMLCanvasElement}
             */
            this.wave = null;
            /**
             * The wave canvas rendering context
             *
             * @type {CanvasRenderingContext2D}
             */
            this.waveCtx = null;
            /**
             * The (optional) progress wave node
             *
             * @type {HTMLCanvasElement}
             */
            this.progress = null;
            /**
             * The (optional) progress wave canvas rendering context
             *
             * @type {CanvasRenderingContext2D}
             */
            this.progressCtx = null;
            /**
             * Start of the area the canvas should render, between 0 and 1
             *
             * @type {number}
             */
            this.start = 0;
            /**
             * End of the area the canvas should render, between 0 and 1
             *
             * @type {number}
             */
            this.end = 1;
            /**
             * Unique identifier for this entry
             *
             * @type {string}
             */
            this.id = (0, _getId.default)(typeof this.constructor.name !== 'undefined' ? this.constructor.name.toLowerCase() + '_' : 'canvasentry_');
            /**
             * Canvas 2d context attributes
             *
             * @type {object}
             */
            this.canvasContextAttributes = {};
          }
          /**
           * Store the wave canvas element and create the 2D rendering context
           *
           * @param {HTMLCanvasElement} element The wave `canvas` element.
           */
          _createClass(CanvasEntry, [{
            key: "initWave",
            value: function initWave(element) {
              this.wave = element;
              this.waveCtx = this.wave.getContext('2d', this.canvasContextAttributes);
            }
            /**
             * Store the progress wave canvas element and create the 2D rendering
             * context
             *
             * @param {HTMLCanvasElement} element The progress wave `canvas` element.
             */
          }, {
            key: "initProgress",
            value: function initProgress(element) {
              this.progress = element;
              this.progressCtx = this.progress.getContext('2d', this.canvasContextAttributes);
            }
            /**
             * Update the dimensions
             *
             * @param {number} elementWidth Width of the entry
             * @param {number} totalWidth Total width of the multi canvas renderer
             * @param {number} width The new width of the element
             * @param {number} height The new height of the element
             */
          }, {
            key: "updateDimensions",
            value: function updateDimensions(elementWidth, totalWidth, width, height) {
              // where the canvas starts and ends in the waveform, represented as a
              // decimal between 0 and 1
              this.start = this.wave.offsetLeft / totalWidth || 0;
              this.end = this.start + elementWidth / totalWidth;
              // set wave canvas dimensions
              this.wave.width = width;
              this.wave.height = height;
              var elementSize = {
                width: elementWidth + 'px'
              };
              (0, _style.default)(this.wave, elementSize);
              if (this.hasProgressCanvas) {
                // set progress canvas dimensions
                this.progress.width = width;
                this.progress.height = height;
                (0, _style.default)(this.progress, elementSize);
              }
            }
            /**
             * Clear the wave and progress rendering contexts
             */
          }, {
            key: "clearWave",
            value: function clearWave() {
              // wave
              this.waveCtx.clearRect(0, 0, this.waveCtx.canvas.width, this.waveCtx.canvas.height);
              // progress
              if (this.hasProgressCanvas) {
                this.progressCtx.clearRect(0, 0, this.progressCtx.canvas.width, this.progressCtx.canvas.height);
              }
            }
            /**
             * Set the fill styles for wave and progress
             * @param {string|string[]} waveColor Fill color for the wave canvas,
             * or an array of colors to apply as a gradient
             * @param {?string|string[]} progressColor Fill color for the progress canvas,
             * or an array of colors to apply as a gradient
             */
          }, {
            key: "setFillStyles",
            value: function setFillStyles(waveColor, progressColor) {
              this.waveCtx.fillStyle = this.getFillStyle(this.waveCtx, waveColor);
              if (this.hasProgressCanvas) {
                this.progressCtx.fillStyle = this.getFillStyle(this.progressCtx, progressColor);
              }
            }
            /**
             * Utility function to handle wave color arguments
             *
             * When the color argument type is a string or CanvasGradient instance,
             * it will be returned as is. Otherwise, it will be treated as an array,
             * and a new CanvasGradient will be returned
             *
             * @since 6.0.0
             * @param {CanvasRenderingContext2D} ctx Rendering context of target canvas
             * @param {string|string[]|CanvasGradient} color Either a single fill color
             *     for the wave canvas, an existing CanvasGradient instance, or an array
             *     of colors to apply as a gradient
             * @returns {string|CanvasGradient} Returns a string fillstyle value, or a
             *     canvas gradient
             */
          }, {
            key: "getFillStyle",
            value: function getFillStyle(ctx, color) {
              if (typeof color == 'string' || color instanceof CanvasGradient) {
                return color;
              }
              var waveGradient = ctx.createLinearGradient(0, 0, 0, ctx.canvas.height);
              color.forEach(function (value, index) {
                return waveGradient.addColorStop(index / color.length, value);
              });
              return waveGradient;
            }
            /**
             * Set the canvas transforms for wave and progress
             *
             * @param {boolean} vertical Whether to render vertically
             */
          }, {
            key: "applyCanvasTransforms",
            value: function applyCanvasTransforms(vertical) {
              if (vertical) {
                // Reflect the waveform across the line y = -x
                this.waveCtx.setTransform(0, 1, 1, 0, 0, 0);
                if (this.hasProgressCanvas) {
                  this.progressCtx.setTransform(0, 1, 1, 0, 0, 0);
                }
              }
            }
            /**
             * Draw a rectangle for wave and progress
             *
             * @param {number} x X start position
             * @param {number} y Y start position
             * @param {number} width Width of the rectangle
             * @param {number} height Height of the rectangle
             * @param {number} radius Radius of the rectangle
             */
          }, {
            key: "fillRects",
            value: function fillRects(x, y, width, height, radius) {
              this.fillRectToContext(this.waveCtx, x, y, width, height, radius);
              if (this.hasProgressCanvas) {
                this.fillRectToContext(this.progressCtx, x, y, width, height, radius);
              }
            }
            /**
             * Draw the actual rectangle on a `canvas` element
             *
             * @param {CanvasRenderingContext2D} ctx Rendering context of target canvas
             * @param {number} x X start position
             * @param {number} y Y start position
             * @param {number} width Width of the rectangle
             * @param {number} height Height of the rectangle
             * @param {number} radius Radius of the rectangle
             */
          }, {
            key: "fillRectToContext",
            value: function fillRectToContext(ctx, x, y, width, height, radius) {
              if (!ctx) {
                return;
              }
              if (radius) {
                this.drawRoundedRect(ctx, x, y, width, height, radius);
              } else {
                ctx.fillRect(x, y, width, height);
              }
            }
            /**
             * Draw a rounded rectangle on Canvas
             *
             * @param {CanvasRenderingContext2D} ctx Canvas context
             * @param {number} x X-position of the rectangle
             * @param {number} y Y-position of the rectangle
             * @param {number} width Width of the rectangle
             * @param {number} height Height of the rectangle
             * @param {number} radius Radius of the rectangle
             *
             * @return {void}
             * @example drawRoundedRect(ctx, 50, 50, 5, 10, 3)
             */
          }, {
            key: "drawRoundedRect",
            value: function drawRoundedRect(ctx, x, y, width, height, radius) {
              if (height === 0) {
                return;
              }
              // peaks are float values from -1 to 1. Use absolute height values in
              // order to correctly calculate rounded rectangle coordinates
              if (height < 0) {
                height *= -1;
                y -= height;
              }
              ctx.beginPath();
              ctx.moveTo(x + radius, y);
              ctx.lineTo(x + width - radius, y);
              ctx.quadraticCurveTo(x + width, y, x + width, y + radius);
              ctx.lineTo(x + width, y + height - radius);
              ctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);
              ctx.lineTo(x + radius, y + height);
              ctx.quadraticCurveTo(x, y + height, x, y + height - radius);
              ctx.lineTo(x, y + radius);
              ctx.quadraticCurveTo(x, y, x + radius, y);
              ctx.closePath();
              ctx.fill();
            }
            /**
             * Render the actual wave and progress lines
             *
             * @param {number[]} peaks Array with peaks data
             * @param {number} absmax Maximum peak value (absolute)
             * @param {number} halfH Half the height of the waveform
             * @param {number} offsetY Offset to the top
             * @param {number} start The x-offset of the beginning of the area that
             * should be rendered
             * @param {number} end The x-offset of the end of the area that
             * should be rendered
             */
          }, {
            key: "drawLines",
            value: function drawLines(peaks, absmax, halfH, offsetY, start, end) {
              this.drawLineToContext(this.waveCtx, peaks, absmax, halfH, offsetY, start, end);
              if (this.hasProgressCanvas) {
                this.drawLineToContext(this.progressCtx, peaks, absmax, halfH, offsetY, start, end);
              }
            }
            /**
             * Render the actual waveform line on a `canvas` element
             *
             * @param {CanvasRenderingContext2D} ctx Rendering context of target canvas
             * @param {number[]} peaks Array with peaks data
             * @param {number} absmax Maximum peak value (absolute)
             * @param {number} halfH Half the height of the waveform
             * @param {number} offsetY Offset to the top
             * @param {number} start The x-offset of the beginning of the area that
             * should be rendered
             * @param {number} end The x-offset of the end of the area that
             * should be rendered
             */
          }, {
            key: "drawLineToContext",
            value: function drawLineToContext(ctx, peaks, absmax, halfH, offsetY, start, end) {
              if (!ctx) {
                return;
              }
              var length = peaks.length / 2;
              var first = Math.round(length * this.start);
              // use one more peak value to make sure we join peaks at ends -- unless,
              // of course, this is the last canvas
              var last = Math.round(length * this.end) + 1;
              var canvasStart = first;
              var canvasEnd = last;
              var scale = this.wave.width / (canvasEnd - canvasStart - 1);
              // optimization
              var halfOffset = halfH + offsetY;
              var absmaxHalf = absmax / halfH;
              ctx.beginPath();
              ctx.moveTo((canvasStart - first) * scale, halfOffset);
              ctx.lineTo((canvasStart - first) * scale, halfOffset - Math.round((peaks[2 * canvasStart] || 0) / absmaxHalf));
              var i, peak, h;
              for (i = canvasStart; i < canvasEnd; i++) {
                peak = peaks[2 * i] || 0;
                h = Math.round(peak / absmaxHalf);
                ctx.lineTo((i - first) * scale + this.halfPixel, halfOffset - h);
              }
              // draw the bottom edge going backwards, to make a single
              // closed hull to fill
              var j = canvasEnd - 1;
              for (j; j >= canvasStart; j--) {
                peak = peaks[2 * j + 1] || 0;
                h = Math.round(peak / absmaxHalf);
                ctx.lineTo((j - first) * scale + this.halfPixel, halfOffset - h);
              }
              ctx.lineTo((canvasStart - first) * scale, halfOffset - Math.round((peaks[2 * canvasStart + 1] || 0) / absmaxHalf));
              ctx.closePath();
              ctx.fill();
            }
            /**
             * Destroys this entry
             */
          }, {
            key: "destroy",
            value: function destroy() {
              this.waveCtx = null;
              this.wave = null;
              this.progressCtx = null;
              this.progress = null;
            }
            /**
             * Return image data of the wave `canvas` element
             *
             * When using a `type` of `'blob'`, this will return a `Promise` that
             * resolves with a `Blob` instance.
             *
             * @param {string} format='image/png' An optional value of a format type.
             * @param {number} quality=0.92 An optional value between 0 and 1.
             * @param {string} type='dataURL' Either 'dataURL' or 'blob'.
             * @return {string|Promise} When using the default `'dataURL'` `type` this
             * returns a data URL. When using the `'blob'` `type` this returns a
             * `Promise` that resolves with a `Blob` instance.
             */
          }, {
            key: "getImage",
            value: function getImage(format, quality, type) {
              var _this = this;
              if (type === 'blob') {
                return new Promise(function (resolve) {
                  _this.wave.toBlob(resolve, format, quality);
                });
              } else if (type === 'dataURL') {
                return this.wave.toDataURL(format, quality);
              }
            }
          }]);
          return CanvasEntry;
        }();
        exports["default"] = CanvasEntry;
        module.exports = exports.default;
        /***/ }),
      /***/ "./src/drawer.js":
      /*!***********************!*\
  !*** ./src/drawer.js ***!
  \***********************/
      /***/ ((module, exports, __webpack_require__) => {
        "use strict";
        function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
        Object.defineProperty(exports, "__esModule", ({
          value: true
        }));
        exports["default"] = void 0;
        var util = _interopRequireWildcard(__webpack_require__(/*! ./util */ "./src/util/index.js"));
        function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
        function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
        function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } }
        function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
        function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
        function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
        function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
        function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
        function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
        function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
        function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
        /**
         * Parent class for renderers
         *
         * @extends {Observer}
         */
        var Drawer = /*#__PURE__*/function (_util$Observer) {
          _inherits(Drawer, _util$Observer);
          var _super = _createSuper(Drawer);
          /**
           * @param {HTMLElement} container The container node of the wavesurfer instance
           * @param {WavesurferParams} params The wavesurfer initialisation options
           */
          function Drawer(container, params) {
            var _this;
            _classCallCheck(this, Drawer);
            _this = _super.call(this);
            _this.container = util.withOrientation(container, params.vertical);
            /**
             * @type {WavesurferParams}
             */
            _this.params = params;
            /**
             * The width of the renderer
             * @type {number}
             */
            _this.width = 0;
            /**
             * The height of the renderer
             * @type {number}
             */
            _this.height = params.height * _this.params.pixelRatio;
            _this.lastPos = 0;
            /**
             * The `<wave>` element which is added to the container
             * @type {HTMLElement}
             */
            _this.wrapper = null;
            return _this;
          }
          /**
           * Alias of `util.style`
           *
           * @param {HTMLElement} el The element that the styles will be applied to
           * @param {Object} styles The map of propName: attribute, both are used as-is
           * @return {HTMLElement} el
           */
          _createClass(Drawer, [{
            key: "style",
            value: function style(el, styles) {
              return util.style(el, styles);
            }
            /**
             * Create the wrapper `<wave>` element, style it and set up the events for
             * interaction
             */
          }, {
            key: "createWrapper",
            value: function createWrapper() {
              this.wrapper = util.withOrientation(this.container.appendChild(document.createElement('wave')), this.params.vertical);
              this.style(this.wrapper, {
                display: 'block',
                position: 'relative',
                userSelect: 'none',
                webkitUserSelect: 'none',
                height: this.params.height + 'px'
              });
              if (this.params.fillParent || this.params.scrollParent) {
                this.style(this.wrapper, {
                  width: '100%',
                  cursor: this.params.hideCursor ? 'none' : 'auto',
                  overflowX: this.params.hideScrollbar ? 'hidden' : 'auto',
                  overflowY: 'hidden'
                });
              }
              this.setupWrapperEvents();
            }
            /**
             * Handle click event
             *
             * @param {Event} e Click event
             * @param {?boolean} noPrevent Set to true to not call `e.preventDefault()`
             * @return {number} Playback position from 0 to 1
             */
          }, {
            key: "handleEvent",
            value: function handleEvent(e, noPrevent) {
              !noPrevent && e.preventDefault();
              var clientX = util.withOrientation(e.targetTouches ? e.targetTouches[0] : e, this.params.vertical).clientX;
              var bbox = this.wrapper.getBoundingClientRect();
              var nominalWidth = this.width;
              var parentWidth = this.getWidth();
              var progressPixels = this.getProgressPixels(bbox, clientX);
              var progress;
              if (!this.params.fillParent && nominalWidth < parentWidth) {
                progress = progressPixels * (this.params.pixelRatio / nominalWidth) || 0;
              } else {
                progress = (progressPixels + this.wrapper.scrollLeft) / this.wrapper.scrollWidth || 0;
              }
              return util.clamp(progress, 0, 1);
            }
          }, {
            key: "getProgressPixels",
            value: function getProgressPixels(wrapperBbox, clientX) {
              if (this.params.rtl) {
                return wrapperBbox.right - clientX;
              } else {
                return clientX - wrapperBbox.left;
              }
            }
          }, {
            key: "setupWrapperEvents",
            value: function setupWrapperEvents() {
              var _this2 = this;
              this.wrapper.addEventListener('click', function (e) {
                var orientedEvent = util.withOrientation(e, _this2.params.vertical);
                var scrollbarHeight = _this2.wrapper.offsetHeight - _this2.wrapper.clientHeight;
                if (scrollbarHeight !== 0) {
                  // scrollbar is visible.  Check if click was on it
                  var bbox = _this2.wrapper.getBoundingClientRect();
                  if (orientedEvent.clientY >= bbox.bottom - scrollbarHeight) {
                    // ignore mousedown as it was on the scrollbar
                    return;
                  }
                }
                if (_this2.params.interact) {
                  _this2.fireEvent('click', e, _this2.handleEvent(e));
                }
              });
              this.wrapper.addEventListener('dblclick', function (e) {
                if (_this2.params.interact) {
                  _this2.fireEvent('dblclick', e, _this2.handleEvent(e));
                }
              });
              this.wrapper.addEventListener('scroll', function (e) {
                return _this2.fireEvent('scroll', e);
              });
            }
            /**
             * Draw peaks on the canvas
             *
             * @param {number[]|Number.<Array[]>} peaks Can also be an array of arrays
             * for split channel rendering
             * @param {number} length The width of the area that should be drawn
             * @param {number} start The x-offset of the beginning of the area that
             * should be rendered
             * @param {number} end The x-offset of the end of the area that should be
             * rendered
             */
          }, {
            key: "drawPeaks",
            value: function drawPeaks(peaks, length, start, end) {
              if (!this.setWidth(length)) {
                this.clearWave();
              }
              this.params.barWidth ? this.drawBars(peaks, 0, start, end) : this.drawWave(peaks, 0, start, end);
            }
            /**
             * Scroll to the beginning
             */
          }, {
            key: "resetScroll",
            value: function resetScroll() {
              if (this.wrapper !== null) {
                this.wrapper.scrollLeft = 0;
              }
            }
            /**
             * Recenter the view-port at a certain percent of the waveform
             *
             * @param {number} percent Value from 0 to 1 on the waveform
             */
          }, {
            key: "recenter",
            value: function recenter(percent) {
              var position = this.wrapper.scrollWidth * percent;
              this.recenterOnPosition(position, true);
            }
            /**
             * Recenter the view-port on a position, either scroll there immediately or
             * in steps of 5 pixels
             *
             * @param {number} position X-offset in pixels
             * @param {boolean} immediate Set to true to immediately scroll somewhere
             */
          }, {
            key: "recenterOnPosition",
            value: function recenterOnPosition(position, immediate) {
              var scrollLeft = this.wrapper.scrollLeft;
              var half = ~~(this.wrapper.clientWidth / 2);
              var maxScroll = this.wrapper.scrollWidth - this.wrapper.clientWidth;
              var target = position - half;
              var offset = target - scrollLeft;
              if (maxScroll == 0) {
                // no need to continue if scrollbar is not there
                return;
              }
              // if the cursor is currently visible...
              if (!immediate && -half <= offset && offset < half) {
                // set rate at which waveform is centered
                var rate = this.params.autoCenterRate;
                // make rate depend on width of view and length of waveform
                rate /= half;
                rate *= maxScroll;
                offset = Math.max(-rate, Math.min(rate, offset));
                target = scrollLeft + offset;
              }
              // limit target to valid range (0 to maxScroll)
              target = Math.max(0, Math.min(maxScroll, target));
              // no use attempting to scroll if we're not moving
              if (target != scrollLeft) {
                this.wrapper.scrollLeft = target;
              }
            }
            /**
             * Get the current scroll position in pixels
             *
             * @return {number} Horizontal scroll position in pixels
             */
          }, {
            key: "getScrollX",
            value: function getScrollX() {
              var x = 0;
              if (this.wrapper) {
                var pixelRatio = this.params.pixelRatio;
                x = Math.round(this.wrapper.scrollLeft * pixelRatio);
                // In cases of elastic scroll (safari with mouse wheel) you can
                // scroll beyond the limits of the container
                // Calculate and floor the scrollable extent to make sure an out
                // of bounds value is not returned
                // Ticket #1312
                if (this.params.scrollParent) {
                  var maxScroll = ~~(this.wrapper.scrollWidth * pixelRatio - this.getWidth());
                  x = Math.min(maxScroll, Math.max(0, x));
                }
              }
              return x;
            }
            /**
             * Get the width of the container
             *
             * @return {number} The width of the container
             */
          }, {
            key: "getWidth",
            value: function getWidth() {
              return Math.round(this.container.clientWidth * this.params.pixelRatio);
            }
            /**
             * Set the width of the container
             *
             * @param {number} width The new width of the container
             * @return {boolean} Whether the width of the container was updated or not
             */
          }, {
            key: "setWidth",
            value: function setWidth(width) {
              if (this.width == width) {
                return false;
              }
              this.width = width;
              if (this.params.fillParent || this.params.scrollParent) {
                this.style(this.wrapper, {
                  width: ''
                });
              } else {
                var newWidth = ~~(this.width / this.params.pixelRatio) + 'px';
                this.style(this.wrapper, {
                  width: newWidth
                });
              }
              this.updateSize();
              return true;
            }
            /**
             * Set the height of the container
             *
             * @param {number} height The new height of the container.
             * @return {boolean} Whether the height of the container was updated or not
             */
          }, {
            key: "setHeight",
            value: function setHeight(height) {
              if (height == this.height) {
                return false;
              }
              this.height = height;
              this.style(this.wrapper, {
                height: ~~(this.height / this.params.pixelRatio) + 'px'
              });
              this.updateSize();
              return true;
            }
            /**
             * Called by wavesurfer when progress should be rendered
             *
             * @param {number} progress From 0 to 1
             */
          }, {
            key: "progress",
            value: function progress(_progress) {
              var minPxDelta = 1 / this.params.pixelRatio;
              var pos = Math.round(_progress * this.width) * minPxDelta;
              if (pos < this.lastPos || pos - this.lastPos >= minPxDelta) {
                this.lastPos = pos;
                if (this.params.scrollParent && this.params.autoCenter) {
                  var newPos = ~~(this.wrapper.scrollWidth * _progress);
                  this.recenterOnPosition(newPos, this.params.autoCenterImmediately);
                }
                this.updateProgress(pos);
              }
            }
            /**
             * This is called when wavesurfer is destroyed
             */
          }, {
            key: "destroy",
            value: function destroy() {
              this.unAll();
              if (this.wrapper) {
                if (this.wrapper.parentNode == this.container.domElement) {
                  this.container.removeChild(this.wrapper.domElement);
                }
                this.wrapper = null;
              }
            }
            /* Renderer-specific methods */
            /**
             * Called after cursor related params have changed.
             *
             * @abstract
             */
          }, {
            key: "updateCursor",
            value: function updateCursor() {}
            /**
             * Called when the size of the container changes so the renderer can adjust
             *
             * @abstract
             */
          }, {
            key: "updateSize",
            value: function updateSize() {}
            /**
             * Draw a waveform with bars
             *
             * @abstract
             * @param {number[]|Number.<Array[]>} peaks Can also be an array of arrays for split channel
             * rendering
             * @param {number} channelIndex The index of the current channel. Normally
             * should be 0
             * @param {number} start The x-offset of the beginning of the area that
             * should be rendered
             * @param {number} end The x-offset of the end of the area that should be
             * rendered
             */
          }, {
            key: "drawBars",
            value: function drawBars(peaks, channelIndex, start, end) {}
            /**
             * Draw a waveform
             *
             * @abstract
             * @param {number[]|Number.<Array[]>} peaks Can also be an array of arrays for split channel
             * rendering
             * @param {number} channelIndex The index of the current channel. Normally
             * should be 0
             * @param {number} start The x-offset of the beginning of the area that
             * should be rendered
             * @param {number} end The x-offset of the end of the area that should be
             * rendered
             */
          }, {
            key: "drawWave",
            value: function drawWave(peaks, channelIndex, start, end) {}
            /**
             * Clear the waveform
             *
             * @abstract
             */
          }, {
            key: "clearWave",
            value: function clearWave() {}
            /**
             * Render the new progress
             *
             * @abstract
             * @param {number} position X-Offset of progress position in pixels
             */
          }, {
            key: "updateProgress",
            value: function updateProgress(position) {}
          }]);
          return Drawer;
        }(util.Observer);
        exports["default"] = Drawer;
        module.exports = exports.default;
        /***/ }),
      /***/ "./src/drawer.multicanvas.js":
      /*!***********************************!*\
  !*** ./src/drawer.multicanvas.js ***!
  \***********************************/
      /***/ ((module, exports, __webpack_require__) => {
        "use strict";
        function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
        Object.defineProperty(exports, "__esModule", ({
          value: true
        }));
        exports["default"] = void 0;
        var _drawer = _interopRequireDefault(__webpack_require__(/*! ./drawer */ "./src/drawer.js"));
        var util = _interopRequireWildcard(__webpack_require__(/*! ./util */ "./src/util/index.js"));
        var _drawer2 = _interopRequireDefault(__webpack_require__(/*! ./drawer.canvasentry */ "./src/drawer.canvasentry.js"));
        function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
        function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
        function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
        function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } }
        function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
        function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
        function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
        function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
        function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
        function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
        function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
        function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
        /**
         * MultiCanvas renderer for wavesurfer. Is currently the default and sole
         * builtin renderer.
         *
         * A `MultiCanvas` consists of one or more `CanvasEntry` instances, depending
         * on the zoom level.
         */
        var MultiCanvas = /*#__PURE__*/function (_Drawer) {
          _inherits(MultiCanvas, _Drawer);
          var _super = _createSuper(MultiCanvas);
          /**
           * @param {HTMLElement} container The container node of the wavesurfer instance
           * @param {WavesurferParams} params The wavesurfer initialisation options
           */
          function MultiCanvas(container, params) {
            var _this;
            _classCallCheck(this, MultiCanvas);
            _this = _super.call(this, container, params);
            /**
             * @type {number}
             */
            _this.maxCanvasWidth = params.maxCanvasWidth;
            /**
             * @type {number}
             */
            _this.maxCanvasElementWidth = Math.round(params.maxCanvasWidth / params.pixelRatio);
            /**
             * Whether or not the progress wave is rendered. If the `waveColor`
             * and `progressColor` are the same color it is not.
             *
             * @type {boolean}
             */
            _this.hasProgressCanvas = params.waveColor != params.progressColor;
            /**
             * @type {number}
             */
            _this.halfPixel = 0.5 / params.pixelRatio;
            /**
             * List of `CanvasEntry` instances.
             *
             * @type {Array}
             */
            _this.canvases = [];
            /**
             * @type {HTMLElement}
             */
            _this.progressWave = null;
            /**
             * Class used to generate entries.
             *
             * @type {function}
             */
            _this.EntryClass = _drawer2.default;
            /**
             * Canvas 2d context attributes.
             *
             * @type {object}
             */
            _this.canvasContextAttributes = params.drawingContextAttributes;
            /**
             * Overlap added between entries to prevent vertical white stripes
             * between `canvas` elements.
             *
             * @type {number}
             */
            _this.overlap = 2 * Math.ceil(params.pixelRatio / 2);
            /**
             * The radius of the wave bars. Makes bars rounded
             *
             * @type {number}
             */
            _this.barRadius = params.barRadius || 0;
            /**
             * Whether to render the waveform vertically. Defaults to false.
             *
             * @type {boolean}
             */
            _this.vertical = params.vertical;
            return _this;
          }
          /**
           * Initialize the drawer
           */
          _createClass(MultiCanvas, [{
            key: "init",
            value: function init() {
              this.createWrapper();
              this.createElements();
            }
            /**
             * Create the canvas elements and style them
             *
             */
          }, {
            key: "createElements",
            value: function createElements() {
              this.progressWave = util.withOrientation(this.wrapper.appendChild(document.createElement('wave')), this.params.vertical);
              this.style(this.progressWave, {
                position: 'absolute',
                zIndex: 3,
                left: 0,
                top: 0,
                bottom: 0,
                overflow: 'hidden',
                width: '0',
                display: 'none',
                boxSizing: 'border-box',
                borderRightStyle: 'solid',
                pointerEvents: 'none'
              });
              this.addCanvas();
              this.updateCursor();
            }
            /**
             * Update cursor style
             */
          }, {
            key: "updateCursor",
            value: function updateCursor() {
              this.style(this.progressWave, {
                borderRightWidth: this.params.cursorWidth + 'px',
                borderRightColor: this.params.cursorColor
              });
            }
            /**
             * Adjust to the updated size by adding or removing canvases
             */
          }, {
            key: "updateSize",
            value: function updateSize() {
              var _this2 = this;
              var totalWidth = Math.round(this.width / this.params.pixelRatio);
              var requiredCanvases = Math.ceil(totalWidth / (this.maxCanvasElementWidth + this.overlap));
              // add required canvases
              while (this.canvases.length < requiredCanvases) {
                this.addCanvas();
              }
              // remove older existing canvases, if any
              while (this.canvases.length > requiredCanvases) {
                this.removeCanvas();
              }
              var canvasWidth = this.maxCanvasWidth + this.overlap;
              var lastCanvas = this.canvases.length - 1;
              this.canvases.forEach(function (entry, i) {
                if (i == lastCanvas) {
                  canvasWidth = _this2.width - _this2.maxCanvasWidth * lastCanvas;
                }
                _this2.updateDimensions(entry, canvasWidth, _this2.height);
                entry.clearWave();
              });
            }
            /**
             * Add a canvas to the canvas list
             *
             */
          }, {
            key: "addCanvas",
            value: function addCanvas() {
              var entry = new this.EntryClass();
              entry.canvasContextAttributes = this.canvasContextAttributes;
              entry.hasProgressCanvas = this.hasProgressCanvas;
              entry.halfPixel = this.halfPixel;
              var leftOffset = this.maxCanvasElementWidth * this.canvases.length;
              // wave
              var wave = util.withOrientation(this.wrapper.appendChild(document.createElement('canvas')), this.params.vertical);
              this.style(wave, {
                position: 'absolute',
                zIndex: 2,
                left: leftOffset + 'px',
                top: 0,
                bottom: 0,
                height: '100%',
                pointerEvents: 'none'
              });
              entry.initWave(wave);
              // progress
              if (this.hasProgressCanvas) {
                var progress = util.withOrientation(this.progressWave.appendChild(document.createElement('canvas')), this.params.vertical);
                this.style(progress, {
                  position: 'absolute',
                  left: leftOffset + 'px',
                  top: 0,
                  bottom: 0,
                  height: '100%'
                });
                entry.initProgress(progress);
              }
              this.canvases.push(entry);
            }
            /**
             * Pop single canvas from the list
             *
             */
          }, {
            key: "removeCanvas",
            value: function removeCanvas() {
              var lastEntry = this.canvases[this.canvases.length - 1];
              // wave
              lastEntry.wave.parentElement.removeChild(lastEntry.wave.domElement);
              // progress
              if (this.hasProgressCanvas) {
                lastEntry.progress.parentElement.removeChild(lastEntry.progress.domElement);
              }
              // cleanup
              if (lastEntry) {
                lastEntry.destroy();
                lastEntry = null;
              }
              this.canvases.pop();
            }
            /**
             * Update the dimensions of a canvas element
             *
             * @param {CanvasEntry} entry Target entry
             * @param {number} width The new width of the element
             * @param {number} height The new height of the element
             */
          }, {
            key: "updateDimensions",
            value: function updateDimensions(entry, width, height) {
              var elementWidth = Math.round(width / this.params.pixelRatio);
              var totalWidth = Math.round(this.width / this.params.pixelRatio);
              // update canvas dimensions
              entry.updateDimensions(elementWidth, totalWidth, width, height);
              // style element
              this.style(this.progressWave, {
                display: 'block'
              });
            }
            /**
             * Clear the whole multi-canvas
             */
          }, {
            key: "clearWave",
            value: function clearWave() {
              var _this3 = this;
              util.frame(function () {
                _this3.canvases.forEach(function (entry) {
                  return entry.clearWave();
                });
              })();
            }
            /**
             * Draw a waveform with bars
             *
             * @param {number[]|Number.<Array[]>} peaks Can also be an array of arrays
             * for split channel rendering
             * @param {number} channelIndex The index of the current channel. Normally
             * should be 0. Must be an integer.
             * @param {number} start The x-offset of the beginning of the area that
             * should be rendered
             * @param {number} end The x-offset of the end of the area that should be
             * rendered
             * @returns {void}
             */
          }, {
            key: "drawBars",
            value: function drawBars(peaks, channelIndex, start, end) {
              var _this4 = this;
              return this.prepareDraw(peaks, channelIndex, start, end, function (_ref) {
                var absmax = _ref.absmax,
                  hasMinVals = _ref.hasMinVals,
                  height = _ref.height,
                  offsetY = _ref.offsetY,
                  halfH = _ref.halfH,
                  peaks = _ref.peaks,
                  ch = _ref.channelIndex;
                // if drawBars was called within ws.empty we don't pass a start and
                // don't want anything to happen
                if (start === undefined) {
                  return;
                }
                // Skip every other value if there are negatives.
                var peakIndexScale = hasMinVals ? 2 : 1;
                var length = peaks.length / peakIndexScale;
                var bar = _this4.params.barWidth * _this4.params.pixelRatio;
                var gap = _this4.params.barGap === null ? Math.max(_this4.params.pixelRatio, ~~(bar / 2)) : Math.max(_this4.params.pixelRatio, _this4.params.barGap * _this4.params.pixelRatio);
                var step = bar + gap;
                var scale = length / _this4.width;
                var first = start;
                var last = end;
                var peakIndex = first;
                for (peakIndex; peakIndex < last; peakIndex += step) {
                  // search for the highest peak in the range this bar falls into
                  var peak = 0;
                  var peakIndexRange = Math.floor(peakIndex * scale) * peakIndexScale; // start index
                  var peakIndexEnd = Math.floor((peakIndex + step) * scale) * peakIndexScale;
                  do {
                    // do..while makes sure at least one peak is always evaluated
                    var newPeak = Math.abs(peaks[peakIndexRange]); // for arrays starting with negative values
                    if (newPeak > peak) {
                      peak = newPeak; // higher
                    }
                    peakIndexRange += peakIndexScale; // skip every other value for negatives
                  } while (peakIndexRange < peakIndexEnd);
                  // calculate the height of this bar according to the highest peak found
                  var h = Math.round(peak / absmax * halfH);
                  // raise the bar height to the specified minimum height
                  // Math.max is used to replace any value smaller than barMinHeight (not just 0) with barMinHeight
                  if (_this4.params.barMinHeight) {
                    h = Math.max(h, _this4.params.barMinHeight);
                  }
                  _this4.fillRect(peakIndex + _this4.halfPixel, halfH - h + offsetY, bar + _this4.halfPixel, h * 2, _this4.barRadius, ch);
                }
              });
            }
            /**
             * Draw a waveform
             *
             * @param {number[]|Number.<Array[]>} peaks Can also be an array of arrays
             * for split channel rendering
             * @param {number} channelIndex The index of the current channel. Normally
             * should be 0
             * @param {number?} start The x-offset of the beginning of the area that
             * should be rendered (If this isn't set only a flat line is rendered)
             * @param {number?} end The x-offset of the end of the area that should be
             * rendered
             * @returns {void}
             */
          }, {
            key: "drawWave",
            value: function drawWave(peaks, channelIndex, start, end) {
              var _this5 = this;
              return this.prepareDraw(peaks, channelIndex, start, end, function (_ref2) {
                var absmax = _ref2.absmax,
                  hasMinVals = _ref2.hasMinVals,
                  height = _ref2.height,
                  offsetY = _ref2.offsetY,
                  halfH = _ref2.halfH,
                  peaks = _ref2.peaks,
                  channelIndex = _ref2.channelIndex;
                if (!hasMinVals) {
                  var reflectedPeaks = [];
                  var len = peaks.length;
                  var i = 0;
                  for (i; i < len; i++) {
                    reflectedPeaks[2 * i] = peaks[i];
                    reflectedPeaks[2 * i + 1] = -peaks[i];
                  }
                  peaks = reflectedPeaks;
                }
                // if drawWave was called within ws.empty we don't pass a start and
                // end and simply want a flat line
                if (start !== undefined) {
                  _this5.drawLine(peaks, absmax, halfH, offsetY, start, end, channelIndex);
                }
                // always draw a median line
                _this5.fillRect(0, halfH + offsetY - _this5.halfPixel, _this5.width, _this5.halfPixel, _this5.barRadius, channelIndex);
              });
            }
            /**
             * Tell the canvas entries to render their portion of the waveform
             *
             * @param {number[]} peaks Peaks data
             * @param {number} absmax Maximum peak value (absolute)
             * @param {number} halfH Half the height of the waveform
             * @param {number} offsetY Offset to the top
             * @param {number} start The x-offset of the beginning of the area that
             * should be rendered
             * @param {number} end The x-offset of the end of the area that
             * should be rendered
             * @param {channelIndex} channelIndex The channel index of the line drawn
             */
          }, {
            key: "drawLine",
            value: function drawLine(peaks, absmax, halfH, offsetY, start, end, channelIndex) {
              var _this6 = this;
              var _ref3 = this.params.splitChannelsOptions.channelColors[channelIndex] || {},
                waveColor = _ref3.waveColor,
                progressColor = _ref3.progressColor;
              this.canvases.forEach(function (entry, i) {
                _this6.setFillStyles(entry, waveColor, progressColor);
                _this6.applyCanvasTransforms(entry, _this6.params.vertical);
                entry.drawLines(peaks, absmax, halfH, offsetY, start, end);
              });
            }
            /**
             * Draw a rectangle on the multi-canvas
             *
             * @param {number} x X-position of the rectangle
             * @param {number} y Y-position of the rectangle
             * @param {number} width Width of the rectangle
             * @param {number} height Height of the rectangle
             * @param {number} radius Radius of the rectangle
             * @param {channelIndex} channelIndex The channel index of the bar drawn
             */
          }, {
            key: "fillRect",
            value: function fillRect(x, y, width, height, radius, channelIndex) {
              var startCanvas = Math.floor(x / this.maxCanvasWidth);
              var endCanvas = Math.min(Math.ceil((x + width) / this.maxCanvasWidth) + 1, this.canvases.length);
              var i = startCanvas;
              for (i; i < endCanvas; i++) {
                var entry = this.canvases[i];
                var leftOffset = i * this.maxCanvasWidth;
                var intersection = {
                  x1: Math.max(x, i * this.maxCanvasWidth),
                  y1: y,
                  x2: Math.min(x + width, i * this.maxCanvasWidth + entry.wave.width),
                  y2: y + height
                };
                if (intersection.x1 < intersection.x2) {
                  var _ref4 = this.params.splitChannelsOptions.channelColors[channelIndex] || {},
                    waveColor = _ref4.waveColor,
                    progressColor = _ref4.progressColor;
                  this.setFillStyles(entry, waveColor, progressColor);
                  this.applyCanvasTransforms(entry, this.params.vertical);
                  entry.fillRects(intersection.x1 - leftOffset, intersection.y1, intersection.x2 - intersection.x1, intersection.y2 - intersection.y1, radius);
                }
              }
            }
            /**
             * Returns whether to hide the channel from being drawn based on params.
             *
             * @param {number} channelIndex The index of the current channel.
             * @returns {bool} True to hide the channel, false to draw.
             */
          }, {
            key: "hideChannel",
            value: function hideChannel(channelIndex) {
              return this.params.splitChannels && this.params.splitChannelsOptions.filterChannels.includes(channelIndex);
            }
            /**
             * Performs preparation tasks and calculations which are shared by `drawBars`
             * and `drawWave`
             *
             * @param {number[]|Number.<Array[]>} peaks Can also be an array of arrays for
             * split channel rendering
             * @param {number} channelIndex The index of the current channel. Normally
             * should be 0
             * @param {number?} start The x-offset of the beginning of the area that
             * should be rendered. If this isn't set only a flat line is rendered
             * @param {number?} end The x-offset of the end of the area that should be
             * rendered
             * @param {function} fn The render function to call, e.g. `drawWave`
             * @param {number} drawIndex The index of the current channel after filtering.
             * @param {number?} normalizedMax Maximum modulation value across channels for use with relativeNormalization. Ignored when undefined
             * @returns {void}
             */
          }, {
            key: "prepareDraw",
            value: function prepareDraw(peaks, channelIndex, start, end, fn, drawIndex, normalizedMax) {
              var _this7 = this;
              return util.frame(function () {
                // Split channels and call this function with the channelIndex set
                if (peaks[0] instanceof Array) {
                  var channels = peaks;
                  if (_this7.params.splitChannels) {
                    var filteredChannels = channels.filter(function (c, i) {
                      return !_this7.hideChannel(i);
                    });
                    if (!_this7.params.splitChannelsOptions.overlay) {
                      _this7.setHeight(Math.max(filteredChannels.length, 1) * _this7.params.height * _this7.params.pixelRatio);
                    }
                    var overallAbsMax;
                    if (_this7.params.splitChannelsOptions && _this7.params.splitChannelsOptions.relativeNormalization) {
                      // calculate maximum peak across channels to use for normalization
                      overallAbsMax = util.max(channels.map(function (channelPeaks) {
                        return util.absMax(channelPeaks);
                      }));
                    }
                    return channels.forEach(function (channelPeaks, i) {
                      return _this7.prepareDraw(channelPeaks, i, start, end, fn, filteredChannels.indexOf(channelPeaks), overallAbsMax);
                    });
                  }
                  peaks = channels[0];
                }
                // Return and do not draw channel peaks if hidden.
                if (_this7.hideChannel(channelIndex)) {
                  return;
                }
                // calculate maximum modulation value, either from the barHeight
                // parameter or if normalize=true from the largest value in the peak
                // set
                var absmax = 1 / _this7.params.barHeight;
                if (_this7.params.normalize) {
                  absmax = normalizedMax === undefined ? util.absMax(peaks) : normalizedMax;
                }
                // Bar wave draws the bottom only as a reflection of the top,
                // so we don't need negative values
                var hasMinVals = [].some.call(peaks, function (val) {
                  return val < 0;
                });
                var height = _this7.params.height * _this7.params.pixelRatio;
                var halfH = height / 2;
                var offsetY = height * drawIndex || 0;
                // Override offsetY if overlay is true
                if (_this7.params.splitChannelsOptions && _this7.params.splitChannelsOptions.overlay) {
                  offsetY = 0;
                }
                return fn({
                  absmax: absmax,
                  hasMinVals: hasMinVals,
                  height: height,
                  offsetY: offsetY,
                  halfH: halfH,
                  peaks: peaks,
                  channelIndex: channelIndex
                });
              })();
            }
            /**
             * Set the fill styles for a certain entry (wave and progress)
             *
             * @param {CanvasEntry} entry Target entry
             * @param {string} waveColor Wave color to draw this entry
             * @param {string} progressColor Progress color to draw this entry
             */
          }, {
            key: "setFillStyles",
            value: function setFillStyles(entry) {
              var waveColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.params.waveColor;
              var progressColor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.params.progressColor;
              entry.setFillStyles(waveColor, progressColor);
            }
            /**
             * Set the canvas transforms for a certain entry (wave and progress)
             *
             * @param {CanvasEntry} entry Target entry
             * @param {boolean} vertical Whether to render the waveform vertically
             */
          }, {
            key: "applyCanvasTransforms",
            value: function applyCanvasTransforms(entry) {
              var vertical = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
              entry.applyCanvasTransforms(vertical);
            }
            /**
             * Return image data of the multi-canvas
             *
             * When using a `type` of `'blob'`, this will return a `Promise`.
             *
             * @param {string} format='image/png' An optional value of a format type.
             * @param {number} quality=0.92 An optional value between 0 and 1.
             * @param {string} type='dataURL' Either 'dataURL' or 'blob'.
             * @return {string|string[]|Promise} When using the default `'dataURL'`
             * `type` this returns a single data URL or an array of data URLs,
             * one for each canvas. When using the `'blob'` `type` this returns a
             * `Promise` that resolves with an array of `Blob` instances, one for each
             * canvas.
             */
          }, {
            key: "getImage",
            value: function getImage(format, quality, type) {
              if (type === 'blob') {
                return Promise.all(this.canvases.map(function (entry) {
                  return entry.getImage(format, quality, type);
                }));
              } else if (type === 'dataURL') {
                var images = this.canvases.map(function (entry) {
                  return entry.getImage(format, quality, type);
                });
                return images.length > 1 ? images : images[0];
              }
            }
            /**
             * Render the new progress
             *
             * @param {number} position X-offset of progress position in pixels
             */
          }, {
            key: "updateProgress",
            value: function updateProgress(position) {
              this.style(this.progressWave, {
                width: position + 'px'
              });
            }
          }]);
          return MultiCanvas;
        }(_drawer.default);
        exports["default"] = MultiCanvas;
        module.exports = exports.default;
        /***/ }),
      /***/ "./src/mediaelement-webaudio.js":
      /*!**************************************!*\
  !*** ./src/mediaelement-webaudio.js ***!
  \**************************************/
      /***/ ((module, exports, __webpack_require__) => {
        "use strict";
        function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
        Object.defineProperty(exports, "__esModule", ({
          value: true
        }));
        exports["default"] = void 0;
        var _mediaelement = _interopRequireDefault(__webpack_require__(/*! ./mediaelement */ "./src/mediaelement.js"));
        function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
        function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } }
        function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
        function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
        function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
        function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
        function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
        function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
        function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
        function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
        function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
        function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
        /**
         * MediaElementWebAudio backend: load audio via an HTML5 audio tag, but playback with the WebAudio API.
         * The advantage here is that the html5 <audio> tag can perform range requests on the server and not
         * buffer the entire file in one request, and you still get the filtering and scripting functionality
         * of the webaudio API.
         * Note that in order to use range requests and prevent buffering, you must provide peak data.
         *
         * @since 3.2.0
         */
        var MediaElementWebAudio = /*#__PURE__*/function (_MediaElement) {
          _inherits(MediaElementWebAudio, _MediaElement);
          var _super = _createSuper(MediaElementWebAudio);
          /**
           * Construct the backend
           *
           * @param {WavesurferParams} params Wavesurfer parameters
           */
          function MediaElementWebAudio(params) {
            var _this;
            _classCallCheck(this, MediaElementWebAudio);
            _this = _super.call(this, params);
            /** @private */
            _this.params = params;
            /** @private */
            _this.sourceMediaElement = null;
            return _this;
          }
          /**
           * Initialise the backend, called in `wavesurfer.createBackend()`
           */
          _createClass(MediaElementWebAudio, [{
            key: "init",
            value: function init() {
              this.setPlaybackRate(this.params.audioRate);
              this.createTimer();
              this.createVolumeNode();
              this.createScriptNode();
              this.createAnalyserNode();
            }
            /**
             * Private method called by both `load` (from url)
             * and `loadElt` (existing media element) methods.
             *
             * @param {HTMLMediaElement} media HTML5 Audio or Video element
             * @param {number[]|Number.<Array[]>} peaks Array of peak data
             * @param {string} preload HTML 5 preload attribute value
             * @private
             */
          }, {
            key: "_load",
            value: function _load(media, peaks, preload) {
              _get(_getPrototypeOf(MediaElementWebAudio.prototype), "_load", this).call(this, media, peaks, preload);
              this.createMediaElementSource(media);
            }
            /**
             * Create MediaElementSource node
             *
             * @since 3.2.0
             * @param {HTMLMediaElement} mediaElement HTML5 Audio to load
             */
          }, {
            key: "createMediaElementSource",
            value: function createMediaElementSource(mediaElement) {
              this.sourceMediaElement = this.ac.createMediaElementSource(mediaElement);
              this.sourceMediaElement.connect(this.analyser);
            }
          }, {
            key: "play",
            value: function play(start, end) {
              this.resumeAudioContext();
              return _get(_getPrototypeOf(MediaElementWebAudio.prototype), "play", this).call(this, start, end);
            }
            /**
             * This is called when wavesurfer is destroyed
             *
             */
          }, {
            key: "destroy",
            value: function destroy() {
              _get(_getPrototypeOf(MediaElementWebAudio.prototype), "destroy", this).call(this);
              this.destroyWebAudio();
            }
          }]);
          return MediaElementWebAudio;
        }(_mediaelement.default);
        exports["default"] = MediaElementWebAudio;
        module.exports = exports.default;
        /***/ }),
      /***/ "./src/mediaelement.js":
      /*!*****************************!*\
  !*** ./src/mediaelement.js ***!
  \*****************************/
      /***/ ((module, exports, __webpack_require__) => {
        "use strict";
        function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
        Object.defineProperty(exports, "__esModule", ({
          value: true
        }));
        exports["default"] = void 0;
        var _webaudio = _interopRequireDefault(__webpack_require__(/*! ./webaudio */ "./src/webaudio.js"));
        var util = _interopRequireWildcard(__webpack_require__(/*! ./util */ "./src/util/index.js"));
        function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
        function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
        function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
        function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } }
        function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
        function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
        function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
        function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
        function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
        function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
        function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
        function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
        function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
        function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
        /**
         * MediaElement backend
         */
        var MediaElement = /*#__PURE__*/function (_WebAudio) {
          _inherits(MediaElement, _WebAudio);
          var _super = _createSuper(MediaElement);
          /**
           * Construct the backend
           *
           * @param {WavesurferParams} params Wavesurfer parameters
           */
          function MediaElement(params) {
            var _this;
            _classCallCheck(this, MediaElement);
            _this = _super.call(this, params);
            /** @private */
            _this.params = params;
            /**
             * Initially a dummy media element to catch errors. Once `_load` is
             * called, this will contain the actual `HTMLMediaElement`.
             * @private
             */
            _this.media = {
              currentTime: 0,
              duration: 0,
              paused: true,
              playbackRate: 1,
              play: function play() {},
              pause: function pause() {},
              volume: 0
            };
            /** @private */
            _this.mediaType = params.mediaType.toLowerCase();
            /** @private */
            _this.elementPosition = params.elementPosition;
            /** @private */
            _this.peaks = null;
            /** @private */
            _this.playbackRate = 1;
            /** @private */
            _this.volume = 1;
            /** @private */
            _this.isMuted = false;
            /** @private */
            _this.buffer = null;
            /** @private */
            _this.onPlayEnd = null;
            /** @private */
            _this.mediaListeners = {};
            return _this;
          }
          /**
           * Initialise the backend, called in `wavesurfer.createBackend()`
           */
          _createClass(MediaElement, [{
            key: "init",
            value: function init() {
              this.setPlaybackRate(this.params.audioRate);
              this.createTimer();
            }
            /**
             * Attach event listeners to media element.
             */
          }, {
            key: "_setupMediaListeners",
            value: function _setupMediaListeners() {
              var _this2 = this;
              this.mediaListeners.error = function () {
                _this2.fireEvent('error', 'Error loading media element');
              };
              this.mediaListeners.canplay = function () {
                _this2.fireEvent('canplay');
              };
              this.mediaListeners.ended = function () {
                _this2.fireEvent('finish');
              };
              // listen to and relay play, pause and seeked events to enable
              // playback control from the external media element
              this.mediaListeners.play = function () {
                _this2.fireEvent('play');
              };
              this.mediaListeners.pause = function () {
                _this2.fireEvent('pause');
              };
              this.mediaListeners.seeked = function (event) {
                _this2.fireEvent('seek');
              };
              this.mediaListeners.volumechange = function (event) {
                _this2.isMuted = _this2.media.muted;
                if (_this2.isMuted) {
                  _this2.volume = 0;
                } else {
                  _this2.volume = _this2.media.volume;
                }
                _this2.fireEvent('volume');
              };
              // reset event listeners
              Object.keys(this.mediaListeners).forEach(function (id) {
                _this2.media.removeEventListener(id, _this2.mediaListeners[id]);
                _this2.media.addEventListener(id, _this2.mediaListeners[id]);
              });
            }
            /**
             * Create a timer to provide a more precise `audioprocess` event.
             */
          }, {
            key: "createTimer",
            value: function createTimer() {
              var _this3 = this;
              var onAudioProcess = function onAudioProcess() {
                if (_this3.isPaused()) {
                  return;
                }
                _this3.fireEvent('audioprocess', _this3.getCurrentTime());
                // Call again in the next frame
                util.frame(onAudioProcess)();
              };
              this.on('play', onAudioProcess);
              // Update the progress one more time to prevent it from being stuck in
              // case of lower framerates
              this.on('pause', function () {
                _this3.fireEvent('audioprocess', _this3.getCurrentTime());
              });
            }
            /**
             * Create media element with url as its source,
             * and append to container element.
             *
             * @param {string} url Path to media file
             * @param {HTMLElement} container HTML element
             * @param {number[]|Number.<Array[]>} peaks Array of peak data
             * @param {string} preload HTML 5 preload attribute value
             * @throws Will throw an error if the `url` argument is not a valid media
             * element.
             */
          }, {
            key: "load",
            value: function load(url, container, peaks, preload) {
              var media = document.createElement(this.mediaType);
              media.controls = this.params.mediaControls;
              media.autoplay = this.params.autoplay || false;
              media.preload = preload == null ? 'auto' : preload;
              media.src = url;
              media.style.width = '100%';
              var prevMedia = container.querySelector(this.mediaType);
              if (prevMedia) {
                container.removeChild(prevMedia);
              }
              container.appendChild(media);
              this._load(media, peaks, preload);
            }
            /**
             * Load existing media element.
             *
             * @param {HTMLMediaElement} elt HTML5 Audio or Video element
             * @param {number[]|Number.<Array[]>} peaks Array of peak data
             */
          }, {
            key: "loadElt",
            value: function loadElt(elt, peaks) {
              elt.controls = this.params.mediaControls;
              elt.autoplay = this.params.autoplay || false;
              this._load(elt, peaks, elt.preload);
            }
            /**
             * Method called by both `load` (from url)
             * and `loadElt` (existing media element) methods.
             *
             * @param {HTMLMediaElement} media HTML5 Audio or Video element
             * @param {number[]|Number.<Array[]>} peaks Array of peak data
             * @param {string} preload HTML 5 preload attribute value
             * @throws Will throw an error if the `media` argument is not a valid media
             * element.
             * @private
             */
          }, {
            key: "_load",
            value: function _load(media, peaks, preload) {
              // verify media element is valid
              if (!(media instanceof HTMLMediaElement) || typeof media.addEventListener === 'undefined') {
                throw new Error('media parameter is not a valid media element');
              }
              // load must be called manually on iOS, otherwise peaks won't draw
              // until a user interaction triggers load --> 'ready' event
              // note that we avoid calling media.load here when given peaks and preload == 'none'
              // as this almost always triggers some browser fetch of the media.
              if (typeof media.load == 'function' && !(peaks && preload == 'none')) {
                // Resets the media element and restarts the media resource. Any
                // pending events are discarded. How much media data is fetched is
                // still affected by the preload attribute.
                media.load();
              }
              this.media = media;
              this._setupMediaListeners();
              this.peaks = peaks;
              this.onPlayEnd = null;
              this.buffer = null;
              this.isMuted = media.muted;
              this.setPlaybackRate(this.playbackRate);
              this.setVolume(this.volume);
            }
            /**
             * Used by `wavesurfer.isPlaying()` and `wavesurfer.playPause()`
             *
             * @return {boolean} Media paused or not
             */
          }, {
            key: "isPaused",
            value: function isPaused() {
              return !this.media || this.media.paused;
            }
            /**
             * Used by `wavesurfer.getDuration()`
             *
             * @return {number} Duration
             */
          }, {
            key: "getDuration",
            value: function getDuration() {
              if (this.explicitDuration) {
                return this.explicitDuration;
              }
              var duration = (this.buffer || this.media).duration;
              if (duration >= Infinity) {
                // streaming audio
                duration = this.media.seekable.end(0);
              }
              return duration;
            }
            /**
             * Returns the current time in seconds relative to the audio-clip's
             * duration.
             *
             * @return {number} Current time
             */
          }, {
            key: "getCurrentTime",
            value: function getCurrentTime() {
              return this.media && this.media.currentTime;
            }
            /**
             * Get the position from 0 to 1
             *
             * @return {number} Current position
             */
          }, {
            key: "getPlayedPercents",
            value: function getPlayedPercents() {
              return this.getCurrentTime() / this.getDuration() || 0;
            }
            /**
             * Get the audio source playback rate.
             *
             * @return {number} Playback rate
             */
          }, {
            key: "getPlaybackRate",
            value: function getPlaybackRate() {
              return this.playbackRate || this.media.playbackRate;
            }
            /**
             * Set the audio source playback rate.
             *
             * @param {number} value Playback rate
             */
          }, {
            key: "setPlaybackRate",
            value: function setPlaybackRate(value) {
              this.playbackRate = value || 1;
              this.media.playbackRate = this.playbackRate;
            }
            /**
             * Used by `wavesurfer.seekTo()`
             *
             * @param {number} start Position to start at in seconds
             */
          }, {
            key: "seekTo",
            value: function seekTo(start) {
              if (start != null && !isNaN(start)) {
                this.media.currentTime = start;
              }
              this.clearPlayEnd();
            }
            /**
             * Plays the loaded audio region.
             *
             * @param {number} start Start offset in seconds, relative to the beginning
             * of a clip.
             * @param {number} end When to stop, relative to the beginning of a clip.
             * @emits MediaElement#play
             * @return {Promise} Result
             */
          }, {
            key: "play",
            value: function play(start, end) {
              this.seekTo(start);
              var promise = this.media.play();
              end && this.setPlayEnd(end);
              return promise;
            }
            /**
             * Pauses the loaded audio.
             *
             * @emits MediaElement#pause
             * @return {Promise} Result
             */
          }, {
            key: "pause",
            value: function pause() {
              var promise;
              if (this.media) {
                promise = this.media.pause();
              }
              this.clearPlayEnd();
              return promise;
            }
            /**
             * Set the play end
             *
             * @param {number} end Where to end
             */
          }, {
            key: "setPlayEnd",
            value: function setPlayEnd(end) {
              var _this4 = this;
              this.clearPlayEnd();
              this._onPlayEnd = function (time) {
                if (time >= end) {
                  _this4.pause();
                  _this4.seekTo(end);
                }
              };
              this.on('audioprocess', this._onPlayEnd);
            }
            /** @private */
          }, {
            key: "clearPlayEnd",
            value: function clearPlayEnd() {
              if (this._onPlayEnd) {
                this.un('audioprocess', this._onPlayEnd);
                this._onPlayEnd = null;
              }
            }
            /**
             * Compute the max and min value of the waveform when broken into
             * <length> subranges.
             *
             * @param {number} length How many subranges to break the waveform into.
             * @param {number} first First sample in the required range.
             * @param {number} last Last sample in the required range.
             * @return {number[]|Number.<Array[]>} Array of 2*<length> peaks or array of
             * arrays of peaks consisting of (max, min) values for each subrange.
             */
          }, {
            key: "getPeaks",
            value: function getPeaks(length, first, last) {
              if (this.buffer) {
                return _get(_getPrototypeOf(MediaElement.prototype), "getPeaks", this).call(this, length, first, last);
              }
              return this.peaks || [];
            }
            /**
             * Set the sink id for the media player
             *
             * @param {string} deviceId String value representing audio device id.
             * @returns {Promise} A Promise that resolves to `undefined` when there
             * are no errors.
             */
          }, {
            key: "setSinkId",
            value: function setSinkId(deviceId) {
              if (deviceId) {
                if (!this.media.setSinkId) {
                  return Promise.reject(new Error('setSinkId is not supported in your browser'));
                }
                return this.media.setSinkId(deviceId);
              }
              return Promise.reject(new Error('Invalid deviceId: ' + deviceId));
            }
            /**
             * Get the current volume
             *
             * @return {number} value A floating point value between 0 and 1.
             */
          }, {
            key: "getVolume",
            value: function getVolume() {
              return this.volume;
            }
            /**
             * Set the audio volume
             *
             * @param {number} value A floating point value between 0 and 1.
             */
          }, {
            key: "setVolume",
            value: function setVolume(value) {
              this.volume = value;
              // no need to change when it's already at that volume
              if (this.media.volume !== this.volume) {
                this.media.volume = this.volume;
              }
            }
            /**
             * Enable or disable muted audio
             *
             * @since 4.0.0
             * @param {boolean} muted Specify `true` to mute audio.
             */
          }, {
            key: "setMute",
            value: function setMute(muted) {
              // This causes a volume change to be emitted too through the
              // volumechange event listener.
              this.isMuted = this.media.muted = muted;
            }
            /**
             * This is called when wavesurfer is destroyed
             *
             */
          }, {
            key: "destroy",
            value: function destroy() {
              var _this5 = this;
              this.pause();
              this.unAll();
              this.destroyed = true;
              // cleanup media event listeners
              Object.keys(this.mediaListeners).forEach(function (id) {
                if (_this5.media) {
                  _this5.media.removeEventListener(id, _this5.mediaListeners[id]);
                }
              });
              if (this.params.removeMediaElementOnDestroy && this.media && this.media.parentNode) {
                this.media.parentNode.removeChild(this.media);
              }
              this.media = null;
            }
          }]);
          return MediaElement;
        }(_webaudio.default);
        exports["default"] = MediaElement;
        module.exports = exports.default;
        /***/ }),
      /***/ "./src/peakcache.js":
      /*!**************************!*\
  !*** ./src/peakcache.js ***!
  \**************************/
      /***/ ((module, exports) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", ({
          value: true
        }));
        exports["default"] = void 0;
        function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } }
        function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
        /**
         * Caches the decoded peaks data to improve rendering speed for large audio
         *
         * Is used if the option parameter `partialRender` is set to `true`
         */
        var PeakCache = /*#__PURE__*/function () {
          /**
           * Instantiate cache
           */
          function PeakCache() {
            _classCallCheck(this, PeakCache);
            this.clearPeakCache();
          }
          /**
           * Empty the cache
           */
          _createClass(PeakCache, [{
            key: "clearPeakCache",
            value: function clearPeakCache() {
              /**
               * Flat array with entries that are always in pairs to mark the
               * beginning and end of each subrange.  This is a convenience so we can
               * iterate over the pairs for easy set difference operations.
               * @private
               */
              this.peakCacheRanges = [];
              /**
               * Length of the entire cachable region, used for resetting the cache
               * when this changes (zoom events, for instance).
               * @private
               */
              this.peakCacheLength = -1;
            }
            /**
             * Add a range of peaks to the cache
             *
             * @param {number} length The length of the range
             * @param {number} start The x offset of the start of the range
             * @param {number} end The x offset of the end of the range
             * @return {Number.<Array[]>} Array with arrays of numbers
             */
          }, {
            key: "addRangeToPeakCache",
            value: function addRangeToPeakCache(length, start, end) {
              if (length != this.peakCacheLength) {
                this.clearPeakCache();
                this.peakCacheLength = length;
              }
              // Return ranges that weren't in the cache before the call.
              var uncachedRanges = [];
              var i = 0;
              // Skip ranges before the current start.
              while (i < this.peakCacheRanges.length && this.peakCacheRanges[i] < start) {
                i++;
              }
              // If |i| is even, |start| falls after an existing range.  Otherwise,
              // |start| falls between an existing range, and the uncached region
              // starts when we encounter the next node in |peakCacheRanges| or
              // |end|, whichever comes first.
              if (i % 2 == 0) {
                uncachedRanges.push(start);
              }
              while (i < this.peakCacheRanges.length && this.peakCacheRanges[i] <= end) {
                uncachedRanges.push(this.peakCacheRanges[i]);
                i++;
              }
              // If |i| is even, |end| is after all existing ranges.
              if (i % 2 == 0) {
                uncachedRanges.push(end);
              }
              // Filter out the 0-length ranges.
              uncachedRanges = uncachedRanges.filter(function (item, pos, arr) {
                if (pos == 0) {
                  return item != arr[pos + 1];
                } else if (pos == arr.length - 1) {
                  return item != arr[pos - 1];
                }
                return item != arr[pos - 1] && item != arr[pos + 1];
              });
              // Merge the two ranges together, uncachedRanges will either contain
              // wholly new points, or duplicates of points in peakCacheRanges.  If
              // duplicates are detected, remove both and extend the range.
              this.peakCacheRanges = this.peakCacheRanges.concat(uncachedRanges);
              this.peakCacheRanges = this.peakCacheRanges.sort(function (a, b) {
                return a - b;
              }).filter(function (item, pos, arr) {
                if (pos == 0) {
                  return item != arr[pos + 1];
                } else if (pos == arr.length - 1) {
                  return item != arr[pos - 1];
                }
                return item != arr[pos - 1] && item != arr[pos + 1];
              });
              // Push the uncached ranges into an array of arrays for ease of
              // iteration in the functions that call this.
              var uncachedRangePairs = [];
              for (i = 0; i < uncachedRanges.length; i += 2) {
                uncachedRangePairs.push([uncachedRanges[i], uncachedRanges[i + 1]]);
              }
              return uncachedRangePairs;
            }
            /**
             * For testing
             *
             * @return {Number.<Array[]>} Array with arrays of numbers
             */
          }, {
            key: "getCacheRanges",
            value: function getCacheRanges() {
              var peakCacheRangePairs = [];
              var i;
              for (i = 0; i < this.peakCacheRanges.length; i += 2) {
                peakCacheRangePairs.push([this.peakCacheRanges[i], this.peakCacheRanges[i + 1]]);
              }
              return peakCacheRangePairs;
            }
          }]);
          return PeakCache;
        }();
        exports["default"] = PeakCache;
        module.exports = exports.default;
        /***/ }),
      /***/ "./src/util/absMax.js":
      /*!****************************!*\
  !*** ./src/util/absMax.js ***!
  \****************************/
      /***/ ((module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", ({
          value: true
        }));
        exports["default"] = absMax;
        var _max = _interopRequireDefault(__webpack_require__(/*! ./max */ "./src/util/max.js"));
        var _min = _interopRequireDefault(__webpack_require__(/*! ./min */ "./src/util/min.js"));
        function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
        /**
         * Get the largest absolute value in an array
         *
         * @param   {Array} values Array of numbers
         * @returns {Number} Largest number found
         * @example console.log(max([-3, 2, 1]), max([-3, 2, 4])); // logs 3 4
         * @since 4.3.0
         */
        function absMax(values) {
          var max = (0, _max.default)(values);
          var min = (0, _min.default)(values);
          return -min > max ? -min : max;
        }
        module.exports = exports.default;
        /***/ }),
      /***/ "./src/util/clamp.js":
      /*!***************************!*\
  !*** ./src/util/clamp.js ***!
  \***************************/
      /***/ ((module, exports) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", ({
          value: true
        }));
        exports["default"] = clamp;
        /**
         * Returns a number limited to the given range.
         *
         * @param {number} val The number to be limited to a range
         * @param {number} min The lower boundary of the limit range
         * @param {number} max The upper boundary of the limit range
         * @returns {number} A number in the range [min, max]
         */
        function clamp(val, min, max) {
          return Math.min(Math.max(min, val), max);
        }
        module.exports = exports.default;
        /***/ }),
      /***/ "./src/util/fetch.js":
      /*!***************************!*\
  !*** ./src/util/fetch.js ***!
  \***************************/
      /***/ ((module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", ({
          value: true
        }));
        exports["default"] = fetchFile;
        var _observer = _interopRequireDefault(__webpack_require__(/*! ./observer */ "./src/util/observer.js"));
        function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
        function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } }
        function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
        var ProgressHandler = /*#__PURE__*/function () {
          /**
           * Instantiate ProgressHandler
           *
           * @param {Observer} instance The `fetchFile` observer instance.
           * @param {Number} contentLength Content length.
           * @param {Response} response Response object.
           */
          function ProgressHandler(instance, contentLength, response) {
            _classCallCheck(this, ProgressHandler);
            this.instance = instance;
            this.instance._reader = response.body.getReader();
            this.total = parseInt(contentLength, 10);
            this.loaded = 0;
          }
          /**
           * A method that is called once, immediately after the `ReadableStream``
           * is constructed.
           *
           * @param {ReadableStreamDefaultController} controller Controller instance
           *     used to control the stream.
           */
          _createClass(ProgressHandler, [{
            key: "start",
            value: function start(controller) {
              var _this = this;
              var read = function read() {
                // instance._reader.read() returns a promise that resolves
                // when a value has been received
                _this.instance._reader.read().then(function (_ref) {
                  var done = _ref.done,
                    value = _ref.value;
                  // result objects contain two properties:
                  // done  - true if the stream has already given you all its data.
                  // value - some data. Always undefined when done is true.
                  if (done) {
                    // ensure onProgress called when content-length=0
                    if (_this.total === 0) {
                      _this.instance.onProgress.call(_this.instance, {
                        loaded: _this.loaded,
                        total: _this.total,
                        lengthComputable: false
                      });
                    }
                    // no more data needs to be consumed, close the stream
                    controller.close();
                    return;
                  }
                  _this.loaded += value.byteLength;
                  _this.instance.onProgress.call(_this.instance, {
                    loaded: _this.loaded,
                    total: _this.total,
                    lengthComputable: !(_this.total === 0)
                  });
                  // enqueue the next data chunk into our target stream
                  controller.enqueue(value);
                  read();
                }).catch(function (error) {
                  controller.error(error);
                });
              };
              read();
            }
          }]);
          return ProgressHandler;
        }();
        /**
         * Load a file using `fetch`.
         *
         * @param {object} options Request options to use. See example below.
         * @returns {Observer} Observer instance
         * @example
         * // default options
         * let options = {
         *     url: undefined,
         *     method: 'GET',
         *     mode: 'cors',
         *     credentials: 'same-origin',
         *     cache: 'default',
         *     responseType: 'json',
         *     requestHeaders: [],
         *     redirect: 'follow',
         *     referrer: 'client'
         * };
         *
         * // override some options
         * options.url = '../media/demo.wav';
         * // available types: 'arraybuffer', 'blob', 'json' or 'text'
         * options.responseType = 'arraybuffer';
         *
         * // make fetch call
         * let request = util.fetchFile(options);
         *
         * // listen for events
         * request.on('progress', e => {
         *     console.log('progress', e);
         * });
         *
         * request.on('success', data => {
         *     console.log('success!', data);
         * });
         *
         * request.on('error', e => {
         *     console.warn('fetchFile error: ', e);
         * });
         */
        function fetchFile(options) {
          if (!options) {
            throw new Error('fetch options missing');
          } else if (!options.url) {
            throw new Error('fetch url missing');
          }
          var instance = new _observer.default();
          var fetchHeaders = new Headers();
          var fetchRequest = new Request(options.url);
          // add ability to abort
          instance.controller = new AbortController();
          // check if headers have to be added
          if (options && options.requestHeaders) {
            // add custom request headers
            options.requestHeaders.forEach(function (header) {
              fetchHeaders.append(header.key, header.value);
            });
          }
          // parse fetch options
          var responseType = options.responseType || 'json';
          var fetchOptions = {
            method: options.method || 'GET',
            headers: fetchHeaders,
            mode: options.mode || 'cors',
            credentials: options.credentials || 'same-origin',
            cache: options.cache || 'default',
            redirect: options.redirect || 'follow',
            referrer: options.referrer || 'client',
            signal: instance.controller.signal
          };
          fetch(fetchRequest, fetchOptions).then(function (response) {
            // store response reference
            instance.response = response;
            var progressAvailable = true;
            if (!response.body) {
              // ReadableStream is not yet supported in this browser
              // see https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream
              progressAvailable = false;
            }
            // Server must send CORS header "Access-Control-Expose-Headers: content-length"
            var contentLength = response.headers.get('content-length');
            if (contentLength === null) {
              // Content-Length server response header missing.
              // Don't evaluate download progress if we can't compare against a total size
              // see https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Access-Control-Expose-Headers
              progressAvailable = false;
            }
            if (!progressAvailable) {
              // not able to check download progress so skip it
              return response;
            }
            // fire progress event when during load
            instance.onProgress = function (e) {
              instance.fireEvent('progress', e);
            };
            return new Response(new ReadableStream(new ProgressHandler(instance, contentLength, response)), fetchOptions);
          }).then(function (response) {
            var errMsg;
            if (response.ok) {
              switch (responseType) {
                case 'arraybuffer':
                  return response.arrayBuffer();
                case 'json':
                  return response.json();
                case 'blob':
                  return response.blob();
                case 'text':
                  return response.text();
                default:
                  errMsg = 'Unknown responseType: ' + responseType;
                  break;
              }
            }
            if (!errMsg) {
              errMsg = 'HTTP error status: ' + response.status;
            }
            throw new Error(errMsg);
          }).then(function (response) {
            instance.fireEvent('success', response);
          }).catch(function (error) {
            instance.fireEvent('error', error);
          });
          // return the fetch request
          instance.fetchRequest = fetchRequest;
          return instance;
        }
        module.exports = exports.default;
        /***/ }),
      /***/ "./src/util/frame.js":
      /*!***************************!*\
  !*** ./src/util/frame.js ***!
  \***************************/
      /***/ ((module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", ({
          value: true
        }));
        exports["default"] = frame;
        var _requestAnimationFrame = _interopRequireDefault(__webpack_require__(/*! ./request-animation-frame */ "./src/util/request-animation-frame.js"));
        function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
        /**
         * Create a function which will be called at the next requestAnimationFrame
         * cycle
         *
         * @param {function} func The function to call
         *
         * @return {func} The function wrapped within a requestAnimationFrame
         */
        function frame(func) {
          return function () {
            for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
              args[_key] = arguments[_key];
            }
            return (0, _requestAnimationFrame.default)(function () {
              return func.apply(void 0, args);
            });
          };
        }
        module.exports = exports.default;
        /***/ }),
      /***/ "./src/util/get-id.js":
      /*!****************************!*\
  !*** ./src/util/get-id.js ***!
  \****************************/
      /***/ ((module, exports) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", ({
          value: true
        }));
        exports["default"] = getId;
        /**
         * Get a random prefixed ID
         *
         * @param {String} prefix Prefix to use. Default is `'wavesurfer_'`.
         * @returns {String} Random prefixed ID
         * @example
         * console.log(getId()); // logs 'wavesurfer_b5pors4ru6g'
         *
         * let prefix = 'foo-';
         * console.log(getId(prefix)); // logs 'foo-b5pors4ru6g'
         */
        function getId(prefix) {
          if (prefix === undefined) {
            prefix = 'wavesurfer_';
          }
          return prefix + Math.random().toString(32).substring(2);
        }
        module.exports = exports.default;
        /***/ }),
      /***/ "./src/util/index.js":
      /*!***************************!*\
  !*** ./src/util/index.js ***!
  \***************************/
      /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", ({
          value: true
        }));
        Object.defineProperty(exports, "Observer", ({
          enumerable: true,
          get: function get() {
            return _observer.default;
          }
        }));
        Object.defineProperty(exports, "absMax", ({
          enumerable: true,
          get: function get() {
            return _absMax.default;
          }
        }));
        Object.defineProperty(exports, "clamp", ({
          enumerable: true,
          get: function get() {
            return _clamp.default;
          }
        }));
        Object.defineProperty(exports, "debounce", ({
          enumerable: true,
          get: function get() {
            return _debounce.default;
          }
        }));
        Object.defineProperty(exports, "fetchFile", ({
          enumerable: true,
          get: function get() {
            return _fetch.default;
          }
        }));
        Object.defineProperty(exports, "frame", ({
          enumerable: true,
          get: function get() {
            return _frame.default;
          }
        }));
        Object.defineProperty(exports, "getId", ({
          enumerable: true,
          get: function get() {
            return _getId.default;
          }
        }));
        Object.defineProperty(exports, "ignoreSilenceMode", ({
          enumerable: true,
          get: function get() {
            return _silenceMode.default;
          }
        }));
        Object.defineProperty(exports, "max", ({
          enumerable: true,
          get: function get() {
            return _max.default;
          }
        }));
        Object.defineProperty(exports, "min", ({
          enumerable: true,
          get: function get() {
            return _min.default;
          }
        }));
        Object.defineProperty(exports, "preventClick", ({
          enumerable: true,
          get: function get() {
            return _preventClick.default;
          }
        }));
        Object.defineProperty(exports, "requestAnimationFrame", ({
          enumerable: true,
          get: function get() {
            return _requestAnimationFrame.default;
          }
        }));
        Object.defineProperty(exports, "style", ({
          enumerable: true,
          get: function get() {
            return _style.default;
          }
        }));
        Object.defineProperty(exports, "withOrientation", ({
          enumerable: true,
          get: function get() {
            return _orientation.default;
          }
        }));
        var _getId = _interopRequireDefault(__webpack_require__(/*! ./get-id */ "./src/util/get-id.js"));
        var _max = _interopRequireDefault(__webpack_require__(/*! ./max */ "./src/util/max.js"));
        var _min = _interopRequireDefault(__webpack_require__(/*! ./min */ "./src/util/min.js"));
        var _absMax = _interopRequireDefault(__webpack_require__(/*! ./absMax */ "./src/util/absMax.js"));
        var _observer = _interopRequireDefault(__webpack_require__(/*! ./observer */ "./src/util/observer.js"));
        var _style = _interopRequireDefault(__webpack_require__(/*! ./style */ "./src/util/style.js"));
        var _requestAnimationFrame = _interopRequireDefault(__webpack_require__(/*! ./request-animation-frame */ "./src/util/request-animation-frame.js"));
        var _frame = _interopRequireDefault(__webpack_require__(/*! ./frame */ "./src/util/frame.js"));
        var _debounce = _interopRequireDefault(__webpack_require__(/*! debounce */ "./node_modules/debounce/index.js"));
        var _preventClick = _interopRequireDefault(__webpack_require__(/*! ./prevent-click */ "./src/util/prevent-click.js"));
        var _fetch = _interopRequireDefault(__webpack_require__(/*! ./fetch */ "./src/util/fetch.js"));
        var _clamp = _interopRequireDefault(__webpack_require__(/*! ./clamp */ "./src/util/clamp.js"));
        var _orientation = _interopRequireDefault(__webpack_require__(/*! ./orientation */ "./src/util/orientation.js"));
        var _silenceMode = _interopRequireDefault(__webpack_require__(/*! ./silence-mode */ "./src/util/silence-mode.js"));
        function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
        /***/ }),
      /***/ "./src/util/max.js":
      /*!*************************!*\
  !*** ./src/util/max.js ***!
  \*************************/
      /***/ ((module, exports) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", ({
          value: true
        }));
        exports["default"] = max;
        /**
         * Get the largest value
         *
         * @param   {Array} values Array of numbers
         * @returns {Number} Largest number found
         * @example console.log(max([1, 2, 3])); // logs 3
         */
        function max(values) {
          var largest = -Infinity;
          Object.keys(values).forEach(function (i) {
            if (values[i] > largest) {
              largest = values[i];
            }
          });
          return largest;
        }
        module.exports = exports.default;
        /***/ }),
      /***/ "./src/util/min.js":
      /*!*************************!*\
  !*** ./src/util/min.js ***!
  \*************************/
      /***/ ((module, exports) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", ({
          value: true
        }));
        exports["default"] = min;
        /**
         * Get the smallest value
         *
         * @param   {Array} values Array of numbers
         * @returns {Number} Smallest number found
         * @example console.log(min([1, 2, 3])); // logs 1
         */
        function min(values) {
          var smallest = Number(Infinity);
          Object.keys(values).forEach(function (i) {
            if (values[i] < smallest) {
              smallest = values[i];
            }
          });
          return smallest;
        }
        module.exports = exports.default;
        /***/ }),
      /***/ "./src/util/observer.js":
      /*!******************************!*\
  !*** ./src/util/observer.js ***!
  \******************************/
      /***/ ((module, exports) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", ({
          value: true
        }));
        exports["default"] = void 0;
        function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } }
        function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
        /**
         * @typedef {Object} ListenerDescriptor
         * @property {string} name The name of the event
         * @property {function} callback The callback
         * @property {function} un The function to call to remove the listener
         */
        /**
         * Observer class
         */
        var Observer = /*#__PURE__*/function () {
          /**
           * Instantiate Observer
           */
          function Observer() {
            _classCallCheck(this, Observer);
            /**
             * @private
             * @todo Initialise the handlers here already and remove the conditional
             * assignment in `on()`
             */
            this._disabledEventEmissions = [];
            this.handlers = null;
          }
          /**
           * Attach a handler function for an event.
           *
           * @param {string} event Name of the event to listen to
           * @param {function} fn The callback to trigger when the event is fired
           * @return {ListenerDescriptor} The event descriptor
           */
          _createClass(Observer, [{
            key: "on",
            value: function on(event, fn) {
              var _this = this;
              if (!this.handlers) {
                this.handlers = {};
              }
              var handlers = this.handlers[event];
              if (!handlers) {
                handlers = this.handlers[event] = [];
              }
              handlers.push(fn);
              // Return an event descriptor
              return {
                name: event,
                callback: fn,
                un: function un(e, fn) {
                  return _this.un(e, fn);
                }
              };
            }
            /**
             * Remove an event handler.
             *
             * @param {string} event Name of the event the listener that should be
             * removed listens to
             * @param {function} fn The callback that should be removed
             */
          }, {
            key: "un",
            value: function un(event, fn) {
              if (!this.handlers) {
                return;
              }
              var handlers = this.handlers[event];
              var i;
              if (handlers) {
                if (fn) {
                  for (i = handlers.length - 1; i >= 0; i--) {
                    if (handlers[i] == fn) {
                      handlers.splice(i, 1);
                    }
                  }
                } else {
                  handlers.length = 0;
                }
              }
            }
            /**
             * Remove all event handlers.
             */
          }, {
            key: "unAll",
            value: function unAll() {
              this.handlers = null;
            }
            /**
             * Attach a handler to an event. The handler is executed at most once per
             * event type.
             *
             * @param {string} event The event to listen to
             * @param {function} handler The callback that is only to be called once
             * @return {ListenerDescriptor} The event descriptor
             */
          }, {
            key: "once",
            value: function once(event, handler) {
              var _this2 = this;
              var fn = function fn() {
                for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
                  args[_key] = arguments[_key];
                }
                /*  eslint-disable no-invalid-this */
                handler.apply(_this2, args);
                /*  eslint-enable no-invalid-this */
                setTimeout(function () {
                  _this2.un(event, fn);
                }, 0);
              };
              return this.on(event, fn);
            }
            /**
             * Disable firing a list of events by name. When specified, event handlers for any event type
             * passed in here will not be called.
             *
             * @since 4.0.0
             * @param {string[]} eventNames an array of event names to disable emissions for
             * @example
             * // disable seek and interaction events
             * wavesurfer.setDisabledEventEmissions(['seek', 'interaction']);
             */
          }, {
            key: "setDisabledEventEmissions",
            value: function setDisabledEventEmissions(eventNames) {
              this._disabledEventEmissions = eventNames;
            }
            /**
             * plugins borrow part of this class without calling the constructor,
             * so we have to be careful about _disabledEventEmissions
             */
          }, {
            key: "_isDisabledEventEmission",
            value: function _isDisabledEventEmission(event) {
              return this._disabledEventEmissions && this._disabledEventEmissions.includes(event);
            }
            /**
             * Manually fire an event
             *
             * @param {string} event The event to fire manually
             * @param {...any} args The arguments with which to call the listeners
             */
          }, {
            key: "fireEvent",
            value: function fireEvent(event) {
              for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
                args[_key2 - 1] = arguments[_key2];
              }
              if (!this.handlers || this._isDisabledEventEmission(event)) {
                return;
              }
              var handlers = this.handlers[event];
              handlers && handlers.forEach(function (fn) {
                fn.apply(void 0, args);
              });
            }
          }]);
          return Observer;
        }();
        exports["default"] = Observer;
        module.exports = exports.default;
        /***/ }),
      /***/ "./src/util/orientation.js":
      /*!*********************************!*\
  !*** ./src/util/orientation.js ***!
  \*********************************/
      /***/ ((module, exports) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", ({
          value: true
        }));
        exports["default"] = withOrientation;
        var verticalPropMap = {
          width: 'height',
          height: 'width',
          overflowX: 'overflowY',
          overflowY: 'overflowX',
          clientWidth: 'clientHeight',
          clientHeight: 'clientWidth',
          clientX: 'clientY',
          clientY: 'clientX',
          scrollWidth: 'scrollHeight',
          scrollLeft: 'scrollTop',
          offsetLeft: 'offsetTop',
          offsetTop: 'offsetLeft',
          offsetHeight: 'offsetWidth',
          offsetWidth: 'offsetHeight',
          left: 'top',
          right: 'bottom',
          top: 'left',
          bottom: 'right',
          borderRightStyle: 'borderBottomStyle',
          borderRightWidth: 'borderBottomWidth',
          borderRightColor: 'borderBottomColor'
        };
        /**
         * Convert a horizontally-oriented property name to a vertical one.
         *
         * @param {string} prop A property name
         * @param {bool} vertical Whether the element is oriented vertically
         * @returns {string} prop, converted appropriately
         */
        function mapProp(prop, vertical) {
          if (Object.prototype.hasOwnProperty.call(verticalPropMap, prop)) {
            return vertical ? verticalPropMap[prop] : prop;
          } else {
            return prop;
          }
        }
        var isProxy = Symbol("isProxy");
        /**
         * Returns an appropriately oriented object based on vertical.
         * If vertical is true, attribute getting and setting will be mapped through
         * verticalPropMap, so that e.g. getting the object's .width will give its
         * .height instead.
         * Certain methods of an oriented object will return oriented objects as well.
         * Oriented objects can't be added to the DOM directly since they are Proxy objects
         * and thus fail typechecks. Use domElement to get the actual element for this.
         *
         * @param {object} target The object to be wrapped and oriented
         * @param {bool} vertical Whether the element is oriented vertically
         * @returns {Proxy} An oriented object with attr translation via verticalAttrMap
         * @since 5.0.0
         */
        function withOrientation(target, vertical) {
          if (target[isProxy]) {
            return target;
          } else {
            return new Proxy(target, {
              get: function get(obj, prop, receiver) {
                if (prop === isProxy) {
                  return true;
                } else if (prop === 'domElement') {
                  return obj;
                } else if (prop === 'style') {
                  return withOrientation(obj.style, vertical);
                } else if (prop === 'canvas') {
                  return withOrientation(obj.canvas, vertical);
                } else if (prop === 'getBoundingClientRect') {
                  return function () {
                    return withOrientation(obj.getBoundingClientRect.apply(obj, arguments), vertical);
                  };
                } else if (prop === 'getContext') {
                  return function () {
                    return withOrientation(obj.getContext.apply(obj, arguments), vertical);
                  };
                } else {
                  var value = obj[mapProp(prop, vertical)];
                  return typeof value == 'function' ? value.bind(obj) : value;
                }
              },
              set: function set(obj, prop, value) {
                obj[mapProp(prop, vertical)] = value;
                return true;
              }
            });
          }
        }
        module.exports = exports.default;
        /***/ }),
      /***/ "./src/util/prevent-click.js":
      /*!***********************************!*\
  !*** ./src/util/prevent-click.js ***!
  \***********************************/
      /***/ ((module, exports) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", ({
          value: true
        }));
        exports["default"] = preventClick;
        /**
         * Stops propagation of click event and removes event listener
         *
         * @private
         * @param {object} event The click event
         */
        function preventClickHandler(event) {
          event.stopPropagation();
          document.body.removeEventListener('click', preventClickHandler, true);
        }
        /**
         * Starts listening for click event and prevent propagation
         *
         * @param {object} values Values
         */
        function preventClick(values) {
          document.body.addEventListener('click', preventClickHandler, true);
        }
        module.exports = exports.default;
        /***/ }),
      /***/ "./src/util/request-animation-frame.js":
      /*!*********************************************!*\
  !*** ./src/util/request-animation-frame.js ***!
  \*********************************************/
      /***/ ((module, exports) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", ({
          value: true
        }));
        exports["default"] = void 0;
        /* eslint-disable valid-jsdoc */
        /**
         * Returns the `requestAnimationFrame` function for the browser, or a shim with
         * `setTimeout` if the function is not found
         *
         * @return {function} Available `requestAnimationFrame` function for the browser
         */
        var _default = (window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (callback, element) {
          return setTimeout(callback, 1000 / 60);
        }).bind(window);
        exports["default"] = _default;
        module.exports = exports.default;
        /***/ }),
      /***/ "./src/util/silence-mode.js":
      /*!**********************************!*\
  !*** ./src/util/silence-mode.js ***!
  \**********************************/
      /***/ ((module, exports) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", ({
          value: true
        }));
        exports["default"] = ignoreSilenceMode;
        /**
         * Ignores device silence mode when using the `WebAudio` backend.
         *
         * Many mobile devices contain a hardware button to mute the ringtone for incoming
         * calls and messages. Unfortunately, on some platforms like iOS, this also mutes
         * wavesurfer's audio when using the `WebAudio` backend. This function creates a
         * temporary `<audio>` element that makes sure the WebAudio backend keeps playing
         * when muting the device ringer.
         *
         * @since 5.2.0
         */
        function ignoreSilenceMode() {
          // Set the src to a short bit of url encoded as a silent mp3
          // NOTE The silence MP3 must be high quality, when web audio sounds are played
          // in parallel the web audio sound is mixed to match the bitrate of the html sound
          // 0.01 seconds of silence VBR220-260 Joint Stereo 859B
          var audioData = "data:audio/mpeg;base64,//uQxAAAAAAAAAAAAAAAAAAAAAAAWGluZwAAAA8AAAACAAACcQCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA//////////////////////////////////////////////////////////////////8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//sQxAADgnABGiAAQBCqgCRMAAgEAH///////////////7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq//////////////////9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQ==";
          // disable iOS Airplay (setting the attribute in js doesn't work)
          var tmp = document.createElement("div");
          tmp.innerHTML = '<audio x-webkit-airplay="deny"></audio>';
          var audioSilentMode = tmp.children.item(0);
          audioSilentMode.src = audioData;
          audioSilentMode.preload = "auto";
          audioSilentMode.type = "audio/mpeg";
          audioSilentMode.disableRemotePlayback = true;
          // play
          audioSilentMode.play();
          // cleanup
          audioSilentMode.remove();
          tmp.remove();
        }
        module.exports = exports.default;
        /***/ }),
      /***/ "./src/util/style.js":
      /*!***************************!*\
  !*** ./src/util/style.js ***!
  \***************************/
      /***/ ((module, exports) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", ({
          value: true
        }));
        exports["default"] = style;
        /**
         * Apply a map of styles to an element
         *
         * @param {HTMLElement} el The element that the styles will be applied to
         * @param {Object} styles The map of propName: attribute, both are used as-is
         *
         * @return {HTMLElement} el
         */
        function style(el, styles) {
          Object.keys(styles).forEach(function (prop) {
            if (el.style[prop] !== styles[prop]) {
              el.style[prop] = styles[prop];
            }
          });
          return el;
        }
        module.exports = exports.default;
        /***/ }),
      /***/ "./src/wavesurfer.js":
      /*!***************************!*\
  !*** ./src/wavesurfer.js ***!
  \***************************/
      /***/ ((module, exports, __webpack_require__) => {
        "use strict";
        function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
        Object.defineProperty(exports, "__esModule", ({
          value: true
        }));
        exports["default"] = void 0;
        var util = _interopRequireWildcard(__webpack_require__(/*! ./util */ "./src/util/index.js"));
        var _drawer = _interopRequireDefault(__webpack_require__(/*! ./drawer.multicanvas */ "./src/drawer.multicanvas.js"));
        var _webaudio = _interopRequireDefault(__webpack_require__(/*! ./webaudio */ "./src/webaudio.js"));
        var _mediaelement = _interopRequireDefault(__webpack_require__(/*! ./mediaelement */ "./src/mediaelement.js"));
        var _peakcache = _interopRequireDefault(__webpack_require__(/*! ./peakcache */ "./src/peakcache.js"));
        var _mediaelementWebaudio = _interopRequireDefault(__webpack_require__(/*! ./mediaelement-webaudio */ "./src/mediaelement-webaudio.js"));
        function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
        function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
        function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
        function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
        function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
        function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
        function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
        function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
        function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
        function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
        function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
        function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } }
        function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
        /*
 * This work is licensed under a BSD-3-Clause License.
 */
        /** @external {HTMLElement} https://developer.mozilla.org/en/docs/Web/API/HTMLElement */
        /** @external {OfflineAudioContext} https://developer.mozilla.org/en-US/docs/Web/API/OfflineAudioContext */
        /** @external {File} https://developer.mozilla.org/en-US/docs/Web/API/File */
        /** @external {Blob} https://developer.mozilla.org/en-US/docs/Web/API/Blob */
        /** @external {CanvasRenderingContext2D} https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D */
        /** @external {MediaStreamConstraints} https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamConstraints */
        /** @external {AudioNode} https://developer.mozilla.org/de/docs/Web/API/AudioNode */
        /**
         * @typedef {Object} WavesurferParams
         * @property {AudioContext} audioContext=null Use your own previously
         * initialized AudioContext or leave blank.
         * @property {number} audioRate=1 Speed at which to play audio. Lower number is
         * slower.
         * @property {ScriptProcessorNode} audioScriptProcessor=null Use your own previously
         * initialized ScriptProcessorNode or leave blank.
         * @property {boolean} autoCenter=true If a scrollbar is present, center the
         * waveform on current progress
         * @property {number} autoCenterRate=5 If autoCenter is active, rate at which the
         * waveform is centered
         * @property {boolean} autoCenterImmediately=false If autoCenter is active, immediately
         * center waveform on current progress
         * @property {string} backend='WebAudio' `'WebAudio'|'MediaElement'|'MediaElementWebAudio'` In most cases
         * you don't have to set this manually. MediaElement is a fallback for unsupported browsers.
         * MediaElementWebAudio allows to use WebAudio API also with big audio files, loading audio like with
         * MediaElement backend (HTML5 audio tag). You have to use the same methods of MediaElement backend for loading and
         * playback, giving also peaks, so the audio data are not decoded. In this way you can use WebAudio features, like filters,
         * also with audio with big duration. For example:
         * ` wavesurfer.load(url | HTMLMediaElement, peaks, preload, duration);
         *   wavesurfer.play();
         *   wavesurfer.setFilter(customFilter);
         * `
         * @property {string} backgroundColor=null Change background color of the
         * waveform container.
         * @property {number} barHeight=1 The height of the wave bars.
         * @property {number} barRadius=0 The radius of the wave bars. Makes bars rounded
         * @property {number} barGap=null The optional spacing between bars of the wave,
         * if not provided will be calculated in legacy format.
         * @property {number} barWidth=null Draw the waveform using bars.
         * @property {number} barMinHeight=null If specified, draw at least a bar of this height,
         * eliminating waveform gaps
         * @property {boolean} closeAudioContext=false Close and nullify all audio
         * contexts when the destroy method is called.
         * @property {!string|HTMLElement} container CSS selector or HTML element where
         * the waveform should be drawn. This is the only required parameter.
         * @property {string} cursorColor='#333' The fill color of the cursor indicating
         * the playhead position.
         * @property {number} cursorWidth=1 Measured in pixels.
         * @property {object} drawingContextAttributes={desynchronized: false} Drawing context
         * attributes.
         * @property {number} duration=null Optional audio length so pre-rendered peaks
         * can be display immediately for example.
         * @property {boolean} fillParent=true Whether to fill the entire container or
         * draw only according to `minPxPerSec`.
         * @property {boolean} forceDecode=false Force decoding of audio using web audio
         * when zooming to get a more detailed waveform.
         * @property {number} height=128 The height of the waveform. Measured in
         * pixels.
         * @property {boolean} hideScrollbar=false Whether to hide the horizontal
         * scrollbar when one would normally be shown.
         * @property {boolean} hideCursor=false Whether to hide the mouse cursor
         * when one would normally be shown by default.
         * @property {boolean} ignoreSilenceMode=false If true, ignores device silence mode
         * when using the `WebAudio` backend.
         * @property {boolean} interact=true Whether the mouse interaction will be
         * enabled at initialization. You can switch this parameter at any time later
         * on.
         * @property {boolean} loopSelection=true (Use with regions plugin) Enable
         * looping of selected regions
         * @property {number} maxCanvasWidth=4000 Maximum width of a single canvas in
         * pixels, excluding a small overlap (2 * `pixelRatio`, rounded up to the next
         * even integer). If the waveform is longer than this value, additional canvases
         * will be used to render the waveform, which is useful for very large waveforms
         * that may be too wide for browsers to draw on a single canvas.
         * @property {boolean} mediaControls=false (Use with backend `MediaElement` or `MediaElementWebAudio`)
         * this enables the native controls for the media element
         * @property {string} mediaType='audio' (Use with backend `MediaElement` or `MediaElementWebAudio`)
         * `'audio'|'video'` ('video' only for `MediaElement`)
         * @property {number} minPxPerSec=20 Minimum number of pixels per second of
         * audio.
         * @property {boolean} normalize=false If true, normalize by the maximum peak
         * instead of 1.0.
         * @property {boolean} partialRender=false Use the PeakCache to improve
         * rendering speed of large waveforms
         * @property {number} pixelRatio=window.devicePixelRatio The pixel ratio used to
         * calculate display
         * @property {PluginDefinition[]} plugins=[] An array of plugin definitions to
         * register during instantiation, they will be directly initialised unless they
         * are added with the `deferInit` property set to true.
         * @property {string} progressColor='#555' The fill color of the part of the
         * waveform behind the cursor. When `progressColor` and `waveColor` are the same
         * the progress wave is not rendered at all.
         * @property {boolean} removeMediaElementOnDestroy=true Set to false to keep the
         * media element in the DOM when the player is destroyed. This is useful when
         * reusing an existing media element via the `loadMediaElement` method.
         * @property {Object} renderer=MultiCanvas Can be used to inject a custom
         * renderer.
         * @property {boolean|number} responsive=false If set to `true` resize the
         * waveform, when the window is resized. This is debounced with a `100ms`
         * timeout by default. If this parameter is a number it represents that timeout.
         * @property {boolean} rtl=false If set to `true`, renders waveform from
         * right-to-left.
         * @property {boolean} scrollParent=false Whether to scroll the container with a
         * lengthy waveform. Otherwise the waveform is shrunk to the container width
         * (see fillParent).
         * @property {number} skipLength=2 Number of seconds to skip with the
         * skipForward() and skipBackward() methods.
         * @property {boolean} splitChannels=false Render with separate waveforms for
         * the channels of the audio
         * @property {SplitChannelOptions} splitChannelsOptions={} Options for splitChannel rendering
         * @property {boolean} vertical=false Render the waveform vertically instead of horizontally.
         * @property {string} waveColor='#999' The fill color of the waveform after the
         * cursor.
         * @property {object} xhr={} XHR options. For example:
         * `let xhr = {
         *     cache: 'default',
         *     mode: 'cors',
         *     method: 'GET',
         *     credentials: 'same-origin',
         *     redirect: 'follow',
         *     referrer: 'client',
         *     requestHeaders: [
         *         {
         *             key: 'Authorization',
         *             value: 'my-token'
         *         }
         *     ]
         * };`
         */
        /**
         * @typedef {Object} PluginDefinition
         * @desc The Object used to describe a plugin
         * @example wavesurfer.addPlugin(pluginDefinition);
         * @property {string} name The name of the plugin, the plugin instance will be
         * added as a property to the wavesurfer instance under this name
         * @property {?Object} staticProps The properties that should be added to the
         * wavesurfer instance as static properties
         * @property {?boolean} deferInit Don't initialise plugin
         * automatically
         * @property {Object} params={} The plugin parameters, they are the first parameter
         * passed to the plugin class constructor function
         * @property {PluginClass} instance The plugin instance factory, is called with
         * the dependency specified in extends. Returns the plugin class.
         */
        /**
         * @typedef {Object} SplitChannelOptions
         * @desc parameters applied when splitChannels option is true
         * @property {boolean} overlay=false determines whether channels are rendered on top of each other or on separate tracks
         * @property {object} channelColors={} object describing color for each channel. Example:
         * {
         *     0: {
         *         progressColor: 'green',
         *         waveColor: 'pink'
         *     },
         *     1: {
         *         progressColor: 'orange',
         *         waveColor: 'purple'
         *     }
         * }
         * @property {number[]} filterChannels=[] indexes of channels to be hidden from rendering
         * @property {boolean} relativeNormalization=false determines whether
         * normalization is done per channel or maintains proportionality between
         * channels. Only applied when normalize and splitChannels are both true.
         * @property {boolean} splitDragSelection=false determines if drag selection in regions
         * plugin works separately on each channel or only one selection for all channels
         * @since 4.3.0
         */
        /**
         * @interface PluginClass
         *
         * @desc This is the interface which is implemented by all plugin classes. Note
         * that this only turns into an observer after being passed through
         * `wavesurfer.addPlugin`.
         *
         * @extends {Observer}
         */
        var PluginClass = /*#__PURE__*/function () {
          /**
           * Construct the plugin
           *
           * @param {Object} params={} The plugin params (specific to the plugin)
           * @param {Object} ws The wavesurfer instance
           */
          function PluginClass(params, ws) {
            _classCallCheck(this, PluginClass);
          }
          /**
           * Initialise the plugin
           *
           * Start doing something. This is called by
           * `wavesurfer.initPlugin(pluginName)`
           */
          _createClass(PluginClass, [{
            key: "create",
            value:
              /**
               * Plugin definition factory
               *
               * This function must be used to create a plugin definition which can be
               * used by wavesurfer to correctly instantiate the plugin.
               *
               * It returns a `PluginDefinition` object representing the plugin.
               *
               * @param {Object} params={} The plugin params (specific to the plugin)
               */
              function create(params) {}
          }, {
            key: "init",
            value: function init() {}
            /**
             * Destroy the plugin instance
             *
             * Stop doing something. This is called by
             * `wavesurfer.destroyPlugin(pluginName)`
             */
          }, {
            key: "destroy",
            value: function destroy() {}
          }]);
          return PluginClass;
        }();
        /**
         * WaveSurfer core library class
         *
         * @extends {Observer}
         * @example
         * const params = {
         *   container: '#waveform',
         *   waveColor: 'violet',
         *   progressColor: 'purple'
         * };
         *
         * // initialise like this
         * const wavesurfer = WaveSurfer.create(params);
         *
         * // or like this ...
         * const wavesurfer = new WaveSurfer(params);
         * wavesurfer.init();
         *
         * // load audio file
         * wavesurfer.load('example/media/demo.wav');
         */
        var WaveSurfer = /*#__PURE__*/function (_util$Observer) {
          _inherits(WaveSurfer, _util$Observer);
          var _super = _createSuper(WaveSurfer);
          /**
           * Initialise wavesurfer instance
           *
           * @param {WavesurferParams} params Instantiation options for wavesurfer
           * @example
           * const wavesurfer = new WaveSurfer(params);
           * @returns {this} Wavesurfer instance
           */
          function WaveSurfer(params) {
            var _this;
            _classCallCheck(this, WaveSurfer);
            _this = _super.call(this);
            /**
             * Extract relevant parameters (or defaults)
             * @private
             */
            _defineProperty(_assertThisInitialized(_this), "defaultParams", {
              audioContext: null,
              audioScriptProcessor: null,
              audioRate: 1,
              autoCenter: true,
              autoCenterRate: 5,
              autoCenterImmediately: false,
              backend: 'WebAudio',
              backgroundColor: null,
              barHeight: 1,
              barRadius: 0,
              barGap: null,
              barMinHeight: null,
              container: null,
              cursorColor: '#333',
              cursorWidth: 1,
              dragSelection: true,
              drawingContextAttributes: {
                // Boolean that hints the user agent to reduce the latency
                // by desynchronizing the canvas paint cycle from the event
                // loop
                desynchronized: false
              },
              duration: null,
              fillParent: true,
              forceDecode: false,
              height: 128,
              hideScrollbar: false,
              hideCursor: false,
              ignoreSilenceMode: false,
              interact: true,
              loopSelection: true,
              maxCanvasWidth: 4000,
              mediaContainer: null,
              mediaControls: false,
              mediaType: 'audio',
              minPxPerSec: 20,
              normalize: false,
              partialRender: false,
              pixelRatio: window.devicePixelRatio || screen.deviceXDPI / screen.logicalXDPI,
              plugins: [],
              progressColor: '#555',
              removeMediaElementOnDestroy: true,
              renderer: _drawer.default,
              responsive: false,
              rtl: false,
              scrollParent: false,
              skipLength: 2,
              splitChannels: false,
              splitChannelsOptions: {
                overlay: false,
                channelColors: {},
                filterChannels: [],
                relativeNormalization: false,
                splitDragSelection: false
              },
              vertical: false,
              waveColor: '#999',
              xhr: {}
            });
            _defineProperty(_assertThisInitialized(_this), "backends", {
              MediaElement: _mediaelement.default,
              WebAudio: _webaudio.default,
              MediaElementWebAudio: _mediaelementWebaudio.default
            });
            _defineProperty(_assertThisInitialized(_this), "util", util);
            _this.params = Object.assign({}, _this.defaultParams, params);
            _this.params.splitChannelsOptions = Object.assign({}, _this.defaultParams.splitChannelsOptions, params.splitChannelsOptions);
            /** @private */
            _this.container = 'string' == typeof params.container ? document.querySelector(_this.params.container) : _this.params.container;
            if (!_this.container) {
              throw new Error('Container element not found');
            }
            if (_this.params.mediaContainer == null) {
              /** @private */
              _this.mediaContainer = _this.container;
            } else if (typeof _this.params.mediaContainer == 'string') {
              /** @private */
              _this.mediaContainer = document.querySelector(_this.params.mediaContainer);
            } else {
              /** @private */
              _this.mediaContainer = _this.params.mediaContainer;
            }
            if (!_this.mediaContainer) {
              throw new Error('Media Container element not found');
            }
            if (_this.params.maxCanvasWidth <= 1) {
              throw new Error('maxCanvasWidth must be greater than 1');
            } else if (_this.params.maxCanvasWidth % 2 == 1) {
              throw new Error('maxCanvasWidth must be an even number');
            }
            if (_this.params.rtl === true) {
              if (_this.params.vertical === true) {
                util.style(_this.container, {
                  transform: 'rotateX(180deg)'
                });
              } else {
                util.style(_this.container, {
                  transform: 'rotateY(180deg)'
                });
              }
            }
            if (_this.params.backgroundColor) {
              _this.setBackgroundColor(_this.params.backgroundColor);
            }
            /**
             * @private Used to save the current volume when muting so we can
             * restore once unmuted
             * @type {number}
             */
            _this.savedVolume = 0;
            /**
             * @private The current muted state
             * @type {boolean}
             */
            _this.isMuted = false;
            /**
             * @private Will hold a list of event descriptors that need to be
             * canceled on subsequent loads of audio
             * @type {Object[]}
             */
            _this.tmpEvents = [];
            /**
             * @private Holds any running audio downloads
             * @type {Observer}
             */
            _this.currentRequest = null;
            /** @private */
            _this.arraybuffer = null;
            /** @private */
            _this.drawer = null;
            /** @private */
            _this.backend = null;
            /** @private */
            _this.peakCache = null;
            // cache constructor objects
            if (typeof _this.params.renderer !== 'function') {
              throw new Error('Renderer parameter is invalid');
            }
            /**
             * @private The uninitialised Drawer class
             */
            _this.Drawer = _this.params.renderer;
            /**
             * @private The uninitialised Backend class
             */
            // Back compat
            if (_this.params.backend == 'AudioElement') {
              _this.params.backend = 'MediaElement';
            }
            if ((_this.params.backend == 'WebAudio' || _this.params.backend === 'MediaElementWebAudio') && !_webaudio.default.prototype.supportsWebAudio.call(null)) {
              _this.params.backend = 'MediaElement';
            }
            _this.Backend = _this.backends[_this.params.backend];
            /**
             * @private map of plugin names that are currently initialised
             */
            _this.initialisedPluginList = {};
            /** @private */
            _this.isDestroyed = false;
            /**
             * Get the current ready status.
             *
             * @example const isReady = wavesurfer.isReady;
             * @return {boolean}
             */
            _this.isReady = false;
            // responsive debounced event listener. If this.params.responsive is not
            // set, this is never called. Use 100ms or this.params.responsive as
            // timeout for the debounce function.
            var prevWidth = 0;
            _this._onResize = util.debounce(function () {
              if (_this.drawer.wrapper && prevWidth != _this.drawer.wrapper.clientWidth && !_this.params.scrollParent) {
                prevWidth = _this.drawer.wrapper.clientWidth;
                if (prevWidth) {
                  // redraw only if waveform container is rendered and has a width
                  _this.drawer.fireEvent('redraw');
                }
              }
            }, typeof _this.params.responsive === 'number' ? _this.params.responsive : 100);
            return _possibleConstructorReturn(_this, _assertThisInitialized(_this));
          }
          /**
           * Initialise the wave
           *
           * @example
           * var wavesurfer = new WaveSurfer(params);
           * wavesurfer.init();
           * @return {this} The wavesurfer instance
           */
          _createClass(WaveSurfer, [{
            key: "init",
            value: function init() {
              this.registerPlugins(this.params.plugins);
              this.createDrawer();
              this.createBackend();
              this.createPeakCache();
              return this;
            }
            /**
             * Add and initialise array of plugins (if `plugin.deferInit` is falsey),
             * this function is called in the init function of wavesurfer
             *
             * @param {PluginDefinition[]} plugins An array of plugin definitions
             * @emits {WaveSurfer#plugins-registered} Called with the array of plugin definitions
             * @return {this} The wavesurfer instance
             */
          }, {
            key: "registerPlugins",
            value: function registerPlugins(plugins) {
              var _this2 = this;
              // first instantiate all the plugins
              plugins.forEach(function (plugin) {
                return _this2.addPlugin(plugin);
              });
              // now run the init functions
              plugins.forEach(function (plugin) {
                // call init function of the plugin if deferInit is falsey
                // in that case you would manually use initPlugins()
                if (!plugin.deferInit) {
                  _this2.initPlugin(plugin.name);
                }
              });
              this.fireEvent('plugins-registered', plugins);
              return this;
            }
            /**
             * Get a map of plugin names that are currently initialised
             *
             * @example wavesurfer.getPlugins();
             * @return {Object} Object with plugin names
             */
          }, {
            key: "getActivePlugins",
            value: function getActivePlugins() {
              return this.initialisedPluginList;
            }
            /**
             * Add a plugin object to wavesurfer
             *
             * @param {PluginDefinition} plugin A plugin definition
             * @emits {WaveSurfer#plugin-added} Called with the name of the plugin that was added
             * @example wavesurfer.addPlugin(WaveSurfer.minimap());
             * @return {this} The wavesurfer instance
             */
          }, {
            key: "addPlugin",
            value: function addPlugin(plugin) {
              var _this3 = this;
              if (!plugin.name) {
                throw new Error('Plugin does not have a name!');
              }
              if (!plugin.instance) {
                throw new Error("Plugin ".concat(plugin.name, " does not have an instance property!"));
              }
              // staticProps properties are applied to wavesurfer instance
              if (plugin.staticProps) {
                Object.keys(plugin.staticProps).forEach(function (pluginStaticProp) {
                  /**
                   * Properties defined in a plugin definition's `staticProps` property are added as
                   * staticProps properties of the WaveSurfer instance
                   */
                  _this3[pluginStaticProp] = plugin.staticProps[pluginStaticProp];
                });
              }
              var Instance = plugin.instance;
              // turn the plugin instance into an observer
              var observerPrototypeKeys = Object.getOwnPropertyNames(util.Observer.prototype);
              observerPrototypeKeys.forEach(function (key) {
                Instance.prototype[key] = util.Observer.prototype[key];
              });
              /**
               * Instantiated plugin classes are added as a property of the wavesurfer
               * instance
               * @type {Object}
               */
              this[plugin.name] = new Instance(plugin.params || {}, this);
              this.fireEvent('plugin-added', plugin.name);
              return this;
            }
            /**
             * Initialise a plugin
             *
             * @param {string} name A plugin name
             * @emits WaveSurfer#plugin-initialised
             * @example wavesurfer.initPlugin('minimap');
             * @return {this} The wavesurfer instance
             */
          }, {
            key: "initPlugin",
            value: function initPlugin(name) {
              if (!this[name]) {
                throw new Error("Plugin ".concat(name, " has not been added yet!"));
              }
              if (this.initialisedPluginList[name]) {
                // destroy any already initialised plugins
                this.destroyPlugin(name);
              }
              this[name].init();
              this.initialisedPluginList[name] = true;
              this.fireEvent('plugin-initialised', name);
              return this;
            }
            /**
             * Destroy a plugin
             *
             * @param {string} name A plugin name
             * @emits WaveSurfer#plugin-destroyed
             * @example wavesurfer.destroyPlugin('minimap');
             * @returns {this} The wavesurfer instance
             */
          }, {
            key: "destroyPlugin",
            value: function destroyPlugin(name) {
              if (!this[name]) {
                throw new Error("Plugin ".concat(name, " has not been added yet and cannot be destroyed!"));
              }
              if (!this.initialisedPluginList[name]) {
                throw new Error("Plugin ".concat(name, " is not active and cannot be destroyed!"));
              }
              if (typeof this[name].destroy !== 'function') {
                throw new Error("Plugin ".concat(name, " does not have a destroy function!"));
              }
              this[name].destroy();
              delete this.initialisedPluginList[name];
              this.fireEvent('plugin-destroyed', name);
              return this;
            }
            /**
             * Destroy all initialised plugins. Convenience function to use when
             * wavesurfer is removed
             *
             * @private
             */
          }, {
            key: "destroyAllPlugins",
            value: function destroyAllPlugins() {
              var _this4 = this;
              Object.keys(this.initialisedPluginList).forEach(function (name) {
                return _this4.destroyPlugin(name);
              });
            }
            /**
             * Create the drawer and draw the waveform
             *
             * @private
             * @emits WaveSurfer#drawer-created
             */
          }, {
            key: "createDrawer",
            value: function createDrawer() {
              var _this5 = this;
              this.drawer = new this.Drawer(this.container, this.params);
              this.drawer.init();
              this.fireEvent('drawer-created', this.drawer);
              if (this.params.responsive !== false) {
                window.addEventListener('resize', this._onResize, true);
                window.addEventListener('orientationchange', this._onResize, true);
              }
              this.drawer.on('redraw', function () {
                _this5.drawBuffer();
                _this5.drawer.progress(_this5.backend.getPlayedPercents());
              });
              // Click-to-seek
              this.drawer.on('click', function (e, progress) {
                setTimeout(function () {
                  return _this5.seekTo(progress);
                }, 0);
              });
              // Relay the scroll event from the drawer
              this.drawer.on('scroll', function (e) {
                if (_this5.params.partialRender) {
                  _this5.drawBuffer();
                }
                _this5.fireEvent('scroll', e);
              });
            }
            /**
             * Create the backend
             *
             * @private
             * @emits WaveSurfer#backend-created
             */
          }, {
            key: "createBackend",
            value: function createBackend() {
              var _this6 = this;
              if (this.backend) {
                this.backend.destroy();
              }
              this.backend = new this.Backend(this.params);
              this.backend.init();
              this.fireEvent('backend-created', this.backend);
              this.backend.on('finish', function () {
                _this6.drawer.progress(_this6.backend.getPlayedPercents());
                _this6.fireEvent('finish');
              });
              this.backend.on('play', function () {
                return _this6.fireEvent('play');
              });
              this.backend.on('pause', function () {
                return _this6.fireEvent('pause');
              });
              this.backend.on('audioprocess', function (time) {
                _this6.drawer.progress(_this6.backend.getPlayedPercents());
                _this6.fireEvent('audioprocess', time);
              });
              // only needed for MediaElement and MediaElementWebAudio backend
              if (this.params.backend === 'MediaElement' || this.params.backend === 'MediaElementWebAudio') {
                this.backend.on('seek', function () {
                  _this6.drawer.progress(_this6.backend.getPlayedPercents());
                });
                this.backend.on('volume', function () {
                  var newVolume = _this6.getVolume();
                  _this6.fireEvent('volume', newVolume);
                  if (_this6.backend.isMuted !== _this6.isMuted) {
                    _this6.isMuted = _this6.backend.isMuted;
                    _this6.fireEvent('mute', _this6.isMuted);
                  }
                });
              }
            }
            /**
             * Create the peak cache
             *
             * @private
             */
          }, {
            key: "createPeakCache",
            value: function createPeakCache() {
              if (this.params.partialRender) {
                this.peakCache = new _peakcache.default();
              }
            }
            /**
             * Get the duration of the audio clip
             *
             * @example const duration = wavesurfer.getDuration();
             * @return {number} Duration in seconds
             */
          }, {
            key: "getDuration",
            value: function getDuration() {
              return this.backend.getDuration();
            }
            /**
             * Get the current playback position
             *
             * @example const currentTime = wavesurfer.getCurrentTime();
             * @return {number} Playback position in seconds
             */
          }, {
            key: "getCurrentTime",
            value: function getCurrentTime() {
              return this.backend.getCurrentTime();
            }
            /**
             * Set the current play time in seconds.
             *
             * @param {number} seconds A positive number in seconds. E.g. 10 means 10
             * seconds, 60 means 1 minute
             */
          }, {
            key: "setCurrentTime",
            value: function setCurrentTime(seconds) {
              if (seconds >= this.getDuration()) {
                this.seekTo(1);
              } else {
                this.seekTo(seconds / this.getDuration());
              }
            }
            /**
             * Starts playback from the current position. Optional start and end
             * measured in seconds can be used to set the range of audio to play.
             *
             * @param {?number} start Position to start at
             * @param {?number} end Position to end at
             * @emits WaveSurfer#interaction
             * @return {Promise} Result of the backend play method
             * @example
             * // play from second 1 to 5
             * wavesurfer.play(1, 5);
             */
          }, {
            key: "play",
            value: function play(start, end) {
              var _this7 = this;
              if (this.params.ignoreSilenceMode) {
                // ignores device hardware silence mode
                util.ignoreSilenceMode();
              }
              this.fireEvent('interaction', function () {
                return _this7.play(start, end);
              });
              return this.backend.play(start, end);
            }
            /**
             * Set a point in seconds for playback to stop at.
             *
             * @param {number} position Position (in seconds) to stop at
             * @version 3.3.0
             */
          }, {
            key: "setPlayEnd",
            value: function setPlayEnd(position) {
              this.backend.setPlayEnd(position);
            }
            /**
             * Stops and pauses playback
             *
             * @example wavesurfer.pause();
             * @return {Promise} Result of the backend pause method
             */
          }, {
            key: "pause",
            value: function pause() {
              if (!this.backend.isPaused()) {
                return this.backend.pause();
              }
            }
            /**
             * Toggle playback
             *
             * @example wavesurfer.playPause();
             * @return {Promise} Result of the backend play or pause method
             */
          }, {
            key: "playPause",
            value: function playPause() {
              return this.backend.isPaused() ? this.play() : this.pause();
            }
            /**
             * Get the current playback state
             *
             * @example const isPlaying = wavesurfer.isPlaying();
             * @return {boolean} False if paused, true if playing
             */
          }, {
            key: "isPlaying",
            value: function isPlaying() {
              return !this.backend.isPaused();
            }
            /**
             * Skip backward
             *
             * @param {?number} seconds Amount to skip back, if not specified `skipLength`
             * is used
             * @example wavesurfer.skipBackward();
             */
          }, {
            key: "skipBackward",
            value: function skipBackward(seconds) {
              this.skip(-seconds || -this.params.skipLength);
            }
            /**
             * Skip forward
             *
             * @param {?number} seconds Amount to skip back, if not specified `skipLength`
             * is used
             * @example wavesurfer.skipForward();
             */
          }, {
            key: "skipForward",
            value: function skipForward(seconds) {
              this.skip(seconds || this.params.skipLength);
            }
            /**
             * Skip a number of seconds from the current position (use a negative value
             * to go backwards).
             *
             * @param {number} offset Amount to skip back or forwards
             * @example
             * // go back 2 seconds
             * wavesurfer.skip(-2);
             */
          }, {
            key: "skip",
            value: function skip(offset) {
              var duration = this.getDuration() || 1;
              var position = this.getCurrentTime() || 0;
              position = Math.max(0, Math.min(duration, position + (offset || 0)));
              this.seekAndCenter(position / duration);
            }
            /**
             * Seeks to a position and centers the view
             *
             * @param {number} progress Between 0 (=beginning) and 1 (=end)
             * @example
             * // seek and go to the middle of the audio
             * wavesurfer.seekTo(0.5);
             */
          }, {
            key: "seekAndCenter",
            value: function seekAndCenter(progress) {
              this.seekTo(progress);
              this.drawer.recenter(progress);
            }
            /**
             * Seeks to a position
             *
             * @param {number} progress Between 0 (=beginning) and 1 (=end)
             * @emits WaveSurfer#interaction
             * @emits WaveSurfer#seek
             * @example
             * // seek to the middle of the audio
             * wavesurfer.seekTo(0.5);
             */
          }, {
            key: "seekTo",
            value: function seekTo(progress) {
              var _this8 = this;
              // return an error if progress is not a number between 0 and 1
              if (typeof progress !== 'number' || !isFinite(progress) || progress < 0 || progress > 1) {
                throw new Error('Error calling wavesurfer.seekTo, parameter must be a number between 0 and 1!');
              }
              this.fireEvent('interaction', function () {
                return _this8.seekTo(progress);
              });
              var isWebAudioBackend = this.params.backend === 'WebAudio';
              var paused = this.backend.isPaused();
              if (isWebAudioBackend && !paused) {
                this.backend.pause();
              }
              // avoid small scrolls while paused seeking
              var oldScrollParent = this.params.scrollParent;
              this.params.scrollParent = false;
              this.backend.seekTo(progress * this.getDuration());
              this.drawer.progress(progress);
              if (isWebAudioBackend && !paused) {
                this.backend.play();
              }
              this.params.scrollParent = oldScrollParent;
              this.fireEvent('seek', progress);
            }
            /**
             * Stops and goes to the beginning.
             *
             * @example wavesurfer.stop();
             */
          }, {
            key: "stop",
            value: function stop() {
              this.pause();
              this.seekTo(0);
              this.drawer.progress(0);
            }
            /**
             * Sets the ID of the audio device to use for output and returns a Promise.
             *
             * @param {string} deviceId String value representing underlying output
             * device
             * @returns {Promise} `Promise` that resolves to `undefined` when there are
             * no errors detected.
             */
          }, {
            key: "setSinkId",
            value: function setSinkId(deviceId) {
              return this.backend.setSinkId(deviceId);
            }
            /**
             * Set the playback volume.
             *
             * @param {number} newVolume A value between 0 and 1, 0 being no
             * volume and 1 being full volume.
             * @emits WaveSurfer#volume
             */
          }, {
            key: "setVolume",
            value: function setVolume(newVolume) {
              this.backend.setVolume(newVolume);
              this.fireEvent('volume', newVolume);
            }
            /**
             * Get the playback volume.
             *
             * @return {number} A value between 0 and 1, 0 being no
             * volume and 1 being full volume.
             */
          }, {
            key: "getVolume",
            value: function getVolume() {
              return this.backend.getVolume();
            }
            /**
             * Set the playback rate.
             *
             * @param {number} rate A positive number. E.g. 0.5 means half the normal
             * speed, 2 means double speed and so on.
             * @example wavesurfer.setPlaybackRate(2);
             */
          }, {
            key: "setPlaybackRate",
            value: function setPlaybackRate(rate) {
              this.backend.setPlaybackRate(rate);
            }
            /**
             * Get the playback rate.
             *
             * @return {number} The current playback rate.
             */
          }, {
            key: "getPlaybackRate",
            value: function getPlaybackRate() {
              return this.backend.getPlaybackRate();
            }
            /**
             * Toggle the volume on and off. If not currently muted it will save the
             * current volume value and turn the volume off. If currently muted then it
             * will restore the volume to the saved value, and then rest the saved
             * value.
             *
             * @example wavesurfer.toggleMute();
             */
          }, {
            key: "toggleMute",
            value: function toggleMute() {
              this.setMute(!this.isMuted);
            }
            /**
             * Enable or disable muted audio
             *
             * @param {boolean} mute Specify `true` to mute audio.
             * @emits WaveSurfer#volume
             * @emits WaveSurfer#mute
             * @example
             * // unmute
             * wavesurfer.setMute(false);
             * console.log(wavesurfer.getMute()) // logs false
             */
          }, {
            key: "setMute",
            value: function setMute(mute) {
              // ignore all muting requests if the audio is already in that state
              if (mute === this.isMuted) {
                this.fireEvent('mute', this.isMuted);
                return;
              }
              if (this.backend.setMute) {
                // Backends such as the MediaElement backend have their own handling
                // of mute, let them handle it.
                this.backend.setMute(mute);
                this.isMuted = mute;
              } else {
                if (mute) {
                  // If currently not muted then save current volume,
                  // turn off the volume and update the mute properties
                  this.savedVolume = this.backend.getVolume();
                  this.backend.setVolume(0);
                  this.isMuted = true;
                  this.fireEvent('volume', 0);
                } else {
                  // If currently muted then restore to the saved volume
                  // and update the mute properties
                  this.backend.setVolume(this.savedVolume);
                  this.isMuted = false;
                  this.fireEvent('volume', this.savedVolume);
                }
              }
              this.fireEvent('mute', this.isMuted);
            }
            /**
             * Get the current mute status.
             *
             * @example const isMuted = wavesurfer.getMute();
             * @return {boolean} Current mute status
             */
          }, {
            key: "getMute",
            value: function getMute() {
              return this.isMuted;
            }
            /**
             * Get the list of current set filters as an array.
             *
             * Filters must be set with setFilters method first
             *
             * @return {array} List of enabled filters
             */
          }, {
            key: "getFilters",
            value: function getFilters() {
              return this.backend.filters || [];
            }
            /**
             * Toggles `scrollParent` and redraws
             *
             * @example wavesurfer.toggleScroll();
             */
          }, {
            key: "toggleScroll",
            value: function toggleScroll() {
              this.params.scrollParent = !this.params.scrollParent;
              this.drawBuffer();
            }
            /**
             * Toggle mouse interaction
             *
             * @example wavesurfer.toggleInteraction();
             */
          }, {
            key: "toggleInteraction",
            value: function toggleInteraction() {
              this.params.interact = !this.params.interact;
            }
            /**
             * Get the fill color of the waveform after the cursor.
             *
             * @param {?number} channelIdx Optional index of the channel to get its wave color if splitChannels is true
             * @return {string|object} A CSS color string, or an array of CSS color strings.
             */
          }, {
            key: "getWaveColor",
            value: function getWaveColor() {
              var channelIdx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
              if (this.params.splitChannelsOptions.channelColors[channelIdx]) {
                return this.params.splitChannelsOptions.channelColors[channelIdx].waveColor;
              }
              return this.params.waveColor;
            }
            /**
             * Set the fill color of the waveform after the cursor.
             *
             * @param {string|object} color A CSS color string, or an array of CSS color strings.
             * @param {?number} channelIdx Optional index of the channel to set its wave color if splitChannels is true
             * @example wavesurfer.setWaveColor('#ddd');
             */
          }, {
            key: "setWaveColor",
            value: function setWaveColor(color) {
              var channelIdx = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
              if (this.params.splitChannelsOptions.channelColors[channelIdx]) {
                this.params.splitChannelsOptions.channelColors[channelIdx].waveColor = color;
              } else {
                this.params.waveColor = color;
              }
              this.drawBuffer();
            }
            /**
             * Get the fill color of the waveform behind the cursor.
             *
             * @param {?number} channelIdx Optional index of the channel to get its progress color if splitChannels is true
             * @return {string|object} A CSS color string, or an array of CSS color strings.
             */
          }, {
            key: "getProgressColor",
            value: function getProgressColor() {
              var channelIdx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
              if (this.params.splitChannelsOptions.channelColors[channelIdx]) {
                return this.params.splitChannelsOptions.channelColors[channelIdx].progressColor;
              }
              return this.params.progressColor;
            }
            /**
             * Set the fill color of the waveform behind the cursor.
             *
             * @param {string|object} color A CSS color string, or an array of CSS color strings.
             * @param {?number} channelIdx Optional index of the channel to set its progress color if splitChannels is true
             * @example wavesurfer.setProgressColor('#400');
             */
          }, {
            key: "setProgressColor",
            value: function setProgressColor(color, channelIdx) {
              if (this.params.splitChannelsOptions.channelColors[channelIdx]) {
                this.params.splitChannelsOptions.channelColors[channelIdx].progressColor = color;
              } else {
                this.params.progressColor = color;
              }
              this.drawBuffer();
            }
            /**
             * Get the background color of the waveform container.
             *
             * @return {string} A CSS color string.
             */
          }, {
            key: "getBackgroundColor",
            value: function getBackgroundColor() {
              return this.params.backgroundColor;
            }
            /**
             * Set the background color of the waveform container.
             *
             * @param {string} color A CSS color string.
             * @example wavesurfer.setBackgroundColor('#FF00FF');
             */
          }, {
            key: "setBackgroundColor",
            value: function setBackgroundColor(color) {
              this.params.backgroundColor = color;
              util.style(this.container, {
                background: this.params.backgroundColor
              });
            }
            /**
             * Get the fill color of the cursor indicating the playhead
             * position.
             *
             * @return {string} A CSS color string.
             */
          }, {
            key: "getCursorColor",
            value: function getCursorColor() {
              return this.params.cursorColor;
            }
            /**
             * Set the fill color of the cursor indicating the playhead
             * position.
             *
             * @param {string} color A CSS color string.
             * @example wavesurfer.setCursorColor('#222');
             */
          }, {
            key: "setCursorColor",
            value: function setCursorColor(color) {
              this.params.cursorColor = color;
              this.drawer.updateCursor();
            }
            /**
             * Get the height of the waveform.
             *
             * @return {number} Height measured in pixels.
             */
          }, {
            key: "getHeight",
            value: function getHeight() {
              return this.params.height;
            }
            /**
             * Set the height of the waveform.
             *
             * @param {number} height Height measured in pixels.
             * @example wavesurfer.setHeight(200);
             */
          }, {
            key: "setHeight",
            value: function setHeight(height) {
              this.params.height = height;
              this.drawer.setHeight(height * this.params.pixelRatio);
              this.drawBuffer();
            }
            /**
             * Hide channels from being drawn on the waveform if splitting channels.
             *
             * For example, if we want to draw only the peaks for the right stereo channel:
             *
             * const wavesurfer = new WaveSurfer.create({...splitChannels: true});
             * wavesurfer.load('stereo_audio.mp3');
             *
             * wavesurfer.setFilteredChannel([0]); <-- hide left channel peaks.
             *
             * @param {array} channelIndices Channels to be filtered out from drawing.
             * @version 4.0.0
             */
          }, {
            key: "setFilteredChannels",
            value: function setFilteredChannels(channelIndices) {
              this.params.splitChannelsOptions.filterChannels = channelIndices;
              this.drawBuffer();
            }
            /**
             * Get the correct peaks for current wave view-port and render wave
             *
             * @private
             * @emits WaveSurfer#redraw
             */
          }, {
            key: "drawBuffer",
            value: function drawBuffer() {
              var nominalWidth = Math.round(this.getDuration() * this.params.minPxPerSec * this.params.pixelRatio);
              var parentWidth = this.drawer.getWidth();
              var width = nominalWidth;
              // always start at 0 after zooming for scrolling : issue redraw left part
              var start = 0;
              var end = Math.max(start + parentWidth, width);
              // Fill container
              if (this.params.fillParent && (!this.params.scrollParent || nominalWidth < parentWidth)) {
                width = parentWidth;
                start = 0;
                end = width;
              }
              var peaks;
              if (this.params.partialRender) {
                var newRanges = this.peakCache.addRangeToPeakCache(width, start, end);
                var i;
                for (i = 0; i < newRanges.length; i++) {
                  peaks = this.backend.getPeaks(width, newRanges[i][0], newRanges[i][1]);
                  this.drawer.drawPeaks(peaks, width, newRanges[i][0], newRanges[i][1]);
                }
              } else {
                peaks = this.backend.getPeaks(width, start, end);
                this.drawer.drawPeaks(peaks, width, start, end);
              }
              this.fireEvent('redraw', peaks, width);
            }
            /**
             * Horizontally zooms the waveform in and out. It also changes the parameter
             * `minPxPerSec` and enables the `scrollParent` option. Calling the function
             * with a falsey parameter will reset the zoom state.
             *
             * @param {?number} pxPerSec Number of horizontal pixels per second of
             * audio, if none is set the waveform returns to unzoomed state
             * @emits WaveSurfer#zoom
             * @example wavesurfer.zoom(20);
             */
          }, {
            key: "zoom",
            value: function zoom(pxPerSec) {
              if (!pxPerSec) {
                this.params.minPxPerSec = this.defaultParams.minPxPerSec;
                this.params.scrollParent = false;
              } else {
                this.params.minPxPerSec = pxPerSec;
                this.params.scrollParent = true;
              }
              this.drawBuffer();
              this.drawer.progress(this.backend.getPlayedPercents());
              this.drawer.recenter(this.getCurrentTime() / this.getDuration());
              this.fireEvent('zoom', pxPerSec);
            }
            /**
             * Decode buffer and load
             *
             * @private
             * @param {ArrayBuffer} arraybuffer Buffer to process
             */
          }, {
            key: "loadArrayBuffer",
            value: function loadArrayBuffer(arraybuffer) {
              var _this9 = this;
              this.decodeArrayBuffer(arraybuffer, function (data) {
                if (!_this9.isDestroyed) {
                  _this9.loadDecodedBuffer(data);
                }
              });
            }
            /**
             * Directly load an externally decoded AudioBuffer
             *
             * @private
             * @param {AudioBuffer} buffer Buffer to process
             * @emits WaveSurfer#ready
             */
          }, {
            key: "loadDecodedBuffer",
            value: function loadDecodedBuffer(buffer) {
              this.backend.load(buffer);
              this.drawBuffer();
              this.isReady = true;
              this.fireEvent('ready');
            }
            /**
             * Loads audio data from a Blob or File object
             *
             * @param {Blob|File} blob Audio data
             * @example
             */
          }, {
            key: "loadBlob",
            value: function loadBlob(blob) {
              var _this10 = this;
              // Create file reader
              var reader = new FileReader();
              reader.addEventListener('progress', function (e) {
                return _this10.onProgress(e);
              });
              reader.addEventListener('load', function (e) {
                return _this10.loadArrayBuffer(e.target.result);
              });
              reader.addEventListener('error', function () {
                return _this10.fireEvent('error', 'Error reading file');
              });
              reader.readAsArrayBuffer(blob);
              this.empty();
            }
            /**
             * Loads audio and re-renders the waveform.
             *
             * @param {string|HTMLMediaElement} url The url of the audio file or the
             * audio element with the audio
             * @param {number[]|Number.<Array[]>} peaks Wavesurfer does not have to decode
             * the audio to render the waveform if this is specified
             * @param {?string} preload (Use with backend `MediaElement` and `MediaElementWebAudio`)
             * `'none'|'metadata'|'auto'` Preload attribute for the media element
             * @param {?number} duration The duration of the audio. This is used to
             * render the peaks data in the correct size for the audio duration (as
             * befits the current `minPxPerSec` and zoom value) without having to decode
             * the audio.
             * @returns {void}
             * @throws Will throw an error if the `url` argument is empty.
             * @example
             * // uses fetch or media element to load file (depending on backend)
             * wavesurfer.load('http://example.com/demo.wav');
             *
             * // setting preload attribute with media element backend and supplying
             * // peaks
             * wavesurfer.load(
             *   'http://example.com/demo.wav',
             *   [0.0218, 0.0183, 0.0165, 0.0198, 0.2137, 0.2888],
             *   true
             * );
             */
          }, {
            key: "load",
            value: function load(url, peaks, preload, duration) {
              if (!url) {
                throw new Error('url parameter cannot be empty');
              }
              this.empty();
              if (preload) {
                // check whether the preload attribute will be usable and if not log
                // a warning listing the reasons why not and nullify the variable
                var preloadIgnoreReasons = {
                  "Preload is not 'auto', 'none' or 'metadata'": ['auto', 'metadata', 'none'].indexOf(preload) === -1,
                  'Peaks are not provided': !peaks,
                  "Backend is not of type 'MediaElement' or 'MediaElementWebAudio'": ['MediaElement', 'MediaElementWebAudio'].indexOf(this.params.backend) === -1,
                  'Url is not of type string': typeof url !== 'string'
                };
                var activeReasons = Object.keys(preloadIgnoreReasons).filter(function (reason) {
                  return preloadIgnoreReasons[reason];
                });
                if (activeReasons.length) {
                  // eslint-disable-next-line no-console
                  console.warn('Preload parameter of wavesurfer.load will be ignored because:\n\t- ' + activeReasons.join('\n\t- '));
                  // stop invalid values from being used
                  preload = null;
                }
              }
              // loadBuffer(url, peaks, duration) requires that url is a string
              // but users can pass in a HTMLMediaElement to WaveSurfer
              if (this.params.backend === 'WebAudio' && url instanceof HTMLMediaElement) {
                url = url.src;
              }
              switch (this.params.backend) {
                case 'WebAudio':
                  return this.loadBuffer(url, peaks, duration);
                case 'MediaElement':
                case 'MediaElementWebAudio':
                  return this.loadMediaElement(url, peaks, preload, duration);
              }
            }
            /**
             * Loads audio using Web Audio buffer backend.
             *
             * @private
             * @emits WaveSurfer#waveform-ready
             * @param {string} url URL of audio file
             * @param {number[]|Number.<Array[]>} peaks Peaks data
             * @param {?number} duration Optional duration of audio file
             * @returns {void}
             */
          }, {
            key: "loadBuffer",
            value: function loadBuffer(url, peaks, duration) {
              var _this11 = this;
              var load = function load(action) {
                if (action) {
                  _this11.tmpEvents.push(_this11.once('ready', action));
                }
                return _this11.getArrayBuffer(url, function (data) {
                  return _this11.loadArrayBuffer(data);
                });
              };
              if (peaks) {
                this.backend.setPeaks(peaks, duration);
                this.drawBuffer();
                this.fireEvent('waveform-ready');
                this.tmpEvents.push(this.once('interaction', load));
              } else {
                return load();
              }
            }
            /**
             * Either create a media element, or load an existing media element.
             *
             * @private
             * @emits WaveSurfer#waveform-ready
             * @param {string|HTMLMediaElement} urlOrElt Either a path to a media file, or an
             * existing HTML5 Audio/Video Element
             * @param {number[]|Number.<Array[]>} peaks Array of peaks. Required to bypass web audio
             * dependency
             * @param {?boolean} preload Set to true if the preload attribute of the
             * audio element should be enabled
             * @param {?number} duration Optional duration of audio file
             */
          }, {
            key: "loadMediaElement",
            value: function loadMediaElement(urlOrElt, peaks, preload, duration) {
              var _this12 = this;
              var url = urlOrElt;
              if (typeof urlOrElt === 'string') {
                this.backend.load(url, this.mediaContainer, peaks, preload);
              } else {
                var elt = urlOrElt;
                this.backend.loadElt(elt, peaks);
                // If peaks are not provided,
                // url = element.src so we can get peaks with web audio
                url = elt.src;
              }
              this.tmpEvents.push(this.backend.once('canplay', function () {
                // ignore when backend was already destroyed
                if (!_this12.backend.destroyed) {
                  _this12.drawBuffer();
                  _this12.isReady = true;
                  _this12.fireEvent('ready');
                }
              }), this.backend.once('error', function (err) {
                return _this12.fireEvent('error', err);
              }));
              // If peaks are provided, render them and fire the `waveform-ready` event.
              if (peaks) {
                this.backend.setPeaks(peaks, duration);
                this.drawBuffer();
                this.fireEvent('waveform-ready');
              }
              // If no pre-decoded peaks are provided, or are provided with
              // forceDecode flag, attempt to download the audio file and decode it
              // with Web Audio.
              if ((!peaks || this.params.forceDecode) && this.backend.supportsWebAudio()) {
                this.getArrayBuffer(url, function (arraybuffer) {
                  _this12.decodeArrayBuffer(arraybuffer, function (buffer) {
                    _this12.backend.buffer = buffer;
                    _this12.backend.setPeaks(null);
                    _this12.drawBuffer();
                    _this12.fireEvent('waveform-ready');
                  });
                });
              }
            }
            /**
             * Decode an array buffer and pass data to a callback
             *
             * @private
             * @param {Object} arraybuffer The array buffer to decode
             * @param {function} callback The function to call on complete
             */
          }, {
            key: "decodeArrayBuffer",
            value: function decodeArrayBuffer(arraybuffer, callback) {
              var _this13 = this;
              if (!this.isDestroyed) {
                this.arraybuffer = arraybuffer;
                this.backend.decodeArrayBuffer(arraybuffer, function (data) {
                  // Only use the decoded data if we haven't been destroyed or
                  // another decode started in the meantime
                  if (!_this13.isDestroyed && _this13.arraybuffer == arraybuffer) {
                    callback(data);
                    _this13.arraybuffer = null;
                  }
                }, function () {
                  return _this13.fireEvent('error', 'Error decoding audiobuffer');
                });
              }
            }
            /**
             * Load an array buffer using fetch and pass the result to a callback
             *
             * @param {string} url The URL of the file object
             * @param {function} callback The function to call on complete
             * @returns {util.fetchFile} fetch call
             * @private
             */
          }, {
            key: "getArrayBuffer",
            value: function getArrayBuffer(url, callback) {
              var _this14 = this;
              var options = Object.assign({
                url: url,
                responseType: 'arraybuffer'
              }, this.params.xhr);
              var request = util.fetchFile(options);
              this.currentRequest = request;
              this.tmpEvents.push(request.on('progress', function (e) {
                _this14.onProgress(e);
              }), request.on('success', function (data) {
                callback(data);
                _this14.currentRequest = null;
              }), request.on('error', function (e) {
                _this14.fireEvent('error', e);
                _this14.currentRequest = null;
              }));
              return request;
            }
            /**
             * Called while the audio file is loading
             *
             * @private
             * @param {Event} e Progress event
             * @emits WaveSurfer#loading
             */
          }, {
            key: "onProgress",
            value: function onProgress(e) {
              var percentComplete;
              if (e.lengthComputable) {
                percentComplete = e.loaded / e.total;
              } else {
                // Approximate progress with an asymptotic
                // function, and assume downloads in the 1-3 MB range.
                percentComplete = e.loaded / (e.loaded + 1000000);
              }
              this.fireEvent('loading', Math.round(percentComplete * 100), e.target);
            }
            /**
             * Exports PCM data into a JSON array and optionally opens in a new window
             * as valid JSON Blob instance.
             *
             * @param {number} length=1024 The scale in which to export the peaks
             * @param {number} accuracy=10000
             * @param {?boolean} noWindow Set to true to disable opening a new
             * window with the JSON
             * @param {number} start Start index
             * @param {number} end End index
             * @return {Promise} Promise that resolves with array of peaks
             */
          }, {
            key: "exportPCM",
            value: function exportPCM(length, accuracy, noWindow, start, end) {
              length = length || 1024;
              start = start || 0;
              accuracy = accuracy || 10000;
              noWindow = noWindow || false;
              var peaks = this.backend.getPeaks(length, start, end);
              var arr = [].map.call(peaks, function (val) {
                return Math.round(val * accuracy) / accuracy;
              });
              return new Promise(function (resolve, reject) {
                if (!noWindow) {
                  var blobJSON = new Blob([JSON.stringify(arr)], {
                    type: 'application/json;charset=utf-8'
                  });
                  var objURL = URL.createObjectURL(blobJSON);
                  window.open(objURL);
                  URL.revokeObjectURL(objURL);
                }
                resolve(arr);
              });
            }
            /**
             * Save waveform image as data URI.
             *
             * The default format is `image/png`. Other supported types are
             * `image/jpeg` and `image/webp`.
             *
             * @param {string} format='image/png' A string indicating the image format.
             * The default format type is `image/png`.
             * @param {number} quality=1 A number between 0 and 1 indicating the image
             * quality to use for image formats that use lossy compression such as
             * `image/jpeg` and `image/webp`.
             * @param {string} type Image data type to return. Either `dataURL` (default)
             * or `blob`.
             * @return {string|string[]|Promise} When using `dataURL` type this returns
             * a single data URL or an array of data URLs, one for each canvas. When using
             * `blob` type this returns a `Promise` resolving with an array of `Blob`
             * instances, one for each canvas.
             */
          }, {
            key: "exportImage",
            value: function exportImage(format, quality, type) {
              if (!format) {
                format = 'image/png';
              }
              if (!quality) {
                quality = 1;
              }
              if (!type) {
                type = 'dataURL';
              }
              return this.drawer.getImage(format, quality, type);
            }
            /**
             * Cancel any fetch request currently in progress
             */
          }, {
            key: "cancelAjax",
            value: function cancelAjax() {
              if (this.currentRequest && this.currentRequest.controller) {
                // If the current request has a ProgressHandler, then its ReadableStream might need to be cancelled too
                // See: Wavesurfer issue #2042
                // See Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1583815
                if (this.currentRequest._reader) {
                  // Ignoring exceptions thrown by call to cancel()
                  this.currentRequest._reader.cancel().catch(function (err) {});
                }
                this.currentRequest.controller.abort();
                this.currentRequest = null;
              }
            }
            /**
             * @private
             */
          }, {
            key: "clearTmpEvents",
            value: function clearTmpEvents() {
              this.tmpEvents.forEach(function (e) {
                return e.un();
              });
            }
            /**
             * Display empty waveform.
             */
          }, {
            key: "empty",
            value: function empty() {
              if (!this.backend.isPaused()) {
                this.stop();
                this.backend.disconnectSource();
              }
              this.isReady = false;
              this.cancelAjax();
              this.clearTmpEvents();
              // empty drawer
              this.drawer.progress(0);
              this.drawer.setWidth(0);
              this.drawer.drawPeaks({
                length: this.drawer.getWidth()
              }, 0);
            }
            /**
             * Remove events, elements and disconnect WebAudio nodes.
             *
             * @emits WaveSurfer#destroy
             */
          }, {
            key: "destroy",
            value: function destroy() {
              this.destroyAllPlugins();
              this.fireEvent('destroy');
              this.cancelAjax();
              this.clearTmpEvents();
              this.unAll();
              if (this.params.responsive !== false) {
                window.removeEventListener('resize', this._onResize, true);
                window.removeEventListener('orientationchange', this._onResize, true);
              }
              if (this.backend) {
                this.backend.destroy();
                // clears memory usage
                this.backend = null;
              }
              if (this.drawer) {
                this.drawer.destroy();
              }
              this.isDestroyed = true;
              this.isReady = false;
              this.arraybuffer = null;
            }
          }], [{
            key: "create",
            value: /** @private */
            /** @private */
              /**
               * Instantiate this class, call its `init` function and returns it
               *
               * @param {WavesurferParams} params The wavesurfer parameters
               * @return {Object} WaveSurfer instance
               * @example const wavesurfer = WaveSurfer.create(params);
               */
              function create(params) {
                var wavesurfer = new WaveSurfer(params);
                return wavesurfer.init();
              }
            /**
             * The library version number is available as a static property of the
             * WaveSurfer class
             *
             * @type {String}
             * @example
             * console.log('Using wavesurfer.js ' + WaveSurfer.VERSION);
             */
          }]);
          return WaveSurfer;
        }(util.Observer);
        exports["default"] = WaveSurfer;
        _defineProperty(WaveSurfer, "VERSION", "6.4.0");
        _defineProperty(WaveSurfer, "util", util);
        module.exports = exports.default;
        /***/ }),
      /***/ "./src/webaudio.js":
      /*!*************************!*\
  !*** ./src/webaudio.js ***!
  \*************************/
      /***/ ((module, exports, __webpack_require__) => {
        "use strict";
        function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
        Object.defineProperty(exports, "__esModule", ({
          value: true
        }));
        exports["default"] = void 0;
        var util = _interopRequireWildcard(__webpack_require__(/*! ./util */ "./src/util/index.js"));
        function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
        function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
        function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } }
        function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
        function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
        function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
        function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
        function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
        function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
        function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
        function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
        function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
// using constants to prevent someone writing the string wrong
        var PLAYING = 'playing';
        var PAUSED = 'paused';
        var FINISHED = 'finished';
        /**
         * WebAudio backend
         *
         * @extends {Observer}
         */
        var WebAudio = /*#__PURE__*/function (_util$Observer) {
          _inherits(WebAudio, _util$Observer);
          var _super = _createSuper(WebAudio);
          /**
           * Construct the backend
           *
           * @param {WavesurferParams} params Wavesurfer parameters
           */
          function WebAudio(params) {
            var _defineProperty2, _this$states;
            var _this;
            _classCallCheck(this, WebAudio);
            _this = _super.call(this);
            /** @private */
            _defineProperty(_assertThisInitialized(_this), "audioContext", null);
            _defineProperty(_assertThisInitialized(_this), "offlineAudioContext", null);
            _defineProperty(_assertThisInitialized(_this), "stateBehaviors", (_defineProperty2 = {}, _defineProperty(_defineProperty2, PLAYING, {
              init: function init() {
                this.addOnAudioProcess();
              },
              getPlayedPercents: function getPlayedPercents() {
                var duration = this.getDuration();
                return this.getCurrentTime() / duration || 0;
              },
              getCurrentTime: function getCurrentTime() {
                return this.startPosition + this.getPlayedTime();
              }
            }), _defineProperty(_defineProperty2, PAUSED, {
              init: function init() {
                this.removeOnAudioProcess();
              },
              getPlayedPercents: function getPlayedPercents() {
                var duration = this.getDuration();
                return this.getCurrentTime() / duration || 0;
              },
              getCurrentTime: function getCurrentTime() {
                return this.startPosition;
              }
            }), _defineProperty(_defineProperty2, FINISHED, {
              init: function init() {
                this.removeOnAudioProcess();
                this.fireEvent('finish');
              },
              getPlayedPercents: function getPlayedPercents() {
                return 1;
              },
              getCurrentTime: function getCurrentTime() {
                return this.getDuration();
              }
            }), _defineProperty2));
            _this.params = params;
            /** ac: Audio Context instance */
            _this.ac = params.audioContext || (_this.supportsWebAudio() ? _this.getAudioContext() : {});
            /**@private */
            _this.lastPlay = _this.ac.currentTime;
            /** @private */
            _this.startPosition = 0;
            /** @private */
            _this.scheduledPause = null;
            /** @private */
            _this.states = (_this$states = {}, _defineProperty(_this$states, PLAYING, Object.create(_this.stateBehaviors[PLAYING])), _defineProperty(_this$states, PAUSED, Object.create(_this.stateBehaviors[PAUSED])), _defineProperty(_this$states, FINISHED, Object.create(_this.stateBehaviors[FINISHED])), _this$states);
            /** @private */
            _this.buffer = null;
            /** @private */
            _this.filters = [];
            /** gainNode: allows to control audio volume */
            _this.gainNode = null;
            /** @private */
            _this.mergedPeaks = null;
            /** @private */
            _this.offlineAc = null;
            /** @private */
            _this.peaks = null;
            /** @private */
            _this.playbackRate = 1;
            /** analyser: provides audio analysis information */
            _this.analyser = null;
            /** scriptNode: allows processing audio */
            _this.scriptNode = null;
            /** @private */
            _this.source = null;
            /** @private */
            _this.splitPeaks = [];
            /** @private */
            _this.state = null;
            /** @private */
            _this.explicitDuration = params.duration;
            /** @private */
            _this.sinkStreamDestination = null;
            /** @private */
            _this.sinkAudioElement = null;
            /**
             * Boolean indicating if the backend was destroyed.
             */
            _this.destroyed = false;
            return _this;
          }
          /**
           * Initialise the backend, called in `wavesurfer.createBackend()`
           */
          _createClass(WebAudio, [{
            key: "supportsWebAudio",
            value: /** scriptBufferSize: size of the processing buffer */
            /** audioContext: allows to process audio with WebAudio API */
            /** @private */
            /** @private */
              /**
               * Does the browser support this backend
               *
               * @return {boolean} Whether or not this browser supports this backend
               */
              function supportsWebAudio() {
                return !!(window.AudioContext || window.webkitAudioContext);
              }
            /**
             * Get the audio context used by this backend or create one
             *
             * @return {AudioContext} Existing audio context, or creates a new one
             */
          }, {
            key: "getAudioContext",
            value: function getAudioContext() {
              if (!window.WaveSurferAudioContext) {
                window.WaveSurferAudioContext = new (window.AudioContext || window.webkitAudioContext)();
              }
              return window.WaveSurferAudioContext;
            }
            /**
             * Get the offline audio context used by this backend or create one
             *
             * @param {number} sampleRate The sample rate to use
             * @return {OfflineAudioContext} Existing offline audio context, or creates
             * a new one
             */
          }, {
            key: "getOfflineAudioContext",
            value: function getOfflineAudioContext(sampleRate) {
              if (!window.WaveSurferOfflineAudioContext) {
                window.WaveSurferOfflineAudioContext = new (window.OfflineAudioContext || window.webkitOfflineAudioContext)(1, 2, sampleRate);
              }
              return window.WaveSurferOfflineAudioContext;
            }
          }, {
            key: "init",
            value: function init() {
              this.createVolumeNode();
              this.createScriptNode();
              this.createAnalyserNode();
              this.setState(PAUSED);
              this.setPlaybackRate(this.params.audioRate);
              this.setLength(0);
            }
            /** @private */
          }, {
            key: "disconnectFilters",
            value: function disconnectFilters() {
              if (this.filters) {
                this.filters.forEach(function (filter) {
                  filter && filter.disconnect();
                });
                this.filters = null;
                // Reconnect direct path
                this.analyser.connect(this.gainNode);
              }
            }
            /**
             * @private
             *
             * @param {string} state The new state
             */
          }, {
            key: "setState",
            value: function setState(state) {
              if (this.state !== this.states[state]) {
                this.state = this.states[state];
                this.state.init.call(this);
              }
            }
            /**
             * Unpacked `setFilters()`
             *
             * @param {...AudioNode} filters One or more filters to set
             */
          }, {
            key: "setFilter",
            value: function setFilter() {
              for (var _len = arguments.length, filters = new Array(_len), _key = 0; _key < _len; _key++) {
                filters[_key] = arguments[_key];
              }
              this.setFilters(filters);
            }
            /**
             * Insert custom Web Audio nodes into the graph
             *
             * @param {AudioNode[]} filters Packed filters array
             * @example
             * const lowpass = wavesurfer.backend.ac.createBiquadFilter();
             * wavesurfer.backend.setFilter(lowpass);
             */
          }, {
            key: "setFilters",
            value: function setFilters(filters) {
              // Remove existing filters
              this.disconnectFilters();
              // Insert filters if filter array not empty
              if (filters && filters.length) {
                this.filters = filters;
                // Disconnect direct path before inserting filters
                this.analyser.disconnect();
                // Connect each filter in turn
                filters.reduce(function (prev, curr) {
                  prev.connect(curr);
                  return curr;
                }, this.analyser).connect(this.gainNode);
              }
            }
            /** Create ScriptProcessorNode to process audio */
          }, {
            key: "createScriptNode",
            value: function createScriptNode() {
              if (this.params.audioScriptProcessor) {
                this.scriptNode = this.params.audioScriptProcessor;
              } else {
                if (this.ac.createScriptProcessor) {
                  this.scriptNode = this.ac.createScriptProcessor(WebAudio.scriptBufferSize);
                } else {
                  this.scriptNode = this.ac.createJavaScriptNode(WebAudio.scriptBufferSize);
                }
              }
              this.scriptNode.connect(this.ac.destination);
            }
            /** @private */
          }, {
            key: "addOnAudioProcess",
            value: function addOnAudioProcess() {
              var _this2 = this;
              this.scriptNode.onaudioprocess = function () {
                var time = _this2.getCurrentTime();
                if (time >= _this2.getDuration()) {
                  _this2.setState(FINISHED);
                  _this2.fireEvent('pause');
                } else if (time >= _this2.scheduledPause) {
                  _this2.pause();
                } else if (_this2.state === _this2.states[PLAYING]) {
                  _this2.fireEvent('audioprocess', time);
                }
              };
            }
            /** @private */
          }, {
            key: "removeOnAudioProcess",
            value: function removeOnAudioProcess() {
              this.scriptNode.onaudioprocess = null;
            }
            /** Create analyser node to perform audio analysis */
          }, {
            key: "createAnalyserNode",
            value: function createAnalyserNode() {
              this.analyser = this.ac.createAnalyser();
              this.analyser.connect(this.gainNode);
            }
            /**
             * Create the gain node needed to control the playback volume.
             *
             */
          }, {
            key: "createVolumeNode",
            value: function createVolumeNode() {
              // Create gain node using the AudioContext
              if (this.ac.createGain) {
                this.gainNode = this.ac.createGain();
              } else {
                this.gainNode = this.ac.createGainNode();
              }
              // Add the gain node to the graph
              this.gainNode.connect(this.ac.destination);
            }
            /**
             * Set the sink id for the media player
             *
             * @param {string} deviceId String value representing audio device id.
             * @returns {Promise} A Promise that resolves to `undefined` when there
             * are no errors.
             */
          }, {
            key: "setSinkId",
            value: function setSinkId(deviceId) {
              if (deviceId) {
                /**
                 * The webaudio API doesn't currently support setting the device
                 * output. Here we create an HTMLAudioElement, connect the
                 * webaudio stream to that element and setSinkId there.
                 */
                if (!this.sinkAudioElement) {
                  this.sinkAudioElement = new window.Audio();
                  // autoplay is necessary since we're not invoking .play()
                  this.sinkAudioElement.autoplay = true;
                }
                if (!this.sinkAudioElement.setSinkId) {
                  return Promise.reject(new Error('setSinkId is not supported in your browser'));
                }
                if (!this.sinkStreamDestination) {
                  this.sinkStreamDestination = this.ac.createMediaStreamDestination();
                }
                this.gainNode.disconnect();
                this.gainNode.connect(this.sinkStreamDestination);
                this.sinkAudioElement.srcObject = this.sinkStreamDestination.stream;
                return this.sinkAudioElement.setSinkId(deviceId);
              } else {
                return Promise.reject(new Error('Invalid deviceId: ' + deviceId));
              }
            }
            /**
             * Set the audio volume
             *
             * @param {number} value A floating point value between 0 and 1.
             */
          }, {
            key: "setVolume",
            value: function setVolume(value) {
              this.gainNode.gain.setValueAtTime(value, this.ac.currentTime);
            }
            /**
             * Get the current volume
             *
             * @return {number} value A floating point value between 0 and 1.
             */
          }, {
            key: "getVolume",
            value: function getVolume() {
              return this.gainNode.gain.value;
            }
            /**
             * Decode an array buffer and pass data to a callback
             *
             * @private
             * @param {ArrayBuffer} arraybuffer The array buffer to decode
             * @param {function} callback The function to call on complete.
             * @param {function} errback The function to call on error.
             */
          }, {
            key: "decodeArrayBuffer",
            value: function decodeArrayBuffer(arraybuffer, callback, errback) {
              if (!this.offlineAc) {
                this.offlineAc = this.getOfflineAudioContext(this.ac && this.ac.sampleRate ? this.ac.sampleRate : 44100);
              }
              if ('webkitAudioContext' in window) {
                // Safari: no support for Promise-based decodeAudioData enabled
                // Enable it in Safari using the Experimental Features > Modern WebAudio API option
                this.offlineAc.decodeAudioData(arraybuffer, function (data) {
                  return callback(data);
                }, errback);
              } else {
                this.offlineAc.decodeAudioData(arraybuffer).then(function (data) {
                  return callback(data);
                }).catch(function (err) {
                  return errback(err);
                });
              }
            }
            /**
             * Set pre-decoded peaks
             *
             * @param {number[]|Number.<Array[]>} peaks Peaks data
             * @param {?number} duration Explicit duration
             */
          }, {
            key: "setPeaks",
            value: function setPeaks(peaks, duration) {
              if (duration != null) {
                this.explicitDuration = duration;
              }
              this.peaks = peaks;
            }
            /**
             * Set the rendered length (different from the length of the audio)
             *
             * @param {number} length The rendered length
             */
          }, {
            key: "setLength",
            value: function setLength(length) {
              // No resize, we can preserve the cached peaks.
              if (this.mergedPeaks && length == 2 * this.mergedPeaks.length - 1 + 2) {
                return;
              }
              this.splitPeaks = [];
              this.mergedPeaks = [];
              // Set the last element of the sparse array so the peak arrays are
              // appropriately sized for other calculations.
              var channels = this.buffer ? this.buffer.numberOfChannels : 1;
              var c;
              for (c = 0; c < channels; c++) {
                this.splitPeaks[c] = [];
                this.splitPeaks[c][2 * (length - 1)] = 0;
                this.splitPeaks[c][2 * (length - 1) + 1] = 0;
              }
              this.mergedPeaks[2 * (length - 1)] = 0;
              this.mergedPeaks[2 * (length - 1) + 1] = 0;
            }
            /**
             * Compute the max and min value of the waveform when broken into <length> subranges.
             *
             * @param {number} length How many subranges to break the waveform into.
             * @param {number} first First sample in the required range.
             * @param {number} last Last sample in the required range.
             * @return {number[]|Number.<Array[]>} Array of 2*<length> peaks or array of arrays of
             * peaks consisting of (max, min) values for each subrange.
             */
          }, {
            key: "getPeaks",
            value: function getPeaks(length, first, last) {
              if (this.peaks) {
                return this.peaks;
              }
              if (!this.buffer) {
                return [];
              }
              first = first || 0;
              last = last || length - 1;
              this.setLength(length);
              if (!this.buffer) {
                return this.params.splitChannels ? this.splitPeaks : this.mergedPeaks;
              }
              /**
               * The following snippet fixes a buffering data issue on the Safari
               * browser which returned undefined It creates the missing buffer based
               * on 1 channel, 4096 samples and the sampleRate from the current
               * webaudio context 4096 samples seemed to be the best fit for rendering
               * will review this code once a stable version of Safari TP is out
               */
              if (!this.buffer.length) {
                var newBuffer = this.createBuffer(1, 4096, this.sampleRate);
                this.buffer = newBuffer.buffer;
              }
              var sampleSize = this.buffer.length / length;
              var sampleStep = ~~(sampleSize / 10) || 1;
              var channels = this.buffer.numberOfChannels;
              var c;
              for (c = 0; c < channels; c++) {
                var peaks = this.splitPeaks[c];
                var chan = this.buffer.getChannelData(c);
                var i = void 0;
                for (i = first; i <= last; i++) {
                  var start = ~~(i * sampleSize);
                  var end = ~~(start + sampleSize);
                  /**
                   * Initialize the max and min to the first sample of this
                   * subrange, so that even if the samples are entirely
                   * on one side of zero, we still return the true max and
                   * min values in the subrange.
                   */
                  var min = chan[start];
                  var max = min;
                  var j = void 0;
                  for (j = start; j < end; j += sampleStep) {
                    var value = chan[j];
                    if (value > max) {
                      max = value;
                    }
                    if (value < min) {
                      min = value;
                    }
                  }
                  peaks[2 * i] = max;
                  peaks[2 * i + 1] = min;
                  if (c == 0 || max > this.mergedPeaks[2 * i]) {
                    this.mergedPeaks[2 * i] = max;
                  }
                  if (c == 0 || min < this.mergedPeaks[2 * i + 1]) {
                    this.mergedPeaks[2 * i + 1] = min;
                  }
                }
              }
              return this.params.splitChannels ? this.splitPeaks : this.mergedPeaks;
            }
            /**
             * Get the position from 0 to 1
             *
             * @return {number} Position
             */
          }, {
            key: "getPlayedPercents",
            value: function getPlayedPercents() {
              return this.state.getPlayedPercents.call(this);
            }
            /** @private */
          }, {
            key: "disconnectSource",
            value: function disconnectSource() {
              if (this.source) {
                this.source.disconnect();
              }
            }
            /**
             * Destroy all references with WebAudio, disconnecting audio nodes and closing Audio Context
             */
          }, {
            key: "destroyWebAudio",
            value: function destroyWebAudio() {
              this.disconnectFilters();
              this.disconnectSource();
              this.gainNode.disconnect();
              this.scriptNode.disconnect();
              this.analyser.disconnect();
              // close the audioContext if closeAudioContext option is set to true
              if (this.params.closeAudioContext) {
                // check if browser supports AudioContext.close()
                if (typeof this.ac.close === 'function' && this.ac.state != 'closed') {
                  this.ac.close();
                }
                // clear the reference to the audiocontext
                this.ac = null;
                // clear the actual audiocontext, either passed as param or the
                // global singleton
                if (!this.params.audioContext) {
                  window.WaveSurferAudioContext = null;
                } else {
                  this.params.audioContext = null;
                }
                // clear the offlineAudioContext
                window.WaveSurferOfflineAudioContext = null;
              }
              // disconnect resources used by setSinkId
              if (this.sinkStreamDestination) {
                this.sinkAudioElement.pause();
                this.sinkAudioElement.srcObject = null;
                this.sinkStreamDestination.disconnect();
                this.sinkStreamDestination = null;
              }
            }
            /**
             * This is called when wavesurfer is destroyed
             */
          }, {
            key: "destroy",
            value: function destroy() {
              if (!this.isPaused()) {
                this.pause();
              }
              this.unAll();
              this.buffer = null;
              this.destroyed = true;
              this.destroyWebAudio();
            }
            /**
             * Loaded a decoded audio buffer
             *
             * @param {Object} buffer Decoded audio buffer to load
             */
          }, {
            key: "load",
            value: function load(buffer) {
              this.startPosition = 0;
              this.lastPlay = this.ac.currentTime;
              this.buffer = buffer;
              this.createSource();
            }
            /** @private */
          }, {
            key: "createSource",
            value: function createSource() {
              this.disconnectSource();
              this.source = this.ac.createBufferSource();
              // adjust for old browsers
              this.source.start = this.source.start || this.source.noteGrainOn;
              this.source.stop = this.source.stop || this.source.noteOff;
              this.setPlaybackRate(this.playbackRate);
              this.source.buffer = this.buffer;
              this.source.connect(this.analyser);
            }
            /**
             * @private
             *
             * some browsers require an explicit call to #resume before they will play back audio
             */
          }, {
            key: "resumeAudioContext",
            value: function resumeAudioContext() {
              if (this.ac.state == 'suspended') {
                this.ac.resume && this.ac.resume();
              }
            }
            /**
             * Used by `wavesurfer.isPlaying()` and `wavesurfer.playPause()`
             *
             * @return {boolean} Whether or not this backend is currently paused
             */
          }, {
            key: "isPaused",
            value: function isPaused() {
              return this.state !== this.states[PLAYING];
            }
            /**
             * Used by `wavesurfer.getDuration()`
             *
             * @return {number} Duration of loaded buffer
             */
          }, {
            key: "getDuration",
            value: function getDuration() {
              if (this.explicitDuration) {
                return this.explicitDuration;
              }
              if (!this.buffer) {
                return 0;
              }
              return this.buffer.duration;
            }
            /**
             * Used by `wavesurfer.seekTo()`
             *
             * @param {number} start Position to start at in seconds
             * @param {number} end Position to end at in seconds
             * @return {{start: number, end: number}} Object containing start and end
             * positions
             */
          }, {
            key: "seekTo",
            value: function seekTo(start, end) {
              if (!this.buffer) {
                return;
              }
              this.scheduledPause = null;
              if (start == null) {
                start = this.getCurrentTime();
                if (start >= this.getDuration()) {
                  start = 0;
                }
              }
              if (end == null) {
                end = this.getDuration();
              }
              this.startPosition = start;
              this.lastPlay = this.ac.currentTime;
              if (this.state === this.states[FINISHED]) {
                this.setState(PAUSED);
              }
              return {
                start: start,
                end: end
              };
            }
            /**
             * Get the playback position in seconds
             *
             * @return {number} The playback position in seconds
             */
          }, {
            key: "getPlayedTime",
            value: function getPlayedTime() {
              return (this.ac.currentTime - this.lastPlay) * this.playbackRate;
            }
            /**
             * Plays the loaded audio region.
             *
             * @param {number} start Start offset in seconds, relative to the beginning
             * of a clip.
             * @param {number} end When to stop relative to the beginning of a clip.
             */
          }, {
            key: "play",
            value: function play(start, end) {
              if (!this.buffer) {
                return;
              }
              // need to re-create source on each playback
              this.createSource();
              var adjustedTime = this.seekTo(start, end);
              start = adjustedTime.start;
              end = adjustedTime.end;
              this.scheduledPause = end;
              this.source.start(0, start);
              this.resumeAudioContext();
              this.setState(PLAYING);
              this.fireEvent('play');
            }
            /**
             * Pauses the loaded audio.
             */
          }, {
            key: "pause",
            value: function pause() {
              this.scheduledPause = null;
              this.startPosition += this.getPlayedTime();
              try {
                this.source && this.source.stop(0);
              } catch (err) {
                // Calling stop can throw the following 2 errors:
                // - RangeError (The value specified for when is negative.)
                // - InvalidStateNode (The node has not been started by calling start().)
                // We can safely ignore both errors, because:
                // - The range is surely correct
                // - The node might not have been started yet, in which case we just want to carry on without causing any trouble.
              }
              this.setState(PAUSED);
              this.fireEvent('pause');
            }
            /**
             * Returns the current time in seconds relative to the audio-clip's
             * duration.
             *
             * @return {number} The current time in seconds
             */
          }, {
            key: "getCurrentTime",
            value: function getCurrentTime() {
              return this.state.getCurrentTime.call(this);
            }
            /**
             * Returns the current playback rate. (0=no playback, 1=normal playback)
             *
             * @return {number} The current playback rate
             */
          }, {
            key: "getPlaybackRate",
            value: function getPlaybackRate() {
              return this.playbackRate;
            }
            /**
             * Set the audio source playback rate.
             *
             * @param {number} value The playback rate to use
             */
          }, {
            key: "setPlaybackRate",
            value: function setPlaybackRate(value) {
              this.playbackRate = value || 1;
              this.source && this.source.playbackRate.setValueAtTime(this.playbackRate, this.ac.currentTime);
            }
            /**
             * Set a point in seconds for playback to stop at.
             *
             * @param {number} end Position to end at
             * @version 3.3.0
             */
          }, {
            key: "setPlayEnd",
            value: function setPlayEnd(end) {
              this.scheduledPause = end;
            }
          }]);
          return WebAudio;
        }(util.Observer);
        exports["default"] = WebAudio;
        _defineProperty(WebAudio, "scriptBufferSize", 256);
        module.exports = exports.default;
        /***/ }),
      /***/ "./node_modules/debounce/index.js":
      /*!****************************************!*\
  !*** ./node_modules/debounce/index.js ***!
  \****************************************/
      /***/ ((module) => {
        /**
         * Returns a function, that, as long as it continues to be invoked, will not
         * be triggered. The function will be called after it stops being called for
         * N milliseconds. If `immediate` is passed, trigger the function on the
         * leading edge, instead of the trailing. The function also has a property 'clear'
         * that is a function which will clear the timer to prevent previously scheduled executions.
         *
         * @source underscore.js
         * @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/
         * @param {Function} function to wrap
         * @param {Number} timeout in ms (`100`)
         * @param {Boolean} whether to execute at the beginning (`false`)
         * @api public
         */
        function debounce(func, wait, immediate){
          var timeout, args, context, timestamp, result;
          if (null == wait) wait = 100;
          function later() {
            var last = Date.now() - timestamp;
            if (last < wait && last >= 0) {
              timeout = setTimeout(later, wait - last);
            } else {
              timeout = null;
              if (!immediate) {
                result = func.apply(context, args);
                context = args = null;
              }
            }
          };
          var debounced = function(){
            context = this;
            args = arguments;
            timestamp = Date.now();
            var callNow = immediate && !timeout;
            if (!timeout) timeout = setTimeout(later, wait);
            if (callNow) {
              result = func.apply(context, args);
              context = args = null;
            }
            return result;
          };
          debounced.clear = function() {
            if (timeout) {
              clearTimeout(timeout);
              timeout = null;
            }
          };
          debounced.flush = function() {
            if (timeout) {
              result = func.apply(context, args);
              context = args = null;
              clearTimeout(timeout);
              timeout = null;
            }
          };
          return debounced;
        };
// Adds compatibility for ES modules
        debounce.debounce = debounce;
        module.exports = debounce;
        /***/ })
      /******/ 	});
    /************************************************************************/
    /******/ 	// The module cache
    /******/ 	var __webpack_module_cache__ = {};
    /******/
    /******/ 	// The require function
    /******/ 	function __webpack_require__(moduleId) {
      /******/ 		// Check if module is in cache
      /******/ 		var cachedModule = __webpack_module_cache__[moduleId];
      /******/ 		if (cachedModule !== undefined) {
        /******/ 			return cachedModule.exports;
        /******/ 		}
      /******/ 		// Create a new module (and put it into the cache)
      /******/ 		var module = __webpack_module_cache__[moduleId] = {
        /******/ 			// no module.id needed
        /******/ 			// no module.loaded needed
        /******/ 			exports: {}
        /******/ 		};
      /******/
      /******/ 		// Execute the module function
      /******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
      /******/
      /******/ 		// Return the exports of the module
      /******/ 		return module.exports;
      /******/ 	}
    /******/
    /************************************************************************/
    /******/
    /******/ 	// startup
    /******/ 	// Load entry module and return exports
    /******/ 	// This entry module is referenced by other modules so it can't be inlined
    /******/ 	var __webpack_exports__ = __webpack_require__("./src/wavesurfer.js");
    /******/
    /******/ 	return __webpack_exports__;
    /******/ })()
    ;
});
//# sourceMappingURL=/Scripts/modules/wavesurfer.js.map;;
/*! Magnific Popup - v1.1.0 - 2016-02-20
* http://dimsemenov.com/plugins/magnific-popup/
* Copyright (c) 2016 Dmitry Semenov; */
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):window.jQuery||window.Zepto)}(function(a){var b,c,d,e,f,g,h="Close",i="BeforeClose",j="AfterClose",k="BeforeAppend",l="MarkupParse",m="Open",n="Change",o="mfp",p="."+o,q="mfp-ready",r="mfp-removing",s="mfp-prevent-close",t=function(){},u=!!window.jQuery,v=a(window),w=function(a,c){b.ev.on(o+a+p,c)},x=function(b,c,d,e){var f=document.createElement("div");return f.className="mfp-"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},y=function(c,d){b.ev.triggerHandler(o+c,d),b.st.callbacks&&(c=c.charAt(0).toLowerCase()+c.slice(1),b.st.callbacks[c]&&b.st.callbacks[c].apply(b,a.isArray(d)?d:[d]))},z=function(c){return c===g&&b.currTemplate.closeBtn||(b.currTemplate.closeBtn=a(b.st.closeMarkup.replace("%title%",b.st.tClose)),g=c),b.currTemplate.closeBtn},A=function(){a.magnificPopup.instance||(b=new t,b.init(),a.magnificPopup.instance=b)},B=function(){var a=document.createElement("p").style,b=["ms","O","Moz","Webkit"];if(void 0!==a.transition)return!0;for(;b.length;)if(b.pop()+"Transition"in a)return!0;return!1};t.prototype={constructor:t,init:function(){var c=navigator.appVersion;b.isLowIE=b.isIE8=document.all&&!document.addEventListener,b.isAndroid=/android/gi.test(c),b.isIOS=/iphone|ipad|ipod/gi.test(c),b.supportsTransition=B(),b.probablyMobile=b.isAndroid||b.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),d=a(document),b.popupsCache={}},open:function(c){var e;if(c.isObj===!1){b.items=c.items.toArray(),b.index=0;var g,h=c.items;for(e=0;e<h.length;e++)if(g=h[e],g.parsed&&(g=g.el[0]),g===c.el[0]){b.index=e;break}}else b.items=a.isArray(c.items)?c.items:[c.items],b.index=c.index||0;if(b.isOpen)return void b.updateItemHTML();b.types=[],f="",c.mainEl&&c.mainEl.length?b.ev=c.mainEl.eq(0):b.ev=d,c.key?(b.popupsCache[c.key]||(b.popupsCache[c.key]={}),b.currTemplate=b.popupsCache[c.key]):b.currTemplate={},b.st=a.extend(!0,{},a.magnificPopup.defaults,c),b.fixedContentPos="auto"===b.st.fixedContentPos?!b.probablyMobile:b.st.fixedContentPos,b.st.modal&&(b.st.closeOnContentClick=!1,b.st.closeOnBgClick=!1,b.st.showCloseBtn=!1,b.st.enableEscapeKey=!1),b.bgOverlay||(b.bgOverlay=x("bg").on("click"+p,function(){b.close()}),b.wrap=x("wrap").attr("tabindex",-1).on("click"+p,function(a){b._checkIfClose(a.target)&&b.close()}),b.container=x("container",b.wrap)),b.contentContainer=x("content"),b.st.preloader&&(b.preloader=x("preloader",b.container,b.st.tLoading));var i=a.magnificPopup.modules;for(e=0;e<i.length;e++){var j=i[e];j=j.charAt(0).toUpperCase()+j.slice(1),b["init"+j].call(b)}y("BeforeOpen"),b.st.showCloseBtn&&(b.st.closeBtnInside?(w(l,function(a,b,c,d){c.close_replaceWith=z(d.type)}),f+=" mfp-close-btn-in"):b.wrap.append(z())),b.st.alignTop&&(f+=" mfp-align-top"),b.fixedContentPos?b.wrap.css({overflow:b.st.overflowY,overflowX:"hidden",overflowY:b.st.overflowY}):b.wrap.css({top:v.scrollTop(),position:"absolute"}),(b.st.fixedBgPos===!1||"auto"===b.st.fixedBgPos&&!b.fixedContentPos)&&b.bgOverlay.css({height:d.height(),position:"absolute"}),b.st.enableEscapeKey&&d.on("keyup"+p,function(a){27===a.keyCode&&b.close()}),v.on("resize"+p,function(){b.updateSize()}),b.st.closeOnContentClick||(f+=" mfp-auto-cursor"),f&&b.wrap.addClass(f);var k=b.wH=v.height(),n={};if(b.fixedContentPos&&b._hasScrollBar(k)){var o=b._getScrollbarSize();o&&(n.marginRight=o)}b.fixedContentPos&&(b.isIE7?a("body, html").css("overflow","hidden"):n.overflow="hidden");var r=b.st.mainClass;return b.isIE7&&(r+=" mfp-ie7"),r&&b._addClassToMFP(r),b.updateItemHTML(),y("BuildControls"),a("html").css(n),b.bgOverlay.add(b.wrap).prependTo(b.st.prependTo||a(document.body)),b._lastFocusedEl=document.activeElement,setTimeout(function(){b.content?(b._addClassToMFP(q),b._setFocus()):b.bgOverlay.addClass(q),d.on("focusin"+p,b._onFocusIn)},16),b.isOpen=!0,b.updateSize(k),y(m),c},close:function(){b.isOpen&&(y(i),b.isOpen=!1,b.st.removalDelay&&!b.isLowIE&&b.supportsTransition?(b._addClassToMFP(r),setTimeout(function(){b._close()},b.st.removalDelay)):b._close())},_close:function(){y(h);var c=r+" "+q+" ";if(b.bgOverlay.detach(),b.wrap.detach(),b.container.empty(),b.st.mainClass&&(c+=b.st.mainClass+" "),b._removeClassFromMFP(c),b.fixedContentPos){var e={marginRight:""};b.isIE7?a("body, html").css("overflow",""):e.overflow="",a("html").css(e)}d.off("keyup"+p+" focusin"+p),b.ev.off(p),b.wrap.attr("class","mfp-wrap").removeAttr("style"),b.bgOverlay.attr("class","mfp-bg"),b.container.attr("class","mfp-container"),!b.st.showCloseBtn||b.st.closeBtnInside&&b.currTemplate[b.currItem.type]!==!0||b.currTemplate.closeBtn&&b.currTemplate.closeBtn.detach(),b.st.autoFocusLast&&b._lastFocusedEl&&a(b._lastFocusedEl).focus(),b.currItem=null,b.content=null,b.currTemplate=null,b.prevHeight=0,y(j)},updateSize:function(a){if(b.isIOS){var c=document.documentElement.clientWidth/window.innerWidth,d=window.innerHeight*c;b.wrap.css("height",d),b.wH=d}else b.wH=a||v.height();b.fixedContentPos||b.wrap.css("height",b.wH),y("Resize")},updateItemHTML:function(){var c=b.items[b.index];b.contentContainer.detach(),b.content&&b.content.detach(),c.parsed||(c=b.parseEl(b.index));var d=c.type;if(y("BeforeChange",[b.currItem?b.currItem.type:"",d]),b.currItem=c,!b.currTemplate[d]){var f=b.st[d]?b.st[d].markup:!1;y("FirstMarkupParse",f),f?b.currTemplate[d]=a(f):b.currTemplate[d]=!0}e&&e!==c.type&&b.container.removeClass("mfp-"+e+"-holder");var g=b["get"+d.charAt(0).toUpperCase()+d.slice(1)](c,b.currTemplate[d]);b.appendContent(g,d),c.preloaded=!0,y(n,c),e=c.type,b.container.prepend(b.contentContainer),y("AfterChange")},appendContent:function(a,c){b.content=a,a?b.st.showCloseBtn&&b.st.closeBtnInside&&b.currTemplate[c]===!0?b.content.find(".mfp-close").length||b.content.append(z()):b.content=a:b.content="",y(k),b.container.addClass("mfp-"+c+"-holder"),b.contentContainer.append(b.content)},parseEl:function(c){var d,e=b.items[c];if(e.tagName?e={el:a(e)}:(d=e.type,e={data:e,src:e.src}),e.el){for(var f=b.types,g=0;g<f.length;g++)if(e.el.hasClass("mfp-"+f[g])){d=f[g];break}e.src=e.el.attr("data-mfp-src"),e.src||(e.src=e.el.attr("href"))}return e.type=d||b.st.type||"inline",e.index=c,e.parsed=!0,b.items[c]=e,y("ElementParse",e),b.items[c]},addGroup:function(a,c){var d=function(d){d.mfpEl=this,b._openClick(d,a,c)};c||(c={});var e="click.magnificPopup";c.mainEl=a,c.items?(c.isObj=!0,a.off(e).on(e,d)):(c.isObj=!1,c.delegate?a.off(e).on(e,c.delegate,d):(c.items=a,a.off(e).on(e,d)))},_openClick:function(c,d,e){var f=void 0!==e.midClick?e.midClick:a.magnificPopup.defaults.midClick;if(f||!(2===c.which||c.ctrlKey||c.metaKey||c.altKey||c.shiftKey)){var g=void 0!==e.disableOn?e.disableOn:a.magnificPopup.defaults.disableOn;if(g)if(a.isFunction(g)){if(!g.call(b))return!0}else if(v.width()<g)return!0;c.type&&(c.preventDefault(),b.isOpen&&c.stopPropagation()),e.el=a(c.mfpEl),e.delegate&&(e.items=d.find(e.delegate)),b.open(e)}},updateStatus:function(a,d){if(b.preloader){c!==a&&b.container.removeClass("mfp-s-"+c),d||"loading"!==a||(d=b.st.tLoading);var e={status:a,text:d};y("UpdateStatus",e),a=e.status,d=e.text,b.preloader.html(d),b.preloader.find("a").on("click",function(a){a.stopImmediatePropagation()}),b.container.addClass("mfp-s-"+a),c=a}},_checkIfClose:function(c){if(!a(c).hasClass(s)){var d=b.st.closeOnContentClick,e=b.st.closeOnBgClick;if(d&&e)return!0;if(!b.content||a(c).hasClass("mfp-close")||b.preloader&&c===b.preloader[0])return!0;if(c===b.content[0]||a.contains(b.content[0],c)){if(d)return!0}else if(e&&a.contains(document,c))return!0;return!1}},_addClassToMFP:function(a){b.bgOverlay.addClass(a),b.wrap.addClass(a)},_removeClassFromMFP:function(a){this.bgOverlay.removeClass(a),b.wrap.removeClass(a)},_hasScrollBar:function(a){return(b.isIE7?d.height():document.body.scrollHeight)>(a||v.height())},_setFocus:function(){(b.st.focus?b.content.find(b.st.focus).eq(0):b.wrap).focus()},_onFocusIn:function(c){return c.target===b.wrap[0]||a.contains(b.wrap[0],c.target)?void 0:(b._setFocus(),!1)},_parseMarkup:function(b,c,d){var e;d.data&&(c=a.extend(d.data,c)),y(l,[b,c,d]),a.each(c,function(c,d){if(void 0===d||d===!1)return!0;if(e=c.split("_"),e.length>1){var f=b.find(p+"-"+e[0]);if(f.length>0){var g=e[1];"replaceWith"===g?f[0]!==d[0]&&f.replaceWith(d):"img"===g?f.is("img")?f.attr("src",d):f.replaceWith(a("<img>").attr("src",d).attr("class",f.attr("class"))):f.attr(e[1],d)}}else b.find(p+"-"+c).html(d)})},_getScrollbarSize:function(){if(void 0===b.scrollbarSize){var a=document.createElement("div");a.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(a),b.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return b.scrollbarSize}},a.magnificPopup={instance:null,proto:t.prototype,modules:[],open:function(b,c){return A(),b=b?a.extend(!0,{},b):{},b.isObj=!0,b.index=c||0,this.instance.open(b)},close:function(){return a.magnificPopup.instance&&a.magnificPopup.instance.close()},registerModule:function(b,c){c.options&&(a.magnificPopup.defaults[b]=c.options),a.extend(this.proto,c.proto),this.modules.push(b)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">&#215;</button>',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}},a.fn.magnificPopup=function(c){A();var d=a(this);if("string"==typeof c)if("open"===c){var e,f=u?d.data("magnificPopup"):d[0].magnificPopup,g=parseInt(arguments[1],10)||0;f.items?e=f.items[g]:(e=d,f.delegate&&(e=e.find(f.delegate)),e=e.eq(g)),b._openClick({mfpEl:e},d,f)}else b.isOpen&&b[c].apply(b,Array.prototype.slice.call(arguments,1));else c=a.extend(!0,{},c),u?d.data("magnificPopup",c):d[0].magnificPopup=c,b.addGroup(d,c);return d};var C,D,E,F="inline",G=function(){E&&(D.after(E.addClass(C)).detach(),E=null)};a.magnificPopup.registerModule(F,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){b.types.push(F),w(h+"."+F,function(){G()})},getInline:function(c,d){if(G(),c.src){var e=b.st.inline,f=a(c.src);if(f.length){var g=f[0].parentNode;g&&g.tagName&&(D||(C=e.hiddenClass,D=x(C),C="mfp-"+C),E=f.after(D).detach().removeClass(C)),b.updateStatus("ready")}else b.updateStatus("error",e.tNotFound),f=a("<div>");return c.inlineElement=f,f}return b.updateStatus("ready"),b._parseMarkup(d,{},c),d}}});var H,I="ajax",J=function(){H&&a(document.body).removeClass(H)},K=function(){J(),b.req&&b.req.abort()};a.magnificPopup.registerModule(I,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){b.types.push(I),H=b.st.ajax.cursor,w(h+"."+I,K),w("BeforeChange."+I,K)},getAjax:function(c){H&&a(document.body).addClass(H),b.updateStatus("loading");var d=a.extend({url:c.src,success:function(d,e,f){var g={data:d,xhr:f};y("ParseAjax",g),b.appendContent(a(g.data),I),c.finished=!0,J(),b._setFocus(),setTimeout(function(){b.wrap.addClass(q)},16),b.updateStatus("ready"),y("AjaxContentAdded")},error:function(){J(),c.finished=c.loadError=!0,b.updateStatus("error",b.st.ajax.tError.replace("%url%",c.src))}},b.st.ajax.settings);return b.req=a.ajax(d),""}}});var L,M=function(c){if(c.data&&void 0!==c.data.title)return c.data.title;var d=b.st.image.titleSrc;if(d){if(a.isFunction(d))return d.call(b,c);if(c.el)return c.el.attr(d)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var c=b.st.image,d=".image";b.types.push("image"),w(m+d,function(){"image"===b.currItem.type&&c.cursor&&a(document.body).addClass(c.cursor)}),w(h+d,function(){c.cursor&&a(document.body).removeClass(c.cursor),v.off("resize"+p)}),w("Resize"+d,b.resizeImage),b.isLowIE&&w("AfterChange",b.resizeImage)},resizeImage:function(){var a=b.currItem;if(a&&a.img&&b.st.image.verticalFit){var c=0;b.isLowIE&&(c=parseInt(a.img.css("padding-top"),10)+parseInt(a.img.css("padding-bottom"),10)),a.img.css("max-height",b.wH-c)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,L&&clearInterval(L),a.isCheckingImgSize=!1,y("ImageHasSize",a),a.imgHidden&&(b.content&&b.content.removeClass("mfp-loading"),a.imgHidden=!1))},findImageSize:function(a){var c=0,d=a.img[0],e=function(f){L&&clearInterval(L),L=setInterval(function(){return d.naturalWidth>0?void b._onImageHasSize(a):(c>200&&clearInterval(L),c++,void(3===c?e(10):40===c?e(50):100===c&&e(500)))},f)};e(1)},getImage:function(c,d){var e=0,f=function(){c&&(c.img[0].complete?(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("ready")),c.hasSize=!0,c.loaded=!0,y("ImageLoadComplete")):(e++,200>e?setTimeout(f,100):g()))},g=function(){c&&(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("error",h.tError.replace("%url%",c.src))),c.hasSize=!0,c.loaded=!0,c.loadError=!0)},h=b.st.image,i=d.find(".mfp-img");if(i.length){var j=document.createElement("img");j.className="mfp-img",c.el&&c.el.find("img").length&&(j.alt=c.el.find("img").attr("alt")),c.img=a(j).on("load.mfploader",f).on("error.mfploader",g),j.src=c.src,i.is("img")&&(c.img=c.img.clone()),j=c.img[0],j.naturalWidth>0?c.hasSize=!0:j.width||(c.hasSize=!1)}return b._parseMarkup(d,{title:M(c),img_replaceWith:c.img},c),b.resizeImage(),c.hasSize?(L&&clearInterval(L),c.loadError?(d.addClass("mfp-loading"),b.updateStatus("error",h.tError.replace("%url%",c.src))):(d.removeClass("mfp-loading"),b.updateStatus("ready")),d):(b.updateStatus("loading"),c.loading=!0,c.hasSize||(c.imgHidden=!0,d.addClass("mfp-loading"),b.findImageSize(c)),d)}}});var N,O=function(){return void 0===N&&(N=void 0!==document.createElement("p").style.MozTransform),N};a.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return a.is("img")?a:a.find("img")}},proto:{initZoom:function(){var a,c=b.st.zoom,d=".zoom";if(c.enabled&&b.supportsTransition){var e,f,g=c.duration,j=function(a){var b=a.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),d="all "+c.duration/1e3+"s "+c.easing,e={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,b.css(e),b},k=function(){b.content.css("visibility","visible")};w("BuildControls"+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.content.css("visibility","hidden"),a=b._getItemToZoom(),!a)return void k();f=j(a),f.css(b._getOffset()),b.wrap.append(f),e=setTimeout(function(){f.css(b._getOffset(!0)),e=setTimeout(function(){k(),setTimeout(function(){f.remove(),a=f=null,y("ZoomAnimationEnded")},16)},g)},16)}}),w(i+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.st.removalDelay=g,!a){if(a=b._getItemToZoom(),!a)return;f=j(a)}f.css(b._getOffset(!0)),b.wrap.append(f),b.content.css("visibility","hidden"),setTimeout(function(){f.css(b._getOffset())},16)}}),w(h+d,function(){b._allowZoom()&&(k(),f&&f.remove(),a=null)})}},_allowZoom:function(){return"image"===b.currItem.type},_getItemToZoom:function(){return b.currItem.hasSize?b.currItem.img:!1},_getOffset:function(c){var d;d=c?b.currItem.img:b.st.zoom.opener(b.currItem.el||b.currItem);var e=d.offset(),f=parseInt(d.css("padding-top"),10),g=parseInt(d.css("padding-bottom"),10);e.top-=a(window).scrollTop()-f;var h={width:d.width(),height:(u?d.innerHeight():d[0].offsetHeight)-g-f};return O()?h["-moz-transform"]=h.transform="translate("+e.left+"px,"+e.top+"px)":(h.left=e.left,h.top=e.top),h}}});var P="iframe",Q="//about:blank",R=function(a){if(b.currTemplate[P]){var c=b.currTemplate[P].find("iframe");c.length&&(a||(c[0].src=Q),b.isIE8&&c.css("display",a?"block":"none"))}};a.magnificPopup.registerModule(P,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){b.types.push(P),w("BeforeChange",function(a,b,c){b!==c&&(b===P?R():c===P&&R(!0))}),w(h+"."+P,function(){R()})},getIframe:function(c,d){var e=c.src,f=b.st.iframe;a.each(f.patterns,function(){return e.indexOf(this.index)>-1?(this.id&&(e="string"==typeof this.id?e.substr(e.lastIndexOf(this.id)+this.id.length,e.length):this.id.call(this,e)),e=this.src.replace("%id%",e),!1):void 0});var g={};return f.srcAction&&(g[f.srcAction]=e),b._parseMarkup(d,g,c),b.updateStatus("ready"),d}}});var S=function(a){var c=b.items.length;return a>c-1?a-c:0>a?c+a:a},T=function(a,b,c){return a.replace(/%curr%/gi,b+1).replace(/%total%/gi,c)};a.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var c=b.st.gallery,e=".mfp-gallery";return b.direction=!0,c&&c.enabled?(f+=" mfp-gallery",w(m+e,function(){c.navigateByImgClick&&b.wrap.on("click"+e,".mfp-img",function(){return b.items.length>1?(b.next(),!1):void 0}),d.on("keydown"+e,function(a){37===a.keyCode?b.prev():39===a.keyCode&&b.next()})}),w("UpdateStatus"+e,function(a,c){c.text&&(c.text=T(c.text,b.currItem.index,b.items.length))}),w(l+e,function(a,d,e,f){var g=b.items.length;e.counter=g>1?T(c.tCounter,f.index,g):""}),w("BuildControls"+e,function(){if(b.items.length>1&&c.arrows&&!b.arrowLeft){var d=c.arrowMarkup,e=b.arrowLeft=a(d.replace(/%title%/gi,c.tPrev).replace(/%dir%/gi,"left")).addClass(s),f=b.arrowRight=a(d.replace(/%title%/gi,c.tNext).replace(/%dir%/gi,"right")).addClass(s);e.click(function(){b.prev()}),f.click(function(){b.next()}),b.container.append(e.add(f))}}),w(n+e,function(){b._preloadTimeout&&clearTimeout(b._preloadTimeout),b._preloadTimeout=setTimeout(function(){b.preloadNearbyImages(),b._preloadTimeout=null},16)}),void w(h+e,function(){d.off(e),b.wrap.off("click"+e),b.arrowRight=b.arrowLeft=null})):!1},next:function(){b.direction=!0,b.index=S(b.index+1),b.updateItemHTML()},prev:function(){b.direction=!1,b.index=S(b.index-1),b.updateItemHTML()},goTo:function(a){b.direction=a>=b.index,b.index=a,b.updateItemHTML()},preloadNearbyImages:function(){var a,c=b.st.gallery.preload,d=Math.min(c[0],b.items.length),e=Math.min(c[1],b.items.length);for(a=1;a<=(b.direction?e:d);a++)b._preloadItem(b.index+a);for(a=1;a<=(b.direction?d:e);a++)b._preloadItem(b.index-a)},_preloadItem:function(c){if(c=S(c),!b.items[c].preloaded){var d=b.items[c];d.parsed||(d=b.parseEl(c)),y("LazyLoad",d),"image"===d.type&&(d.img=a('<img class="mfp-img" />').on("load.mfploader",function(){d.hasSize=!0}).on("error.mfploader",function(){d.hasSize=!0,d.loadError=!0,y("LazyLoadError",d)}).attr("src",d.src)),d.preloaded=!0}}}});var U="retina";a.magnificPopup.registerModule(U,{options:{replaceSrc:function(a){return a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=b.st.retina,c=a.ratio;c=isNaN(c)?c():c,c>1&&(w("ImageHasSize."+U,function(a,b){b.img.css({"max-width":b.img[0].naturalWidth/c,width:"100%"})}),w("ElementParse."+U,function(b,d){d.src=a.replaceSrc(d,c)}))}}}}),A()});;
const getElement = (context, selector) => {
    if (!context && !selector) {
        return null;
    }
    return context.querySelector(selector);
};
// main-slider
window.mainSlider = function () {
    const parentInit = document.querySelector('[data-slider="main"]');
    if (parentInit !== null) {
        const mainSlider = parentInit.querySelector('.swiper-container');
        const mainSwiper = new Swiper(mainSlider, {
            simulateTouch: false,
            loop: false,
            lazy: {
                loadOnTransitionStart: true
            },
            effect: 'fade',
            fadeEffect: {
                crossFade: true
            },
            speed: 2000,
            followFinger: false,
            //autoplay: {
            //    delay: document.getElementById('delay-slider').value
            //},
            navigation: {
                nextEl: '.js-main-next',
                prevEl: '.js-main-prev',
                disabledClass: 'swiper-lock'
            },
            pagination: {
                el: '.top-swiper-pagination',
                clickable: true
            },
            on: {
                afterInit: (event) => {
                    event.$el[0].classList.add('show'); /*E.S. Do Not Remove This Line */
                    setTimeout(() => {
                        event.$el[0].classList.add('remove')
                    }, 1200)
                },
                activeIndexChange: function () {
                    parentInit.querySelectorAll('.swiper-pagination-bullet').forEach((bullet, i) => {
                        bullet.setAttribute('tabindex', '0')
                        var count = parentInit.querySelectorAll('.swiper-pagination-bullet').length;
                        bullet.setAttribute('aria-label', count + ' מעבר בין שקופיות, שקופית ' + i + ' מתוך ')
                    })
                }
            }
        });
        parentInit.querySelector('.js-play-swiper').addEventListener('click', (event) => {
            const elem = event.currentTarget;
            if (elem.classList.contains('playing')) {
                mainSwiper.autoplay.stop()
                elem.classList.remove('playing');
            } else {
                mainSwiper.autoplay.start()
                elem.classList.add('playing');
            }
        })
        parentInit.querySelectorAll('.js-button-swiper').forEach((el, i) => {
            el.addEventListener('click', () => {
                mainSwiper.autoplay.stop()
                parentInit.querySelector('.js-play-swiper').classList.remove('playing');
            })
        })
        parentInit.querySelectorAll('.swiper-pagination-bullet').forEach((el, i) => {
            el.addEventListener('click', () => {
                mainSwiper.autoplay.stop()
                parentInit.querySelector('.js-play-swiper').classList.remove('playing');
            })
        })
    }
}
// mini-slider
window.miniSlider = function () {
    const parentInit = document.querySelector('[data-slider="mini"]');
    if (parentInit !== null) {
        const miniSlider = parentInit.querySelector('.swiper-container');
        const miniSwiper = new Swiper(miniSlider, {
            simulateTouch: true,
            effect: 'fade',
            fadeEffect: {
                crossFade: true
            },
            loop: false,
            lazy: {
                loadOnTransitionStart: true
            },
            followFinger: false,
            navigation: {
                nextEl: '.js-mini-next',
                prevEl: '.js-mini-prev',
                disabledClass: 'swiper-lock',
            },
        });
        let navPosition = function () {
            let contentSlide = miniSwiper.wrapperEl.querySelector('.picture-block__content');
            let button = miniSwiper.wrapperEl.querySelector('.button--default');
            let buttonHeight = button.offsetHeight;
            let buttonLeft = button.offsetLeft;
            let buttonWidth = button.clientWidth;
            let posTop = contentSlide.offsetTop + contentSlide.offsetHeight;
            let posLeft = miniSwiper.wrapperEl.querySelector('.picture-block__content').offsetLeft;
            const nav = document.querySelector('.section__nav');
            if (nav != null) {
                nav.style.top = contentSlide.parentElement.classList.contains('reversee') ? posTop - 50 + 'px' : posTop + 15 + 'px';
                nav.style.left = posLeft + buttonLeft - buttonWidth / 2 - 30 + 'px';
            }
        }
        navPosition();
        window.addEventListener('resize', function () {
            setTimeout(() => {
                navPosition();
            }, 300)
        });
        if (window.outerWidth > 1366) {
            miniSwiper.on('slideChangeTransitionEnd', function () {
                const image = document.getElementsByClassName('parallax');
                var p = new Parallax(image, {
                    offsetYBounds: 1200,
                    intensity: 40,
                    center: 2.5,
                    safeHeight: 0.15
                }).init()
            });
        }
    }
}
// card-slider
window.cardSlider = function () {
    const parentInit = document.querySelector('[data-slider="card"]');
    if (parentInit !== null) {
        const cardSlider = parentInit.querySelector('.swiper-container');
        const navSlider = document.querySelector('.big-card__nav[data-id="cards"]');
        const cardSwiper = new Swiper(cardSlider, {
            simulateTouch: true,
            effect: 'fade',
            loop: false,
            fadeEffect: {
                crossFade: true
            },
            lazy: {
                loadOnTransitionStart: true
            },
            followFinger: true,
            navigation: {
                nextEl: '.js-card-next',
                prevEl: '.js-card-prev',
                disabledClass: 'swiper-lock'
            },
            pagination: {
                el: '.card-swiper-pagination',
                clickable: true
            },
            on: {
                afterInit: () => {
                    setTimeout(() => {
                        document.querySelector('.swiper-preloader[data-id="card"]').style.display = 'none';
                    }, 1000)
                    navSlider.querySelectorAll('.swiper-pagination-bullet').forEach((bullet, i) => {
                        bullet.setAttribute('tabindex', '0')
                        var count = navSlider.querySelectorAll('.swiper-pagination-bullet').length;
                        bullet.setAttribute('aria-label', count + ' מעבר בין שקופיות, שקופית ' + i + ' מתוך ')
                    })
                    navSlider.querySelector('.swiper-pagination-bullets').setAttribute("role","toolbar")
                    navSlider.querySelector('.swiper-pagination-bullets').setAttribute("tabindex","0")
                },
                activeIndexChange: function () {
                }
            },
        });
    }
}
// card-slider
window.smallCardsSlider = function () {
    const parentInit = document.querySelectorAll('[data-slider="small-cards"]');
    if (parentInit !== null) {
        parentInit.forEach((el) => {
            const smallCardsSlider = el.querySelector('.swiper-container');
            const smallCardsSwiper = new Swiper(smallCardsSlider, {
                simulateTouch: true,
                lazy: {
                    loadOnTransitionStart: true
                },
                loop: false,
                slidesPerView: 2,
                slidesPerGroup: 1,
                spaceBetween: 16,
                a11y: false,
                watchSlidesProgress: true,
                followFinger: true,
                navigation: {
                    nextEl: getElement(smallCardsSlider.closest('[data-slider="small-cards"]'), '.js-small-cards-next'),
                    prevEl: getElement(smallCardsSlider.closest('[data-slider="small-cards"]'), '.js-small-cards-prev'),
                    disabledClass: 'swiper-lock'
                },
                breakpoints: {
                    320: {
                        slidesPerView: 1
                    },
                    480: {
                        slidesPerView: 2
                    },
                    640: {
                        slidesPerView: 3
                    },
                    1024: {
                        slidesPerView: smallCardsSlider.closest('.section--triple-cards') !== null ? '4' : '3'
                    }
                },
                on: {
                    afterInit: () => {
                        setTimeout(() => {
                            el.querySelector('.swiper-preloader[data-id="small-cards"]').style.display = 'none';
                        }, 1000)
                        smallCardsSlider.querySelectorAll('.swiper-slide').forEach((visible, i) => {
                            /*E.S. Changes  Do Not Remove Comment*/
                            if (visible.querySelector('[tabindex]') == null) return;
                            if (!visible.classList.contains('swiper-slide-visible')) {
                                visible.querySelector('[tabindex]').setAttribute('tabindex', '-1')
                            }
                        })
                    },
                    slideChangeTransitionEnd: () => {
                        console.log(16486);
                        smallCardsSlider.querySelectorAll('.swiper-slide').forEach((visible, i) => {
                            /*E.S. Changes  Do Not Remove Comment*/
                            if (visible.querySelector('[tabindex]') == null) return;
                            if (!visible.classList.contains('swiper-slide-visible')) {
                                visible.querySelectorAll('[tabindex]').forEach((el) => {
                                    el.setAttribute('tabindex', '-1')
                                })
                            }
                        })
                        setTimeout(() => {
                            smallCardsSlider.querySelectorAll('.swiper-slide-visible').forEach((visible, i) => {
                                /*E.S. Changes  Do Not Remove Comment*/
                                if (visible.querySelector('[tabindex]') == null) return;
                                visible.querySelectorAll('[tabindex]').forEach((el) => {
                                    el.setAttribute('tabindex', '11')
                                })
                                if (i === 0) {
                                    visible.querySelector('[tabindex]').focus()
                                }
                            })
                        }, 100)
                    }
                },
            });
        })
    }
}
// cards slider
window.cardsSlider = function () {
    const parentInit = document.querySelector('[data-slider="cards"]');
    if (parentInit !== null) {
        const cardsSlider = parentInit.querySelector('.swiper-container');
        const cardsSwiper = new Swiper(cardsSlider, {
            simulateTouch: true,
            lazy: {
                loadOnTransitionStart: true
            },
            slidesPerView: 3,
            slidesPerGroup: 3,
            spaceBetween: 16,
            followFinger: false,
            navigation: {
                nextEl: '.js-cards-prev',
                prevEl: '.js-cards-next',
                disabledClass: 'swiper-lock'
            },
            breakpoints: {
                320: {
                    slidesPerView: 1
                },
                640: {
                    slidesPerView: 2
                },
                1024: {
                    slidesPerView: 3
                }
            },
            on: {
                afterInit: () => {
                    setTimeout(() => {
                        document.querySelector('.swiper-preloader[data-id="cards"]').style.display = 'none';
                    }, 1000)
                    cardsSlider.querySelectorAll('.swiper-slide').forEach((visible, i) => {
                        /*E.S. Changes  Do Not Remove */
                        //if (visible.querySelector('[tabindex]') == null) return;
                        //if (!visible.classList.contains('swiper-slide-visible')) {
                        //    visible.querySelectorAll('[tabindex]').forEach((el) => {
                        //        el.setAttribute('tabindex', '-1')
                        //    })
                        //}
                    })
                },
                slideChangeTransitionEnd: () => {
                    cardsSlider.querySelectorAll('.swiper-slide').forEach((visible, i) => {
                        /*E.S. Changes  Do Not Remove */
                        //if (visible.querySelector('[tabindex]') == null) return;
                        //if (!visible.classList.contains('swiper-slide-visible')) {
                        //    visible.querySelectorAll('[tabindex]').forEach((el) => {
                        //        el.removeAttribute('tabindex')
                        //        el.setAttribute('tabindex', '-1')
                        //    })
                        //}
                    })
                    setTimeout(() => {
                        cardsSlider.querySelectorAll('.swiper-slide-visible').forEach((visible, i) => {
                            /*E.S. Changes  Do Not Remove Comment*/
                            if (visible.querySelector('[tabindex]') == null) return;
                            visible.querySelectorAll('[tabindex]').forEach((newVisible, index) => {
                                newVisible.setAttribute('tabindex', '11')
                            })
                            if (i === 0) {
                                visible.querySelectorAll('[tabindex]').forEach((newVisible, index) => {
                                    if (index === 0) {
                                        newVisible.focus()
                                    }
                                })
                            }
                        })
                    }, 100)
                }
            },
        });
        if (window.innerWidth < 640) {
            cardsSwiper.disable();
        }
        window.addEventListener('resize', function () {
            if (window.innerWidth < 640) {
                cardsSwiper.disable();
            } else {
                cardsSwiper.enable();
            }
        });
    }
}
// study slider
window.studySlider = function () {
    const parentInit = document.querySelector('[data-slider="study"]');
    if (parentInit !== null) {
        const studySlider = parentInit.querySelector('.swiper-container');
        const studySwiper = new Swiper(studySlider, {
            simulateTouch: true,
            slidesPerView: 2,
            slidesPerGroup: 2,
            spaceBetween: 40,
            followFinger: false,
            navigation: {
                nextEl: '.js-study-next',
                prevEl: '.js-study-prev',
                disabledClass: 'swiper-lock'
            },
            breakpoints: {
                320: {
                    slidesPerView: 1
                },
                640: {
                    slidesPerView: 2
                }
            }
        });
        if (window.innerWidth < 640) {
            studySwiper.disable();
        }
        window.addEventListener('resize', function () {
            if (window.innerWidth < 640) {
                studySwiper.disable();
            } else {
                studySwiper.enable();
            }
        });
    }
}
// article slider
window.articleSlider = function () {
    const parentInit = document.querySelector('[data-slider="article"]');
    if (parentInit !== null) {
        const articleSlider = parentInit.querySelector('.swiper-container');
        const articleeSwiper = new Swiper(articleSlider, {
            simulateTouch: false,
            speed: 900,
            lazy: {
                loadOnTransitionStart: true
            },
            followFinger: true,
            navigation: {
                nextEl: getElement(articleSlider.closest('[data-slider="article"]'), '.js-prev'),
                prevEl: getElement(articleSlider.closest('[data-slider="article"]'), '.js-next'),
                disabledClass: 'swiper-lock'
            },
            pagination: {
                el: getElement(articleSlider.closest('[data-slider="article"]'), '.swiper-pagination'),
                clickable: false
            },
            on: {
                afterInit: () => {
                    setTimeout(() => {
                        parentInit.querySelector('.swiper-preloader[data-id="article"]').style.display = 'none';
                    }, 1000)
                }
            },
        });
    }
}
// gallerySlider
window.gallerySlider = function () {
    const parentInit = document.querySelector('[data-slider="gallery"]');
    if (parentInit !== null) {
        const gallerySlider = parentInit.querySelector('.swiper-container');
        if (gallerySlider.querySelectorAll('.swiper-slide').length === 0) {
            return;
        }
        const gallerySwiper = new Swiper(gallerySlider, {
            grabCursor: true,
            centeredSlides: true,
            slidesPerView: 'auto',
            spaceBetween: 40,
            loop: true,
            watchSlidesProgress: true,
            speed: 900,
            lazy: {
                loadOnTransitionStart: true
            },
            followFinger: true,
            on: {
                afterInit: () => {
                    setTimeout(() => {
                        document.querySelector('.swiper-preloader[data-id="gallery"]').style.display = 'none';
                    }, 1000)
                    gallerySlider.querySelectorAll('.swiper-slide').forEach((visible, i) => {
                        /*E.S. Changes  Do Not Remove Comment*/
                        if (visible.querySelector('[tabindex]') == null) return;
                        if (!visible.classList.contains('swiper-slide-visible')) {
                            visible.querySelectorAll('a').forEach((el) => {
                                el.setAttribute('tabindex', '-1')
                            })
                    }
                    })
                }
            },
        });
        if (window.innerWidth < 767) {
            gallerySwiper.destroy(true, true);
        }
        window.addEventListener('resize', () => {
            if (window.innerWidth < 767) {
                gallerySwiper.destroy(true, true);
            }
        })
    }
}
// interests
window.interestsSlider = function () {
    const parentInit = document.querySelectorAll('[data-slider="interests"]');
    if (parentInit !== null) {
        parentInit.forEach((el) => {
            const interestsSlider = el.querySelector('.swiper-container');
            const interestsSwiper = new Swiper(interestsSlider, {
                simulateTouch: true,
                lazy: {
                    loadOnTransitionStart: true
                },
                slidesPerView: 4,
                slidesPerGroup: 1,
                spaceBetween: 16,
                edgeSwipeThreshold: 50,
                watchSlidesProgress: true,
                followFinger: true,
                navigation: {
                    nextEl: getElement(interestsSlider.closest('[data-slider="interests"]'), '.js-interest-prev'),
                    prevEl: getElement(interestsSlider.closest('[data-slider="interests"]'), '.js-interest-next'),
                    disabledClass: 'swiper-lock'
                },
                pagination: {
                    el: getElement(interestsSlider.closest('[data-slider="interests"]'), '.int-swiper-pagination'),
                    clickable: true
                },
                on: {
                    afterInit: () => {
                        setTimeout(() => {
                            el.querySelector('.swiper-preloader[data-id="interests"]').style.display = 'none';
                        }, 1000)
                        el.querySelectorAll('.swiper-slide').forEach((visible, i) => {
                            /*E.S. Changes  Do Not Remove Comment*/
                            if (visible.querySelector('[tabindex]') == null) return;
                            if (!visible.classList.contains('swiper-slide-visible')) {
                                visible.querySelector('.service-item').querySelectorAll('[tabindex]').forEach((el) => {
                                    el.removeAttribute('tabindex')
                                    setTimeout(() => {
                                        el.setAttribute('tabindex', '-1')
                                    }, 100)
                                })
                            }
                        })
                    },
                    slideChangeTransitionEnd: () => {
                        el.querySelectorAll('.swiper-slide').forEach((visible, i) => {
                            /*E.S. Changes  Do Not Remove Comment*/
                            if (visible.querySelector('[tabindex]') == null) return;
                            if (!visible.classList.contains('swiper-slide-visible')) {
                                visible.querySelector('.service-item').querySelectorAll('[tabindex]').forEach((el) => {
                                    el.removeAttribute('tabindex')
                                    el.setAttribute('tabindex', '-1')
                                })
                            }
                        })
                        setTimeout(() => {
                            el.querySelectorAll('.swiper-slide-visible').forEach((visible, i) => {
                                /*E.S. Changes  Do Not Remove Comment*/
                                if (visible.querySelector('[tabindex]') == null) return;
                                visible.querySelectorAll('[tabindex]').forEach((newVisible, index) => {
                                    newVisible.setAttribute('tabindex', '0')
                                })
                                if (i === 0) {
                                    visible.querySelectorAll('[tabindex]').forEach((newVisible, index) => {
                                        if (index === 0) {
                                            newVisible.focus()
                                        }
                                    })
                                }
                            })
                        }, 100)
                    }
                },
                breakpoints: {
                    320: {
                        slidesPerView: 1,
                        slidesPerGroup: 1
                    },
                    561: {
                        slidesPerView: 2
                    },
                    768: {
                        slidesPerView: 3
                    },
                    1300: {
                        slidesPerGroup: 2,
                        slidesPerView: interestsSlider.closest('.section--triple-int') !== null ? '3' : '4'
                    }
                }
            });
        })
    }
}
// programSlider
window.programSlider = function () {
    const parentInit = document.querySelector('[data-slider="program"]');
    if (parentInit !== null) {
        const programSlider = parentInit.querySelector('.swiper-container');
        const programSwiper = new Swiper(programSlider, {
            simulateTouch: false,
            effect: 'fade',
            fadeEffect: {
                crossFade: true
            },
            loop: false,
            speed: 900,
            lazy: {
                loadOnTransitionStart: true
            },
            followFinger: true,
            watchSlidesProgress: true,
            on: {
                afterInit: () => {
                    programSlider.querySelectorAll('.swiper-slide').forEach((visible, i) => {
                        /*E.S. Changes  Do Not Remove Comment*/
                        if (visible.querySelector('[tabindex]') == null) return;
                        if (!visible.classList.contains('swiper-slide-visible')) {
                            visible.querySelectorAll('[tabindex]').forEach((el) => {
                                el.setAttribute('aria-disabled', 'true')
                            })
                        }
                    })
                },
                activeIndexChange: function () {
                    programSlider.querySelectorAll('.swiper-slide').forEach((visible, i) => {
                        /*E.S. Changes  Do Not Remove Comment*/
                        if (visible.querySelector('[tabindex]') == null) return;
                        if (!visible.classList.contains('swiper-slide-visible')) {
                            visible.querySelector('[tabindex]').setAttribute('tabindex', '-1')
                        } else {
                            visible.querySelector('[tabindex]').setAttribute('tabindex', '0')
                        }
                    })
                }
            },
            // navigation: {
            // 	nextEl: '.js-card-next',
            // 	prevEl: '.js-card-prev',
            // 	disabledClass: 'swiper-lock'
            // },
            // pagination: {
            //   el: '.card-swiper-pagination',
            //   clickable: true
            // }
        });
        const cubeControl = document.querySelectorAll('.js-cube-control');
        let removeClass = function () {
            cubeControl.forEach((el) => {
                el.classList.remove('active')
            })
        }
        cubeControl.forEach((el, i) => {
            const id = Number(el.getAttribute('data-id'));
            el.addEventListener('click', () => {
                programSwiper.slideTo(id, 900, false);
                removeClass();
                el.classList.add('active');
            })
        })
    }
}
// programSecondSlider
window.programSecondSlider = function () {
    const parentInit = document.querySelectorAll('[data-slider="program-second"]');
    if (parentInit !== null) {
        parentInit.forEach((slider) => {
            const programSecondSlider = slider.querySelector('.swiper-container');
            const programSecondSwiper = new Swiper(programSecondSlider, {
                simulateTouch: false,
                loop: true,
                speed: 900,
                lazy: {
                    loadOnTransitionStart: true
                },
                followFinger: true,
                navigation: {
                    nextEl: getElement(programSecondSlider.closest('[data-slider="program-second"]'), '.js-next'),
                    prevEl: getElement(programSecondSlider.closest('[data-slider="program-second"]'), '.js-prev'),
                    disabledClass: 'swiper-lock'
                },
                pagination: {
                    el: getElement(programSecondSlider.closest('[data-slider="program-second"]'), '.swiper-pagination'),
                    clickable: true
                },
                on: {
                    afterInit: () => {
                        setTimeout(() => {
                            slider.querySelector('.swiper-preloader[data-id="program-second"]').style.display = 'none';
                        }, 1000)
                        slider.querySelectorAll('.swiper-pagination-bullet').forEach((bullet, i) => {
                            bullet.setAttribute('tabindex', '0')
                        })
                    }
                }
            });
        })
    }
}
// science Slider
window.scienceSlider = function () {
    const parentInit = document.querySelector('[data-slider="science"]');
    if (parentInit !== null) {
        const scienceSlider = parentInit.querySelector('.swiper-container');
        const scienceSwiper = new Swiper(scienceSlider, {
            simulateTouch: true,
            lazy: {
                loadOnTransitionStart: true
            },
            loop: false,
            slidesPerView: 2,
            slidesPerGroup: 1,
            spaceBetween: 16,
            watchSlidesProgress: true,
            followFinger: true,
            navigation: {
                nextEl: getElement(scienceSlider.closest('[data-slider="science"]'), '.js-science-prev'),
                prevEl: getElement(scienceSlider.closest('[data-slider="science"]'), '.js-science-next'),
                disabledClass: 'swiper-lock'
            },
            breakpoints: {
                320: {
                    slidesPerView: 1
                },
                640: {
                    slidesPerView: 2
                }
            },
            on: {
                afterInit: () => {
                    setTimeout(() => {
                        document.querySelector('.swiper-preloader[data-id="science"]').style.display = 'none';
                    }, 1000)
                    scienceSlider.querySelectorAll('.swiper-slide').forEach((visible, i) => {
                        /*E.S. Changes  Do Not Remove Comment*/
                        if (visible.querySelector('[tabindex]') == null) return;
                        if (!visible.classList.contains('swiper-slide-visible')) {
                            visible.querySelectorAll('[tabindex]').forEach((el) => {
                                el.setAttribute('tabindex', '-1')
                            })
                        }
                    })
                },
                activeIndexChange: function () {
                    scienceSlider.querySelectorAll('.swiper-slide').forEach((visible, i) => {
                        /*E.S. Changes  Do Not Remove Comment*/
                        if (visible.querySelector('[tabindex]') == null) return;
                        if (!visible.classList.contains('swiper-slide-visible') ) {
                            visible.querySelector('[tabindex]').setAttribute('tabindex', '-1')
                        } else {
                            visible.querySelector('[tabindex]').setAttribute('tabindex', '0')
                        }
                    })
                }
            },
        });
    }
}
// science Slider
window.scienceBigSlider = function () {
    const parentInit = document.querySelector('[data-slider="science-big"]');
    if (parentInit !== null) {
        const scienceBigSlider = parentInit.querySelector('.swiper-container');
        const scienceBigSwiper = new Swiper(scienceBigSlider, {
            simulateTouch: true,
            lazy: {
                loadOnTransitionStart: true
            },
            loop: false,
            slidesPerView: 2,
            slidesPerGroup: 1,
            spaceBetween: 16,
            followFinger: true,
            navigation: {
                nextEl: getElement(scienceBigSlider.closest('[data-slider="science-big"]'), '.js-science-prev'),
                prevEl: getElement(scienceBigSlider.closest('[data-slider="science-big"]'), '.js-science-next'),
                disabledClass: 'swiper-lock'
            },
            pagination: {
                el: getElement(scienceBigSlider.closest('[data-slider="science-big"]'), '.swiper-pagination'),
                clickable: true
            },
            breakpoints: {
                320: {
                    slidesPerView: 1
                },
                640: {
                    slidesPerView: 2
                },
                1024: {
                    slidesPerView: 3
                }
            },
            on: {
                afterInit: () => {
                    setTimeout(() => {
                        document.querySelector('.swiper-preloader[data-id="science"]').style.display = 'none';
                    }, 1000)
                },
            },
        });
        if (!document.body.classList.contains('ios-detect') && !document.body.classList.contains('android')) {
            scienceBigSwiper.on('progress', function () {
                if (scienceBigSwiper.$el[0].closest('.computer-science--full') !== null) {
                    scienceBigSwiper.$el[0].querySelector('.swiper-slide-next').nextElementSibling.classList.add('my-next-slide')
                }
            });
            scienceBigSwiper.on('slideChange', function () {
                scienceBigSwiper.$el[0].querySelector('.my-next-slide').classList.remove('my-next-slide')
            });
            scienceBigSwiper.on('slideChangeTransitionEnd', function () {
                scienceBigSwiper.$el[0].querySelector('.swiper-slide-next').nextElementSibling.classList.add('my-next-slide')
            });
        }
    }
}
// department Slider
window.departmentSlider = function () {
    const parentInitNav = document.querySelector('[data-slider="nav-department"]');
    const parentInit = document.querySelector('[data-slider="department"]');
    if (parentInit !== null && parentInitNav !== null) {
        const navDepartmentSlider = parentInitNav.querySelector('.swiper-container');
        const navDepartmentSwiper = new Swiper(navDepartmentSlider, {
            spaceBetween: 16,
            slidesPerView: 4,
            slidesPerGroup: 1,
            freeMode: true,
            watchSlidesVisibility: true,
            watchSlidesProgress: true,
            preloadImages: false,
            navigation: {
                nextEl: getElement(navDepartmentSlider.closest('[data-slider="nav-department"]'), '.js-department-next'),
                prevEl: getElement(navDepartmentSlider.closest('[data-slider="nav-department"]'), '.js-department-prev'),
                disabledClass: 'swiper-lock'
            },
            pagination: {
                el: getElement(navDepartmentSlider.closest('[data-slider="nav-department"]'), '.swiper-pagination')
            },
            breakpoints: {
                320: {
                    slidesPerView: 1
                },
                560: {
                    slidesPerView: 2
                },
                768: {
                    slidesPerView: 3
                },
                1200: {
                    slidesPerView: 4
                }
            },
            on: {
                afterInit: () => {
                    setTimeout(() => {
                        document.querySelector('.swiper-preloader[data-id="nav-department"]').style.display = 'none';
                        navDepartmentSlider.querySelectorAll('.slide-min').forEach((el) => {
                            el.addEventListener('click', () => {
                                departmentSwiper.slideNext()
                            })
                        })
                    }, 1000)
                }
            },
        });
        const departmentSlider = parentInit.querySelector('.swiper-container');
        const departmentSwiper = new Swiper(departmentSlider, {
            simulateTouch: false,
            preloadImages: false,
            watchOverflow: true,
            watchSlidesVisibility: true,
            watchSlidesProgress: true,
            preventInteractionOnTransition: true,
            speed: 300,
            lazy: {
                loadOnTransitionStart: true
            },
            effect: 'fade',
            fadeEffect: {
                crossFade: true
            },
            navigation: {
                nextEl: getElement(departmentSlider.closest('[data-slider="department"]'), '.js-department-next'),
                prevEl: getElement(departmentSlider.closest('[data-slider="department"]'), '.js-department-prev'),
                disabledClass: 'swiper-lock'
            },
            thumbs: {
                swiper: navDepartmentSwiper,
                thumbsContainerClass: 'swiper-thumbs'
            },
            on: {
                afterInit: () => {
                    departmentSlider.querySelectorAll('.swiper-slide').forEach((visible, i) => {
                        /*E.S. Changes  Do Not Remove Comment*/
                        if (visible.querySelector('[tabindex]') == null) return;
                        if (!visible.classList.contains('swiper-slide-visible')) {
                            visible.querySelectorAll('[tabindex ]').forEach((el) => {
                                el.setAttribute('tabindex', '-1')
                            })
                        }
                    })
                }
            },
        });
    }
    if (parentInit === null && parentInitNav !== null) {
        const navDepartmentSlider = parentInitNav.querySelector('.swiper-container');
        const navDepartmentSwiper = new Swiper(navDepartmentSlider, {
            spaceBetween: 16,
            slidesPerView: 4,
            slidesPerGroup: 1,
            freeMode: true,
            watchSlidesVisibility: true,
            watchSlidesProgress: true,
            preloadImages: false,
            navigation: {
                nextEl: getElement(navDepartmentSlider.closest('[data-slider="nav-department"]'), '.js-department-next'),
                prevEl: getElement(navDepartmentSlider.closest('[data-slider="nav-department"]'), '.js-department-prev'),
                disabledClass: 'swiper-lock'
            },
            pagination: {
                el: getElement(navDepartmentSlider.closest('[data-slider="nav-department"]'), '.swiper-pagination')
            },
            breakpoints: {
                320: {
                    slidesPerView: 1
                },
                560: {
                    slidesPerView: 2
                },
                768: {
                    slidesPerView: 3
                },
                1200: {
                    slidesPerView: 4
                }
            },
            on: {
                afterInit: () => {
                    setTimeout(() => {
                        document.querySelector('.swiper-preloader[data-id="nav-department"]').style.display = 'none';
                    }, 1000)
                    navDepartmentSlider.querySelectorAll('.swiper-slide').forEach((visible, i) => {
                        /*E.S. Changes  Do Not Remove Comment*/
                        if (visible.querySelector('[tabindex]') == null) return;
                        if (!visible.classList.contains('swiper-slide-visible')) {
                            visible.querySelector('.slide-min').setAttribute('tabindex', '-1')
                        }
                    })
                }
            },
        });
    }
}
window.fitSlider = function () {
  const parentWrap = document.querySelectorAll('.fit-block__slides');
  if(parentWrap !== null) {
    parentWrap.forEach((wrao) => {
      const parentInitNav = wrao.querySelector('[data-slider="fit-nav"]');
      const parentInit = wrao.querySelector('[data-slider="fit-main"]');
      const fitNav = parentInitNav.querySelector('.swiper-container');
      const fitNavSwiper = new Swiper(fitNav, {
        spaceBetween: 11,
        slidesPerView: 3,
        slidesPerGroup: 1,
        freeMode: true,
        watchSlidesVisibility: true,
        watchSlidesProgress: true,
        preloadImages: false,
        navigation: {
          nextEl: getElement(fitNav.closest('[data-slider="fit-nav"]'), '.js-next'),
          prevEl: getElement(fitNav.closest('[data-slider="fit-nav"]'), '.js-prev'),
          disabledClass: 'swiper-lock'
        },
        on: {
          afterInit: () => {
            setTimeout(() => {
              parentInitNav.querySelector('.swiper-preloader[data-id="fit-nav"]').style.display = 'none';
            }, 1000)
          }
        }
      });
      const fitMain = parentInit.querySelector('.swiper-container');
      const fitMainSwiper = new Swiper(fitMain, {
        simulateTouch: false,
        preloadImages: false,
        watchOverflow: true,
        watchSlidesVisibility: true,
        watchSlidesProgress: true,
        preventInteractionOnTransition: true,
        speed: 300,
        lazy: {
          loadOnTransitionStart: true
        },
        effect: 'fade',
        fadeEffect: {
          crossFade: true
        },
        navigation: {
          nextEl: getElement(fitMain.closest('[data-slider="fit-main"]'), '.js-next'),
          prevEl: getElement(fitMain.closest('[data-slider="fit-main"]'), '.js-prev'),
          disabledClass: 'swiper-lock'
        },
        pagination: {
          el: parentInit.querySelector('.swiper-pagination'),
          clickable: true
        },
        thumbs: {
          swiper: fitNavSwiper,
          autoScrollOffset: true,
          thumbsContainerClass: 'swiper-thumbs'
        },
        on: {
          afterInit: () => {
            setTimeout(() => {
              parentInit.querySelector('.swiper-preloader[data-id="fit-main"]').style.display = 'none';
            }, 1000)
            fitMain.querySelectorAll('.swiper-pagination-bullet').forEach((bullet, i) => {
              bullet.setAttribute('tabindex', '9')
            })
          }
        }
      });
    })
  }
}
window.fitSlider = function () {
    const parentWrap = document.querySelectorAll('.fit-block__slides');
    if (parentWrap !== null) {
        parentWrap.forEach((wrao) => {
            const parentInitNav = wrao.querySelector('[data-slider="fit-nav"]');
            const parentInit = wrao.querySelector('[data-slider="fit-main"]');
            const fitNav = parentInitNav.querySelector('.swiper-container');
            const fitNavSwiper = new Swiper(fitNav, {
                spaceBetween: 11,
                slidesPerView: 3,
                slidesPerGroup: 1,
                freeMode: true,
                watchSlidesVisibility: true,
                watchSlidesProgress: true,
                preloadImages: false,
                navigation: {
                    nextEl: getElement(fitNav.closest('[data-slider="fit-nav"]'), '.js-next'),
                    prevEl: getElement(fitNav.closest('[data-slider="fit-nav"]'), '.js-prev'),
                    disabledClass: 'swiper-lock'
                },
                on: {
                    afterInit: () => {
                        setTimeout(() => {
                            parentInitNav.querySelector('.swiper-preloader[data-id="fit-nav"]').style.display = 'none';
                        }, 1000)
                    }
                }
            });
            const fitMain = parentInit.querySelector('.swiper-container');
            const fitMainSwiper = new Swiper(fitMain, {
                simulateTouch: false,
                preloadImages: false,
                watchOverflow: true,
                watchSlidesVisibility: true,
                watchSlidesProgress: true,
                preventInteractionOnTransition: true,
                speed: 300,
                lazy: {
                    loadOnTransitionStart: true
                },
                effect: 'fade',
                fadeEffect: {
                    crossFade: true
                },
                navigation: {
                    nextEl: getElement(fitMain.closest('[data-slider="fit-main"]'), '.js-next'),
                    prevEl: getElement(fitMain.closest('[data-slider="fit-main"]'), '.js-prev'),
                    disabledClass: 'swiper-lock'
                },
                pagination: {
                    el: parentInit.querySelector('.swiper-pagination'),
                    clickable: true
                },
                thumbs: {
                    swiper: fitNavSwiper,
                    autoScrollOffset: true,
                    thumbsContainerClass: 'swiper-thumbs'
                },
                on: {
                    afterInit: () => {
                        setTimeout(() => {
                            parentInit.querySelector('.swiper-preloader[data-id="fit-main"]').style.display = 'none';
                        }, 1000)
                        fitMain.querySelectorAll('.swiper-pagination-bullet').forEach((bullet, i) => {
                            bullet.setAttribute('tabindex', '9')
                        })
                    }
                }
            });
        })
    }
}
// specialization
window.specializationSlider = function () {
    const parentInit = document.querySelector('[data-slider="specialization"]');
    if (parentInit !== null) {
        const specializationSlider = parentInit.querySelector('.swiper-container');
        const specializationSwiper = new Swiper(specializationSlider, {
            simulateTouch: true,
            lazy: {
                loadOnTransitionStart: true
            },
            slidesPerView: 3,
            slidesPerGroup: 2,
            spaceBetween: 16,
            followFinger: true,
            navigation: {
                nextEl: '.js-spec-prev',
                prevEl: '.js-spec-next',
                disabledClass: 'swiper-lock'
            },
            breakpoints: {
                320: {
                    slidesPerView: 1
                },
                640: {
                    slidesPerView: 2
                },
                768: {
                    slidesPerView: 3
                },
                1200: {
                    slidesPerView: 4
                }
            },
            on: {
                afterInit: () => {
                    setTimeout(() => {
                        document.querySelector('.swiper-preloader[data-id="specialization"]').style.display = 'none';
                    }, 1000)
                }
            },
        });
        if (window.innerWidth < 640) {
            specializationSwiper.disable();
        }
        window.addEventListener('resize', function () {
            if (window.innerWidth < 640) {
                specializationSwiper.disable();
            } else {
                specializationSwiper.enable();
            }
        });
    }
}
// faculties
window.facultiesSlider = function () {
    const parentInit = document.querySelector('[data-slider="faculties"]');
    if (parentInit !== null) {
        const facultiesSlider = parentInit.querySelector('.swiper-container');
        const facultiesSwiper = new Swiper(facultiesSlider, {
            simulateTouch: true,
            lazy: {
                loadOnTransitionStart: true
            },
            slidesPerView: 4,
            slidesPerGroup: 2,
            spaceBetween: 15,
            followFinger: true,
            navigation: {
                nextEl: getElement(facultiesSlider.closest('[data-slider="faculties"]'), '.js-prev'),
                prevEl: getElement(facultiesSlider.closest('[data-slider="faculties"]'), '.js-next'),
                disabledClass: 'swiper-lock'
            },
            // pagination: {
            //   el: getElement(facultiesSlider.closest('[data-slider="faculties"]'), '.swiper-pagination'),
            //   clickable: true
            // },
            breakpoints: {
                320: {
                    slidesPerView: 2
                },
                640: {
                    slidesPerView: 3
                },
                1024: {
                    slidesPerView: 4,
                    spaceBetween: 28
                }
            },
            on: {
                afterInit: () => {
                    setTimeout(() => {
                        document.querySelector('.swiper-preloader[data-id="faculties"]').style.display = 'none';
                    }, 1000)
                }
            },
        });
        if (window.innerWidth > 640 && parentInit.classList.contains('js-short-slider')) {
            facultiesSlider.disable();
        }
    }
}
// filter
window.filterSlider = function () {
    const parentInit = document.querySelector('[data-slider="filter"]');
    if (parentInit !== null) {
        const filterSlider = parentInit.querySelector('.swiper-container');
        const filterSwiper = new Swiper(filterSlider, {
            simulateTouch: true,
            loop: false,
            slidesPerView: 'auto',
            slidesPerGroup: 1,
            loopedSlides: null,
            edgeSwipeThreshold: 50,
            freeMode: false,
            navigation: {
                nextEl: getElement(filterSlider.closest('[data-slider="filter"]'), '.js-next'),
                prevEl: getElement(filterSlider.closest('[data-slider="filter"]'), '.js-prev'),
                disabledClass: 'swiper-lock'
            },
            on: {
                afterInit: () => {
                    setTimeout(() => {
                        filterSlider.querySelectorAll('.swiper-slide').forEach((el, i) => {
                            if (el.querySelector('.active')) {
                                filterSwiper.slideTo(i, 900, false);
                            }
                        })
                    }, 0)
                    setTimeout(() => {
                        parentInit.querySelectorAll('.swiper-button').forEach((button) => {
                            button.classList.add('loaded')
                        }, 500)
                    })
                }
            },
            breakpoints: {
                320: {
                    spaceBetween: parentInit.classList.contains('js-lobby-slider') ? 20 : 28,
                    centeredSlides: false,
                },
                1024: {
                    spaceBetween: parentInit.classList.contains('js-lobby-slider') ? 40 : 55,
                    centeredSlides: false,
                }
            },
        });
    }
}
// sidebar
window.sidebarSlider = function () {
    const parentInit = document.querySelector('[data-slider="sidebar"]');
    if (parentInit !== null) {
        const sidebarSlider = parentInit.querySelector('.swiper-container');
        const sidebarSwiper = new Swiper(sidebarSlider, {
            spaceBetween: 16,
            slidesPerView: 4,
            freeMode: false,
            slidesPerGroup: 1,
            watchSlidesVisibility: true,
            watchSlidesProgress: true,
            preloadImages: false,
            pagination: {
                el: getElement(sidebarSlider.closest('[data-slider="sidebar"]'), '.swiper-pagination'),
                clickable: true
            },
            breakpoints: {
                320: {
                    slidesPerView: 1
                },
                560: {
                    slidesPerView: 2
                },
                768: {
                    slidesPerView: 3
                },
                1200: {
                    slidesPerView: 4
                }
            },
            on: {
                afterInit: () => {
                    setTimeout(() => {
                        document.querySelector('.swiper-preloader[data-id="sidebar"]').style.display = 'none';
                    }, 1000)
                }
            },
        });
        if (window.innerWidth > 767) {
            sidebarSwiper.destroy(true, true);
        }
        window.addEventListener('resize', () => {
            if (window.innerWidth > 767) {
                sidebarSwiper.destroy(true, true);
            }
        })
    }
}
// lobby
window.lobbySlider = function () {
    const parentInit = document.querySelector('[data-slider="lobby"]');
    if (parentInit !== null) {
        const lobbySlider = parentInit.querySelector('.swiper-container');
        const lobbySwiper = new Swiper(lobbySlider, {
            spaceBetween: 16,
            slidesPerView: 1,
            freeMode: false,
            slidesPerGroup: 1,
            watchSlidesVisibility: true,
            watchSlidesProgress: true,
            preloadImages: false,
            pagination: {
                el: getElement(lobbySlider.closest('[data-slider="lobby"]'), '.swiper-pagination'),
                clickable: true
            },
            on: {
                afterInit: () => {
                    setTimeout(() => {
                        document.querySelector('.swiper-preloader[data-id="lobby"]').style.display = 'none';
                    }, 1000)
                }
            },
        });
    }
}
// include
window.includeSlider = function () {
    const parentInit = document.querySelector('[data-slider="include"]');
    if (parentInit !== null) {
        const includeSlider = parentInit.querySelector('.swiper-container');
        const includeSwiper = new Swiper(includeSlider, {
            simulateTouch: true,
            lazy: {
                loadOnTransitionStart: true
            },
            slidesPerView: 4,
            slidesPerGroup: 1,
            spaceBetween: 15,
            followFinger: true,
            watchSlidesVisibility: true,
            watchSlidesProgress: true,
            navigation: {
                nextEl: getElement(includeSlider.closest('[data-slider="include"]'), '.js-prev'),
                prevEl: getElement(includeSlider.closest('[data-slider="include"]'), '.js-next'),
                disabledClass: 'swiper-lock'
            },
            pagination: {
                el: getElement(includeSlider.closest('[data-slider="include"]'), '.swiper-pagination'),
                clickable: true
            },
            breakpoints: {
                320: {
                    slidesPerView: 1
                },
                561: {
                    slidesPerView: 2
                },
                640: {
                    slidesPerView: 3
                },
                1024: {
                    slidesPerView: 4,
                    spaceBetween: 14
                }
            },
            on: {
                afterInit: () => {
                    setTimeout(() => {
                        parentInit.querySelector('.swiper-preloader[data-id="include"]').style.display = 'none';
                    }, 1000)
                    if (parentInit.querySelectorAll('.swiper-slide').length < 4) {
                        parentInit.querySelector('.swiper-wrapper').classList.add('center')
                    }
                    if (parentInit.querySelectorAll('.swiper-slide').length === 1) {
                        parentInit.querySelector('.swiper-wrapper').classList.add('single')
                    }
                    includeSlider.querySelectorAll('.swiper-slide').forEach((visible, i) => {
                        if (!visible.classList.contains('swiper-slide-visible')) {
                            visible.querySelector('.include-item').querySelectorAll('[tabindex]').forEach((el) => {
                                el.removeAttribute('tabindex')
                                setTimeout(() => {
                                    el.setAttribute('tabindex', '-1')
                                }, 100)
                            })
                        }
                    })
                }
            },
        });
    }
}
//master-slider
window.mastersSlider = function () {
    const parentInit = document.querySelector('[data-slider="masters"]');
    const parentInitNav = document.querySelector('[data-slider="masters-nav"]');
    if (parentInit !== null && parentInitNav !== null) {
        const mastersSliderNav = parentInitNav.querySelector('.swiper-container');
        const mastersSwiperNav = new Swiper(mastersSliderNav, {
            freeMode: true,
            watchSlidesVisibility: true,
            watchSlidesProgress: true,
            simulateTouch: true,
            loop: false,
            lazy: {
                loadOnTransitionStart: true
            },
            slidesPerView: 6,
            slidesPerGroup: 1,
            spaceBetween: 13,
            // centeredSlides: true,
            speed: 450,
            followFinger: true,
            on: {
                afterInit: () => {
                }
            },
            breakpoints: {
                320: {
                    slidesPerView: 4,
                    spaceBetween: 14,
                },
                640: {
                    slidesPerView: 6,
                    spaceBetween: 14,
                }
            },
        });
        const mastersSlider = parentInit.querySelector('.swiper-container');
        const mastersSwiper = new Swiper(mastersSlider, {
            simulateTouch: false,
            loop: false,
            lazy: {
                loadOnTransitionStart: true
            },
            effect: 'fade',
            fadeEffect: {
                crossFade: true
            },
            speed: 2000,
            followFinger: false,
            navigation: {
                nextEl: '.js-master-next',
                prevEl: '.js-master-prev',
                disabledClass: 'swiper-lock'
            },
            pagination: {
                el: '.master-swiper-pagination',
                clickable: true
            },
            thumbs: {
                swiper: mastersSwiperNav,
                thumbsContainerClass: 'swiper-thumbs'
            },
            on: {
                afterInit: () => {
                    setTimeout(() => {
                        document.querySelector('.swiper-preloader[data-id="masters"]').style.display = 'none';
                    }, 1000)
                }
            }
        });
    }
}
window.openDrop = function () {
    document.querySelectorAll(".js-open-drop").forEach((el, i) => {
        el.addEventListener('click', (event) => {
            let $this = $(event.currentTarget);
            let $wrap = $this.closest('.js-help')
            let $drop = $wrap.find('.js-drop')
            let $close = $wrap.find('.js-drop-close')
            $('.js-drop').removeClass('open')
            $drop.toggleClass('open');
            $this.closest('section').addClass('z-top')
            $('.swiper-slide').removeClass('z-top')
            $this.closest('.swiper-slide').addClass('z-top')
            let innerItems = $drop.find('[tabindex]');
            if ($this.closest('.popup').length) {
                $this.closest('.popup').find('.close-popup-tooltip').css('display', 'flex');
                $drop.closest('li').css('position', 'initial');
            }
            if ($wrap.hasClass('js-help-popup')) {
                $('body').addClass('drop-opened')
            }
            //if (window.outerWidth < 1025) {
            //    document.body.classList.add('simple-overflow')
            //}
            //  //E.S Do not remove - removed by Elipaz
            //if(window.outerWidth < 1025 && !$wrap.hasClass('link--dop')) {
            //  document.body.classList.add('filter-opened')
            //}
            if ($this.closest('.popup').length && window.outerWidth > 1024) {
                const popupW = $this.closest('.popup').width();
                const posLeft = $this.offsetParent()[0].offsetLeft
                if (posLeft > popupW / 2) {
                    $drop.addClass('reverse')
                }
            }
            $close.focus()
            innerItems.each(function (i, el) {
                $(this).on('blur', function () {
                    setTimeout(() => {
                        if (i + 1 === innerItems.length && document.activeElement.closest('.js-drop') === null || i === 0 && document.activeElement.closest('.js-drop') === null) {
                            $drop.removeClass("open")
                            $this.closest('section').removeClass('z-top')
                        }
                    }, 0)
                })
            })
        //innerItems.each(function (i, el) {
        //    $(this).on('blur', function (event) {
        //        setTimeout(() => {
        //            if (i + 1 === innerItems.length && document.activeElement.closest('.ac-panel') === null || i === 0 && document.activeElement.closest('.ac-panel') === null) {
        //                $parent.removeClass('is-active');
        //                $block.slideUp(400);
        //                $parentMini.removeClass('opened');
        //                $button.attr('aria-expanded', 'false').prop('aria-expanded', 'false');
        //            }
        //        }, 0)
        //    })
        //});
        })
    });
};
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){function i(){var b,c,d={height:f.innerHeight,width:f.innerWidth};return d.height||(b=e.compatMode,(b||!a.support.boxModel)&&(c="CSS1Compat"===b?g:e.body,d={height:c.clientHeight,width:c.clientWidth})),d}function j(){return{top:f.pageYOffset||g.scrollTop||e.body.scrollTop,left:f.pageXOffset||g.scrollLeft||e.body.scrollLeft}}function k(){if(b.length){var e=0,f=a.map(b,function(a){var b=a.data.selector,c=a.$element;return b?c.find(b):c});for(c=c||i(),d=d||j();e<b.length;e++)if(a.contains(g,f[e][0])){var h=a(f[e]),k={height:h[0].offsetHeight,width:h[0].offsetWidth},l=h.offset(),m=h.data("inview");if(!d||!c)return;l.top+k.height>d.top&&l.top<d.top+c.height&&l.left+k.width>d.left&&l.left<d.left+c.width?m||h.data("inview",!0).trigger("inview",[!0]):m&&h.data("inview",!1).trigger("inview",[!1])}}}var c,d,h,b=[],e=document,f=window,g=e.documentElement;a.event.special.inview={add:function(c){b.push({data:c,$element:a(this),element:this}),!h&&b.length&&(h=setInterval(k,250))},remove:function(a){for(var c=0;c<b.length;c++){var d=b[c];if(d.element===this&&d.data.guid===a.guid){b.splice(c,1);break}}b.length||(clearInterval(h),h=null)}},a(f).on("scroll resize scrollstop",function(){c=d=null}),!g.addEventListener&&g.attachEvent&&g.attachEvent("onfocusin",function(){d=null})});;
/**
* @version: 3.1
* @author: Dan Grossman http://www.dangrossman.info/
* @copyright: Copyright (c) 2012-2019 Dan Grossman. All rights reserved.
* @license: Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php
* @website: http://www.daterangepicker.com/
*/
// Following the UMD template https://github.com/umdjs/umd/blob/master/templates/returnExportsGlobal.js
(function (root, factory) {
    if (typeof define === 'function' && define.amd) {
        // AMD. Make globaly available as well
        define(['moment', 'jquery'], function (moment, jquery) {
            if (!jquery.fn) jquery.fn = {}; // webpack server rendering
            if (typeof moment !== 'function' && moment.hasOwnProperty('default')) moment = moment['default']
            return factory(moment, jquery);
        });
    } else if (typeof module === 'object' && module.exports) {
        // Node / Browserify
        //isomorphic issue
        var jQuery = (typeof window != 'undefined') ? window.jQuery : undefined;
        if (!jQuery) {
            jQuery = require('jquery');
            if (!jQuery.fn) jQuery.fn = {};
        }
        var moment = (typeof window != 'undefined' && typeof window.moment != 'undefined') ? window.moment : require('moment');
        module.exports = factory(moment, jQuery);
    } else {
        // Browser globals
        root.daterangepicker = factory(root.moment, root.jQuery);
    }
}(typeof window !== 'undefined' ? window : this, function(moment, $) {
    var DateRangePicker = function(element, options, cb) {
        //default settings for options
        this.parentEl = 'body';
        this.element = $(element);
        this.startDate = moment().startOf('day');
        this.endDate = moment().endOf('day');
        this.minDate = false;
        this.maxDate = false;
        this.maxSpan = false;
        this.autoApply = false;
        this.singleDatePicker = false;
        this.showDropdowns = false;
        this.minYear = moment().subtract(100, 'year').format('YYYY');
        this.maxYear = moment().add(100, 'year').format('YYYY');
        this.showWeekNumbers = false;
        this.showISOWeekNumbers = false;
        this.showCustomRangeLabel = true;
        this.timePicker = false;
        this.timePicker24Hour = false;
        this.timePickerIncrement = 1;
        this.timePickerSeconds = false;
        this.linkedCalendars = true;
        this.autoUpdateInput = true;
        this.alwaysShowCalendars = false;
        this.ranges = {};
        this.opens = 'right';
        if (this.element.hasClass('pull-right'))
            this.opens = 'left';
        this.drops = 'down';
        if (this.element.hasClass('dropup'))
            this.drops = 'up';
        this.buttonClasses = 'btn btn-sm';
        this.applyButtonClasses = 'btn-primary';
        this.cancelButtonClasses = 'btn-default';
        this.locale = {
            direction: 'ltr',
            format: moment.localeData().longDateFormat('L'),
            separator: ' - ',
            applyLabel: 'Apply',
            cancelLabel: 'Cancel',
            weekLabel: 'W',
            customRangeLabel: 'Custom Range',
            daysOfWeek: moment.weekdaysMin(),
            monthNames: moment.monthsShort(),
            firstDay: moment.localeData().firstDayOfWeek()
        };
        this.callback = function() { };
        //some state information
        this.isShowing = false;
        this.leftCalendar = {};
        this.rightCalendar = {};
        //custom options from user
        if (typeof options !== 'object' || options === null)
            options = {};
        //allow setting options with data attributes
        //data-api options will be overwritten with custom javascript options
        options = $.extend(this.element.data(), options);
        //html template for the picker UI
        if (typeof options.template !== 'string' && !(options.template instanceof $))
            options.template =
            '<div class="daterangepicker">' +
                '<div class="ranges"></div>' +
                '<div class="drp-calendar left">' +
                    '<div class="calendar-table"></div>' +
                    '<div class="calendar-time"></div>' +
                '</div>' +
                '<div class="drp-calendar right">' +
                    '<div class="calendar-table"></div>' +
                    '<div class="calendar-time"></div>' +
                '</div>' +
                '<div class="drp-buttons">' +
                    '<span class="drp-selected"></span>' +
                    '<button class="cancelBtn" type="button"></button>' +
                    '<button class="applyBtn" disabled="disabled" type="button"></button> ' +
                '</div>' +
            '</div>';
        this.parentEl = (options.parentEl && $(options.parentEl).length) ? $(options.parentEl) : $(this.parentEl);
        this.container = $(options.template).appendTo(this.parentEl);
        // handle all the possible options overriding defaults
        if (typeof options.locale === 'object') {
            if (typeof options.locale.direction === 'string')
                this.locale.direction = options.locale.direction;
            if (typeof options.locale.format === 'string')
                this.locale.format = options.locale.format;
            if (typeof options.locale.separator === 'string')
                this.locale.separator = options.locale.separator;
            if (typeof options.locale.daysOfWeek === 'object')
                this.locale.daysOfWeek = options.locale.daysOfWeek.slice();
            if (typeof options.locale.monthNames === 'object')
              this.locale.monthNames = options.locale.monthNames.slice();
            if (typeof options.locale.firstDay === 'number')
              this.locale.firstDay = options.locale.firstDay;
            if (typeof options.locale.applyLabel === 'string')
              this.locale.applyLabel = options.locale.applyLabel;
            if (typeof options.locale.cancelLabel === 'string')
              this.locale.cancelLabel = options.locale.cancelLabel;
            if (typeof options.locale.weekLabel === 'string')
              this.locale.weekLabel = options.locale.weekLabel;
            if (typeof options.locale.customRangeLabel === 'string'){
                //Support unicode chars in the custom range name.
                var elem = document.createElement('textarea');
                elem.innerHTML = options.locale.customRangeLabel;
                var rangeHtml = elem.value;
                this.locale.customRangeLabel = rangeHtml;
            }
        }
        this.container.addClass(this.locale.direction);
        if (typeof options.startDate === 'string')
            this.startDate = moment(options.startDate, this.locale.format);
        if (typeof options.endDate === 'string')
            this.endDate = moment(options.endDate, this.locale.format);
        if (typeof options.minDate === 'string')
            this.minDate = moment(options.minDate, this.locale.format);
        if (typeof options.maxDate === 'string')
            this.maxDate = moment(options.maxDate, this.locale.format);
        if (typeof options.startDate === 'object')
            this.startDate = moment(options.startDate);
        if (typeof options.endDate === 'object')
            this.endDate = moment(options.endDate);
        if (typeof options.minDate === 'object')
            this.minDate = moment(options.minDate);
        if (typeof options.maxDate === 'object')
            this.maxDate = moment(options.maxDate);
        // sanity check for bad options
        if (this.minDate && this.startDate.isBefore(this.minDate))
            this.startDate = this.minDate.clone();
        // sanity check for bad options
        if (this.maxDate && this.endDate.isAfter(this.maxDate))
            this.endDate = this.maxDate.clone();
        if (typeof options.applyButtonClasses === 'string')
            this.applyButtonClasses = options.applyButtonClasses;
        if (typeof options.applyClass === 'string') //backwards compat
            this.applyButtonClasses = options.applyClass;
        if (typeof options.cancelButtonClasses === 'string')
            this.cancelButtonClasses = options.cancelButtonClasses;
        if (typeof options.cancelClass === 'string') //backwards compat
            this.cancelButtonClasses = options.cancelClass;
        if (typeof options.maxSpan === 'object')
            this.maxSpan = options.maxSpan;
        if (typeof options.dateLimit === 'object') //backwards compat
            this.maxSpan = options.dateLimit;
        if (typeof options.opens === 'string')
            this.opens = options.opens;
        if (typeof options.drops === 'string')
            this.drops = options.drops;
        if (typeof options.showWeekNumbers === 'boolean')
            this.showWeekNumbers = options.showWeekNumbers;
        if (typeof options.showISOWeekNumbers === 'boolean')
            this.showISOWeekNumbers = options.showISOWeekNumbers;
        if (typeof options.buttonClasses === 'string')
            this.buttonClasses = options.buttonClasses;
        if (typeof options.buttonClasses === 'object')
            this.buttonClasses = options.buttonClasses.join(' ');
        if (typeof options.showDropdowns === 'boolean')
            this.showDropdowns = options.showDropdowns;
        if (typeof options.minYear === 'number')
            this.minYear = options.minYear;
        if (typeof options.maxYear === 'number')
            this.maxYear = options.maxYear;
        if (typeof options.showCustomRangeLabel === 'boolean')
            this.showCustomRangeLabel = options.showCustomRangeLabel;
        if (typeof options.singleDatePicker === 'boolean') {
            this.singleDatePicker = options.singleDatePicker;
            if (this.singleDatePicker)
                this.endDate = this.startDate.clone();
        }
        if (typeof options.timePicker === 'boolean')
            this.timePicker = options.timePicker;
        if (typeof options.timePickerSeconds === 'boolean')
            this.timePickerSeconds = options.timePickerSeconds;
        if (typeof options.timePickerIncrement === 'number')
            this.timePickerIncrement = options.timePickerIncrement;
        if (typeof options.timePicker24Hour === 'boolean')
            this.timePicker24Hour = options.timePicker24Hour;
        if (typeof options.autoApply === 'boolean')
            this.autoApply = options.autoApply;
        if (typeof options.autoUpdateInput === 'boolean')
            this.autoUpdateInput = options.autoUpdateInput;
        if (typeof options.linkedCalendars === 'boolean')
            this.linkedCalendars = options.linkedCalendars;
        if (typeof options.isInvalidDate === 'function')
            this.isInvalidDate = options.isInvalidDate;
        if (typeof options.isCustomDate === 'function')
            this.isCustomDate = options.isCustomDate;
        if (typeof options.alwaysShowCalendars === 'boolean')
            this.alwaysShowCalendars = options.alwaysShowCalendars;
        // update day names order to firstDay
        if (this.locale.firstDay != 0) {
            var iterator = this.locale.firstDay;
            while (iterator > 0) {
                this.locale.daysOfWeek.push(this.locale.daysOfWeek.shift());
                iterator--;
            }
        }
        var start, end, range;
        //if no start/end dates set, check if an input element contains initial values
        if (typeof options.startDate === 'undefined' && typeof options.endDate === 'undefined') {
            if ($(this.element).is(':text')) {
                var val = $(this.element).val(),
                    split = val.split(this.locale.separator);
                start = end = null;
                if (split.length == 2) {
                    start = moment(split[0], this.locale.format);
                    end = moment(split[1], this.locale.format);
                } else if (this.singleDatePicker && val !== "") {
                    start = moment(val, this.locale.format);
                    end = moment(val, this.locale.format);
                }
                if (start !== null && end !== null) {
                    this.setStartDate(start);
                    this.setEndDate(end);
                }
            }
        }
        if (typeof options.ranges === 'object') {
            for (range in options.ranges) {
                if (typeof options.ranges[range][0] === 'string')
                    start = moment(options.ranges[range][0], this.locale.format);
                else
                    start = moment(options.ranges[range][0]);
                if (typeof options.ranges[range][1] === 'string')
                    end = moment(options.ranges[range][1], this.locale.format);
                else
                    end = moment(options.ranges[range][1]);
                // If the start or end date exceed those allowed by the minDate or maxSpan
                // options, shorten the range to the allowable period.
                if (this.minDate && start.isBefore(this.minDate))
                    start = this.minDate.clone();
                var maxDate = this.maxDate;
                if (this.maxSpan && maxDate && start.clone().add(this.maxSpan).isAfter(maxDate))
                    maxDate = start.clone().add(this.maxSpan);
                if (maxDate && end.isAfter(maxDate))
                    end = maxDate.clone();
                // If the end of the range is before the minimum or the start of the range is
                // after the maximum, don't display this range option at all.
                if ((this.minDate && end.isBefore(this.minDate, this.timepicker ? 'minute' : 'day'))
                  || (maxDate && start.isAfter(maxDate, this.timepicker ? 'minute' : 'day')))
                    continue;
                //Support unicode chars in the range names.
                var elem = document.createElement('textarea');
                elem.innerHTML = range;
                var rangeHtml = elem.value;
                this.ranges[rangeHtml] = [start, end];
            }
            var list = '<ul>';
            for (range in this.ranges) {
                list += '<li data-range-key="' + range + '">' + range + '</li>';
            }
            if (this.showCustomRangeLabel) {
                list += '<li data-range-key="' + this.locale.customRangeLabel + '">' + this.locale.customRangeLabel + '</li>';
            }
            list += '</ul>';
            this.container.find('.ranges').prepend(list);
        }
        if (typeof cb === 'function') {
            this.callback = cb;
        }
        if (!this.timePicker) {
            this.startDate = this.startDate.startOf('day');
            this.endDate = this.endDate.endOf('day');
            this.container.find('.calendar-time').hide();
        }
        //can't be used together for now
        if (this.timePicker && this.autoApply)
            this.autoApply = false;
        if (this.autoApply) {
            this.container.addClass('auto-apply');
        }
        if (typeof options.ranges === 'object')
            this.container.addClass('show-ranges');
        if (this.singleDatePicker) {
            this.container.addClass('single');
            this.container.find('.drp-calendar.left').addClass('single');
            this.container.find('.drp-calendar.left').show();
            this.container.find('.drp-calendar.right').hide();
            if (!this.timePicker && this.autoApply) {
                this.container.addClass('auto-apply');
            }
        }
        if ((typeof options.ranges === 'undefined' && !this.singleDatePicker) || this.alwaysShowCalendars) {
            this.container.addClass('show-calendar');
        }
        this.container.addClass('opens' + this.opens);
        //apply CSS classes and labels to buttons
        this.container.find('.applyBtn, .cancelBtn').addClass(this.buttonClasses);
        if (this.applyButtonClasses.length)
            this.container.find('.applyBtn').addClass(this.applyButtonClasses);
        if (this.cancelButtonClasses.length)
            this.container.find('.cancelBtn').addClass(this.cancelButtonClasses);
        this.container.find('.applyBtn').html(this.locale.applyLabel);
        this.container.find('.cancelBtn').html(this.locale.cancelLabel);
        // event listeners
        this.container.find('.drp-calendar')
            .on('click.daterangepicker', '.prev', $.proxy(this.clickPrev, this))
            .on('click.daterangepicker', '.next', $.proxy(this.clickNext, this))
            .on('mousedown.daterangepicker', 'td.available', $.proxy(this.clickDate, this))
            .on('mouseenter.daterangepicker', 'td.available', $.proxy(this.hoverDate, this))
            .on('change.daterangepicker', 'select.yearselect', $.proxy(this.monthOrYearChanged, this))
            .on('change.daterangepicker', 'select.monthselect', $.proxy(this.monthOrYearChanged, this))
            .on('change.daterangepicker', 'select.hourselect,select.minuteselect,select.secondselect,select.ampmselect', $.proxy(this.timeChanged, this));
        this.container.find('.ranges')
            .on('click.daterangepicker', 'li', $.proxy(this.clickRange, this));
        this.container.find('.drp-buttons')
            .on('click.daterangepicker', 'button.applyBtn', $.proxy(this.clickApply, this))
            .on('click.daterangepicker', 'button.cancelBtn', $.proxy(this.clickCancel, this));
        if (this.element.is('input') || this.element.is('button')) {
            this.element.on({
                'click.daterangepicker': $.proxy(this.show, this),
                'focus.daterangepicker': $.proxy(this.show, this),
                'keyup.daterangepicker': $.proxy(this.elementChanged, this),
                'keydown.daterangepicker': $.proxy(this.keydown, this) //IE 11 compatibility
            });
        } else {
            this.element.on('click.daterangepicker', $.proxy(this.toggle, this));
            this.element.on('keydown.daterangepicker', $.proxy(this.toggle, this));
        }
        // if attached to a text input, set the initial value
        this.updateElement();
    };
    DateRangePicker.prototype = {
        constructor: DateRangePicker,
        setStartDate: function(startDate) {
            if (typeof startDate === 'string')
                this.startDate = moment(startDate, this.locale.format);
            if (typeof startDate === 'object')
                this.startDate = moment(startDate);
            if (!this.timePicker)
                this.startDate = this.startDate.startOf('day');
            if (this.timePicker && this.timePickerIncrement)
                this.startDate.minute(Math.round(this.startDate.minute() / this.timePickerIncrement) * this.timePickerIncrement);
            if (this.minDate && this.startDate.isBefore(this.minDate)) {
                this.startDate = this.minDate.clone();
                if (this.timePicker && this.timePickerIncrement)
                    this.startDate.minute(Math.round(this.startDate.minute() / this.timePickerIncrement) * this.timePickerIncrement);
            }
            if (this.maxDate && this.startDate.isAfter(this.maxDate)) {
                this.startDate = this.maxDate.clone();
                if (this.timePicker && this.timePickerIncrement)
                    this.startDate.minute(Math.floor(this.startDate.minute() / this.timePickerIncrement) * this.timePickerIncrement);
            }
            if (!this.isShowing)
                this.updateElement();
            this.updateMonthsInView();
        },
        setEndDate: function(endDate) {
            if (typeof endDate === 'string')
                this.endDate = moment(endDate, this.locale.format);
            if (typeof endDate === 'object')
                this.endDate = moment(endDate);
            if (!this.timePicker)
                this.endDate = this.endDate.endOf('day');
            if (this.timePicker && this.timePickerIncrement)
                this.endDate.minute(Math.round(this.endDate.minute() / this.timePickerIncrement) * this.timePickerIncrement);
            if (this.endDate.isBefore(this.startDate))
                this.endDate = this.startDate.clone();
            if (this.maxDate && this.endDate.isAfter(this.maxDate))
                this.endDate = this.maxDate.clone();
            if (this.maxSpan && this.startDate.clone().add(this.maxSpan).isBefore(this.endDate))
                this.endDate = this.startDate.clone().add(this.maxSpan);
            this.previousRightTime = this.endDate.clone();
            this.container.find('.drp-selected').html(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
            if (!this.isShowing)
                this.updateElement();
            this.updateMonthsInView();
        },
        isInvalidDate: function() {
            return false;
        },
        isCustomDate: function() {
            return false;
        },
        updateView: function() {
            if (this.timePicker) {
                this.renderTimePicker('left');
                this.renderTimePicker('right');
                if (!this.endDate) {
                    this.container.find('.right .calendar-time select').prop('disabled', true).addClass('disabled');
                } else {
                    this.container.find('.right .calendar-time select').prop('disabled', false).removeClass('disabled');
                }
            }
            if (this.endDate)
                this.container.find('.drp-selected').html(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
            this.updateMonthsInView();
            this.updateCalendars();
            this.updateFormInputs();
        },
        updateMonthsInView: function() {
            if (this.endDate) {
                //if both dates are visible already, do nothing
                if (!this.singleDatePicker && this.leftCalendar.month && this.rightCalendar.month &&
                    (this.startDate.format('YYYY-MM') == this.leftCalendar.month.format('YYYY-MM') || this.startDate.format('YYYY-MM') == this.rightCalendar.month.format('YYYY-MM'))
                    &&
                    (this.endDate.format('YYYY-MM') == this.leftCalendar.month.format('YYYY-MM') || this.endDate.format('YYYY-MM') == this.rightCalendar.month.format('YYYY-MM'))
                    ) {
                    return;
                }
                this.leftCalendar.month = this.startDate.clone().date(2);
                if (!this.linkedCalendars && (this.endDate.month() != this.startDate.month() || this.endDate.year() != this.startDate.year())) {
                    this.rightCalendar.month = this.endDate.clone().date(2);
                } else {
                    this.rightCalendar.month = this.startDate.clone().date(2).add(1, 'month');
                }
            } else {
                if (this.leftCalendar.month.format('YYYY-MM') != this.startDate.format('YYYY-MM') && this.rightCalendar.month.format('YYYY-MM') != this.startDate.format('YYYY-MM')) {
                    this.leftCalendar.month = this.startDate.clone().date(2);
                    this.rightCalendar.month = this.startDate.clone().date(2).add(1, 'month');
                }
            }
            if (this.maxDate && this.linkedCalendars && !this.singleDatePicker && this.rightCalendar.month > this.maxDate) {
              this.rightCalendar.month = this.maxDate.clone().date(2);
              this.leftCalendar.month = this.maxDate.clone().date(2).subtract(1, 'month');
            }
        },
        updateCalendars: function() {
            if (this.timePicker) {
                var hour, minute, second;
                if (this.endDate) {
                    hour = parseInt(this.container.find('.left .hourselect').val(), 10);
                    minute = parseInt(this.container.find('.left .minuteselect').val(), 10);
                    if (isNaN(minute)) {
                        minute = parseInt(this.container.find('.left .minuteselect option:last').val(), 10);
                    }
                    second = this.timePickerSeconds ? parseInt(this.container.find('.left .secondselect').val(), 10) : 0;
                    if (!this.timePicker24Hour) {
                        var ampm = this.container.find('.left .ampmselect').val();
                        if (ampm === 'PM' && hour < 12)
                            hour += 12;
                        if (ampm === 'AM' && hour === 12)
                            hour = 0;
                    }
                } else {
                    hour = parseInt(this.container.find('.right .hourselect').val(), 10);
                    minute = parseInt(this.container.find('.right .minuteselect').val(), 10);
                    if (isNaN(minute)) {
                        minute = parseInt(this.container.find('.right .minuteselect option:last').val(), 10);
                    }
                    second = this.timePickerSeconds ? parseInt(this.container.find('.right .secondselect').val(), 10) : 0;
                    if (!this.timePicker24Hour) {
                        var ampm = this.container.find('.right .ampmselect').val();
                        if (ampm === 'PM' && hour < 12)
                            hour += 12;
                        if (ampm === 'AM' && hour === 12)
                            hour = 0;
                    }
                }
                this.leftCalendar.month.hour(hour).minute(minute).second(second);
                this.rightCalendar.month.hour(hour).minute(minute).second(second);
            }
            this.renderCalendar('left');
            this.renderCalendar('right');
            //highlight any predefined range matching the current start and end dates
            this.container.find('.ranges li').removeClass('active');
            if (this.endDate == null) return;
            this.calculateChosenLabel();
        },
        renderCalendar: function(side) {
            // Build the matrix of dates that will populate the calendar
            var calendar = side == 'left' ? this.leftCalendar : this.rightCalendar;
            var month = calendar.month.month();
            var year = calendar.month.year();
            var hour = calendar.month.hour();
            var minute = calendar.month.minute();
            var second = calendar.month.second();
            var daysInMonth = moment([year, month]).daysInMonth();
            var firstDay = moment([year, month, 1]);
            var lastDay = moment([year, month, daysInMonth]);
            var lastMonth = moment(firstDay).subtract(1, 'month').month();
            var lastYear = moment(firstDay).subtract(1, 'month').year();
            var daysInLastMonth = moment([lastYear, lastMonth]).daysInMonth();
            var dayOfWeek = firstDay.day();
            //initialize a 6 rows x 7 columns array for the calendar
            var calendar = [];
            calendar.firstDay = firstDay;
            calendar.lastDay = lastDay;
            for (var i = 0; i < 6; i++) {
                calendar[i] = [];
            }
            //populate the calendar with date objects
            var startDay = daysInLastMonth - dayOfWeek + this.locale.firstDay + 1;
            if (startDay > daysInLastMonth)
                startDay -= 7;
            if (dayOfWeek == this.locale.firstDay)
                startDay = daysInLastMonth - 6;
            var curDate = moment([lastYear, lastMonth, startDay, 12, minute, second]);
            var col, row;
            for (var i = 0, col = 0, row = 0; i < 42; i++, col++, curDate = moment(curDate).add(24, 'hour')) {
                if (i > 0 && col % 7 === 0) {
                    col = 0;
                    row++;
                }
                calendar[row][col] = curDate.clone().hour(hour).minute(minute).second(second);
                curDate.hour(12);
                if (this.minDate && calendar[row][col].format('YYYY-MM-DD') == this.minDate.format('YYYY-MM-DD') && calendar[row][col].isBefore(this.minDate) && side == 'left') {
                    calendar[row][col] = this.minDate.clone();
                }
                if (this.maxDate && calendar[row][col].format('YYYY-MM-DD') == this.maxDate.format('YYYY-MM-DD') && calendar[row][col].isAfter(this.maxDate) && side == 'right') {
                    calendar[row][col] = this.maxDate.clone();
                }
            }
            //make the calendar object available to hoverDate/clickDate
            if (side == 'left') {
                this.leftCalendar.calendar = calendar;
            } else {
                this.rightCalendar.calendar = calendar;
            }
            // Display the calendar
            var minDate = side == 'left' ? this.minDate : this.startDate;
            var maxDate = this.maxDate;
            var selected = side == 'left' ? this.startDate : this.endDate;
            var arrow = this.locale.direction == 'ltr' ? {left: 'chevron-left', right: 'chevron-right'} : {left: 'chevron-right', right: 'chevron-left'};
            var html = '<table class="table-condensed">';
            html += '<thead>';
            html += '<tr>';
            // add empty cell for week number
            if (this.showWeekNumbers || this.showISOWeekNumbers)
                html += '<th></th>';
            if ((!minDate || minDate.isBefore(calendar.firstDay)) && (!this.linkedCalendars || side == 'left')) {
                html += '<th class="prev available"><span></span></th>';
            } else {
                html += '<th></th>';
            }
            var dateHtml = this.locale.monthNames[calendar[1][1].month()] + calendar[1][1].format(" YYYY");
            if (this.showDropdowns) {
                var currentMonth = calendar[1][1].month();
                var currentYear = calendar[1][1].year();
                var maxYear = (maxDate && maxDate.year()) || (this.maxYear);
                var minYear = (minDate && minDate.year()) || (this.minYear);
                var inMinYear = currentYear == minYear;
                var inMaxYear = currentYear == maxYear;
                var monthHtml = '<select class="monthselect">';
                for (var m = 0; m < 12; m++) {
                    if ((!inMinYear || (minDate && m >= minDate.month())) && (!inMaxYear || (maxDate && m <= maxDate.month()))) {
                        monthHtml += "<option value='" + m + "'" +
                            (m === currentMonth ? " selected='selected'" : "") +
                            ">" + this.locale.monthNames[m] + "</option>";
                    } else {
                        monthHtml += "<option value='" + m + "'" +
                            (m === currentMonth ? " selected='selected'" : "") +
                            " disabled='disabled'>" + this.locale.monthNames[m] + "</option>";
                    }
                }
                monthHtml += "</select>";
                var yearHtml = '<select class="yearselect">';
                for (var y = minYear; y <= maxYear; y++) {
                    yearHtml += '<option value="' + y + '"' +
                        (y === currentYear ? ' selected="selected"' : '') +
                        '>' + y + '</option>';
                }
                yearHtml += '</select>';
                dateHtml = monthHtml + yearHtml;
            }
            html += '<th colspan="5" class="month">' + dateHtml + '</th>';
            if ((!maxDate || maxDate.isAfter(calendar.lastDay)) && (!this.linkedCalendars || side == 'right' || this.singleDatePicker)) {
                html += '<th class="next available"><span></span></th>';
            } else {
                html += '<th></th>';
            }
            html += '</tr>';
            html += '<tr>';
            // add week number label
            if (this.showWeekNumbers || this.showISOWeekNumbers)
                html += '<th class="week">' + this.locale.weekLabel + '</th>';
            $.each(this.locale.daysOfWeek, function(index, dayOfWeek) {
                html += '<th>' + dayOfWeek + '</th>';
            });
            html += '</tr>';
            html += '</thead>';
            html += '<tbody>';
            //adjust maxDate to reflect the maxSpan setting in order to
            //grey out end dates beyond the maxSpan
            if (this.endDate == null && this.maxSpan) {
                var maxLimit = this.startDate.clone().add(this.maxSpan).endOf('day');
                if (!maxDate || maxLimit.isBefore(maxDate)) {
                    maxDate = maxLimit;
                }
            }
            for (var row = 0; row < 6; row++) {
                html += '<tr>';
                // add week number
                if (this.showWeekNumbers)
                    html += '<td class="week">' + calendar[row][0].week() + '</td>';
                else if (this.showISOWeekNumbers)
                    html += '<td class="week">' + calendar[row][0].isoWeek() + '</td>';
                for (var col = 0; col < 7; col++) {
                    var classes = [];
                    //highlight today's date
                    if (calendar[row][col].isSame(new Date(), "day"))
                        classes.push('today');
                    //highlight weekends
                    if (calendar[row][col].isoWeekday() > 5)
                        classes.push('weekend');
                    //grey out the dates in other months displayed at beginning and end of this calendar
                    if (calendar[row][col].month() != calendar[1][1].month())
                        classes.push('off', 'ends');
                    //don't allow selection of dates before the minimum date
                    if (this.minDate && calendar[row][col].isBefore(this.minDate, 'day'))
                        classes.push('off', 'disabled');
                    //don't allow selection of dates after the maximum date
                    if (maxDate && calendar[row][col].isAfter(maxDate, 'day'))
                        classes.push('off', 'disabled');
                    //don't allow selection of date if a custom function decides it's invalid
                    if (this.isInvalidDate(calendar[row][col]))
                        classes.push('off', 'disabled');
                    //highlight the currently selected start date
                    if (calendar[row][col].format('YYYY-MM-DD') == this.startDate.format('YYYY-MM-DD'))
                        classes.push('active', 'start-date');
                    //highlight the currently selected end date
                    if (this.endDate != null && calendar[row][col].format('YYYY-MM-DD') == this.endDate.format('YYYY-MM-DD'))
                        classes.push('active', 'end-date');
                    //highlight dates in-between the selected dates
                    if (this.endDate != null && calendar[row][col] > this.startDate && calendar[row][col] < this.endDate)
                        classes.push('in-range');
                    //apply custom classes for this date
                    var isCustom = this.isCustomDate(calendar[row][col]);
                    if (isCustom !== false) {
                        if (typeof isCustom === 'string')
                            classes.push(isCustom);
                        else
                            Array.prototype.push.apply(classes, isCustom);
                    }
                    var cname = '', disabled = false;
                    for (var i = 0; i < classes.length; i++) {
                        cname += classes[i] + ' ';
                        if (classes[i] == 'disabled')
                            disabled = true;
                    }
                    if (!disabled)
                        cname += 'available';
                    html += '<td class="' + cname.replace(/^\s+|\s+$/g, '') + '" data-title="' + 'r' + row + 'c' + col + '">' + calendar[row][col].date() + '</td>';
                }
                html += '</tr>';
            }
            html += '</tbody>';
            html += '</table>';
            this.container.find('.drp-calendar.' + side + ' .calendar-table').html(html);
        },
        renderTimePicker: function(side) {
            // Don't bother updating the time picker if it's currently disabled
            // because an end date hasn't been clicked yet
            if (side == 'right' && !this.endDate) return;
            var html, selected, minDate, maxDate = this.maxDate;
            if (this.maxSpan && (!this.maxDate || this.startDate.clone().add(this.maxSpan).isBefore(this.maxDate)))
                maxDate = this.startDate.clone().add(this.maxSpan);
            if (side == 'left') {
                selected = this.startDate.clone();
                minDate = this.minDate;
            } else if (side == 'right') {
                selected = this.endDate.clone();
                minDate = this.startDate;
                //Preserve the time already selected
                var timeSelector = this.container.find('.drp-calendar.right .calendar-time');
                if (timeSelector.html() != '') {
                    selected.hour(!isNaN(selected.hour()) ? selected.hour() : timeSelector.find('.hourselect option:selected').val());
                    selected.minute(!isNaN(selected.minute()) ? selected.minute() : timeSelector.find('.minuteselect option:selected').val());
                    selected.second(!isNaN(selected.second()) ? selected.second() : timeSelector.find('.secondselect option:selected').val());
                    if (!this.timePicker24Hour) {
                        var ampm = timeSelector.find('.ampmselect option:selected').val();
                        if (ampm === 'PM' && selected.hour() < 12)
                            selected.hour(selected.hour() + 12);
                        if (ampm === 'AM' && selected.hour() === 12)
                            selected.hour(0);
                    }
                }
                if (selected.isBefore(this.startDate))
                    selected = this.startDate.clone();
                if (maxDate && selected.isAfter(maxDate))
                    selected = maxDate.clone();
            }
            // hours
            html = '<select class="hourselect">';
            var start = this.timePicker24Hour ? 0 : 1;
            var end = this.timePicker24Hour ? 23 : 12;
            for (var i = start; i <= end; i++) {
                var i_in_24 = i;
                if (!this.timePicker24Hour)
                    i_in_24 = selected.hour() >= 12 ? (i == 12 ? 12 : i + 12) : (i == 12 ? 0 : i);
                var time = selected.clone().hour(i_in_24);
                var disabled = false;
                if (minDate && time.minute(59).isBefore(minDate))
                    disabled = true;
                if (maxDate && time.minute(0).isAfter(maxDate))
                    disabled = true;
                if (i_in_24 == selected.hour() && !disabled) {
                    html += '<option value="' + i + '" selected="selected">' + i + '</option>';
                } else if (disabled) {
                    html += '<option value="' + i + '" disabled="disabled" class="disabled">' + i + '</option>';
                } else {
                    html += '<option value="' + i + '">' + i + '</option>';
                }
            }
            html += '</select> ';
            // minutes
            html += ': <select class="minuteselect">';
            for (var i = 0; i < 60; i += this.timePickerIncrement) {
                var padded = i < 10 ? '0' + i : i;
                var time = selected.clone().minute(i);
                var disabled = false;
                if (minDate && time.second(59).isBefore(minDate))
                    disabled = true;
                if (maxDate && time.second(0).isAfter(maxDate))
                    disabled = true;
                if (selected.minute() == i && !disabled) {
                    html += '<option value="' + i + '" selected="selected">' + padded + '</option>';
                } else if (disabled) {
                    html += '<option value="' + i + '" disabled="disabled" class="disabled">' + padded + '</option>';
                } else {
                    html += '<option value="' + i + '">' + padded + '</option>';
                }
            }
            html += '</select> ';
            // seconds
            if (this.timePickerSeconds) {
                html += ': <select class="secondselect">';
                for (var i = 0; i < 60; i++) {
                    var padded = i < 10 ? '0' + i : i;
                    var time = selected.clone().second(i);
                    var disabled = false;
                    if (minDate && time.isBefore(minDate))
                        disabled = true;
                    if (maxDate && time.isAfter(maxDate))
                        disabled = true;
                    if (selected.second() == i && !disabled) {
                        html += '<option value="' + i + '" selected="selected">' + padded + '</option>';
                    } else if (disabled) {
                        html += '<option value="' + i + '" disabled="disabled" class="disabled">' + padded + '</option>';
                    } else {
                        html += '<option value="' + i + '">' + padded + '</option>';
                    }
                }
                html += '</select> ';
            }
            // AM/PM
            if (!this.timePicker24Hour) {
                html += '<select class="ampmselect">';
                var am_html = '';
                var pm_html = '';
                if (minDate && selected.clone().hour(12).minute(0).second(0).isBefore(minDate))
                    am_html = ' disabled="disabled" class="disabled"';
                if (maxDate && selected.clone().hour(0).minute(0).second(0).isAfter(maxDate))
                    pm_html = ' disabled="disabled" class="disabled"';
                if (selected.hour() >= 12) {
                    html += '<option value="AM"' + am_html + '>AM</option><option value="PM" selected="selected"' + pm_html + '>PM</option>';
                } else {
                    html += '<option value="AM" selected="selected"' + am_html + '>AM</option><option value="PM"' + pm_html + '>PM</option>';
                }
                html += '</select>';
            }
            this.container.find('.drp-calendar.' + side + ' .calendar-time').html(html);
        },
        updateFormInputs: function() {
            if (this.singleDatePicker || (this.endDate && (this.startDate.isBefore(this.endDate) || this.startDate.isSame(this.endDate)))) {
                this.container.find('button.applyBtn').prop('disabled', false);
            } else {
                this.container.find('button.applyBtn').prop('disabled', true);
            }
        },
        move: function() {
            var parentOffset = { top: 0, left: 0 },
                containerTop,
                drops = this.drops;
            var parentRightEdge = $(window).width();
            if (!this.parentEl.is('body')) {
                parentOffset = {
                    top: this.parentEl.offset().top - this.parentEl.scrollTop(),
                    left: this.parentEl.offset().left - this.parentEl.scrollLeft()
                };
                parentRightEdge = this.parentEl[0].clientWidth + this.parentEl.offset().left;
            }
            switch (drops) {
            case 'auto':
                containerTop = this.element.offset().top + this.element.outerHeight() - parentOffset.top;
                if (containerTop + this.container.outerHeight() >= this.parentEl[0].scrollHeight) {
                    containerTop = this.element.offset().top - this.container.outerHeight() - parentOffset.top;
                    drops = 'up';
                }
                break;
            case 'up':
                containerTop = this.element.offset().top - this.container.outerHeight() - parentOffset.top;
                break;
            default:
                containerTop = this.element.offset().top + this.element.outerHeight() - parentOffset.top;
                break;
            }
            // Force the container to it's actual width
            this.container.css({
              top: 0,
              left: 0,
              right: 'auto'
            });
            var containerWidth = this.container.outerWidth();
            this.container.toggleClass('drop-up', drops == 'up');
            if (this.opens == 'left') {
                var containerRight = parentRightEdge - this.element.offset().left - this.element.outerWidth();
                if (containerWidth + containerRight > $(window).width()) {
                    this.container.css({
                        top: containerTop,
                        right: 'auto',
                        left: 9
                    });
                } else {
                    this.container.css({
                        top: containerTop,
                        right: containerRight,
                        left: 'auto'
                    });
                }
            } else if (this.opens == 'center') {
                var containerLeft = this.element.offset().left - parentOffset.left + this.element.outerWidth() / 2
                                        - containerWidth / 2;
                if (containerLeft < 0) {
                    this.container.css({
                        top: containerTop,
                        right: 'auto',
                        left: 9
                    });
                } else if (containerLeft + containerWidth > $(window).width()) {
                    this.container.css({
                        top: containerTop,
                        left: 'auto',
                        right: 0
                    });
                } else {
                    this.container.css({
                        top: containerTop,
                        left: containerLeft,
                        right: 'auto'
                    });
                }
            } else {
                var containerLeft = this.element.offset().left - parentOffset.left;
                if (containerLeft + containerWidth > $(window).width()) {
                    this.container.css({
                        top: containerTop,
                        left: 'auto',
                        right: 0
                    });
                } else {
                    this.container.css({
                        top: containerTop,
                        left: containerLeft,
                        right: 'auto'
                    });
                }
            }
        },
        show: function(e) {
            if (this.isShowing) return;
            // Create a click proxy that is private to this instance of datepicker, for unbinding
            this._outsideClickProxy = $.proxy(function(e) { this.outsideClick(e); }, this);
            // Bind global datepicker mousedown for hiding and
            $(document)
              .on('mousedown.daterangepicker', this._outsideClickProxy)
              // also support mobile devices
              .on('touchend.daterangepicker', this._outsideClickProxy)
              // also explicitly play nice with Bootstrap dropdowns, which stopPropagation when clicking them
              .on('click.daterangepicker', '[data-toggle=dropdown]', this._outsideClickProxy)
              // and also close when focus changes to outside the picker (eg. tabbing between controls)
              .on('focusin.daterangepicker', this._outsideClickProxy);
            // Reposition the picker if the window is resized while it's open
            $(window).on('resize.daterangepicker', $.proxy(function(e) { this.move(e); }, this));
            this.oldStartDate = this.startDate.clone();
            this.oldEndDate = this.endDate.clone();
            this.previousRightTime = this.endDate.clone();
            this.updateView();
            this.container.show();
            this.move();
            this.element.trigger('show.daterangepicker', this);
            this.isShowing = true;
        },
        hide: function(e) {
            if (!this.isShowing) return;
            //incomplete date selection, revert to last values
            if (!this.endDate) {
                this.startDate = this.oldStartDate.clone();
                this.endDate = this.oldEndDate.clone();
            }
            //if a new date range was selected, invoke the user callback function
            if (!this.startDate.isSame(this.oldStartDate) || !this.endDate.isSame(this.oldEndDate))
                this.callback(this.startDate.clone(), this.endDate.clone(), this.chosenLabel);
            //if picker is attached to a text input, update it
            this.updateElement();
            $(document).off('.daterangepicker');
            $(window).off('.daterangepicker');
            this.container.hide();
            this.element.trigger('hide.daterangepicker', this);
            this.isShowing = false;
        },
        toggle: function(e) {
            if (this.isShowing) {
                this.hide();
            } else {
                this.show();
            }
        },
        outsideClick: function(e) {
            var target = $(e.target);
            // if the page is clicked anywhere except within the daterangerpicker/button
            // itself then call this.hide()
            if (
                // ie modal dialog fix
                e.type == "focusin" ||
                target.closest(this.element).length ||
                target.closest(this.container).length ||
                target.closest('.calendar-table').length
                ) return;
            this.hide();
            this.element.trigger('outsideClick.daterangepicker', this);
        },
        showCalendars: function() {
            this.container.addClass('show-calendar');
            this.move();
            this.element.trigger('showCalendar.daterangepicker', this);
        },
        hideCalendars: function() {
            this.container.removeClass('show-calendar');
            this.element.trigger('hideCalendar.daterangepicker', this);
        },
        clickRange: function(e) {
            var label = e.target.getAttribute('data-range-key');
            this.chosenLabel = label;
            if (label == this.locale.customRangeLabel) {
                this.showCalendars();
            } else {
                var dates = this.ranges[label];
                this.startDate = dates[0];
                this.endDate = dates[1];
                if (!this.timePicker) {
                    this.startDate.startOf('day');
                    this.endDate.endOf('day');
                }
                if (!this.alwaysShowCalendars)
                    this.hideCalendars();
                this.clickApply();
            }
        },
        clickPrev: function(e) {
            var cal = $(e.target).parents('.drp-calendar');
            if (cal.hasClass('left')) {
                this.leftCalendar.month.subtract(1, 'month');
                if (this.linkedCalendars)
                    this.rightCalendar.month.subtract(1, 'month');
            } else {
                this.rightCalendar.month.subtract(1, 'month');
            }
            this.updateCalendars();
        },
        clickNext: function(e) {
            var cal = $(e.target).parents('.drp-calendar');
            if (cal.hasClass('left')) {
                this.leftCalendar.month.add(1, 'month');
            } else {
                this.rightCalendar.month.add(1, 'month');
                if (this.linkedCalendars)
                    this.leftCalendar.month.add(1, 'month');
            }
            this.updateCalendars();
        },
        hoverDate: function(e) {
            //ignore dates that can't be selected
            if (!$(e.target).hasClass('available')) return;
            var title = $(e.target).attr('data-title');
            var row = title.substr(1, 1);
            var col = title.substr(3, 1);
            var cal = $(e.target).parents('.drp-calendar');
            var date = cal.hasClass('left') ? this.leftCalendar.calendar[row][col] : this.rightCalendar.calendar[row][col];
            //highlight the dates between the start date and the date being hovered as a potential end date
            var leftCalendar = this.leftCalendar;
            var rightCalendar = this.rightCalendar;
            var startDate = this.startDate;
            if (!this.endDate) {
                this.container.find('.drp-calendar tbody td').each(function(index, el) {
                    //skip week numbers, only look at dates
                    if ($(el).hasClass('week')) return;
                    var title = $(el).attr('data-title');
                    var row = title.substr(1, 1);
                    var col = title.substr(3, 1);
                    var cal = $(el).parents('.drp-calendar');
                    var dt = cal.hasClass('left') ? leftCalendar.calendar[row][col] : rightCalendar.calendar[row][col];
                    if ((dt.isAfter(startDate) && dt.isBefore(date)) || dt.isSame(date, 'day')) {
                        $(el).addClass('in-range');
                    } else {
                        $(el).removeClass('in-range');
                    }
                });
            }
        },
        clickDate: function(e) {
            if (!$(e.target).hasClass('available')) return;
            var title = $(e.target).attr('data-title');
            var row = title.substr(1, 1);
            var col = title.substr(3, 1);
            var cal = $(e.target).parents('.drp-calendar');
            var date = cal.hasClass('left') ? this.leftCalendar.calendar[row][col] : this.rightCalendar.calendar[row][col];
            // this function needs to do a few things:
            // * alternate between selecting a start and end date for the range,
            // * if the time picker is enabled, apply the hour/minute/second from the select boxes to the clicked date
            // * if autoapply is enabled, and an end date was chosen, apply the selection
            // * if single date picker mode, and time picker isn't enabled, apply the selection immediately
            // * if one of the inputs above the calendars was focused, cancel that manual input
            if (this.endDate || date.isBefore(this.startDate, 'day')) { //picking start
                if (this.timePicker) {
                    var hour = parseInt(this.container.find('.left .hourselect').val(), 10);
                    if (!this.timePicker24Hour) {
                        var ampm = this.container.find('.left .ampmselect').val();
                        if (ampm === 'PM' && hour < 12)
                            hour += 12;
                        if (ampm === 'AM' && hour === 12)
                            hour = 0;
                    }
                    var minute = parseInt(this.container.find('.left .minuteselect').val(), 10);
                    if (isNaN(minute)) {
                        minute = parseInt(this.container.find('.left .minuteselect option:last').val(), 10);
                    }
                    var second = this.timePickerSeconds ? parseInt(this.container.find('.left .secondselect').val(), 10) : 0;
                    date = date.clone().hour(hour).minute(minute).second(second);
                }
                this.endDate = null;
                this.setStartDate(date.clone());
            } else if (!this.endDate && date.isBefore(this.startDate)) {
                //special case: clicking the same date for start/end,
                //but the time of the end date is before the start date
                this.setEndDate(this.startDate.clone());
            } else { // picking end
                if (this.timePicker) {
                    var hour = parseInt(this.container.find('.right .hourselect').val(), 10);
                    if (!this.timePicker24Hour) {
                        var ampm = this.container.find('.right .ampmselect').val();
                        if (ampm === 'PM' && hour < 12)
                            hour += 12;
                        if (ampm === 'AM' && hour === 12)
                            hour = 0;
                    }
                    var minute = parseInt(this.container.find('.right .minuteselect').val(), 10);
                    if (isNaN(minute)) {
                        minute = parseInt(this.container.find('.right .minuteselect option:last').val(), 10);
                    }
                    var second = this.timePickerSeconds ? parseInt(this.container.find('.right .secondselect').val(), 10) : 0;
                    date = date.clone().hour(hour).minute(minute).second(second);
                }
                this.setEndDate(date.clone());
                if (this.autoApply) {
                  this.calculateChosenLabel();
                  this.clickApply();
                }
            }
            if (this.singleDatePicker) {
                this.setEndDate(this.startDate);
                if (!this.timePicker && this.autoApply)
                    this.clickApply();
            }
            this.updateView();
            //This is to cancel the blur event handler if the mouse was in one of the inputs
            e.stopPropagation();
        },
        calculateChosenLabel: function () {
            var customRange = true;
            var i = 0;
            for (var range in this.ranges) {
              if (this.timePicker) {
                    var format = this.timePickerSeconds ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD HH:mm";
                    //ignore times when comparing dates if time picker seconds is not enabled
                    if (this.startDate.format(format) == this.ranges[range][0].format(format) && this.endDate.format(format) == this.ranges[range][1].format(format)) {
                        customRange = false;
                        this.chosenLabel = this.container.find('.ranges li:eq(' + i + ')').addClass('active').attr('data-range-key');
                        break;
                    }
                } else {
                    //ignore times when comparing dates if time picker is not enabled
                    if (this.startDate.format('YYYY-MM-DD') == this.ranges[range][0].format('YYYY-MM-DD') && this.endDate.format('YYYY-MM-DD') == this.ranges[range][1].format('YYYY-MM-DD')) {
                        customRange = false;
                        this.chosenLabel = this.container.find('.ranges li:eq(' + i + ')').addClass('active').attr('data-range-key');
                        break;
                    }
                }
                i++;
            }
            if (customRange) {
                if (this.showCustomRangeLabel) {
                    this.chosenLabel = this.container.find('.ranges li:last').addClass('active').attr('data-range-key');
                } else {
                    this.chosenLabel = null;
                }
                this.showCalendars();
            }
        },
        clickApply: function(e) {
            this.hide();
            this.element.trigger('apply.daterangepicker', this);
        },
        clickCancel: function(e) {
            this.startDate = this.oldStartDate;
            this.endDate = this.oldEndDate;
            this.hide();
            this.element.trigger('cancel.daterangepicker', this);
        },
        monthOrYearChanged: function(e) {
            var isLeft = $(e.target).closest('.drp-calendar').hasClass('left'),
                leftOrRight = isLeft ? 'left' : 'right',
                cal = this.container.find('.drp-calendar.'+leftOrRight);
            // Month must be Number for new moment versions
            var month = parseInt(cal.find('.monthselect').val(), 10);
            var year = cal.find('.yearselect').val();
            if (!isLeft) {
                if (year < this.startDate.year() || (year == this.startDate.year() && month < this.startDate.month())) {
                    month = this.startDate.month();
                    year = this.startDate.year();
                }
            }
            if (this.minDate) {
                if (year < this.minDate.year() || (year == this.minDate.year() && month < this.minDate.month())) {
                    month = this.minDate.month();
                    year = this.minDate.year();
                }
            }
            if (this.maxDate) {
                if (year > this.maxDate.year() || (year == this.maxDate.year() && month > this.maxDate.month())) {
                    month = this.maxDate.month();
                    year = this.maxDate.year();
                }
            }
            if (isLeft) {
                this.leftCalendar.month.month(month).year(year);
                if (this.linkedCalendars)
                    this.rightCalendar.month = this.leftCalendar.month.clone().add(1, 'month');
            } else {
                this.rightCalendar.month.month(month).year(year);
                if (this.linkedCalendars)
                    this.leftCalendar.month = this.rightCalendar.month.clone().subtract(1, 'month');
            }
            this.updateCalendars();
        },
        timeChanged: function(e) {
            var cal = $(e.target).closest('.drp-calendar'),
                isLeft = cal.hasClass('left');
            var hour = parseInt(cal.find('.hourselect').val(), 10);
            var minute = parseInt(cal.find('.minuteselect').val(), 10);
            if (isNaN(minute)) {
                minute = parseInt(cal.find('.minuteselect option:last').val(), 10);
            }
            var second = this.timePickerSeconds ? parseInt(cal.find('.secondselect').val(), 10) : 0;
            if (!this.timePicker24Hour) {
                var ampm = cal.find('.ampmselect').val();
                if (ampm === 'PM' && hour < 12)
                    hour += 12;
                if (ampm === 'AM' && hour === 12)
                    hour = 0;
            }
            if (isLeft) {
                var start = this.startDate.clone();
                start.hour(hour);
                start.minute(minute);
                start.second(second);
                this.setStartDate(start);
                if (this.singleDatePicker) {
                    this.endDate = this.startDate.clone();
                } else if (this.endDate && this.endDate.format('YYYY-MM-DD') == start.format('YYYY-MM-DD') && this.endDate.isBefore(start)) {
                    this.setEndDate(start.clone());
                }
            } else if (this.endDate) {
                var end = this.endDate.clone();
                end.hour(hour);
                end.minute(minute);
                end.second(second);
                this.setEndDate(end);
            }
            //update the calendars so all clickable dates reflect the new time component
            this.updateCalendars();
            //update the form inputs above the calendars with the new time
            this.updateFormInputs();
            //re-render the time pickers because changing one selection can affect what's enabled in another
            this.renderTimePicker('left');
            this.renderTimePicker('right');
        },
        elementChanged: function() {
            if (!this.element.is('input')) return;
            if (!this.element.val().length) return;
            var dateString = this.element.val().split(this.locale.separator),
                start = null,
                end = null;
            if (dateString.length === 2) {
                start = moment(dateString[0], this.locale.format);
                end = moment(dateString[1], this.locale.format);
            }
            if (this.singleDatePicker || start === null || end === null) {
                start = moment(this.element.val(), this.locale.format);
                end = start;
            }
            if (!start.isValid() || !end.isValid()) return;
            this.setStartDate(start);
            this.setEndDate(end);
            this.updateView();
        },
        keydown: function(e) {
            //hide on tab or enter
            if ((e.keyCode === 9) || (e.keyCode === 13)) {
                this.hide();
            }
            //hide on esc and prevent propagation
            if (e.keyCode === 27) {
                e.preventDefault();
                e.stopPropagation();
                this.hide();
            }
        },
        updateElement: function() {
            if (this.element.is('input') && this.autoUpdateInput) {
                var newValue = this.startDate.format(this.locale.format);
                if (!this.singleDatePicker) {
                    newValue += this.locale.separator + this.endDate.format(this.locale.format);
                }
                if (newValue !== this.element.val()) {
                    this.element.val(newValue).trigger('change');
                }
            }
        },
        remove: function() {
            this.container.remove();
            this.element.off('.daterangepicker');
            this.element.removeData();
        }
    };
    $.fn.daterangepicker = function(options, callback) {
        var implementOptions = $.extend(true, {}, $.fn.daterangepicker.defaultOptions, options);
        this.each(function() {
            var el = $(this);
            if (el.data('daterangepicker'))
                el.data('daterangepicker').remove();
            el.data('daterangepicker', new DateRangePicker(el, implementOptions, callback));
        });
        return this;
    };
    return DateRangePicker;
}));;
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";var e,i;function c(){return e.apply(null,arguments)}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function u(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function l(e){return void 0===e}function h(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function d(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function f(e,t){var n,s=[];for(n=0;n<e.length;++n)s.push(t(e[n],n));return s}function m(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function _(e,t){for(var n in t)m(t,n)&&(e[n]=t[n]);return m(t,"toString")&&(e.toString=t.toString),m(t,"valueOf")&&(e.valueOf=t.valueOf),e}function y(e,t,n,s){return Tt(e,t,n,s,!0).utc()}function g(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function v(e){if(null==e._isValid){var t=g(e),n=i.call(t.parsedDateParts,function(e){return null!=e}),s=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(s=s&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return s;e._isValid=s}return e._isValid}function p(e){var t=y(NaN);return null!=e?_(g(t),e):g(t).userInvalidated=!0,t}i=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1};var r=c.momentProperties=[];function w(e,t){var n,s,i;if(l(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),l(t._i)||(e._i=t._i),l(t._f)||(e._f=t._f),l(t._l)||(e._l=t._l),l(t._strict)||(e._strict=t._strict),l(t._tzm)||(e._tzm=t._tzm),l(t._isUTC)||(e._isUTC=t._isUTC),l(t._offset)||(e._offset=t._offset),l(t._pf)||(e._pf=g(t)),l(t._locale)||(e._locale=t._locale),0<r.length)for(n=0;n<r.length;n++)l(i=t[s=r[n]])||(e[s]=i);return e}var t=!1;function M(e){w(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===t&&(t=!0,c.updateOffset(this),t=!1)}function k(e){return e instanceof M||null!=e&&null!=e._isAMomentObject}function S(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function D(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=S(t)),n}function a(e,t,n){var s,i=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),a=0;for(s=0;s<i;s++)(n&&e[s]!==t[s]||!n&&D(e[s])!==D(t[s]))&&a++;return a+r}function Y(e){!1===c.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function n(i,r){var a=!0;return _(function(){if(null!=c.deprecationHandler&&c.deprecationHandler(null,i),a){for(var e,t=[],n=0;n<arguments.length;n++){if(e="","object"==typeof arguments[n]){for(var s in e+="\n["+n+"] ",arguments[0])e+=s+": "+arguments[0][s]+", ";e=e.slice(0,-2)}else e=arguments[n];t.push(e)}Y(i+"\nArguments: "+Array.prototype.slice.call(t).join("")+"\n"+(new Error).stack),a=!1}return r.apply(this,arguments)},r)}var s,O={};function T(e,t){null!=c.deprecationHandler&&c.deprecationHandler(e,t),O[e]||(Y(t),O[e]=!0)}function b(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function x(e,t){var n,s=_({},e);for(n in t)m(t,n)&&(u(e[n])&&u(t[n])?(s[n]={},_(s[n],e[n]),_(s[n],t[n])):null!=t[n]?s[n]=t[n]:delete s[n]);for(n in e)m(e,n)&&!m(t,n)&&u(e[n])&&(s[n]=_({},s[n]));return s}function P(e){null!=e&&this.set(e)}c.suppressDeprecationWarnings=!1,c.deprecationHandler=null,s=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)m(e,t)&&n.push(t);return n};var W={};function C(e,t){var n=e.toLowerCase();W[n]=W[n+"s"]=W[t]=e}function H(e){return"string"==typeof e?W[e]||W[e.toLowerCase()]:void 0}function R(e){var t,n,s={};for(n in e)m(e,n)&&(t=H(n))&&(s[t]=e[n]);return s}var U={};function F(e,t){U[e]=t}function L(e,t,n){var s=""+Math.abs(e),i=t-s.length;return(0<=e?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+s}var N=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,G=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,V={},E={};function I(e,t,n,s){var i=s;"string"==typeof s&&(i=function(){return this[s]()}),e&&(E[e]=i),t&&(E[t[0]]=function(){return L(i.apply(this,arguments),t[1],t[2])}),n&&(E[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function A(e,t){return e.isValid()?(t=j(t,e.localeData()),V[t]=V[t]||function(s){var e,i,t,r=s.match(N);for(e=0,i=r.length;e<i;e++)E[r[e]]?r[e]=E[r[e]]:r[e]=(t=r[e]).match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"");return function(e){var t,n="";for(t=0;t<i;t++)n+=b(r[t])?r[t].call(e,s):r[t];return n}}(t),V[t](e)):e.localeData().invalidDate()}function j(e,t){var n=5;function s(e){return t.longDateFormat(e)||e}for(G.lastIndex=0;0<=n&&G.test(e);)e=e.replace(G,s),G.lastIndex=0,n-=1;return e}var Z=/\d/,z=/\d\d/,$=/\d{3}/,q=/\d{4}/,J=/[+-]?\d{6}/,B=/\d\d?/,Q=/\d\d\d\d?/,X=/\d\d\d\d\d\d?/,K=/\d{1,3}/,ee=/\d{1,4}/,te=/[+-]?\d{1,6}/,ne=/\d+/,se=/[+-]?\d+/,ie=/Z|[+-]\d\d:?\d\d/gi,re=/Z|[+-]\d\d(?::?\d\d)?/gi,ae=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,oe={};function ue(e,n,s){oe[e]=b(n)?n:function(e,t){return e&&s?s:n}}function le(e,t){return m(oe,e)?oe[e](t._strict,t._locale):new RegExp(he(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,s,i){return t||n||s||i})))}function he(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var de={};function ce(e,n){var t,s=n;for("string"==typeof e&&(e=[e]),h(n)&&(s=function(e,t){t[n]=D(e)}),t=0;t<e.length;t++)de[e[t]]=s}function fe(e,i){ce(e,function(e,t,n,s){n._w=n._w||{},i(e,n._w,n,s)})}var me=0,_e=1,ye=2,ge=3,ve=4,pe=5,we=6,Me=7,ke=8;function Se(e){return De(e)?366:365}function De(e){return e%4==0&&e%100!=0||e%400==0}I("Y",0,0,function(){var e=this.year();return e<=9999?""+e:"+"+e}),I(0,["YY",2],0,function(){return this.year()%100}),I(0,["YYYY",4],0,"year"),I(0,["YYYYY",5],0,"year"),I(0,["YYYYYY",6,!0],0,"year"),C("year","y"),F("year",1),ue("Y",se),ue("YY",B,z),ue("YYYY",ee,q),ue("YYYYY",te,J),ue("YYYYYY",te,J),ce(["YYYYY","YYYYYY"],me),ce("YYYY",function(e,t){t[me]=2===e.length?c.parseTwoDigitYear(e):D(e)}),ce("YY",function(e,t){t[me]=c.parseTwoDigitYear(e)}),ce("Y",function(e,t){t[me]=parseInt(e,10)}),c.parseTwoDigitYear=function(e){return D(e)+(68<D(e)?1900:2e3)};var Ye,Oe=Te("FullYear",!0);function Te(t,n){return function(e){return null!=e?(xe(this,t,e),c.updateOffset(this,n),this):be(this,t)}}function be(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function xe(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&De(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Pe(n,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function Pe(e,t){if(isNaN(e)||isNaN(t))return NaN;var n,s=(t%(n=12)+n)%n;return e+=(t-s)/12,1===s?De(e)?29:28:31-s%7%2}Ye=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},I("M",["MM",2],"Mo",function(){return this.month()+1}),I("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),I("MMMM",0,0,function(e){return this.localeData().months(this,e)}),C("month","M"),F("month",8),ue("M",B),ue("MM",B,z),ue("MMM",function(e,t){return t.monthsShortRegex(e)}),ue("MMMM",function(e,t){return t.monthsRegex(e)}),ce(["M","MM"],function(e,t){t[_e]=D(e)-1}),ce(["MMM","MMMM"],function(e,t,n,s){var i=n._locale.monthsParse(e,s,n._strict);null!=i?t[_e]=i:g(n).invalidMonth=e});var We=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Ce="January_February_March_April_May_June_July_August_September_October_November_December".split("_");var He="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function Re(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=D(t);else if(!h(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),Pe(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function Ue(e){return null!=e?(Re(this,e),c.updateOffset(this,!0),this):be(this,"Month")}var Fe=ae;var Le=ae;function Ne(){function e(e,t){return t.length-e.length}var t,n,s=[],i=[],r=[];for(t=0;t<12;t++)n=y([2e3,t]),s.push(this.monthsShort(n,"")),i.push(this.months(n,"")),r.push(this.months(n,"")),r.push(this.monthsShort(n,""));for(s.sort(e),i.sort(e),r.sort(e),t=0;t<12;t++)s[t]=he(s[t]),i[t]=he(i[t]);for(t=0;t<24;t++)r[t]=he(r[t]);this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Ge(e){var t;if(e<100&&0<=e){var n=Array.prototype.slice.call(arguments);n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)}else t=new Date(Date.UTC.apply(null,arguments));return t}function Ve(e,t,n){var s=7+t-n;return-((7+Ge(e,0,s).getUTCDay()-t)%7)+s-1}function Ee(e,t,n,s,i){var r,a,o=1+7*(t-1)+(7+n-s)%7+Ve(e,s,i);return a=o<=0?Se(r=e-1)+o:o>Se(e)?(r=e+1,o-Se(e)):(r=e,o),{year:r,dayOfYear:a}}function Ie(e,t,n){var s,i,r=Ve(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?s=a+Ae(i=e.year()-1,t,n):a>Ae(e.year(),t,n)?(s=a-Ae(e.year(),t,n),i=e.year()+1):(i=e.year(),s=a),{week:s,year:i}}function Ae(e,t,n){var s=Ve(e,t,n),i=Ve(e+1,t,n);return(Se(e)-s+i)/7}I("w",["ww",2],"wo","week"),I("W",["WW",2],"Wo","isoWeek"),C("week","w"),C("isoWeek","W"),F("week",5),F("isoWeek",5),ue("w",B),ue("ww",B,z),ue("W",B),ue("WW",B,z),fe(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=D(e)});function je(e,t){return e.slice(t,7).concat(e.slice(0,t))}I("d",0,"do","day"),I("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),I("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),I("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),I("e",0,0,"weekday"),I("E",0,0,"isoWeekday"),C("day","d"),C("weekday","e"),C("isoWeekday","E"),F("day",11),F("weekday",11),F("isoWeekday",11),ue("d",B),ue("e",B),ue("E",B),ue("dd",function(e,t){return t.weekdaysMinRegex(e)}),ue("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ue("dddd",function(e,t){return t.weekdaysRegex(e)}),fe(["dd","ddd","dddd"],function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:g(n).invalidWeekday=e}),fe(["d","e","E"],function(e,t,n,s){t[s]=D(e)});var Ze="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");var ze="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");var $e="Su_Mo_Tu_We_Th_Fr_Sa".split("_");var qe=ae;var Je=ae;var Be=ae;function Qe(){function e(e,t){return t.length-e.length}var t,n,s,i,r,a=[],o=[],u=[],l=[];for(t=0;t<7;t++)n=y([2e3,1]).day(t),s=this.weekdaysMin(n,""),i=this.weekdaysShort(n,""),r=this.weekdays(n,""),a.push(s),o.push(i),u.push(r),l.push(s),l.push(i),l.push(r);for(a.sort(e),o.sort(e),u.sort(e),l.sort(e),t=0;t<7;t++)o[t]=he(o[t]),u[t]=he(u[t]),l[t]=he(l[t]);this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Xe(){return this.hours()%12||12}function Ke(e,t){I(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function et(e,t){return t._meridiemParse}I("H",["HH",2],0,"hour"),I("h",["hh",2],0,Xe),I("k",["kk",2],0,function(){return this.hours()||24}),I("hmm",0,0,function(){return""+Xe.apply(this)+L(this.minutes(),2)}),I("hmmss",0,0,function(){return""+Xe.apply(this)+L(this.minutes(),2)+L(this.seconds(),2)}),I("Hmm",0,0,function(){return""+this.hours()+L(this.minutes(),2)}),I("Hmmss",0,0,function(){return""+this.hours()+L(this.minutes(),2)+L(this.seconds(),2)}),Ke("a",!0),Ke("A",!1),C("hour","h"),F("hour",13),ue("a",et),ue("A",et),ue("H",B),ue("h",B),ue("k",B),ue("HH",B,z),ue("hh",B,z),ue("kk",B,z),ue("hmm",Q),ue("hmmss",X),ue("Hmm",Q),ue("Hmmss",X),ce(["H","HH"],ge),ce(["k","kk"],function(e,t,n){var s=D(e);t[ge]=24===s?0:s}),ce(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ce(["h","hh"],function(e,t,n){t[ge]=D(e),g(n).bigHour=!0}),ce("hmm",function(e,t,n){var s=e.length-2;t[ge]=D(e.substr(0,s)),t[ve]=D(e.substr(s)),g(n).bigHour=!0}),ce("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=D(e.substr(0,s)),t[ve]=D(e.substr(s,2)),t[pe]=D(e.substr(i)),g(n).bigHour=!0}),ce("Hmm",function(e,t,n){var s=e.length-2;t[ge]=D(e.substr(0,s)),t[ve]=D(e.substr(s))}),ce("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=D(e.substr(0,s)),t[ve]=D(e.substr(s,2)),t[pe]=D(e.substr(i))});var tt,nt=Te("Hours",!0),st={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Ce,monthsShort:He,week:{dow:0,doy:6},weekdays:Ze,weekdaysMin:$e,weekdaysShort:ze,meridiemParse:/[ap]\.?m?\.?/i},it={},rt={};function at(e){return e?e.toLowerCase().replace("_","-"):e}function ot(e){var t=null;if(!it[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=tt._abbr,require("./locale/"+e),ut(t)}catch(e){}return it[e]}function ut(e,t){var n;return e&&((n=l(t)?ht(e):lt(e,t))?tt=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),tt._abbr}function lt(e,t){if(null===t)return delete it[e],null;var n,s=st;if(t.abbr=e,null!=it[e])T("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=it[e]._config;else if(null!=t.parentLocale)if(null!=it[t.parentLocale])s=it[t.parentLocale]._config;else{if(null==(n=ot(t.parentLocale)))return rt[t.parentLocale]||(rt[t.parentLocale]=[]),rt[t.parentLocale].push({name:e,config:t}),null;s=n._config}return it[e]=new P(x(s,t)),rt[e]&&rt[e].forEach(function(e){lt(e.name,e.config)}),ut(e),it[e]}function ht(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return tt;if(!o(e)){if(t=ot(e))return t;e=[e]}return function(e){for(var t,n,s,i,r=0;r<e.length;){for(t=(i=at(e[r]).split("-")).length,n=(n=at(e[r+1]))?n.split("-"):null;0<t;){if(s=ot(i.slice(0,t).join("-")))return s;if(n&&n.length>=t&&a(i,n,!0)>=t-1)break;t--}r++}return tt}(e)}function dt(e){var t,n=e._a;return n&&-2===g(e).overflow&&(t=n[_e]<0||11<n[_e]?_e:n[ye]<1||n[ye]>Pe(n[me],n[_e])?ye:n[ge]<0||24<n[ge]||24===n[ge]&&(0!==n[ve]||0!==n[pe]||0!==n[we])?ge:n[ve]<0||59<n[ve]?ve:n[pe]<0||59<n[pe]?pe:n[we]<0||999<n[we]?we:-1,g(e)._overflowDayOfYear&&(t<me||ye<t)&&(t=ye),g(e)._overflowWeeks&&-1===t&&(t=Me),g(e)._overflowWeekday&&-1===t&&(t=ke),g(e).overflow=t),e}function ct(e,t,n){return null!=e?e:null!=t?t:n}function ft(e){var t,n,s,i,r,a=[];if(!e._d){var o,u;for(o=e,u=new Date(c.now()),s=o._useUTC?[u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()]:[u.getFullYear(),u.getMonth(),u.getDate()],e._w&&null==e._a[ye]&&null==e._a[_e]&&function(e){var t,n,s,i,r,a,o,u;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)r=1,a=4,n=ct(t.GG,e._a[me],Ie(bt(),1,4).year),s=ct(t.W,1),((i=ct(t.E,1))<1||7<i)&&(u=!0);else{r=e._locale._week.dow,a=e._locale._week.doy;var l=Ie(bt(),r,a);n=ct(t.gg,e._a[me],l.year),s=ct(t.w,l.week),null!=t.d?((i=t.d)<0||6<i)&&(u=!0):null!=t.e?(i=t.e+r,(t.e<0||6<t.e)&&(u=!0)):i=r}s<1||s>Ae(n,r,a)?g(e)._overflowWeeks=!0:null!=u?g(e)._overflowWeekday=!0:(o=Ee(n,s,i,r,a),e._a[me]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(r=ct(e._a[me],s[me]),(e._dayOfYear>Se(r)||0===e._dayOfYear)&&(g(e)._overflowDayOfYear=!0),n=Ge(r,0,e._dayOfYear),e._a[_e]=n.getUTCMonth(),e._a[ye]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=s[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ge]&&0===e._a[ve]&&0===e._a[pe]&&0===e._a[we]&&(e._nextDay=!0,e._a[ge]=0),e._d=(e._useUTC?Ge:function(e,t,n,s,i,r,a){var o;return e<100&&0<=e?(o=new Date(e+400,t,n,s,i,r,a),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,n,s,i,r,a),o}).apply(null,a),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ge]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(g(e).weekdayMismatch=!0)}}var mt=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_t=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,yt=/Z|[+-]\d\d(?::?\d\d)?/,gt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],vt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],pt=/^\/?Date\((\-?\d+)/i;function wt(e){var t,n,s,i,r,a,o=e._i,u=mt.exec(o)||_t.exec(o);if(u){for(g(e).iso=!0,t=0,n=gt.length;t<n;t++)if(gt[t][1].exec(u[1])){i=gt[t][0],s=!1!==gt[t][2];break}if(null==i)return void(e._isValid=!1);if(u[3]){for(t=0,n=vt.length;t<n;t++)if(vt[t][1].exec(u[3])){r=(u[2]||" ")+vt[t][0];break}if(null==r)return void(e._isValid=!1)}if(!s&&null!=r)return void(e._isValid=!1);if(u[4]){if(!yt.exec(u[4]))return void(e._isValid=!1);a="Z"}e._f=i+(r||"")+(a||""),Yt(e)}else e._isValid=!1}var Mt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;function kt(e,t,n,s,i,r){var a=[function(e){var t=parseInt(e,10);{if(t<=49)return 2e3+t;if(t<=999)return 1900+t}return t}(e),He.indexOf(t),parseInt(n,10),parseInt(s,10),parseInt(i,10)];return r&&a.push(parseInt(r,10)),a}var St={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Dt(e){var t,n,s,i=Mt.exec(e._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(i){var r=kt(i[4],i[3],i[2],i[5],i[6],i[7]);if(t=i[1],n=r,s=e,t&&ze.indexOf(t)!==new Date(n[0],n[1],n[2]).getDay()&&(g(s).weekdayMismatch=!0,!(s._isValid=!1)))return;e._a=r,e._tzm=function(e,t,n){if(e)return St[e];if(t)return 0;var s=parseInt(n,10),i=s%100;return(s-i)/100*60+i}(i[8],i[9],i[10]),e._d=Ge.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),g(e).rfc2822=!0}else e._isValid=!1}function Yt(e){if(e._f!==c.ISO_8601)if(e._f!==c.RFC_2822){e._a=[],g(e).empty=!0;var t,n,s,i,r,a,o,u,l=""+e._i,h=l.length,d=0;for(s=j(e._f,e._locale).match(N)||[],t=0;t<s.length;t++)i=s[t],(n=(l.match(le(i,e))||[])[0])&&(0<(r=l.substr(0,l.indexOf(n))).length&&g(e).unusedInput.push(r),l=l.slice(l.indexOf(n)+n.length),d+=n.length),E[i]?(n?g(e).empty=!1:g(e).unusedTokens.push(i),a=i,u=e,null!=(o=n)&&m(de,a)&&de[a](o,u._a,u,a)):e._strict&&!n&&g(e).unusedTokens.push(i);g(e).charsLeftOver=h-d,0<l.length&&g(e).unusedInput.push(l),e._a[ge]<=12&&!0===g(e).bigHour&&0<e._a[ge]&&(g(e).bigHour=void 0),g(e).parsedDateParts=e._a.slice(0),g(e).meridiem=e._meridiem,e._a[ge]=function(e,t,n){var s;if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):(null!=e.isPM&&((s=e.isPM(n))&&t<12&&(t+=12),s||12!==t||(t=0)),t)}(e._locale,e._a[ge],e._meridiem),ft(e),dt(e)}else Dt(e);else wt(e)}function Ot(e){var t,n,s,i,r=e._i,a=e._f;return e._locale=e._locale||ht(e._l),null===r||void 0===a&&""===r?p({nullInput:!0}):("string"==typeof r&&(e._i=r=e._locale.preparse(r)),k(r)?new M(dt(r)):(d(r)?e._d=r:o(a)?function(e){var t,n,s,i,r;if(0===e._f.length)return g(e).invalidFormat=!0,e._d=new Date(NaN);for(i=0;i<e._f.length;i++)r=0,t=w({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],Yt(t),v(t)&&(r+=g(t).charsLeftOver,r+=10*g(t).unusedTokens.length,g(t).score=r,(null==s||r<s)&&(s=r,n=t));_(e,n||t)}(e):a?Yt(e):l(n=(t=e)._i)?t._d=new Date(c.now()):d(n)?t._d=new Date(n.valueOf()):"string"==typeof n?(s=t,null===(i=pt.exec(s._i))?(wt(s),!1===s._isValid&&(delete s._isValid,Dt(s),!1===s._isValid&&(delete s._isValid,c.createFromInputFallback(s)))):s._d=new Date(+i[1])):o(n)?(t._a=f(n.slice(0),function(e){return parseInt(e,10)}),ft(t)):u(n)?function(e){if(!e._d){var t=R(e._i);e._a=f([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),ft(e)}}(t):h(n)?t._d=new Date(n):c.createFromInputFallback(t),v(e)||(e._d=null),e))}function Tt(e,t,n,s,i){var r,a={};return!0!==n&&!1!==n||(s=n,n=void 0),(u(e)&&function(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}(e)||o(e)&&0===e.length)&&(e=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=n,a._i=e,a._f=t,a._strict=s,(r=new M(dt(Ot(a))))._nextDay&&(r.add(1,"d"),r._nextDay=void 0),r}function bt(e,t,n,s){return Tt(e,t,n,s,!1)}c.createFromInputFallback=n("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),c.ISO_8601=function(){},c.RFC_2822=function(){};var xt=n("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=bt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:p()}),Pt=n("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=bt.apply(null,arguments);return this.isValid()&&e.isValid()?this<e?this:e:p()});function Wt(e,t){var n,s;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return bt();for(n=t[0],s=1;s<t.length;++s)t[s].isValid()&&!t[s][e](n)||(n=t[s]);return n}var Ct=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ht(e){var t=R(e),n=t.year||0,s=t.quarter||0,i=t.month||0,r=t.week||t.isoWeek||0,a=t.day||0,o=t.hour||0,u=t.minute||0,l=t.second||0,h=t.millisecond||0;this._isValid=function(e){for(var t in e)if(-1===Ye.call(Ct,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var n=!1,s=0;s<Ct.length;++s)if(e[Ct[s]]){if(n)return!1;parseFloat(e[Ct[s]])!==D(e[Ct[s]])&&(n=!0)}return!0}(t),this._milliseconds=+h+1e3*l+6e4*u+1e3*o*60*60,this._days=+a+7*r,this._months=+i+3*s+12*n,this._data={},this._locale=ht(),this._bubble()}function Rt(e){return e instanceof Ht}function Ut(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ft(e,n){I(e,0,0,function(){var e=this.utcOffset(),t="+";return e<0&&(e=-e,t="-"),t+L(~~(e/60),2)+n+L(~~e%60,2)})}Ft("Z",":"),Ft("ZZ",""),ue("Z",re),ue("ZZ",re),ce(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Nt(re,e)});var Lt=/([\+\-]|\d\d)/gi;function Nt(e,t){var n=(t||"").match(e);if(null===n)return null;var s=((n[n.length-1]||[])+"").match(Lt)||["-",0,0],i=60*s[1]+D(s[2]);return 0===i?0:"+"===s[0]?i:-i}function Gt(e,t){var n,s;return t._isUTC?(n=t.clone(),s=(k(e)||d(e)?e.valueOf():bt(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+s),c.updateOffset(n,!1),n):bt(e).local()}function Vt(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Et(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}c.updateOffset=function(){};var It=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,At=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function jt(e,t){var n,s,i,r=e,a=null;return Rt(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:h(e)?(r={},t?r[t]=e:r.milliseconds=e):(a=It.exec(e))?(n="-"===a[1]?-1:1,r={y:0,d:D(a[ye])*n,h:D(a[ge])*n,m:D(a[ve])*n,s:D(a[pe])*n,ms:D(Ut(1e3*a[we]))*n}):(a=At.exec(e))?(n="-"===a[1]?-1:1,r={y:Zt(a[2],n),M:Zt(a[3],n),w:Zt(a[4],n),d:Zt(a[5],n),h:Zt(a[6],n),m:Zt(a[7],n),s:Zt(a[8],n)}):null==r?r={}:"object"==typeof r&&("from"in r||"to"in r)&&(i=function(e,t){var n;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=Gt(t,e),e.isBefore(t)?n=zt(e,t):((n=zt(t,e)).milliseconds=-n.milliseconds,n.months=-n.months);return n}(bt(r.from),bt(r.to)),(r={}).ms=i.milliseconds,r.M=i.months),s=new Ht(r),Rt(e)&&m(e,"_locale")&&(s._locale=e._locale),s}function Zt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function zt(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function $t(s,i){return function(e,t){var n;return null===t||isNaN(+t)||(T(i,"moment()."+i+"(period, number) is deprecated. Please use moment()."+i+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=e,e=t,t=n),qt(this,jt(e="string"==typeof e?+e:e,t),s),this}}function qt(e,t,n,s){var i=t._milliseconds,r=Ut(t._days),a=Ut(t._months);e.isValid()&&(s=null==s||s,a&&Re(e,be(e,"Month")+a*n),r&&xe(e,"Date",be(e,"Date")+r*n),i&&e._d.setTime(e._d.valueOf()+i*n),s&&c.updateOffset(e,r||a))}jt.fn=Ht.prototype,jt.invalid=function(){return jt(NaN)};var Jt=$t(1,"add"),Bt=$t(-1,"subtract");function Qt(e,t){var n=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(n,"months");return-(n+(t-s<0?(t-s)/(s-e.clone().add(n-1,"months")):(t-s)/(e.clone().add(n+1,"months")-s)))||0}function Xt(e){var t;return void 0===e?this._locale._abbr:(null!=(t=ht(e))&&(this._locale=t),this)}c.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",c.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Kt=n("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function en(){return this._locale}var tn=126227808e5;function nn(e,t){return(e%t+t)%t}function sn(e,t,n){return e<100&&0<=e?new Date(e+400,t,n)-tn:new Date(e,t,n).valueOf()}function rn(e,t,n){return e<100&&0<=e?Date.UTC(e+400,t,n)-tn:Date.UTC(e,t,n)}function an(e,t){I(0,[e,e.length],0,t)}function on(e,t,n,s,i){var r;return null==e?Ie(this,s,i).year:((r=Ae(e,s,i))<t&&(t=r),function(e,t,n,s,i){var r=Ee(e,t,n,s,i),a=Ge(r.year,0,r.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}.call(this,e,t,n,s,i))}I(0,["gg",2],0,function(){return this.weekYear()%100}),I(0,["GG",2],0,function(){return this.isoWeekYear()%100}),an("gggg","weekYear"),an("ggggg","weekYear"),an("GGGG","isoWeekYear"),an("GGGGG","isoWeekYear"),C("weekYear","gg"),C("isoWeekYear","GG"),F("weekYear",1),F("isoWeekYear",1),ue("G",se),ue("g",se),ue("GG",B,z),ue("gg",B,z),ue("GGGG",ee,q),ue("gggg",ee,q),ue("GGGGG",te,J),ue("ggggg",te,J),fe(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=D(e)}),fe(["gg","GG"],function(e,t,n,s){t[s]=c.parseTwoDigitYear(e)}),I("Q",0,"Qo","quarter"),C("quarter","Q"),F("quarter",7),ue("Q",Z),ce("Q",function(e,t){t[_e]=3*(D(e)-1)}),I("D",["DD",2],"Do","date"),C("date","D"),F("date",9),ue("D",B),ue("DD",B,z),ue("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),ce(["D","DD"],ye),ce("Do",function(e,t){t[ye]=D(e.match(B)[0])});var un=Te("Date",!0);I("DDD",["DDDD",3],"DDDo","dayOfYear"),C("dayOfYear","DDD"),F("dayOfYear",4),ue("DDD",K),ue("DDDD",$),ce(["DDD","DDDD"],function(e,t,n){n._dayOfYear=D(e)}),I("m",["mm",2],0,"minute"),C("minute","m"),F("minute",14),ue("m",B),ue("mm",B,z),ce(["m","mm"],ve);var ln=Te("Minutes",!1);I("s",["ss",2],0,"second"),C("second","s"),F("second",15),ue("s",B),ue("ss",B,z),ce(["s","ss"],pe);var hn,dn=Te("Seconds",!1);for(I("S",0,0,function(){return~~(this.millisecond()/100)}),I(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),I(0,["SSS",3],0,"millisecond"),I(0,["SSSS",4],0,function(){return 10*this.millisecond()}),I(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),I(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),I(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),I(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),I(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),C("millisecond","ms"),F("millisecond",16),ue("S",K,Z),ue("SS",K,z),ue("SSS",K,$),hn="SSSS";hn.length<=9;hn+="S")ue(hn,ne);function cn(e,t){t[we]=D(1e3*("0."+e))}for(hn="S";hn.length<=9;hn+="S")ce(hn,cn);var fn=Te("Milliseconds",!1);I("z",0,0,"zoneAbbr"),I("zz",0,0,"zoneName");var mn=M.prototype;function _n(e){return e}mn.add=Jt,mn.calendar=function(e,t){var n=e||bt(),s=Gt(n,this).startOf("day"),i=c.calendarFormat(this,s)||"sameElse",r=t&&(b(t[i])?t[i].call(this,n):t[i]);return this.format(r||this.localeData().calendar(i,this,bt(n)))},mn.clone=function(){return new M(this)},mn.diff=function(e,t,n){var s,i,r;if(!this.isValid())return NaN;if(!(s=Gt(e,this)).isValid())return NaN;switch(i=6e4*(s.utcOffset()-this.utcOffset()),t=H(t)){case"year":r=Qt(this,s)/12;break;case"month":r=Qt(this,s);break;case"quarter":r=Qt(this,s)/3;break;case"second":r=(this-s)/1e3;break;case"minute":r=(this-s)/6e4;break;case"hour":r=(this-s)/36e5;break;case"day":r=(this-s-i)/864e5;break;case"week":r=(this-s-i)/6048e5;break;default:r=this-s}return n?r:S(r)},mn.endOf=function(e){var t;if(void 0===(e=H(e))||"millisecond"===e||!this.isValid())return this;var n=this._isUTC?rn:sn;switch(e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=36e5-nn(t+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":t=this._d.valueOf(),t+=6e4-nn(t,6e4)-1;break;case"second":t=this._d.valueOf(),t+=1e3-nn(t,1e3)-1;break}return this._d.setTime(t),c.updateOffset(this,!0),this},mn.format=function(e){e||(e=this.isUtc()?c.defaultFormatUtc:c.defaultFormat);var t=A(this,e);return this.localeData().postformat(t)},mn.from=function(e,t){return this.isValid()&&(k(e)&&e.isValid()||bt(e).isValid())?jt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},mn.fromNow=function(e){return this.from(bt(),e)},mn.to=function(e,t){return this.isValid()&&(k(e)&&e.isValid()||bt(e).isValid())?jt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},mn.toNow=function(e){return this.to(bt(),e)},mn.get=function(e){return b(this[e=H(e)])?this[e]():this},mn.invalidAt=function(){return g(this).overflow},mn.isAfter=function(e,t){var n=k(e)?e:bt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=H(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},mn.isBefore=function(e,t){var n=k(e)?e:bt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=H(t)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},mn.isBetween=function(e,t,n,s){var i=k(e)?e:bt(e),r=k(t)?t:bt(t);return!!(this.isValid()&&i.isValid()&&r.isValid())&&("("===(s=s||"()")[0]?this.isAfter(i,n):!this.isBefore(i,n))&&(")"===s[1]?this.isBefore(r,n):!this.isAfter(r,n))},mn.isSame=function(e,t){var n,s=k(e)?e:bt(e);return!(!this.isValid()||!s.isValid())&&("millisecond"===(t=H(t)||"millisecond")?this.valueOf()===s.valueOf():(n=s.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},mn.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},mn.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},mn.isValid=function(){return v(this)},mn.lang=Kt,mn.locale=Xt,mn.localeData=en,mn.max=Pt,mn.min=xt,mn.parsingFlags=function(){return _({},g(this))},mn.set=function(e,t){if("object"==typeof e)for(var n=function(e){var t=[];for(var n in e)t.push({unit:n,priority:U[n]});return t.sort(function(e,t){return e.priority-t.priority}),t}(e=R(e)),s=0;s<n.length;s++)this[n[s].unit](e[n[s].unit]);else if(b(this[e=H(e)]))return this[e](t);return this},mn.startOf=function(e){var t;if(void 0===(e=H(e))||"millisecond"===e||!this.isValid())return this;var n=this._isUTC?rn:sn;switch(e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=nn(t+(this._isUTC?0:6e4*this.utcOffset()),36e5);break;case"minute":t=this._d.valueOf(),t-=nn(t,6e4);break;case"second":t=this._d.valueOf(),t-=nn(t,1e3);break}return this._d.setTime(t),c.updateOffset(this,!0),this},mn.subtract=Bt,mn.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},mn.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},mn.toDate=function(){return new Date(this.valueOf())},mn.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||9999<n.year()?A(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):b(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",A(n,"Z")):A(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},mn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var n="["+e+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i=t+'[")]';return this.format(n+s+"-MM-DD[T]HH:mm:ss.SSS"+i)},mn.toJSON=function(){return this.isValid()?this.toISOString():null},mn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},mn.unix=function(){return Math.floor(this.valueOf()/1e3)},mn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},mn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},mn.year=Oe,mn.isLeapYear=function(){return De(this.year())},mn.weekYear=function(e){return on.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},mn.isoWeekYear=function(e){return on.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},mn.quarter=mn.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},mn.month=Ue,mn.daysInMonth=function(){return Pe(this.year(),this.month())},mn.week=mn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},mn.isoWeek=mn.isoWeeks=function(e){var t=Ie(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},mn.weeksInYear=function(){var e=this.localeData()._week;return Ae(this.year(),e.dow,e.doy)},mn.isoWeeksInYear=function(){return Ae(this.year(),1,4)},mn.date=un,mn.day=mn.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t,n,s=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(t=e,n=this.localeData(),e="string"!=typeof t?t:isNaN(t)?"number"==typeof(t=n.weekdaysParse(t))?t:null:parseInt(t,10),this.add(e-s,"d")):s},mn.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},mn.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null==e)return this.day()||7;var t,n,s=(t=e,n=this.localeData(),"string"==typeof t?n.weekdaysParse(t)%7||7:isNaN(t)?null:t);return this.day(this.day()%7?s:s-7)},mn.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},mn.hour=mn.hours=nt,mn.minute=mn.minutes=ln,mn.second=mn.seconds=dn,mn.millisecond=mn.milliseconds=fn,mn.utcOffset=function(e,t,n){var s,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null==e)return this._isUTC?i:Vt(this);if("string"==typeof e){if(null===(e=Nt(re,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(s=Vt(this)),this._offset=e,this._isUTC=!0,null!=s&&this.add(s,"m"),i!==e&&(!t||this._changeInProgress?qt(this,jt(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,c.updateOffset(this,!0),this._changeInProgress=null)),this},mn.utc=function(e){return this.utcOffset(0,e)},mn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Vt(this),"m")),this},mn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Nt(ie,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},mn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?bt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},mn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},mn.isLocal=function(){return!!this.isValid()&&!this._isUTC},mn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},mn.isUtc=Et,mn.isUTC=Et,mn.zoneAbbr=function(){return this._isUTC?"UTC":""},mn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},mn.dates=n("dates accessor is deprecated. Use date instead.",un),mn.months=n("months accessor is deprecated. Use month instead",Ue),mn.years=n("years accessor is deprecated. Use year instead",Oe),mn.zone=n("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),mn.isDSTShifted=n("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!l(this._isDSTShifted))return this._isDSTShifted;var e={};if(w(e,this),(e=Ot(e))._a){var t=e._isUTC?y(e._a):bt(e._a);this._isDSTShifted=this.isValid()&&0<a(e._a,t.toArray())}else this._isDSTShifted=!1;return this._isDSTShifted});var yn=P.prototype;function gn(e,t,n,s){var i=ht(),r=y().set(s,t);return i[n](r,e)}function vn(e,t,n){if(h(e)&&(t=e,e=void 0),e=e||"",null!=t)return gn(e,t,n,"month");var s,i=[];for(s=0;s<12;s++)i[s]=gn(e,s,n,"month");return i}function pn(e,t,n,s){t=("boolean"==typeof e?h(t)&&(n=t,t=void 0):(t=e,e=!1,h(n=t)&&(n=t,t=void 0)),t||"");var i,r=ht(),a=e?r._week.dow:0;if(null!=n)return gn(t,(n+a)%7,s,"day");var o=[];for(i=0;i<7;i++)o[i]=gn(t,(i+a)%7,s,"day");return o}yn.calendar=function(e,t,n){var s=this._calendar[e]||this._calendar.sameElse;return b(s)?s.call(t,n):s},yn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])},yn.invalidDate=function(){return this._invalidDate},yn.ordinal=function(e){return this._ordinal.replace("%d",e)},yn.preparse=_n,yn.postformat=_n,yn.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return b(i)?i(e,t,n,s):i.replace(/%d/i,e)},yn.pastFuture=function(e,t){var n=this._relativeTime[0<e?"future":"past"];return b(n)?n(t):n.replace(/%s/i,t)},yn.set=function(e){var t,n;for(n in e)b(t=e[n])?this[n]=t:this["_"+n]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},yn.months=function(e,t){return e?o(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||We).test(t)?"format":"standalone"][e.month()]:o(this._months)?this._months:this._months.standalone},yn.monthsShort=function(e,t){return e?o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[We.test(t)?"format":"standalone"][e.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},yn.monthsParse=function(e,t,n){var s,i,r;if(this._monthsParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=y([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=Ye.call(this._shortMonthsParse,a))?i:null:-1!==(i=Ye.call(this._longMonthsParse,a))?i:null:"MMM"===t?-1!==(i=Ye.call(this._shortMonthsParse,a))?i:-1!==(i=Ye.call(this._longMonthsParse,a))?i:null:-1!==(i=Ye.call(this._longMonthsParse,a))?i:-1!==(i=Ye.call(this._shortMonthsParse,a))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=y([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[s]||(r="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[s].test(e))return s;if(n&&"MMM"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}},yn.monthsRegex=function(e){return this._monthsParseExact?(m(this,"_monthsRegex")||Ne.call(this),e?this._monthsStrictRegex:this._monthsRegex):(m(this,"_monthsRegex")||(this._monthsRegex=Le),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},yn.monthsShortRegex=function(e){return this._monthsParseExact?(m(this,"_monthsRegex")||Ne.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(m(this,"_monthsShortRegex")||(this._monthsShortRegex=Fe),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},yn.week=function(e){return Ie(e,this._week.dow,this._week.doy).week},yn.firstDayOfYear=function(){return this._week.doy},yn.firstDayOfWeek=function(){return this._week.dow},yn.weekdays=function(e,t){var n=o(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?je(n,this._week.dow):e?n[e.day()]:n},yn.weekdaysMin=function(e){return!0===e?je(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},yn.weekdaysShort=function(e){return!0===e?je(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},yn.weekdaysParse=function(e,t,n){var s,i,r;if(this._weekdaysParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=y([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=Ye.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=y([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(r="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&"ddd"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&"dd"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},yn.weekdaysRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Qe.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(m(this,"_weekdaysRegex")||(this._weekdaysRegex=qe),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},yn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Qe.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(m(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Je),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},yn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Qe.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(m(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Be),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},yn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},yn.meridiem=function(e,t,n){return 11<e?n?"pm":"PM":n?"am":"AM"},ut("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===D(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),c.lang=n("moment.lang is deprecated. Use moment.locale instead.",ut),c.langData=n("moment.langData is deprecated. Use moment.localeData instead.",ht);var wn=Math.abs;function Mn(e,t,n,s){var i=jt(t,n);return e._milliseconds+=s*i._milliseconds,e._days+=s*i._days,e._months+=s*i._months,e._bubble()}function kn(e){return e<0?Math.floor(e):Math.ceil(e)}function Sn(e){return 4800*e/146097}function Dn(e){return 146097*e/4800}function Yn(e){return function(){return this.as(e)}}var On=Yn("ms"),Tn=Yn("s"),bn=Yn("m"),xn=Yn("h"),Pn=Yn("d"),Wn=Yn("w"),Cn=Yn("M"),Hn=Yn("Q"),Rn=Yn("y");function Un(e){return function(){return this.isValid()?this._data[e]:NaN}}var Fn=Un("milliseconds"),Ln=Un("seconds"),Nn=Un("minutes"),Gn=Un("hours"),Vn=Un("days"),En=Un("months"),In=Un("years");var An=Math.round,jn={ss:44,s:45,m:45,h:22,d:26,M:11};var Zn=Math.abs;function zn(e){return(0<e)-(e<0)||+e}function $n(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n=Zn(this._milliseconds)/1e3,s=Zn(this._days),i=Zn(this._months);t=S((e=S(n/60))/60),n%=60,e%=60;var r=S(i/12),a=i%=12,o=s,u=t,l=e,h=n?n.toFixed(3).replace(/\.?0+$/,""):"",d=this.asSeconds();if(!d)return"P0D";var c=d<0?"-":"",f=zn(this._months)!==zn(d)?"-":"",m=zn(this._days)!==zn(d)?"-":"",_=zn(this._milliseconds)!==zn(d)?"-":"";return c+"P"+(r?f+r+"Y":"")+(a?f+a+"M":"")+(o?m+o+"D":"")+(u||l||h?"T":"")+(u?_+u+"H":"")+(l?_+l+"M":"")+(h?_+h+"S":"")}var qn=Ht.prototype;return qn.isValid=function(){return this._isValid},qn.abs=function(){var e=this._data;return this._milliseconds=wn(this._milliseconds),this._days=wn(this._days),this._months=wn(this._months),e.milliseconds=wn(e.milliseconds),e.seconds=wn(e.seconds),e.minutes=wn(e.minutes),e.hours=wn(e.hours),e.months=wn(e.months),e.years=wn(e.years),this},qn.add=function(e,t){return Mn(this,e,t,1)},qn.subtract=function(e,t){return Mn(this,e,t,-1)},qn.as=function(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if("month"===(e=H(e))||"quarter"===e||"year"===e)switch(t=this._days+s/864e5,n=this._months+Sn(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Dn(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return 24*t+s/36e5;case"minute":return 1440*t+s/6e4;case"second":return 86400*t+s/1e3;case"millisecond":return Math.floor(864e5*t)+s;default:throw new Error("Unknown unit "+e)}},qn.asMilliseconds=On,qn.asSeconds=Tn,qn.asMinutes=bn,qn.asHours=xn,qn.asDays=Pn,qn.asWeeks=Wn,qn.asMonths=Cn,qn.asQuarters=Hn,qn.asYears=Rn,qn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*D(this._months/12):NaN},qn._bubble=function(){var e,t,n,s,i,r=this._milliseconds,a=this._days,o=this._months,u=this._data;return 0<=r&&0<=a&&0<=o||r<=0&&a<=0&&o<=0||(r+=864e5*kn(Dn(o)+a),o=a=0),u.milliseconds=r%1e3,e=S(r/1e3),u.seconds=e%60,t=S(e/60),u.minutes=t%60,n=S(t/60),u.hours=n%24,o+=i=S(Sn(a+=S(n/24))),a-=kn(Dn(i)),s=S(o/12),o%=12,u.days=a,u.months=o,u.years=s,this},qn.clone=function(){return jt(this)},qn.get=function(e){return e=H(e),this.isValid()?this[e+"s"]():NaN},qn.milliseconds=Fn,qn.seconds=Ln,qn.minutes=Nn,qn.hours=Gn,qn.days=Vn,qn.weeks=function(){return S(this.days()/7)},qn.months=En,qn.years=In,qn.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t,n,s,i,r,a,o,u,l,h,d,c=this.localeData(),f=(n=!e,s=c,i=jt(t=this).abs(),r=An(i.as("s")),a=An(i.as("m")),o=An(i.as("h")),u=An(i.as("d")),l=An(i.as("M")),h=An(i.as("y")),(d=r<=jn.ss&&["s",r]||r<jn.s&&["ss",r]||a<=1&&["m"]||a<jn.m&&["mm",a]||o<=1&&["h"]||o<jn.h&&["hh",o]||u<=1&&["d"]||u<jn.d&&["dd",u]||l<=1&&["M"]||l<jn.M&&["MM",l]||h<=1&&["y"]||["yy",h])[2]=n,d[3]=0<+t,d[4]=s,function(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}.apply(null,d));return e&&(f=c.pastFuture(+this,f)),c.postformat(f)},qn.toISOString=$n,qn.toString=$n,qn.toJSON=$n,qn.locale=Xt,qn.localeData=en,qn.toIsoString=n("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",$n),qn.lang=Kt,I("X",0,0,"unix"),I("x",0,0,"valueOf"),ue("x",se),ue("X",/[+-]?\d+(\.\d{1,3})?/),ce("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),ce("x",function(e,t,n){n._d=new Date(D(e))}),c.version="2.24.0",e=bt,c.fn=mn,c.min=function(){return Wt("isBefore",[].slice.call(arguments,0))},c.max=function(){return Wt("isAfter",[].slice.call(arguments,0))},c.now=function(){return Date.now?Date.now():+new Date},c.utc=y,c.unix=function(e){return bt(1e3*e)},c.months=function(e,t){return vn(e,t,"months")},c.isDate=d,c.locale=ut,c.invalid=p,c.duration=jt,c.isMoment=k,c.weekdays=function(e,t,n){return pn(e,t,n,"weekdays")},c.parseZone=function(){return bt.apply(null,arguments).parseZone()},c.localeData=ht,c.isDuration=Rt,c.monthsShort=function(e,t){return vn(e,t,"monthsShort")},c.weekdaysMin=function(e,t,n){return pn(e,t,n,"weekdaysMin")},c.defineLocale=lt,c.updateLocale=function(e,t){if(null!=t){var n,s,i=st;null!=(s=ot(e))&&(i=s._config),(n=new P(t=x(i,t))).parentLocale=it[e],it[e]=n,ut(e)}else null!=it[e]&&(null!=it[e].parentLocale?it[e]=it[e].parentLocale:null!=it[e]&&delete it[e]);return it[e]},c.locales=function(){return s(it)},c.weekdaysShort=function(e,t,n){return pn(e,t,n,"weekdaysShort")},c.normalizeUnits=H,c.relativeTimeRounding=function(e){return void 0===e?An:"function"==typeof e&&(An=e,!0)},c.relativeTimeThreshold=function(e,t){return void 0!==jn[e]&&(void 0===t?jn[e]:(jn[e]=t,"s"===e&&(jn.ss=t-1),!0))},c.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},c.prototype=mn,c.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},c});;
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
// Older browsers don't support event options, feature detect it.
// Adopted and modified solution from Bohdan Didukh (2017)
// https://stackoverflow.com/questions/41594997/ios-10-safari-prevent-scrolling-behind-a-fixed-overlay-and-maintain-scroll-posi
var hasPassiveEvents = false;
if (typeof window !== 'undefined') {
  var passiveTestOptions = {
    get passive() {
      hasPassiveEvents = true;
      return undefined;
    }
  };
  window.addEventListener('testPassive', null, passiveTestOptions);
  window.removeEventListener('testPassive', null, passiveTestOptions);
}
var isIosDevice = typeof window !== 'undefined' && window.navigator && window.navigator.platform && (/iP(ad|hone|od)/.test(window.navigator.platform) || window.navigator.platform === 'MacIntel' && window.navigator.maxTouchPoints > 1);
var locks = [];
var documentListenerAdded = false;
var initialClientY = -1;
var previousBodyOverflowSetting = void 0;
var previousBodyPosition = void 0;
var previousBodyPaddingRight = void 0;
// returns true if `el` should be allowed to receive touchmove events.
var allowTouchMove = function allowTouchMove(el) {
  return locks.some(function (lock) {
    if (lock.options.allowTouchMove && lock.options.allowTouchMove(el)) {
      return true;
    }
    return false;
  });
};
var preventDefault = function preventDefault(rawEvent) {
  var e = rawEvent || window.event;
  // For the case whereby consumers adds a touchmove event listener to document.
  // Recall that we do document.addEventListener('touchmove', preventDefault, { passive: false })
  // in disableBodyScroll - so if we provide this opportunity to allowTouchMove, then
  // the touchmove event on document will break.
  if (allowTouchMove(e.target)) {
    return true;
  }
  // Do not prevent if the event has more than one touch (usually meaning this is a multi touch gesture like pinch to zoom).
  if (e.touches.length > 1) return true;
  if (e.preventDefault) e.preventDefault();
  return false;
};
var setOverflowHidden = function setOverflowHidden(options) {
  // If previousBodyPaddingRight is already set, don't set it again.
  if (previousBodyPaddingRight === undefined) {
    var _reserveScrollBarGap = !!options && options.reserveScrollBarGap === true;
    var scrollBarGap = window.innerWidth - document.documentElement.clientWidth;
    if (_reserveScrollBarGap && scrollBarGap > 0) {
      var computedBodyPaddingRight = parseInt(window.getComputedStyle(document.body).getPropertyValue('padding-right'), 10);
      previousBodyPaddingRight = document.body.style.paddingRight;
      document.body.style.paddingRight = computedBodyPaddingRight + scrollBarGap + 'px';
    }
  }
  // If previousBodyOverflowSetting is already set, don't set it again.
  if (previousBodyOverflowSetting === undefined) {
    previousBodyOverflowSetting = document.body.style.overflow;
    document.body.style.overflow = 'hidden';
  }
};
var restoreOverflowSetting = function restoreOverflowSetting() {
  if (previousBodyPaddingRight !== undefined) {
    document.body.style.paddingRight = previousBodyPaddingRight;
    // Restore previousBodyPaddingRight to undefined so setOverflowHidden knows it
    // can be set again.
    previousBodyPaddingRight = undefined;
  }
  if (previousBodyOverflowSetting !== undefined) {
    document.body.style.overflow = previousBodyOverflowSetting;
    // Restore previousBodyOverflowSetting to undefined
    // so setOverflowHidden knows it can be set again.
    previousBodyOverflowSetting = undefined;
  }
};
var setPositionFixed = function setPositionFixed() {
  return window.requestAnimationFrame(function () {
    // If previousBodyPosition is already set, don't set it again.
    if (previousBodyPosition === undefined) {
      previousBodyPosition = {
        position: document.body.style.position,
        top: document.body.style.top,
        left: document.body.style.left
      };
      // Update the dom inside an animation frame
      var _window = window,
        scrollY = _window.scrollY,
        scrollX = _window.scrollX,
        innerHeight = _window.innerHeight;
      document.body.style.position = 'fixed';
      document.body.style.top = -scrollY;
      document.body.style.left = -scrollX;
      setTimeout(function () {
        return window.requestAnimationFrame(function () {
          // Attempt to check if the bottom bar appeared due to the position change
          var bottomBarHeight = innerHeight - window.innerHeight;
          if (bottomBarHeight && scrollY >= innerHeight) {
            // Move the content further up so that the bottom bar doesn't hide it
            document.body.style.top = -(scrollY + bottomBarHeight);
          }
        });
      }, 300);
    }
  });
};
var restorePositionSetting = function restorePositionSetting() {
  if (previousBodyPosition !== undefined) {
    // Convert the position from "px" to Int
    var y = -parseInt(document.body.style.top, 10);
    var x = -parseInt(document.body.style.left, 10);
    // Restore styles
    document.body.style.position = previousBodyPosition.position;
    document.body.style.top = previousBodyPosition.top;
    document.body.style.left = previousBodyPosition.left;
    // Restore scroll
    window.scrollTo(x, y);
    previousBodyPosition = undefined;
  }
};
// https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight#Problems_and_solutions
var isTargetElementTotallyScrolled = function isTargetElementTotallyScrolled(targetElement) {
  return targetElement ? targetElement.scrollHeight - targetElement.scrollTop <= targetElement.clientHeight : false;
};
var handleScroll = function handleScroll(event, targetElement) {
  var clientY = event.targetTouches[0].clientY - initialClientY;
  if (allowTouchMove(event.target)) {
    return false;
  }
  if (targetElement && targetElement.scrollTop === 0 && clientY > 0) {
    // element is at the top of its scroll.
    return preventDefault(event);
  }
  if (isTargetElementTotallyScrolled(targetElement) && clientY < 0) {
    // element is at the bottom of its scroll.
    return preventDefault(event);
  }
  event.stopPropagation();
  return true;
};
var disableBodyScroll = function disableBodyScroll(targetElement, options) {
  // targetElement must be provided
  if (!targetElement) {
    // eslint-disable-next-line no-console
    console.error('disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.');
    return;
  }
  // disableBodyScroll must not have been called on this targetElement before
  if (locks.some(function (lock) {
    return lock.targetElement === targetElement;
  })) {
    return;
  }
  var lock = {
    targetElement: targetElement,
    options: options || {}
  };
  locks = [].concat(_toConsumableArray(locks), [lock]);
  if (isIosDevice) {
    setPositionFixed();
  } else {
    setOverflowHidden(options);
  }
  if (isIosDevice) {
    targetElement.ontouchstart = function (event) {
      if (event.targetTouches.length === 1) {
        // detect single touch.
        initialClientY = event.targetTouches[0].clientY;
      }
    };
    targetElement.ontouchmove = function (event) {
      if (event.targetTouches.length === 1) {
        // detect single touch.
        handleScroll(event, targetElement);
      }
    };
    if (!documentListenerAdded) {
      document.addEventListener('touchmove', preventDefault, hasPassiveEvents ? { passive: false } : undefined);
      documentListenerAdded = true;
    }
  }
};
var clearAllBodyScrollLocks = function clearAllBodyScrollLocks() {
  if (isIosDevice) {
    // Clear all locks ontouchstart/ontouchmove handlers, and the references.
    locks.forEach(function (lock) {
      lock.targetElement.ontouchstart = null;
      lock.targetElement.ontouchmove = null;
    });
    if (documentListenerAdded) {
      document.removeEventListener('touchmove', preventDefault, hasPassiveEvents ? { passive: false } : undefined);
      documentListenerAdded = false;
    }
    // Reset initial clientY.
    initialClientY = -1;
  }
  if (isIosDevice) {
    restorePositionSetting();
  } else {
    restoreOverflowSetting();
  }
  locks = [];
};
var enableBodyScroll = function enableBodyScroll(targetElement) {
  if (!targetElement) {
    // eslint-disable-next-line no-console
    console.error('enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.');
    return;
  }
  locks = locks.filter(function (lock) {
    return lock.targetElement !== targetElement;
  });
  if (isIosDevice) {
    targetElement.ontouchstart = null;
    targetElement.ontouchmove = null;
    if (documentListenerAdded && locks.length === 0) {
      document.removeEventListener('touchmove', preventDefault, hasPassiveEvents ? { passive: false } : undefined);
      documentListenerAdded = false;
    }
  }
  if (isIosDevice) {
    restorePositionSetting();
  } else {
    restoreOverflowSetting();
  }
};;
const getElementMenu = (context, selector) => {
    if (!context && !selector) {
        return null;
    }
    return context.querySelector(selector);
};
function getMobileOperatingSystem() {
    var userAgent = navigator.userAgent || navigator.vendor || window.opera;
    // Windows Phone must come first because its UA also contains "Android"
    if (/windows phone/i.test(userAgent)) {
        return "Windows Phone";
    }
    if (/android/i.test(userAgent)) {
        return "Android";
    }
    // iOS detection from: http://stackoverflow.com/a/9039885/177710
    if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
        return "iOS";
    }
    return "unknown";
}
const arrayFrom = Array.from;
const getElements = (context, selector, returnAsArray = false) => {
    if (!context || !selector) {
        return [];
    }
    return returnAsArray ? arrayFrom(context.querySelectorAll(selector)) : context.querySelectorAll(selector);
};
const getSiblings = (element, parent) => {
    if (!element && !parent) {
        return [];
    }
    const children = [...parent.children];
    return children.filter(child => child !== element);
};
function addActive(item) {
    if ($(item).is('div')) return;
    item.classList.add('is-active');
    item.setAttribute('aria-expanded', 'true');
    getSiblings(item, item.parentElement).forEach(el => {
        el.classList.remove('is-active');
        el.setAttribute('aria-expanded', 'false');
    });
}
function clearList(context) {
    getElements(context, '.nav-menu__list-item').forEach(item => {
        item.classList.remove('is-active');
        item.setAttribute('aria-expanded', 'false');
    });
}
function clearColumn(column) {
    column.classList.remove('is-show');
    clearList(column);
}
function menu() {
    const element = getElementMenu(document, '.js-menu');
    if (!element) {
        return;
    }
    let mar = []
    let myTimeout;
    const eventsFunc = function (event) {
        const item = event.target.closest('.nav-menu__list-item');
        console.log("eventsFunc, item : ", event);
        if (item) {
            const parentId = item.dataset.id;
            const nextColumn = item.closest('.nav-menu__column').nextElementSibling;
            const column = item.closest('.nav-menu__column');
            if (!nextColumn) return;
            addActive(item);
            if (parentId) {
                const subMenu = getElements(nextColumn, `[data-parent="${parentId}"]`);
                if (subMenu.length) {
                    nextColumn.classList.add('is-show');
                    nextColumn.focus();
                    Array.from(nextColumn.querySelectorAll('.nav-menu__list-item')).forEach((link, i) => {
                        link.classList.toggle('is-show', (
                            link.dataset.parent === parentId
                        ));
                    });
                    Array.from(nextColumn.querySelectorAll('.nav-menu__column-bottom')).forEach((bottom, i) => {
                        bottom.classList.remove('show')
                    });
                } else {
                    nextColumn.classList.remove('is-show');
                }
            }
            if (event.type === 'touchend' || event.type === 'click' || event.type === 'keydown') {
                const back = nextColumn.querySelector('.nav-menu__back');
                if (event.target.classList.contains('nav-link__arrow')) {
                    back.querySelector('span').innerText = event.target.closest('.nav-link').querySelector('.nav-link__text').innerText
                } else {
                    back.querySelector('span').innerText = event.target.innerText;
                }
                back.addEventListener('touchend', () => {
                    setTimeout(() => {
                        back.closest('.nav-menu__column').classList.remove('is-show');
                    }, 1)
                })
                back.addEventListener('keydown', () => {
                    setTimeout(() => {
                        back.closest('.nav-menu__column').classList.remove('is-show');
                    }, 1)
                })
                back.addEventListener('click', () => {
                    setTimeout(() => {
                        back.closest('.nav-menu__column').classList.remove('is-show');
                    }, 1)
                })
                var $navMenuLastItem = $(".nav-menu__column-list nav-menu__list-item.is-show").last();
                $navMenuLastItem.bind("keydown",
                    function (e) {
                        if (e.keyCode === 9)
                            setTimeout(function () {
                                $(".nav-menu__close").focus();
                            }, 300);
                    });
            }
        }
    }
    if (getMobileOperatingSystem() === "iOS" || getMobileOperatingSystem() === "Android") {
        element.addEventListener('touchend', (event) => {
            setTimeout(() => {
                eventsFunc(event)
            }, 1)
        });
        element.addEventListener('keydown', (event) => {
            if (event.keyCode === 13) {
                // Your code to handle the "Enter" key press
                console.log("Enter key pressed");
                setTimeout(() => {
                    eventsFunc(event)
                }, 1)
            }
        });
    } else if (getMobileOperatingSystem() === "unknown" && window.innerWidth <= 1280 && window.innerWidth > 1024) {
        element.addEventListener('keydown', (event) => {
            var code = event.keyCode || event.which;
            if (code === 13 || code === 37) {
                eventsFunc(event)
            }
        });
        element.addEventListener('click', (event) => {
            eventsFunc(event)
        });
    } else {
        element.addEventListener('keydown', (event) => {
            var code = event.keyCode || event.which;
            if (code === 13 || code === 37) {
                eventsFunc(event)
            }
        });
        element.addEventListener('mouseover', (event) => {
            eventsFunc(event)
        });
    }
    getElements(element, '.nav-menu__column').forEach(column => {
        column.addEventListener('mouseenter', (e) => {
            const nextColumn = e.target.nextElementSibling;
            if (nextColumn) {
                clearColumn(nextColumn);
                const lastColumn = nextColumn.nextElementSibling;
                if (lastColumn) {
                    clearColumn(lastColumn);
                }
            }
        });
    });
    getElements(element, '.nav-menu__list-item').forEach(item => {
        item.addEventListener('mouseenter', () => {
            bottomLinksDisplay();
        });
        item.addEventListener('mouseleave', () => {
            clearTimeout(myTimeout);
        });
        item.addEventListener('focusin', () => {
            bottomLinksDisplay();
        });
        item.addEventListener('focusout', () => {
            clearTimeout(myTimeout);
        });
        item.addEventListener('keydown', (e) => {
            if (e.keyCode === 39) {
                document.querySelector('.start').classList.add('hide');
                item.closest('.nav-menu__column').querySelectorAll('.nav-menu__column-bottom').forEach((bottom) => {
                    if (bottom.dataset.id === item.dataset.id) {
                        bottom.classList.remove('show')
                    }
                });
            }
        });
        $('.column-link').attr('tabindex', '-1');
        $('.nav-menu__list-item').attr('role', 'menu');
        function bottomLinksDisplay() {
            const parentId = item.dataset.id;
            document.querySelector('.start').classList.add('hide');
            myTimeout = setTimeout(function () {
                item.closest('.nav-menu__column').querySelectorAll('.nav-menu__column-bottom').forEach((bottom) => {
                    if (bottom.dataset.id !== parentId) {
                        bottom.classList.remove('show')
                    }
                })
                document.querySelector('.nav-menu__column-bottom[data-id="' + parentId + '"]').classList.add('show');
            }, 350);
        }
    });
    getElementMenu(document, '.nav-menu__wrap').addEventListener('mouseleave', () => {
        getElements(element, '.nav-menu__column--inner').forEach(column => {
            column.classList.remove('is-show');
        });
        clearList(element);
    });
}
menu();
!function(){var s,i,c,a,o={frameRate:150,animationTime:400,stepSize:100,pulseAlgorithm:!0,pulseScale:4,pulseNormalize:1,accelerationDelta:50,accelerationMax:3,keyboardSupport:!0,arrowScroll:50,fixedBackground:!0,excluded:""},p=o,u=!1,d=!1,n={x:0,y:0},f=!1,m=document.documentElement,l=[],h=/^Mac/.test(navigator.platform),w={left:37,up:38,right:39,down:40,spacebar:32,pageup:33,pagedown:34,end:35,home:36},v={37:1,38:1,39:1,40:1};function y(){if(!f&&document.body){f=!0;var e=document.body,t=document.documentElement,o=window.innerHeight,n=e.scrollHeight;if(m=0<=document.compatMode.indexOf("CSS")?t:e,s=e,p.keyboardSupport&&Y("keydown",x),top!=self)d=!0;else if(Q&&o<n&&(e.offsetHeight<=o||t.offsetHeight<=o)){var r,a=document.createElement("div");a.style.cssText="position:absolute; z-index:-10000; top:0; left:0; right:0; height:"+m.scrollHeight+"px",document.body.appendChild(a),c=function(){r=r||setTimeout(function(){u||(a.style.height="0",a.style.height=m.scrollHeight+"px",r=null)},500)},setTimeout(c,10),Y("resize",c);if((i=new R(c)).observe(e,{attributes:!0,childList:!0,characterData:!1}),m.offsetHeight<=o){var l=document.createElement("div");l.style.clear="both",e.appendChild(l)}}p.fixedBackground||u||(e.style.backgroundAttachment="scroll",t.style.backgroundAttachment="scroll")}}var b=[],g=!1,r=Date.now();function S(d,f,m){if(function(e,t){e=0<e?1:-1,t=0<t?1:-1,n.x===e&&n.y===t||(n.x=e,n.y=t,b=[],r=0)}(f,m),1!=p.accelerationMax){var e=Date.now()-r;if(e<p.accelerationDelta){var t=(1+50/e)/2;1<t&&(t=Math.min(t,p.accelerationMax),f*=t,m*=t)}r=Date.now()}if(b.push({x:f,y:m,lastX:f<0?.99:-.99,lastY:m<0?.99:-.99,start:Date.now()}),!g){var o=q(),h=d===o||d===document.body;null==d.$scrollBehavior&&function(e){var t=M(e);if(null==B[t]){var o=getComputedStyle(e,"")["scroll-behavior"];B[t]="smooth"==o}return B[t]}(d)&&(d.$scrollBehavior=d.style.scrollBehavior,d.style.scrollBehavior="auto");var w=function(e){for(var t=Date.now(),o=0,n=0,r=0;r<b.length;r++){var a=b[r],l=t-a.start,i=l>=p.animationTime,c=i?1:l/p.animationTime;p.pulseAlgorithm&&(c=F(c));var s=a.x*c-a.lastX>>0,u=a.y*c-a.lastY>>0;o+=s,n+=u,a.lastX+=s,a.lastY+=u,i&&(b.splice(r,1),r--)}h?window.scrollBy(o,n):(o&&(d.scrollLeft+=o),n&&(d.scrollTop+=n)),f||m||(b=[]),b.length?j(w,d,1e3/p.frameRate+1):(g=!1,null!=d.$scrollBehavior&&(d.style.scrollBehavior=d.$scrollBehavior,d.$scrollBehavior=null))};j(w,d,0),g=!0}}function e(e){f||y();var t=e.target;if(e.defaultPrevented||e.ctrlKey)return!0;if(N(s,"embed")||N(t,"embed")&&/\.pdf/i.test(t.src)||N(s,"object")||t.shadowRoot)return!0;var o=-e.wheelDeltaX||e.deltaX||0,n=-e.wheelDeltaY||e.deltaY||0;h&&(e.wheelDeltaX&&K(e.wheelDeltaX,120)&&(o=e.wheelDeltaX/Math.abs(e.wheelDeltaX)*-120),e.wheelDeltaY&&K(e.wheelDeltaY,120)&&(n=e.wheelDeltaY/Math.abs(e.wheelDeltaY)*-120)),o||n||(n=-e.wheelDelta||0),1===e.deltaMode&&(o*=40,n*=40);var r=z(t);return r?!!function(e){if(!e)return;l.length||(l=[e,e,e]);e=Math.abs(e),l.push(e),l.shift(),clearTimeout(a),a=setTimeout(function(){try{localStorage.SS_deltaBuffer=l.join(",")}catch(e){}},1e3);var t=120<e&&P(e),o=!P(120)&&!P(100)&&!t;return e<50||o}(n)||(1.2<Math.abs(o)&&(o*=p.stepSize/120),1.2<Math.abs(n)&&(n*=p.stepSize/120),S(r,o,n),e.preventDefault(),void C()):!d||!W||(Object.defineProperty(e,"target",{value:window.frameElement}),parent.wheel(e))}function x(e){var t=e.target,o=e.ctrlKey||e.altKey||e.metaKey||e.shiftKey&&e.keyCode!==w.spacebar;document.body.contains(s)||(s=document.activeElement);var n=/^(button|submit|radio|checkbox|file|color|image)$/i;if(e.defaultPrevented||/^(textarea|select|embed|object)$/i.test(t.nodeName)||N(t,"input")&&!n.test(t.type)||N(s,"video")||function(e){var t=e.target,o=!1;if(-1!=document.URL.indexOf("www.youtube.com/watch"))do{if(o=t.classList&&t.classList.contains("html5-video-controls"))break}while(t=t.parentNode);return o}(e)||t.isContentEditable||o)return!0;if((N(t,"button")||N(t,"input")&&n.test(t.type))&&e.keyCode===w.spacebar)return!0;if(N(t,"input")&&"radio"==t.type&&v[e.keyCode])return!0;var r=0,a=0,l=z(s);if(!l)return!d||!W||parent.keydown(e);var i=l.clientHeight;switch(l==document.body&&(i=window.innerHeight),e.keyCode){case w.up:a=-p.arrowScroll;break;case w.down:a=p.arrowScroll;break;case w.spacebar:a=-(e.shiftKey?1:-1)*i*.9;break;case w.pageup:a=.9*-i;break;case w.pagedown:a=.9*i;break;case w.home:l==document.body&&document.scrollingElement&&(l=document.scrollingElement),a=-l.scrollTop;break;case w.end:var c=l.scrollHeight-l.scrollTop-i;a=0<c?10+c:0;break;case w.left:r=-p.arrowScroll;break;case w.right:r=p.arrowScroll;break;default:return!0}S(l,r,a),e.preventDefault(),C()}function t(e){s=e.target}var k,D,M=(k=0,function(e){return e.uniqueID||(e.uniqueID=k++)}),E={},T={},B={};function C(){clearTimeout(D),D=setInterval(function(){E=T=B={}},1e3)}function H(e,t,o){for(var n=o?E:T,r=e.length;r--;)n[M(e[r])]=t;return t}function z(e){var t=[],o=document.body,n=m.scrollHeight;do{var r=(!1?E:T)[M(e)];if(r)return H(t,r);if(t.push(e),n===e.scrollHeight){var a=O(m)&&O(o)||X(m);if(d&&L(m)||!d&&a)return H(t,q())}else if(L(e)&&X(e))return H(t,e)}while(e=e.parentElement)}function L(e){return e.clientHeight+10<e.scrollHeight}function O(e){return"hidden"!==getComputedStyle(e,"").getPropertyValue("overflow-y")}function X(e){var t=getComputedStyle(e,"").getPropertyValue("overflow-y");return"scroll"===t||"auto"===t}function Y(e,t,o){window.addEventListener(e,t,o||!1)}function A(e,t,o){window.removeEventListener(e,t,o||!1)}function N(e,t){return e&&(e.nodeName||"").toLowerCase()===t.toLowerCase()}if(window.localStorage&&localStorage.SS_deltaBuffer)try{l=localStorage.SS_deltaBuffer.split(",")}catch(e){}function K(e,t){return Math.floor(e/t)==e/t}function P(e){return K(l[0],e)&&K(l[1],e)&&K(l[2],e)}var $,j=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e,t,o){window.setTimeout(e,o||1e3/60)},R=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,q=($=document.scrollingElement,function(){if(!$){var e=document.createElement("div");e.style.cssText="height:10000px;width:1px;",document.body.appendChild(e);var t=document.body.scrollTop;document.documentElement.scrollTop,window.scrollBy(0,3),$=document.body.scrollTop!=t?document.body:document.documentElement,window.scrollBy(0,-3),document.body.removeChild(e)}return $});function V(e){var t;return((e*=p.pulseScale)<1?e-(1-Math.exp(-e)):(e-=1,(t=Math.exp(-1))+(1-Math.exp(-e))*(1-t)))*p.pulseNormalize}function F(e){return 1<=e?1:e<=0?0:(1==p.pulseNormalize&&(p.pulseNormalize/=V(1)),V(e))}var I=window.navigator.userAgent,_=/Edge/.test(I),W=/chrome/i.test(I)&&!_,U=/safari/i.test(I)&&!_,G=/mobile/i.test(I),J=/Windows NT 6.1/i.test(I)&&/rv:11/i.test(I),Q=U&&(/Version\/8/i.test(I)||/Version\/9/i.test(I)),Z=(W||U||J)&&!G,ee=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){ee=!0}}))}catch(e){}var te=!!ee&&{passive:!1},oe="onwheel"in document.createElement("div")?"wheel":"mousewheel";function ne(e){for(var t in e)o.hasOwnProperty(t)&&(p[t]=e[t])}oe&&Z&&(Y(oe,e,te),Y("mousedown",t),Y("load",y)),ne.destroy=function(){i&&i.disconnect(),A(oe,e),A("mousedown",t),A("keydown",x),A("resize",c),A("load",y)},window.SmoothScrollOptions&&ne(window.SmoothScrollOptions),"function"==typeof define&&define.amd?define(function(){return ne}):"object"==typeof exports?module.exports=ne:window.SmoothScroll=ne}();;
window.localStorageHandler = function () {
    var localStorageKey = "favorites";
    var combinationKey = "combination";
    var scholarshipKey = "scholarship";
    var programForExcellenceKey = "programForExcellence";
    var baCategoryKey = "bACategory";
    //all keys need to be exactly syntax the aliases of block lists
    //get local storage data
    var getLocalStorage = function () {
        return JSON.parse(localStorage.getItem(localStorageKey));
    }
    var getCurrentDataArray = function(alias) {
        let currentLocalStorage = getLocalStorage();
        if (currentLocalStorage === undefined)
            return;
        switch (alias) {
        case baCategoryKey:
            return currentLocalStorage.baCategories.nodeIds;
        case combinationKey:
                return currentLocalStorage.combinations.nodeIds;
            case scholarshipKey:
                return currentLocalStorage.scholarships.nodeIds;
        case programForExcellenceKey:
                return currentLocalStorage.programsForExcellence.nodeIds;
        default:
        }
    };
    //check if ba node id available in current data alias
    var isInAliasLocalStorage = function (alias, baNodeId) {
        var resIndex = -1;
        var currentData = getCurrentDataArray(alias);
        if (currentData === undefined)
            return false;
        currentData.forEach(( nodeId,index) => {
            if (nodeId === baNodeId) {
                resIndex = index;
                return false;
            }
        });
        return resIndex;
    }
    //reset local storage for current alias
    var resetAliasLocalStorage = function () {
        let localStorageData = getLocalStorage();
        if (localStorageData == null) {
            // initialize all lists if localStorageData is null
            var data = {
                baCategories: {
                    alias: baCategoryKey,
                    nodeIds: []
                },
                combinations: {
                    alias: combinationKey,
                    nodeIds: []
                },
                scholarships: {
                    alias: scholarshipKey,
                    nodeIds: []
                },
                programsForExcellence: {
                    alias: programForExcellenceKey,
                    nodeIds: []
                },
            };
            localStorage.setItem(localStorageKey, JSON.stringify(data));
        } else {
            // check if each list is empty and initialize it if it is
            var data = localStorageData;
            if (data.baCategories == undefined || data.baCategories.nodeIds.length === 0) {
                data.baCategories = {
                    alias: baCategoryKey,
                    nodeIds: []
                };
            }
            if (data.combinations == undefined || data.combinations.nodeIds.length === 0) {
                data.combinations = {
                    alias: combinationKey,
                    nodeIds: []
                };
            }
            if (data.scholarships== undefined || data.scholarships.nodeIds.length === 0) {
                data.scholarships = {
                    alias: scholarshipKey,
                    nodeIds: []
                };
            }
            if (data.programsForExcellence == undefined || data.programsForExcellence.nodeIds.length === 0) {
                data.programsForExcellence = {
                    alias: programForExcellenceKey,
                    nodeIds: []
                };
            }
            localStorage.setItem(localStorageKey, JSON.stringify(data));
        }
    }
    //set item for current alias local storage
    var setItemForAliasLocalStorage = function (nodeId, alias) {
        var localStorageData = getLocalStorage();
        var isAliasInLocalStorage = isInAliasLocalStorage(alias, nodeId);
        if (isAliasInLocalStorage === -1) {
            switch (alias) {
            case baCategoryKey:
            {      localStorageData.baCategories.nodeIds.push(nodeId);
                break;
            }
            case combinationKey:
            {      localStorageData.combinations.nodeIds.push(nodeId);
                break;
            }
                case scholarshipKey:
            {
                localStorageData.scholarships.nodeIds.push(nodeId);
                break;
            }
            case programForExcellenceKey:
            {
                localStorageData.programsForExcellence.nodeIds.push(nodeId);
                break;
            }
            default:
            }
            localStorage.setItem(localStorageKey, JSON.stringify(localStorageData));
        }
    }
    //remove item for current alias local storage
    var removeItemForAliasLocalStorage = function (baNodeId, alias) {
        var localStorageData = getLocalStorage();
        var isAliasInLocalStorage = isInAliasLocalStorage(alias, baNodeId);
        if (isAliasInLocalStorage !== -1) {
            switch (alias) {
            case baCategoryKey:
                localStorageData.baCategories.nodeIds.splice(isAliasInLocalStorage,1);
                break;
            case combinationKey:
                    localStorageData.combinations.nodeIds.splice(isAliasInLocalStorage,1);
                    break;
                case scholarshipKey:
                    localStorageData.scholarships.nodeIds.splice(isAliasInLocalStorage, 1);
                    break;
            case programForExcellenceKey:
                localStorageData.programsForExcellence.nodeIds.splice(isAliasInLocalStorage, 1);
                break;
            default:
            }
            localStorage.setItem(localStorageKey, JSON.stringify(localStorageData));
        }
    }
    //return list of nodeIds which appear in local storage and appear on current page
    var nodeIdsAvailableOnCurrentPage = function (nodeIds) {
        var nodeIdsAvailableData = [];
        nodeIds.forEach((nodeId) => {
            var nodeIdAvailableOnCurrentPage = $("[node-id=" + nodeId + "]");
            if (nodeIdAvailableOnCurrentPage.length != 0)
                nodeIdsAvailableData.push(nodeId);
        });
        return nodeIdsAvailableData;
    }
    var getBaCategoriesIds=function() {
        var dataLocalStorage = getLocalStorage();
        return dataLocalStorage.baCategories.nodeIds;
    }
    var getCombinationsIds = function () {
        var dataLocalStorage = getLocalStorage();
        return dataLocalStorage.combinations.nodeIds;
    }
    var getScholarshipIds = function () {
        var dataLocalStorage = getLocalStorage();
        return dataLocalStorage?.scholarships?.nodeIds;
    }
    var getProgramsForExcellenceIds = function () {
        var dataLocalStorage = getLocalStorage();
        return dataLocalStorage.programsForExcellence.nodeIds;
    }
    //count current favorites node ids from all arrays: combinationKey and baCategory
    var getCountFavorites=function () {
        var localStorageData = getLocalStorage();
        return localStorageData.combinations?.nodeIds?.length + localStorageData.baCategories.nodeIds.length;
    }
    //when loading handler reset all aliases for local storage
    var initLocalStorage = function () {
        resetAliasLocalStorage();
    };
    return {
        init: function () {
            initLocalStorage();
        },
        isInAliasLocalStorage: function (alias, baNodeId) {
            return  isInAliasLocalStorage(alias, baNodeId);
        },
        getLocalStorage: function () {
            return getLocalStorage();
        },
        setLocalStorage: function (degree, alias) {
            setItemForAliasLocalStorage(degree, alias);
        },
        removeItemFromLocalStorage: function (degree, alias) {
            removeItemForAliasLocalStorage(degree, alias);
        },
        getCountFavorites:function() {
            return getCountFavorites();
        },
        getBaCategoriesIds:function() {
            return getBaCategoriesIds();
        },
        getCombinationsIds: function () {
            return getCombinationsIds();
        },
        getScholarshipIds: function () {
            return getScholarshipIds();
        },
        getProgramsForExcellenceIds: function () {
            return getProgramsForExcellenceIds();
        },
        nodeIdsAvailableOnCurrentPage:function(nodeIds) {
            return nodeIdsAvailableOnCurrentPage(nodeIds);
        },
        getCurrentDataArray:function(alias) {
            return getCurrentDataArray(alias);
        },
        localStorageKey: function () { return localStorageKey },
        getCombinationKey: function () { return combinationKey },
        getBaCategoryKey: function () { return baCategoryKey },
        getScholarshipKey: function () { return scholarshipKey },
        getProgramForExcellenceKey: function () { return programForExcellenceKey }
    };
}();;
window.favoritesHandler = function () {
    var getBaNodeId = function (sender) {
        var $sender = $(sender);
        var nodeId = $sender.closest(".service-item,.service-item__top")
            .closest("*[node-id]").attr("node-id");
        if (nodeId)
            return nodeId;
        nodeId = $sender.attr("node-id");
        return nodeId;
    };
    var getAlias = function(sender) {
        var $sender = $(sender);
        var alias = $sender.closest(".service-item,.service-item__top").closest("*[alias]").attr("alias");
        if (alias)
            return alias;
        alias = $sender.attr("alias");
        return alias;
    };
    var $buttonFavorites = $(".button--favorite");
    var $buttonFavoritesCount = $buttonFavorites.find(".button__count");
    var $mobileFavoritesCount = $buttonFavorites.find(".mob-favorite__count");
    var $buttonFavoritesJsHead = $(".js-head-favorite");
    var $mobileFavoritesJsHead = $(".mob-favorite");
    var $slidersBaCategoryAndCombination = $("[node-id]");
    var favoritesTextButtonCount = function(countFavoriteCountText) {
        if (countFavoriteCountText > 0) {
            $buttonFavoritesCount.text(countFavoriteCountText);
            $buttonFavoritesJsHead.addClass("is-active");
            //Mobile favorites count
            $mobileFavoritesCount.text(countFavoriteCountText);
            $mobileFavoritesJsHead.addClass("active");
            $mobileFavoritesCount.removeClass("hide");
        } else {
            //Desktop favorites empty
            $buttonFavoritesCount.text("");
            $buttonFavoritesJsHead.removeClass("is-active");
            //Mobile favorites empty
            $mobileFavoritesCount.text("");
            $mobileFavoritesCount.addClass("hide");
            $mobileFavoritesJsHead.removeClass("active");
        }
    };
    var markStar = function(nodeIds) {
        for (var i = 0; i < nodeIds.length; i++) {
            var $sliderBaNodeId = $("[node-id=" + nodeIds[i] + "]");
            if ($sliderBaNodeId != null) {
                var $buttons = $sliderBaNodeId.find(".button--favorite:not(.active-vue)");
                if ($buttons.length > 0)
                    for (var j = 0; j < $buttons.length; j++) {
                        $($buttons[j]).toggleClass("active");
                    }
                else {
                    $sliderBaNodeId.toggleClass("active");
                }
            }
        }
    };
    var nodeIdsAvailableOnCurrentPageArrayData = function() {
        var mergedLocalStorageIds = $.merge(
            $.merge(localStorageHandler.getBaCategoriesIds(), localStorageHandler.getProgramsForExcellenceIds()),
            $.merge(localStorageHandler.getCombinationsIds(), localStorageHandler.getScholarshipIds()));
        var nodeIdsAvailableOnCurrentPageData =
            window.localStorageHandler.nodeIdsAvailableOnCurrentPage(mergedLocalStorageIds);
        return nodeIdsAvailableOnCurrentPageData;
    };
    //vue function to mark stars
    var markStarsForButtons = function($cards) {
        var currentNodeIds = nodeIdsAvailableOnCurrentPageArrayData();
        if (currentNodeIds.length == 0)
            return;
        for (var i = 0; i < currentNodeIds.length; i++) {
            for (var j = 0; j < $cards.length; j++) {
                if ($($cards[j]).attr("node-id") == currentNodeIds[i]) {
                    $($cards[j]).find(".button--favorite").addClass("active");
                }  
            }
        }
    };
    var nodeIdsAvailableOnAllPagesArrayData = function() {
        var mergedLocalStorageIds = $.merge(
            $.merge(localStorageHandler.getBaCategoriesIds(), localStorageHandler.getProgramsForExcellenceIds()),
            $.merge(localStorageHandler.getCombinationsIds(), localStorageHandler.getScholarshipIds()));
        return mergedLocalStorageIds;
    };
    //when page loading check current node ids and marker the star of each node id which in local storage and appear in current page
    var markCurrentLocalStorageData = function(nodeIdsAvailableOnCurrentPageData) {
        markStar(nodeIdsAvailableOnCurrentPageData);
    };
    var internalInitFavorites = function($button) {
        var baNodeId = getBaNodeId($button);
        var alias = getAlias($button);
        var arr = [];
        arr.push(baNodeId);
        markStar(arr);
        if (baNodeId != null) {
            if ($button.hasClass("active")||localStorageHandler.isInAliasLocalStorage(alias,baNodeId) < 0){
                localStorageHandler.setLocalStorage(baNodeId, alias);
                $button.attr("aria-pressed", "true");
            }
            else {
               localStorageHandler.removeItemFromLocalStorage(baNodeId,alias); 
                $button.attr("aria-pressed", "false");
            }
            favoritesTextButtonCount(nodeIdsAvailableOnAllPagesArrayData().length);
        }
    };
    var removeCard = function($button) {
        var baNodeId = getBaNodeId($button);
        var alias = getAlias($button);
        window.localStorageHandler.removeItemFromLocalStorage(baNodeId, alias);
        $button.closest(".swiper-slide").remove();
    };
    var initFavorites = function() {
        var nodeIdsAvailableOnCurrentPageData = nodeIdsAvailableOnCurrentPageArrayData();
        favoritesTextButtonCount(nodeIdsAvailableOnAllPagesArrayData()?.length);
        markCurrentLocalStorageData(nodeIdsAvailableOnCurrentPageData);
        $(" .button--favorite").not(".js-head-favorite").not(".bind").bind("click",
            function() {
                var $this = $(this);
                $this.addClass("bind");
                /*    $this.toggleClass("selected")*/
                internalInitFavorites($this);
            }
        );
        var $BaLocalCategoriesIds = window.localStorageHandler.getBaCategoriesIds();
        var $buttonFavoriteSave = $(".favorite-save");
        const $text = $buttonFavoriteSave.find(".button__text");
        const $addText = $buttonFavoriteSave.data("text-add");
        for (var i = 0; i < $BaLocalCategoriesIds.length; i++) {
            if ($buttonFavoriteSave.attr("node-id") == $BaLocalCategoriesIds[i]) {
                $buttonFavoriteSave.addClass("added-fav");
                $text.text($addText);
               // $buttonFavoriteSave.attr("aria-lable",$addText);
                $buttonFavoriteSave.attr("data-add-fav", "true");
                $buttonFavoriteSave.addClass("active");
            }
        }
        //BA category saving favorite 
        $(".favorite-save").bind("click",
            function() {
                var $this = $(this);
                var baNodeId = getBaNodeId = $this.attr("node-id");
                const $addText = $this.data("text-add");
                const $defText = $this.data("text-default");
                var alias = getAlias = $this.attr("alias");
                if ($this.hasClass("active") && $this.hasClass("added-fav")) {
                    for (var i = 0; i < $(".favorite-save").length; i++) {
                        $($(".favorite-save")[i]).removeClass("added-fav");
                        $($(".favorite-save")[i]).attr("data-add-fav", "false");
                        const $text = $($(".favorite-save")[i]).find(".button__text");
                        $text.text($defText);
                        $($(".favorite-save")[i]).attr("aria-live", $defText)
                        //$($(".favorite-save")[i]).attr("aria-label",$defText);
                        $($(".favorite-save")[i]).removeClass("active");
                    }
                    window.localStorageHandler.removeItemFromLocalStorage(baNodeId, alias);
                } else {
                    for (var i = 0; i < $(".favorite-save").length; i++) {
                        var $current = $($(".favorite-save")[i]);
                        $current.addClass("active");
                        window.localStorageHandler.setLocalStorage(baNodeId, alias);
                        $current.addClass("added-fav");
                        const $text = $current.find(".button__text");
                        $text.text($addText);
                        $current.attr("aria-live", $addText)
                        //$current.attr("aria-lable",$addText);
                        $current.attr("data-add-fav", "true");
                    }
                }
                favoritesTextButtonCount(nodeIdsAvailableOnAllPagesArrayData().length);
            });
    };
    return {
        init: function() {
            initFavorites();
        },
        internalInitFavorites: function () {
            var $button = $(event.target);
            internalInitFavorites($button);
            var baNodeId = getBaNodeId($button);
            var alias = getAlias($button);
            //only on favorite page remove non active card
            if (localStorageHandler.isInAliasLocalStorage(alias, baNodeId) === -1)
                $button.closest(".swiper-slide").remove();
        },
        markStars: function($buttons) {
            markStarsForButtons($buttons);
        }
    };
}();
$(document).ready(function() {
    window.localStorageHandler.init();
    window.favoritesHandler.init();
});;
requestFormHandler = function () {
    var requestForm = function () {
        $(".small-menu__body li .drop-link.requestLink").bind("click",
            function (e) {
                if ($("#tu-form-root").length > 0) {
                    e.preventDefault();
                    var headerHeight = document.getElementsByClassName("header")[0].clientHeight + 30;
                    $([document.documentElement, document.body]).animate({
                        scrollTop: $("#tu-form-root").offset().top - headerHeight
                    }, 2000);
                }
            });
    }
    var addAdditionalField = function () {
        tourForm();
        function tourForm() {
            setTimeout(() => {
                let container = $('.campus-tour__form');
                if (container.length == 0) return;
                let form = document.getElementById('tu-form-root').shadowRoot;
                form = $(form).find('form');
                let salesforceElem = container.find('#SalesforceID').detach();
                if (form.length == 0 || salesforceElem.length == 0) return;
                form.append(salesforceElem);
            }, 6000);
        }
    }
    return {
        init: function () {
            requestForm();
            addAdditionalField();
        }
    };
}();
$(document).ready(function () {
    requestFormHandler.init();
});;
/*!
 * typeahead.js 0.11.1
 * https://github.com/twitter/typeahead.js
 * Copyright 2013-2015 Twitter, Inc. and other contributors; Licensed MIT
 */
!function(a,b){"function"==typeof define&&define.amd?define("bloodhound",["jquery"],function(c){return a.Bloodhound=b(c)}):"object"==typeof exports?module.exports=b(require("jquery")):a.Bloodhound=b(jQuery)}(this,function(a){var b=function(){"use strict";return{isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:!1},isBlankString:function(a){return!a||/^\s*$/.test(a)},escapeRegExChars:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(a){return"string"==typeof a},isNumber:function(a){return"number"==typeof a},isArray:a.isArray,isFunction:a.isFunction,isObject:a.isPlainObject,isUndefined:function(a){return"undefined"==typeof a},isElement:function(a){return!(!a||1!==a.nodeType)},isJQuery:function(b){return b instanceof a},toStr:function(a){return b.isUndefined(a)||null===a?"":a+""},bind:a.proxy,each:function(b,c){function d(a,b){return c(b,a)}a.each(b,d)},map:a.map,filter:a.grep,every:function(b,c){var d=!0;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?void 0:!1}),!!d):d},some:function(b,c){var d=!1;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?!1:void 0}),!!d):d},mixin:a.extend,identity:function(a){return a},clone:function(b){return a.extend(!0,{},b)},getIdGenerator:function(){var a=0;return function(){return a++}},templatify:function(b){function c(){return String(b)}return a.isFunction(b)?b:c},defer:function(a){setTimeout(a,0)},debounce:function(a,b,c){var d,e;return function(){var f,g,h=this,i=arguments;return f=function(){d=null,c||(e=a.apply(h,i))},g=c&&!d,clearTimeout(d),d=setTimeout(f,b),g&&(e=a.apply(h,i)),e}},throttle:function(a,b){var c,d,e,f,g,h;return g=0,h=function(){g=new Date,e=null,f=a.apply(c,d)},function(){var i=new Date,j=b-(i-g);return c=this,d=arguments,0>=j?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},stringify:function(a){return b.isString(a)?a:JSON.stringify(a)},noop:function(){}}}(),c="0.11.1",d=function(){"use strict";function a(a){return a=b.toStr(a),a?a.split(/\s+/):[]}function c(a){return a=b.toStr(a),a?a.split(/\W+/):[]}function d(a){return function(c){return c=b.isArray(c)?c:[].slice.call(arguments,0),function(d){var e=[];return b.each(c,function(c){e=e.concat(a(b.toStr(d[c])))}),e}}}return{nonword:c,whitespace:a,obj:{nonword:d(c),whitespace:d(a)}}}(),e=function(){"use strict";function c(c){this.maxSize=b.isNumber(c)?c:100,this.reset(),this.maxSize<=0&&(this.set=this.get=a.noop)}function d(){this.head=this.tail=null}function e(a,b){this.key=a,this.val=b,this.prev=this.next=null}return b.mixin(c.prototype,{set:function(a,b){var c,d=this.list.tail;this.size>=this.maxSize&&(this.list.remove(d),delete this.hash[d.key],this.size--),(c=this.hash[a])?(c.val=b,this.list.moveToFront(c)):(c=new e(a,b),this.list.add(c),this.hash[a]=c,this.size++)},get:function(a){var b=this.hash[a];return b?(this.list.moveToFront(b),b.val):void 0},reset:function(){this.size=0,this.hash={},this.list=new d}}),b.mixin(d.prototype,{add:function(a){this.head&&(a.next=this.head,this.head.prev=a),this.head=a,this.tail=this.tail||a},remove:function(a){a.prev?a.prev.next=a.next:this.head=a.next,a.next?a.next.prev=a.prev:this.tail=a.prev},moveToFront:function(a){this.remove(a),this.add(a)}}),c}(),f=function(){"use strict";function c(a,c){this.prefix=["__",a,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+b.escapeRegExChars(this.prefix)),this.ls=c||h,!this.ls&&this._noop()}function d(){return(new Date).getTime()}function e(a){return JSON.stringify(b.isUndefined(a)?null:a)}function f(b){return a.parseJSON(b)}function g(a){var b,c,d=[],e=h.length;for(b=0;e>b;b++)(c=h.key(b)).match(a)&&d.push(c.replace(a,""));return d}var h;try{h=window.localStorage,h.setItem("~~~","!"),h.removeItem("~~~")}catch(i){h=null}return b.mixin(c.prototype,{_prefix:function(a){return this.prefix+a},_ttlKey:function(a){return this._prefix(a)+this.ttlKey},_noop:function(){this.get=this.set=this.remove=this.clear=this.isExpired=b.noop},_safeSet:function(a,b){try{this.ls.setItem(a,b)}catch(c){"QuotaExceededError"===c.name&&(this.clear(),this._noop())}},get:function(a){return this.isExpired(a)&&this.remove(a),f(this.ls.getItem(this._prefix(a)))},set:function(a,c,f){return b.isNumber(f)?this._safeSet(this._ttlKey(a),e(d()+f)):this.ls.removeItem(this._ttlKey(a)),this._safeSet(this._prefix(a),e(c))},remove:function(a){return this.ls.removeItem(this._ttlKey(a)),this.ls.removeItem(this._prefix(a)),this},clear:function(){var a,b=g(this.keyMatcher);for(a=b.length;a--;)this.remove(b[a]);return this},isExpired:function(a){var c=f(this.ls.getItem(this._ttlKey(a)));return b.isNumber(c)&&d()>c?!0:!1}}),c}(),g=function(){"use strict";function c(a){a=a||{},this.cancelled=!1,this.lastReq=null,this._send=a.transport,this._get=a.limiter?a.limiter(this._get):this._get,this._cache=a.cache===!1?new e(0):h}var d=0,f={},g=6,h=new e(10);return c.setMaxPendingRequests=function(a){g=a},c.resetCache=function(){h.reset()},b.mixin(c.prototype,{_fingerprint:function(b){return b=b||{},b.url+b.type+a.param(b.data||{})},_get:function(a,b){function c(a){b(null,a),k._cache.set(i,a)}function e(){b(!0)}function h(){d--,delete f[i],k.onDeckRequestArgs&&(k._get.apply(k,k.onDeckRequestArgs),k.onDeckRequestArgs=null)}var i,j,k=this;i=this._fingerprint(a),this.cancelled||i!==this.lastReq||((j=f[i])?j.done(c).fail(e):g>d?(d++,f[i]=this._send(a).done(c).fail(e).always(h)):this.onDeckRequestArgs=[].slice.call(arguments,0))},get:function(c,d){var e,f;d=d||a.noop,c=b.isString(c)?{url:c}:c||{},f=this._fingerprint(c),this.cancelled=!1,this.lastReq=f,(e=this._cache.get(f))?d(null,e):this._get(c,d)},cancel:function(){this.cancelled=!0}}),c}(),h=window.SearchIndex=function(){"use strict";function c(c){c=c||{},c.datumTokenizer&&c.queryTokenizer||a.error("datumTokenizer and queryTokenizer are both required"),this.identify=c.identify||b.stringify,this.datumTokenizer=c.datumTokenizer,this.queryTokenizer=c.queryTokenizer,this.reset()}function d(a){return a=b.filter(a,function(a){return!!a}),a=b.map(a,function(a){return a.toLowerCase()})}function e(){var a={};return a[i]=[],a[h]={},a}function f(a){for(var b={},c=[],d=0,e=a.length;e>d;d++)b[a[d]]||(b[a[d]]=!0,c.push(a[d]));return c}function g(a,b){var c=0,d=0,e=[];a=a.sort(),b=b.sort();for(var f=a.length,g=b.length;f>c&&g>d;)a[c]<b[d]?c++:a[c]>b[d]?d++:(e.push(a[c]),c++,d++);return e}var h="c",i="i";return b.mixin(c.prototype,{bootstrap:function(a){this.datums=a.datums,this.trie=a.trie},add:function(a){var c=this;a=b.isArray(a)?a:[a],b.each(a,function(a){var f,g;c.datums[f=c.identify(a)]=a,g=d(c.datumTokenizer(a)),b.each(g,function(a){var b,d,g;for(b=c.trie,d=a.split("");g=d.shift();)b=b[h][g]||(b[h][g]=e()),b[i].push(f)})})},get:function(a){var c=this;return b.map(a,function(a){return c.datums[a]})},search:function(a){var c,e,j=this;return c=d(this.queryTokenizer(a)),b.each(c,function(a){var b,c,d,f;if(e&&0===e.length)return!1;for(b=j.trie,c=a.split("");b&&(d=c.shift());)b=b[h][d];return b&&0===c.length?(f=b[i].slice(0),void(e=e?g(e,f):f)):(e=[],!1)}),e?b.map(f(e),function(a){return j.datums[a]}):[]},all:function(){var a=[];for(var b in this.datums)a.push(this.datums[b]);return a},reset:function(){this.datums={},this.trie=e()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),c}(),i=function(){"use strict";function a(a){this.url=a.url,this.ttl=a.ttl,this.cache=a.cache,this.prepare=a.prepare,this.transform=a.transform,this.transport=a.transport,this.thumbprint=a.thumbprint,this.storage=new f(a.cacheKey)}var c;return c={data:"data",protocol:"protocol",thumbprint:"thumbprint"},b.mixin(a.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},store:function(a){this.cache&&(this.storage.set(c.data,a,this.ttl),this.storage.set(c.protocol,location.protocol,this.ttl),this.storage.set(c.thumbprint,this.thumbprint,this.ttl))},fromCache:function(){var a,b={};return this.cache?(b.data=this.storage.get(c.data),b.protocol=this.storage.get(c.protocol),b.thumbprint=this.storage.get(c.thumbprint),a=b.thumbprint!==this.thumbprint||b.protocol!==location.protocol,b.data&&!a?b.data:null):null},fromNetwork:function(a){function b(){a(!0)}function c(b){a(null,e.transform(b))}var d,e=this;a&&(d=this.prepare(this._settings()),this.transport(d).fail(b).done(c))},clear:function(){return this.storage.clear(),this}}),a}(),j=function(){"use strict";function a(a){this.url=a.url,this.prepare=a.prepare,this.transform=a.transform,this.transport=new g({cache:a.cache,limiter:a.limiter,transport:a.transport})}return b.mixin(a.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},get:function(a,b){function c(a,c){b(a?[]:e.transform(c))}var d,e=this;if(b)return a=a||"",d=this.prepare(a,this._settings()),this.transport.get(d,c)},cancelLastRequest:function(){this.transport.cancel()}}),a}(),k=function(){"use strict";function d(d){var e;return d?(e={url:null,ttl:864e5,cache:!0,cacheKey:null,thumbprint:"",prepare:b.identity,transform:b.identity,transport:null},d=b.isString(d)?{url:d}:d,d=b.mixin(e,d),!d.url&&a.error("prefetch requires url to be set"),d.transform=d.filter||d.transform,d.cacheKey=d.cacheKey||d.url,d.thumbprint=c+d.thumbprint,d.transport=d.transport?h(d.transport):a.ajax,d):null}function e(c){var d;if(c)return d={url:null,cache:!0,prepare:null,replace:null,wildcard:null,limiter:null,rateLimitBy:"debounce",rateLimitWait:300,transform:b.identity,transport:null},c=b.isString(c)?{url:c}:c,c=b.mixin(d,c),!c.url&&a.error("remote requires url to be set"),c.transform=c.filter||c.transform,c.prepare=f(c),c.limiter=g(c),c.transport=c.transport?h(c.transport):a.ajax,delete c.replace,delete c.wildcard,delete c.rateLimitBy,delete c.rateLimitWait,c}function f(a){function b(a,b){return b.url=f(b.url,a),b}function c(a,b){return b.url=b.url.replace(g,encodeURIComponent(a)),b}function d(a,b){return b}var e,f,g;return e=a.prepare,f=a.replace,g=a.wildcard,e?e:e=f?b:a.wildcard?c:d}function g(a){function c(a){return function(c){return b.debounce(c,a)}}function d(a){return function(c){return b.throttle(c,a)}}var e,f,g;return e=a.limiter,f=a.rateLimitBy,g=a.rateLimitWait,e||(e=/^throttle$/i.test(f)?d(g):c(g)),e}function h(c){return function(d){function e(a){b.defer(function(){g.resolve(a)})}function f(a){b.defer(function(){g.reject(a)})}var g=a.Deferred();return c(d,e,f),g}}return function(c){var f,g;return f={initialize:!0,identify:b.stringify,datumTokenizer:null,queryTokenizer:null,sufficient:5,sorter:null,local:[],prefetch:null,remote:null},c=b.mixin(f,c||{}),!c.datumTokenizer&&a.error("datumTokenizer is required"),!c.queryTokenizer&&a.error("queryTokenizer is required"),g=c.sorter,c.sorter=g?function(a){return a.sort(g)}:b.identity,c.local=b.isFunction(c.local)?c.local():c.local,c.prefetch=d(c.prefetch),c.remote=e(c.remote),c}}(),l=function(){"use strict";function c(a){a=k(a),this.sorter=a.sorter,this.identify=a.identify,this.sufficient=a.sufficient,this.local=a.local,this.remote=a.remote?new j(a.remote):null,this.prefetch=a.prefetch?new i(a.prefetch):null,this.index=new h({identify:this.identify,datumTokenizer:a.datumTokenizer,queryTokenizer:a.queryTokenizer}),a.initialize!==!1&&this.initialize()}var e;return e=window&&window.Bloodhound,c.noConflict=function(){return window&&(window.Bloodhound=e),c},c.tokenizers=d,b.mixin(c.prototype,{__ttAdapter:function(){function a(a,b,d){return c.search(a,b,d)}function b(a,b){return c.search(a,b)}var c=this;return this.remote?a:b},_loadPrefetch:function(){function b(a,b){return a?c.reject():(e.add(b),e.prefetch.store(e.index.serialize()),void c.resolve())}var c,d,e=this;return c=a.Deferred(),this.prefetch?(d=this.prefetch.fromCache())?(this.index.bootstrap(d),c.resolve()):this.prefetch.fromNetwork(b):c.resolve(),c.promise()},_initialize:function(){function a(){b.add(b.local)}var b=this;return this.clear(),(this.initPromise=this._loadPrefetch()).done(a),this.initPromise},initialize:function(a){return!this.initPromise||a?this._initialize():this.initPromise},add:function(a){return this.index.add(a),this},get:function(a){return a=b.isArray(a)?a:[].slice.call(arguments),this.index.get(a)},search:function(a,c,d){function e(a){var c=[];b.each(a,function(a){!b.some(f,function(b){return g.identify(a)===g.identify(b)})&&c.push(a)}),d&&d(c)}var f,g=this;return f=this.sorter(this.index.search(a)),c(this.remote?f.slice():f),this.remote&&f.length<this.sufficient?this.remote.get(a,e):this.remote&&this.remote.cancelLastRequest(),this},all:function(){return this.index.all()},clear:function(){return this.index.reset(),this},clearPrefetchCache:function(){return this.prefetch&&this.prefetch.clear(),this},clearRemoteCache:function(){return g.resetCache(),this},ttAdapter:function(){return this.__ttAdapter()}}),c}();return l}),function(a,b){"function"==typeof define&&define.amd?define("typeahead.js",["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){var b=function(){"use strict";return{isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:!1},isBlankString:function(a){return!a||/^\s*$/.test(a)},escapeRegExChars:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(a){return"string"==typeof a},isNumber:function(a){return"number"==typeof a},isArray:a.isArray,isFunction:a.isFunction,isObject:a.isPlainObject,isUndefined:function(a){return"undefined"==typeof a},isElement:function(a){return!(!a||1!==a.nodeType)},isJQuery:function(b){return b instanceof a},toStr:function(a){return b.isUndefined(a)||null===a?"":a+""},bind:a.proxy,each:function(b,c){function d(a,b){return c(b,a)}a.each(b,d)},map:a.map,filter:a.grep,every:function(b,c){var d=!0;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?void 0:!1}),!!d):d},some:function(b,c){var d=!1;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?!1:void 0}),!!d):d},mixin:a.extend,identity:function(a){return a},clone:function(b){return a.extend(!0,{},b)},getIdGenerator:function(){var a=0;return function(){return a++}},templatify:function(b){function c(){return String(b)}return a.isFunction(b)?b:c},defer:function(a){setTimeout(a,0)},debounce:function(a,b,c){var d,e;return function(){var f,g,h=this,i=arguments;return f=function(){d=null,c||(e=a.apply(h,i))},g=c&&!d,clearTimeout(d),d=setTimeout(f,b),g&&(e=a.apply(h,i)),e}},throttle:function(a,b){var c,d,e,f,g,h;return g=0,h=function(){g=new Date,e=null,f=a.apply(c,d)},function(){var i=new Date,j=b-(i-g);return c=this,d=arguments,0>=j?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},stringify:function(a){return b.isString(a)?a:JSON.stringify(a)},noop:function(){}}}(),c=function(){"use strict";function a(a){var g,h;return h=b.mixin({},f,a),g={css:e(),classes:h,html:c(h),selectors:d(h)},{css:g.css,html:g.html,classes:g.classes,selectors:g.selectors,mixin:function(a){b.mixin(a,g)}}}function c(a){return{wrapper:'<span class="'+a.wrapper+'"></span>',menu:'<div class="'+a.menu+'"></div>'}}function d(a){var c={};return b.each(a,function(a,b){c[b]="."+a}),c}function e(){var a={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},menu:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return b.isMsie()&&b.mixin(a.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),a}var f={wrapper:"twitter-typeahead",input:"tt-input",hint:"tt-hint",menu:"tt-menu",dataset:"tt-dataset",suggestion:"tt-suggestion",selectable:"tt-selectable",empty:"tt-empty",open:"tt-open",cursor:"tt-cursor",highlight:"tt-highlight"};return a}(),d=function(){"use strict";function c(b){b&&b.el||a.error("EventBus initialized without el"),this.$el=a(b.el)}var d,e;return d="typeahead:",e={render:"rendered",cursorchange:"cursorchanged",select:"selected",autocomplete:"autocompleted"},b.mixin(c.prototype,{_trigger:function(b,c){var e;return e=a.Event(d+b),(c=c||[]).unshift(e),this.$el.trigger.apply(this.$el,c),e},before:function(a){var b,c;return b=[].slice.call(arguments,1),c=this._trigger("before"+a,b),c.isDefaultPrevented()},trigger:function(a){var b;this._trigger(a,[].slice.call(arguments,1)),(b=e[a])&&this._trigger(b,[].slice.call(arguments,1))}}),c}(),e=function(){"use strict";function a(a,b,c,d){var e;if(!c)return this;for(b=b.split(i),c=d?h(c,d):c,this._callbacks=this._callbacks||{};e=b.shift();)this._callbacks[e]=this._callbacks[e]||{sync:[],async:[]},this._callbacks[e][a].push(c);return this}function b(b,c,d){return a.call(this,"async",b,c,d)}function c(b,c,d){return a.call(this,"sync",b,c,d)}function d(a){var b;if(!this._callbacks)return this;for(a=a.split(i);b=a.shift();)delete this._callbacks[b];return this}function e(a){var b,c,d,e,g;if(!this._callbacks)return this;for(a=a.split(i),d=[].slice.call(arguments,1);(b=a.shift())&&(c=this._callbacks[b]);)e=f(c.sync,this,[b].concat(d)),g=f(c.async,this,[b].concat(d)),e()&&j(g);return this}function f(a,b,c){function d(){for(var d,e=0,f=a.length;!d&&f>e;e+=1)d=a[e].apply(b,c)===!1;return!d}return d}function g(){var a;return a=window.setImmediate?function(a){setImmediate(function(){a()})}:function(a){setTimeout(function(){a()},0)}}function h(a,b){return a.bind?a.bind(b):function(){a.apply(b,[].slice.call(arguments,0))}}var i=/\s+/,j=g();return{onSync:c,onAsync:b,off:d,trigger:e}}(),f=function(a){"use strict";function c(a,c,d){for(var e,f=[],g=0,h=a.length;h>g;g++)f.push(b.escapeRegExChars(a[g]));return e=d?"\\b("+f.join("|")+")\\b":"("+f.join("|")+")",c?new RegExp(e):new RegExp(e,"i")}var d={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function(e){function f(b){var c,d,f;return(c=h.exec(b.data))&&(f=a.createElement(e.tagName),e.className&&(f.className=e.className),d=b.splitText(c.index),d.splitText(c[0].length),f.appendChild(d.cloneNode(!0)),b.parentNode.replaceChild(f,d)),!!c}function g(a,b){for(var c,d=3,e=0;e<a.childNodes.length;e++)c=a.childNodes[e],c.nodeType===d?e+=b(c)?1:0:g(c,b)}var h;e=b.mixin({},d,e),e.node&&e.pattern&&(e.pattern=b.isArray(e.pattern)?e.pattern:[e.pattern],h=c(e.pattern,e.caseSensitive,e.wordsOnly),g(e.node,f))}}(window.document),g=function(){"use strict";function c(c,e){c=c||{},c.input||a.error("input is missing"),e.mixin(this),this.$hint=a(c.hint),this.$input=a(c.input),this.query=this.$input.val(),this.queryWhenFocused=this.hasFocus()?this.query:null,this.$overflowHelper=d(this.$input),this._checkLanguageDirection(),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=b.noop)}function d(b){return a('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:b.css("font-family"),fontSize:b.css("font-size"),fontStyle:b.css("font-style"),fontVariant:b.css("font-variant"),fontWeight:b.css("font-weight"),wordSpacing:b.css("word-spacing"),letterSpacing:b.css("letter-spacing"),textIndent:b.css("text-indent"),textRendering:b.css("text-rendering"),textTransform:b.css("text-transform")}).insertAfter(b)}function f(a,b){return c.normalizeQuery(a)===c.normalizeQuery(b)}function g(a){return a.altKey||a.ctrlKey||a.metaKey||a.shiftKey}var h;return h={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},c.normalizeQuery=function(a){return b.toStr(a).replace(/^\s*/g,"").replace(/\s{2,}/g," ")},b.mixin(c.prototype,e,{_onBlur:function(){this.resetInputValue(),this.trigger("blurred")},_onFocus:function(){this.queryWhenFocused=this.query,this.trigger("focused")},_onKeydown:function(a){var b=h[a.which||a.keyCode];this._managePreventDefault(b,a),b&&this._shouldTrigger(b,a)&&this.trigger(b+"Keyed",a)},_onInput:function(){this._setQuery(this.getInputValue()),this.clearHintIfInvalid(),this._checkLanguageDirection()},_managePreventDefault:function(a,b){var c;switch(a){case"up":case"down":c=!g(b);break;default:c=!1}c&&b.preventDefault()},_shouldTrigger:function(a,b){var c;switch(a){case"tab":c=!g(b);break;default:c=!0}return c},_checkLanguageDirection:function(){var a=(this.$input.css("direction")||"ltr").toLowerCase();this.dir!==a&&(this.dir=a,this.$hint.attr("dir",a),this.trigger("langDirChanged",a))},_setQuery:function(a,b){var c,d;c=f(a,this.query),d=c?this.query.length!==a.length:!1,this.query=a,b||c?!b&&d&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},bind:function(){var a,c,d,e,f=this;return a=b.bind(this._onBlur,this),c=b.bind(this._onFocus,this),d=b.bind(this._onKeydown,this),e=b.bind(this._onInput,this),this.$input.on("blur.tt",a).on("focus.tt",c).on("keydown.tt",d),!b.isMsie()||b.isMsie()>9?this.$input.on("input.tt",e):this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(a){h[a.which||a.keyCode]||b.defer(b.bind(f._onInput,f,a))}),this},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getLangDir:function(){return this.dir},getQuery:function(){return this.query||""},setQuery:function(a,b){this.setInputValue(a),this._setQuery(a,b)},hasQueryChangedSinceLastFocus:function(){return this.query!==this.queryWhenFocused},getInputValue:function(){return this.$input.val()},setInputValue:function(a){this.$input.val(a),this.clearHintIfInvalid(),this._checkLanguageDirection()},resetInputValue:function(){this.setInputValue(this.query)},getHint:function(){return this.$hint.val()},setHint:function(a){this.$hint.val(a)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var a,b,c,d;a=this.getInputValue(),b=this.getHint(),c=a!==b&&0===b.indexOf(a),d=""!==a&&c&&!this.hasOverflow(),!d&&this.clearHint()},hasFocus:function(){return this.$input.is(":focus")},hasOverflow:function(){var a=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=a},isCursorAtEnd:function(){var a,c,d;return a=this.$input.val().length,c=this.$input[0].selectionStart,b.isNumber(c)?c===a:document.selection?(d=document.selection.createRange(),d.moveStart("character",-a),a===d.text.length):!0},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$overflowHelper.remove(),this.$hint=this.$input=this.$overflowHelper=a("<div>")}}),c}(),h=function(){"use strict";function c(c,e){c=c||{},c.templates=c.templates||{},c.templates.notFound=c.templates.notFound||c.templates.empty,c.source||a.error("missing source"),c.node||a.error("missing node"),c.name&&!h(c.name)&&a.error("invalid dataset name: "+c.name),e.mixin(this),this.highlight=!!c.highlight,this.name=c.name||j(),this.limit=c.limit||5,this.displayFn=d(c.display||c.displayKey),this.templates=g(c.templates,this.displayFn),this.source=c.source.__ttAdapter?c.source.__ttAdapter():c.source,this.async=b.isUndefined(c.async)?this.source.length>2:!!c.async,this._resetLastSuggestion(),this.$el=a(c.node).addClass(this.classes.dataset).addClass(this.classes.dataset+"-"+this.name)}function d(a){function c(b){return b[a]}return a=a||b.stringify,b.isFunction(a)?a:c}function g(c,d){function e(b){return a("<div>").text(d(b))}return{notFound:c.notFound&&b.templatify(c.notFound),pending:c.pending&&b.templatify(c.pending),header:c.header&&b.templatify(c.header),footer:c.footer&&b.templatify(c.footer),suggestion:c.suggestion||e}}function h(a){return/^[_a-zA-Z0-9-]+$/.test(a)}var i,j;return i={val:"tt-selectable-display",obj:"tt-selectable-object"},j=b.getIdGenerator(),c.extractData=function(b){var c=a(b);return c.data(i.obj)?{val:c.data(i.val)||"",obj:c.data(i.obj)||null}:null},b.mixin(c.prototype,e,{_overwrite:function(a,b){b=b||[],b.length?this._renderSuggestions(a,b):this.async&&this.templates.pending?this._renderPending(a):!this.async&&this.templates.notFound?this._renderNotFound(a):this._empty(),this.trigger("rendered",this.name,b,!1)},_append:function(a,b){b=b||[],b.length&&this.$lastSuggestion.length?this._appendSuggestions(a,b):b.length?this._renderSuggestions(a,b):!this.$lastSuggestion.length&&this.templates.notFound&&this._renderNotFound(a),this.trigger("rendered",this.name,b,!0)},_renderSuggestions:function(a,b){var c;c=this._getSuggestionsFragment(a,b),this.$lastSuggestion=c.children().last(),this.$el.html(c).prepend(this._getHeader(a,b)).append(this._getFooter(a,b))},_appendSuggestions:function(a,b){var c,d;c=this._getSuggestionsFragment(a,b),d=c.children().last(),this.$lastSuggestion.after(c),this.$lastSuggestion=d},_renderPending:function(a){var b=this.templates.pending;this._resetLastSuggestion(),b&&this.$el.html(b({query:a,dataset:this.name}))},_renderNotFound:function(a){var b=this.templates.notFound;this._resetLastSuggestion(),b&&this.$el.html(b({query:a,dataset:this.name}))},_empty:function(){this.$el.empty(),this._resetLastSuggestion()},_getSuggestionsFragment:function(c,d){var e,g=this;return e=document.createDocumentFragment(),b.each(d,function(b){var d,f;f=g._injectQuery(c,b),d=a(g.templates.suggestion(f)).data(i.obj,b).data(i.val,g.displayFn(b)).addClass(g.classes.suggestion+" "+g.classes.selectable),e.appendChild(d[0])}),this.highlight&&f({className:this.classes.highlight,node:e,pattern:c}),a(e)},_getFooter:function(a,b){return this.templates.footer?this.templates.footer({query:a,suggestions:b,dataset:this.name}):null},_getHeader:function(a,b){return this.templates.header?this.templates.header({query:a,suggestions:b,dataset:this.name}):null},_resetLastSuggestion:function(){this.$lastSuggestion=a()},_injectQuery:function(a,c){return b.isObject(c)?b.mixin({_query:a},c):c},update:function(b){function c(a){g||(g=!0,a=(a||[]).slice(0,e.limit),h=a.length,e._overwrite(b,a),h<e.limit&&e.async&&e.trigger("asyncRequested",b))}function d(c){c=c||[],!f&&h<e.limit&&(e.cancel=a.noop,h+=c.length,e._append(b,c.slice(0,e.limit-h)),e.async&&e.trigger("asyncReceived",b))}var e=this,f=!1,g=!1,h=0;this.cancel(),this.cancel=function(){f=!0,e.cancel=a.noop,e.async&&e.trigger("asyncCanceled",b)},this.source(b,c,d),!g&&c([])},cancel:a.noop,clear:function(){this._empty(),this.cancel(),this.trigger("cleared")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=a("<div>")}}),c}(),i=function(){"use strict";function c(c,d){function e(b){var c=f.$node.find(b.node).first();return b.node=c.length?c:a("<div>").appendTo(f.$node),new h(b,d)}var f=this;c=c||{},c.node||a.error("node is required"),d.mixin(this),this.$node=a(c.node),this.query=null,this.datasets=b.map(c.datasets,e)}return b.mixin(c.prototype,e,{_onSelectableClick:function(b){this.trigger("selectableClicked",a(b.currentTarget))},_onRendered:function(a,b,c,d){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetRendered",b,c,d)},_onCleared:function(){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetCleared")},_propagate:function(){this.trigger.apply(this,arguments)},_allDatasetsEmpty:function(){function a(a){return a.isEmpty()}return b.every(this.datasets,a)},_getSelectables:function(){return this.$node.find(this.selectors.selectable)},_removeCursor:function(){var a=this.getActiveSelectable();a&&a.removeClass(this.classes.cursor)},_ensureVisible:function(a){var b,c,d,e;b=a.position().top,c=b+a.outerHeight(!0),d=this.$node.scrollTop(),e=this.$node.height()+parseInt(this.$node.css("paddingTop"),10)+parseInt(this.$node.css("paddingBottom"),10),0>b?this.$node.scrollTop(d+b):c>e&&this.$node.scrollTop(d+(c-e))},bind:function(){var a,c=this;return a=b.bind(this._onSelectableClick,this),this.$node.on("click.tt",this.selectors.selectable,a),b.each(this.datasets,function(a){a.onSync("asyncRequested",c._propagate,c).onSync("asyncCanceled",c._propagate,c).onSync("asyncReceived",c._propagate,c).onSync("rendered",c._onRendered,c).onSync("cleared",c._onCleared,c)}),this},isOpen:function(){return this.$node.hasClass(this.classes.open)},open:function(){this.$node.addClass(this.classes.open)},close:function(){this.$node.removeClass(this.classes.open),this._removeCursor()},setLanguageDirection:function(a){this.$node.attr("dir",a)},selectableRelativeToCursor:function(a){var b,c,d,e;return c=this.getActiveSelectable(),b=this._getSelectables(),d=c?b.index(c):-1,e=d+a,e=(e+1)%(b.length+1)-1,e=-1>e?b.length-1:e,-1===e?null:b.eq(e)},setCursor:function(a){this._removeCursor(),(a=a&&a.first())&&(a.addClass(this.classes.cursor),this._ensureVisible(a))},getSelectableData:function(a){return a&&a.length?h.extractData(a):null},getActiveSelectable:function(){var a=this._getSelectables().filter(this.selectors.cursor).first();return a.length?a:null},getTopSelectable:function(){var a=this._getSelectables().first();return a.length?a:null},update:function(a){function c(b){b.update(a)}var d=a!==this.query;return d&&(this.query=a,b.each(this.datasets,c)),d},empty:function(){function a(a){a.clear()}b.each(this.datasets,a),this.query=null,this.$node.addClass(this.classes.empty)},destroy:function(){function c(a){a.destroy()}this.$node.off(".tt"),this.$node=a("<div>"),b.each(this.datasets,c)}}),c}(),j=function(){"use strict";function a(){i.apply(this,[].slice.call(arguments,0))}var c=i.prototype;return b.mixin(a.prototype,i.prototype,{open:function(){return!this._allDatasetsEmpty()&&this._show(),c.open.apply(this,[].slice.call(arguments,0))},close:function(){return this._hide(),c.close.apply(this,[].slice.call(arguments,0))},_onRendered:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),c._onRendered.apply(this,[].slice.call(arguments,0))},_onCleared:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),c._onCleared.apply(this,[].slice.call(arguments,0))},setLanguageDirection:function(a){return this.$node.css("ltr"===a?this.css.ltr:this.css.rtl),c.setLanguageDirection.apply(this,[].slice.call(arguments,0))},_hide:function(){this.$node.hide()},_show:function(){this.$node.css("display","block")}}),a}(),k=function(){"use strict";function c(c,e){var f,g,h,i,j,k,l,m,n,o,p;c=c||{},c.input||a.error("missing input"),c.menu||a.error("missing menu"),c.eventBus||a.error("missing event bus"),e.mixin(this),this.eventBus=c.eventBus,this.minLength=b.isNumber(c.minLength)?c.minLength:1,this.input=c.input,this.menu=c.menu,this.enabled=!0,this.active=!1,this.input.hasFocus()&&this.activate(),this.dir=this.input.getLangDir(),this._hacks(),this.menu.bind().onSync("selectableClicked",this._onSelectableClicked,this).onSync("asyncRequested",this._onAsyncRequested,this).onSync("asyncCanceled",this._onAsyncCanceled,this).onSync("asyncReceived",this._onAsyncReceived,this).onSync("datasetRendered",this._onDatasetRendered,this).onSync("datasetCleared",this._onDatasetCleared,this),f=d(this,"activate","open","_onFocused"),g=d(this,"deactivate","_onBlurred"),h=d(this,"isActive","isOpen","_onEnterKeyed"),i=d(this,"isActive","isOpen","_onTabKeyed"),j=d(this,"isActive","_onEscKeyed"),k=d(this,"isActive","open","_onUpKeyed"),l=d(this,"isActive","open","_onDownKeyed"),m=d(this,"isActive","isOpen","_onLeftKeyed"),n=d(this,"isActive","isOpen","_onRightKeyed"),o=d(this,"_openIfActive","_onQueryChanged"),p=d(this,"_openIfActive","_onWhitespaceChanged"),this.input.bind().onSync("focused",f,this).onSync("blurred",g,this).onSync("enterKeyed",h,this).onSync("tabKeyed",i,this).onSync("escKeyed",j,this).onSync("upKeyed",k,this).onSync("downKeyed",l,this).onSync("leftKeyed",m,this).onSync("rightKeyed",n,this).onSync("queryChanged",o,this).onSync("whitespaceChanged",p,this).onSync("langDirChanged",this._onLangDirChanged,this)}function d(a){var c=[].slice.call(arguments,1);return function(){var d=[].slice.call(arguments);b.each(c,function(b){return a[b].apply(a,d)})}}return b.mixin(c.prototype,{_hacks:function(){var c,d;c=this.input.$input||a("<div>"),d=this.menu.$node||a("<div>"),c.on("blur.tt",function(a){var e,f,g;
e=document.activeElement,f=d.is(e),g=d.has(e).length>0,b.isMsie()&&(f||g)&&(a.preventDefault(),a.stopImmediatePropagation(),b.defer(function(){c.focus()}))}),d.on("mousedown.tt",function(a){a.preventDefault()})},_onSelectableClicked:function(a,b){this.select(b)},_onDatasetCleared:function(){this._updateHint()},_onDatasetRendered:function(a,b,c,d){this._updateHint(),this.eventBus.trigger("render",c,d,b)},_onAsyncRequested:function(a,b,c){this.eventBus.trigger("asyncrequest",c,b)},_onAsyncCanceled:function(a,b,c){this.eventBus.trigger("asynccancel",c,b)},_onAsyncReceived:function(a,b,c){this.eventBus.trigger("asyncreceive",c,b)},_onFocused:function(){this._minLengthMet()&&this.menu.update(this.input.getQuery())},_onBlurred:function(){this.input.hasQueryChangedSinceLastFocus()&&this.eventBus.trigger("change",this.input.getQuery())},_onEnterKeyed:function(a,b){var c;(c=this.menu.getActiveSelectable())&&this.select(c)&&b.preventDefault()},_onTabKeyed:function(a,b){var c;(c=this.menu.getActiveSelectable())?this.select(c)&&b.preventDefault():(c=this.menu.getTopSelectable())&&this.autocomplete(c)&&b.preventDefault()},_onEscKeyed:function(){this.close()},_onUpKeyed:function(){this.moveCursor(-1)},_onDownKeyed:function(){this.moveCursor(1)},_onLeftKeyed:function(){"rtl"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onRightKeyed:function(){"ltr"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onQueryChanged:function(a,b){this._minLengthMet(b)?this.menu.update(b):this.menu.empty()},_onWhitespaceChanged:function(){this._updateHint()},_onLangDirChanged:function(a,b){this.dir!==b&&(this.dir=b,this.menu.setLanguageDirection(b))},_openIfActive:function(){this.isActive()&&this.open()},_minLengthMet:function(a){return a=b.isString(a)?a:this.input.getQuery()||"",a.length>=this.minLength},_updateHint:function(){var a,c,d,e,f,h,i;a=this.menu.getTopSelectable(),c=this.menu.getSelectableData(a),d=this.input.getInputValue(),!c||b.isBlankString(d)||this.input.hasOverflow()?this.input.clearHint():(e=g.normalizeQuery(d),f=b.escapeRegExChars(e),h=new RegExp("^(?:"+f+")(.+$)","i"),i=h.exec(c.val),i&&this.input.setHint(d+i[1]))},isEnabled:function(){return this.enabled},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},isActive:function(){return this.active},activate:function(){return this.isActive()?!0:!this.isEnabled()||this.eventBus.before("active")?!1:(this.active=!0,this.eventBus.trigger("active"),!0)},deactivate:function(){return this.isActive()?this.eventBus.before("idle")?!1:(this.active=!1,this.close(),this.eventBus.trigger("idle"),!0):!0},isOpen:function(){return this.menu.isOpen()},open:function(){return this.isOpen()||this.eventBus.before("open")||(this.menu.open(),this._updateHint(),this.eventBus.trigger("open")),this.isOpen()},close:function(){return this.isOpen()&&!this.eventBus.before("close")&&(this.menu.close(),this.input.clearHint(),this.input.resetInputValue(),this.eventBus.trigger("close")),!this.isOpen()},setVal:function(a){this.input.setQuery(b.toStr(a))},getVal:function(){return this.input.getQuery()},select:function(a){var b=this.menu.getSelectableData(a);return b&&!this.eventBus.before("select",b.obj)?(this.input.setQuery(b.val,!0),this.eventBus.trigger("select",b.obj),this.close(),!0):!1},autocomplete:function(a){var b,c,d;return b=this.input.getQuery(),c=this.menu.getSelectableData(a),d=c&&b!==c.val,d&&!this.eventBus.before("autocomplete",c.obj)?(this.input.setQuery(c.val),this.eventBus.trigger("autocomplete",c.obj),!0):!1},moveCursor:function(a){var b,c,d,e,f;return b=this.input.getQuery(),c=this.menu.selectableRelativeToCursor(a),d=this.menu.getSelectableData(c),e=d?d.obj:null,f=this._minLengthMet()&&this.menu.update(b),f||this.eventBus.before("cursorchange",e)?!1:(this.menu.setCursor(c),d?this.input.setInputValue(d.val):(this.input.resetInputValue(),this._updateHint()),this.eventBus.trigger("cursorchange",e),!0)},destroy:function(){this.input.destroy(),this.menu.destroy()}}),c}();!function(){"use strict";function e(b,c){b.each(function(){var b,d=a(this);(b=d.data(p.typeahead))&&c(b,d)})}function f(a,b){return a.clone().addClass(b.classes.hint).removeData().css(b.css.hint).css(l(a)).prop("readonly",!0).removeAttr("id name placeholder required").attr({autocomplete:"off",spellcheck:"false",tabindex:-1})}function h(a,b){a.data(p.attrs,{dir:a.attr("dir"),autocomplete:a.attr("autocomplete"),spellcheck:a.attr("spellcheck"),style:a.attr("style")}),a.addClass(b.classes.input).attr({autocomplete:"off",spellcheck:!1});try{!a.attr("dir")&&a.attr("dir","auto")}catch(c){}return a}function l(a){return{backgroundAttachment:a.css("background-attachment"),backgroundClip:a.css("background-clip"),backgroundColor:a.css("background-color"),backgroundImage:a.css("background-image"),backgroundOrigin:a.css("background-origin"),backgroundPosition:a.css("background-position"),backgroundRepeat:a.css("background-repeat"),backgroundSize:a.css("background-size")}}function m(a){var c,d;c=a.data(p.www),d=a.parent().filter(c.selectors.wrapper),b.each(a.data(p.attrs),function(c,d){b.isUndefined(c)?a.removeAttr(d):a.attr(d,c)}),a.removeData(p.typeahead).removeData(p.www).removeData(p.attr).removeClass(c.classes.input),d.length&&(a.detach().insertAfter(d),d.remove())}function n(c){var d,e;return d=b.isJQuery(c)||b.isElement(c),e=d?a(c).first():[],e.length?e:null}var o,p,q;o=a.fn.typeahead,p={www:"tt-www",attrs:"tt-attrs",typeahead:"tt-typeahead"},q={initialize:function(e,l){function m(){var c,m,q,r,s,t,u,v,w,x,y;b.each(l,function(a){a.highlight=!!e.highlight}),c=a(this),m=a(o.html.wrapper),q=n(e.hint),r=n(e.menu),s=e.hint!==!1&&!q,t=e.menu!==!1&&!r,s&&(q=f(c,o)),t&&(r=a(o.html.menu).css(o.css.menu)),q&&q.val(""),c=h(c,o),(s||t)&&(m.css(o.css.wrapper),c.css(s?o.css.input:o.css.inputWithNoHint),c.wrap(m).parent().prepend(s?q:null).append(t?r:null)),y=t?j:i,u=new d({el:c}),v=new g({hint:q,input:c},o),w=new y({node:r,datasets:l},o),x=new k({input:v,menu:w,eventBus:u,minLength:e.minLength},o),c.data(p.www,o),c.data(p.typeahead,x)}var o;return l=b.isArray(l)?l:[].slice.call(arguments,1),e=e||{},o=c(e.classNames),this.each(m)},isEnabled:function(){var a;return e(this.first(),function(b){a=b.isEnabled()}),a},enable:function(){return e(this,function(a){a.enable()}),this},disable:function(){return e(this,function(a){a.disable()}),this},isActive:function(){var a;return e(this.first(),function(b){a=b.isActive()}),a},activate:function(){return e(this,function(a){a.activate()}),this},deactivate:function(){return e(this,function(a){a.deactivate()}),this},isOpen:function(){var a;return e(this.first(),function(b){a=b.isOpen()}),a},open:function(){return e(this,function(a){a.open()}),this},close:function(){return e(this,function(a){a.close()}),this},select:function(b){var c=!1,d=a(b);return e(this.first(),function(a){c=a.select(d)}),c},autocomplete:function(b){var c=!1,d=a(b);return e(this.first(),function(a){c=a.autocomplete(d)}),c},moveCursor:function(a){var b=!1;return e(this.first(),function(c){b=c.moveCursor(a)}),b},val:function(a){var b;return arguments.length?(e(this,function(b){b.setVal(a)}),this):(e(this.first(),function(a){b=a.getVal()}),b)},destroy:function(){return e(this,function(a,b){m(b),a.destroy()}),this}},a.fn.typeahead=function(a){return q[a]?q[a].apply(this,[].slice.call(arguments,1)):q.initialize.apply(this,arguments)},a.fn.typeahead.noConflict=function(){return a.fn.typeahead=o,this}}()});;
var cookiesHandle = function() {
    return {
        createCookie: function(name, value, expires, path, domain) {
            var cookie = name + "=" + escape(value) + ";";
            if (expires) {
                // If it's a date
                if (expires instanceof Date) {
                    // If it isn't a valid date
                    if (isNaN(expires.getTime()))
                        expires = new Date();
                } else
                    expires = new Date(new Date().getTime() + parseInt(expires) * 1000 * 60 * 60 * 24);
                cookie += "expires=" + expires.toGMTString() + ";";
            }
            if (path)
                cookie += "path=" + path + ";";
            if (domain)
                cookie += "domain=" + domain + ";";
            document.cookie = cookie;
        },
        getCookie: function(cname) {
            var name = cname + "=";
            var decodedCookie = decodeURIComponent(document.cookie);
            var ca = decodedCookie.split(';');
            for (var i = 0; i < ca.length; i++) {
                var c = ca[i];
                while (c.charAt(0) == ' ') {
                    c = c.substring(1);
                }
                if (c.indexOf(name) == 0) {
                    return c.substring(name.length, c.length);
                }
            }
            return "";
        },
        deleteCookie: function(name) {
            // If the cookie exists
            document.cookie = name + '=;expires=Thu, 01 Jan 1970 00:00:01 GMT;';
        }
    };
}();;
clientApprovalPopupsHandler = function () {
    var checkDisclaimerTermsOfUseApproval = function () {
        var cookieName = $("#DisclaimerTermsOfUseCookieName").val();
        $("#disclaimerTermsOfUseApproval #okButton").bind("click", function (e) {
            e.preventDefault();
            var now = new Date();
            var expires = new Date(now.getTime() + (30 * 24 * 60 * 60 * 1000));
            cookiesHandle.createCookie(cookieName, "accept-disclaimer-terms", expires);
            $('#disclaimerTermsOfUseApproval').hide();
        });
        if (cookiesHandle.getCookie(cookieName).length === 0) {
            $('#disclaimerTermsOfUseApproval').show();
        };
    }
    return {
        checkDisclaimerTermsOfUseApproval: function () { checkDisclaimerTermsOfUseApproval() }
}
}();;
window.bindCommonScript = function () {
    // lazy-load
    const el = document.querySelectorAll('.lazy');
    window.observer = lozad(el);
    window.observer.observe();
    // use-babulation
    document.addEventListener('keyup', function (event) {
        var code = event.keyCode || event.which;
        const widgetButton = document.querySelector('.widget-button');
        const langItem = document.querySelectorAll('.js-lang-item');
        const menuItem = document.querySelectorAll('.nav-menu__list-item');
        langItem.forEach((el) => {
            const id = el.getAttribute('id')
            if (document.activeElement === el) {
                el.closest('ul').setAttribute('aria-activedescendant', id);
            }
        })
        document.querySelectorAll('.form__input').forEach((el) => {
            if (el === document.activeElement && code === 9 || code === 9 && code === 16) {
                el.closest('.form__body').classList.add('hover')
                el.closest('.form').classList.add('hover')
            } else {
                el.closest('.form__body').classList.remove('hover')
                el.closest('.form').classList.remove('hover')
            }
        })
        document.querySelectorAll('.select2-search__field').forEach((el) => {
            if (el.closest('.form--catalog') !== null) {
                if (el === document.activeElement && code === 9 || code === 9 && code === 16) {
                    el.closest('.form__body').classList.add('hover')
                    el.closest('.form').classList.add('hover')
                } else {
                    el.closest('.form__body').classList.remove('hover')
                    el.closest('.form').classList.remove('hover')
                }
            }
        })
        document.querySelectorAll('.select2-search__field').forEach((el) => {
            if (el.closest('.form__body') != undefined) {
                if (el === document.activeElement) {
                    el.closest('.form__body').style.outlineColor = '#f37421'
                    el.closest('.form').style.outlineColor = '#f37421'
                } else {
                    el.closest('.form__body').style.outlineColor = 'transparent'
                    el.closest('.form').style.outlineColor = 'transparent'
                }
            }
        })
    });
    if ($('.js-datepicker').length) {
        let dateFoemat = 'mm.dd.yyyy'
        $.fn.datepicker.dates['he'] = {
            days: ['ראשון', 'שני', 'שלישי', 'רביעי', 'חמישי', 'שישי', 'שבת'],
            daysShort: ['א\'', 'ב\'', 'ג\'', 'ד\'', 'ה\'', 'ו\'', 'שבת'],
            daysMin: ['א\'', 'ב\'', 'ג\'', 'ד\'', 'ה\'', 'ו\'', 'שבת'],
            months: ['ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר'],
            monthsShort: ['ינו', 'פבר', 'מרץ', 'אפר', 'מאי', 'יוני', 'יולי', 'אוג', 'ספט', 'אוק', 'נוב', 'דצמ'],
            today: "היום",
            clear: "ברור",
            format: "mm/dd/yyyy",
            titleFormat: "MM yyyy", /* Leverages same syntax as 'format' */
            weekStart: 0
        };
        $('.js-datepicker-from').each((i, el) => {
            $(el).datepicker({
                // templates: {
                //   leftArrow: '<i class="fa fa-chevron-left"></i>',
                //   rightArrow: '<i class="fa fa-chevron-right"></i>'
                // },
                format: "d.m.yy",
                keyboardNavigation: true,
                todayHighlight: true,
                orientation: 'bottom',
                container: $(el).closest('.js-datepicker-from-inline'),
                language: 'he'
            });
        })
        $('.js-datepicker-to').each((i, el) => {
            $(el).datepicker({
                format: "d.m.yy",
                keyboardNavigation: true,
                todayHighlight: true,
                orientation: 'bottom',
                container: $(el).closest('.js-datepicker-to-inline'),
                language: 'he'
            });
        })
    }
    /*E.S Do not remove - removed by Elipaz*/
    //$('.js-close-cookie').on('click', () => {
    //    $('.cookie').addClass('hide');
    //})
    $('.small-search--mini').each((i, el) => {
        let input = $(el).find('input');
        let close = $(el).find('.small-search__clear');
        close.on('click', (event) => {
            input.val('');
            close.hide();
        })
        input.on('keyup', () => {
            if (input.val().length > 0) {
                close.show();
            } else {
                close.hide();
            }
        })
    })
    const menuItem = document.querySelectorAll('.nav-menu__list-item');
    menuItem.forEach((el) => {
        const parent = el.closest('.nav-menu__column')
        el.addEventListener('keydown', (event) => {
            var code = event.keyCode || event.which;
            if (parent !== null && code === 27) {
                setTimeout(() => {
                    parent.classList.remove('is-show')
                    if (parent.previousElementSibling)
                        parent.previousElementSibling.focus()
                }, 100)
            }
        })
    })
    if (document.querySelector('.js-content-block') !== null) {
        document.querySelector('.js-content-block').querySelectorAll('li, a').forEach((li) => {
            li.setAttribute('tabindex', li.closest('.js-content-block').getAttribute('data-index'))
        })
    }
    document.querySelectorAll('.form__input').forEach((el) => {
        el.addEventListener('mouseenter', () => {
            el.closest('.form__body').classList.add('hover')
            el.closest('.form').classList.add('hover')
        })
        el.addEventListener('mouseleave', () => {
            el.closest('.form__body').classList.remove('hover')
            el.closest('.form').classList.remove('hover')
        })
    })
    setTimeout(() => {
        document.querySelectorAll('.select2-selection ').forEach((el) => {
            el.addEventListener('mouseenter', () => {
                if (!el.closest('.select2-container').classList.contains('select2-container--open')) {
                    if (el.closest('.form__body') != null)
                        el.closest('.form__body').style.outlineColor = '#f37421'
                    if (el.closest('.form') != null)
                        el.closest('.form').style.outlineColor = '#f37421'
                }
            })
            el.addEventListener('mouseleave', () => {
                if (el.closest('.form') != null)
                    el.closest('.form').style.outlineColor = 'transparent'
                /*E.S Do not remove - added by Elipaz*/
                if (el.closest('.form__body') != null)
                    el.closest('.form__body').style.outlineColor = 'transparent'
            })
        })
    })
    setTimeout(() => {
        document.querySelectorAll('.select2-selection ').forEach((el) => {
            if (el.closest('.form--catalog') !== null) {
                el.addEventListener('mouseenter', () => {
                    if (!el.closest('.select2-container').classList.contains('select2-container--open')) {
                        el.closest('.form__body').classList.add('hover')
                        el.closest('.form').classList.add('hover')
                    }
                })
                el.addEventListener('mouseleave', () => {
                    el.closest('.form__body').classList.remove('hover')
                    el.closest('.form').classList.remove('hover')
                })
            }
        })
    }, 0)
    $('.swiper-button').each((i, el) => {
        if ($(el).hasClass("swiper-button-lock")) {
            $(el).attr('tabindex', '-1').prop('tabindex', '-1');
            $(el).attr('aria-hidden', 'true').prop('aria-hidden', 'true')
        }
    })
    // widget-button
    const widgetFunc = function () {
        const parent = document.querySelector('[data-toggle]');
        //E.S add the check ? - not delete
        const toggleButton = parent?.querySelector('.widget-button');
        const parentTab = toggleButton?.getAttribute('tabindex')
        const elenTab = parent?.querySelectorAll('.drop-link');
        toggleButton?.addEventListener('click', () => {
            if (parent.classList.contains('open')) {
                parent.classList.remove('open');
                toggleButton.setAttribute('aria-expanded', 'false');
                parent.querySelectorAll('a').forEach((el) => {
                    el.setAttribute('tabindex', '-1')
                })
            } else {
                var child = parent.querySelector(".small-menu__body");
                child.style.opacity = 1;
                parent.classList.add('open');
                toggleButton.setAttribute('aria-expanded', 'true');
                parent.querySelectorAll('a').forEach((el) => {
                    el.setAttribute('tabindex', parentTab)
                })
            }
        })
        // E.S add the check  ? - not delete
        elenTab?.forEach((elem, i) => {
            elem.addEventListener('blur', (ev) => {
                setTimeout(() => {
                    if (i + 1 === elenTab.length && !document.activeElement.classList.contains('drop-link' || i === 0 && !document.activeElement.classList.contains('drop-link'))) {
                        parent.classList.remove('open')
                        parent.setAttribute('aria-expanded', 'false');
                    }
                }, 0)
            })
        })
    }
    // E.S add the check - ? - not delete
    const headerJHeight = document.querySelector('.header')?.offsetHeight;
    const nextSection = document.querySelectorAll('.js-next-section');
    // E.S add the check  ? - not delete
    document.querySelector('.header') != null ? document.querySelector('.header').style.position = 'fixed' : '';
    document.body.style.paddingTop = headerJHeight + 'px';
    // parallax
    const image = document.getElementsByClassName('parallax');
    if (image.length > 0) {
        if (window.outerWidth > 1366) {
            var p = new Parallax(image, {
                offsetYBounds: 1200,
                intensity: 40,
                center: 2.5,
                safeHeight: 0.15
            }).init()
        }
    }
    // burger and search triggers
    const body = document.querySelector('body');
    const burger = document.querySelector('.burger');
    const navMenu = document.querySelector('.nav-menu');
    const searchButton = document.querySelector('.js-open-search');
    const searchBlock = document.querySelector('.search-block');
    const searchClose = document.querySelector('.js-close-search');
    const menuClose = document.querySelector('.js-close-menu');
    // E.S add the check  ? - not delete
    const menuTabElem = navMenu?.querySelectorAll('[tabindex]');
    // E.S add the check  ? - not delete
    const searchTabElem = searchBlock?.querySelectorAll('[tabindex]');
    // E.S add the check  ? - not delete
    searchBlock?.removeAttribute('hidden')
    burger?.addEventListener('keydown', (event) => {
        var code = event.keyCode || event.which;
        if (event.shiftKey && code === 9 || code === 9) {
            openMenuFocus();
        }
    })
    menuTabElem?.forEach((el, i) => {
        el.addEventListener('keydown', (ev) => {
            var code = ev.keyCode || ev.which;
            if (code === 40) {
                ev.preventDefault();
                let inputElement = document.activeElement;
                simulateTabKey(inputElement).then((defaultNotPrevented) => { simulateTabKeyDefaultNotPrevented(defaultNotPrevented, inputElement, false); });
                setTimeout(() => { checkColumnsVisib(); }, 100);
                return;
            }
            if (code === 38) {
                ev.preventDefault();
                let inputElement = document.activeElement;
                simulateTabKey(inputElement, true).then((defaultNotPrevented) => { simulateTabKeyDefaultNotPrevented(defaultNotPrevented, inputElement, true); });
                setTimeout(() => { checkColumnsVisib(); }, 100);
                return;
            }
            if (code === 39) {
                checkColumnsVisib(true);
                return;
            }
            if (code === 9) {
                setTimeout(() => {
                    let indexColumn = $('.nav-menu__column.nav-menu__column--inner.is-show').length;
                    let isMenuElement = $('#menu').has(document.activeElement).length > 0;
                    if (!isMenuElement && indexColumn == 2 && !$('.column-link').last().is($(ev.target))) {
                        $(ev.target).focus();
                    }
                    if (document.activeElement.closest('.nav-menu') == null ||
                        $(document.activeElement.parentElement).hasClass('nav-menu__big-links')) {
                        if (!$(document.activeElement.parentElement).hasClass('nav-menu__big-links')) {
                            let linksMenu = $($('.nav-menu__big-links')[0]).find('a');
                            linksMenu[0].focus();
                        }
                    } else if (!ev.shiftKey && !$(document.activeElement).hasClass('column-link')) {
                        let bottomLinkSection = $('.nav-menu__column-bottom.show')[indexColumn];
                        let bottomLinks = $(bottomLinkSection).find('a');
                        if (bottomLinks.length > 0) {
                            bottomLinks.attr('tabindex', '0');
                            currentSelectSubMenuSection = bottomLinkSection;
                            bottomLinks.first().focus();
                        }
                    }
                    if (document.activeElement.closest('.nav-menu__column--inner') == null) {
                        let element = getElementMenu(document, '.js-menu');
                        getElements(element, '.nav-menu__column--inner').forEach(column => {
                            column.classList.remove('is-show');
                        });
                        clearList(element);
                    }
                    checkColumnsVisib();
                }, 0);
            }
        })
    })
    function checkColumnsVisib(redirect) {
        redirect = redirect ?? false;
        if (!$(document.activeElement).hasClass('column-link')) {
            let columns = $('.nav-menu__column--inner');
            if (columns.length > 1) {
                $.each(columns, (i, v) => {
                    if (i > 0) {
                        v.classList.remove('is-show');
                    }
                });
                clearList(getElementMenu(document, '.js-menu'));
            };
            if (redirect) {
                let prevFocusElem = getPrevFocusElement();
                setTimeout(() => { prevFocusElem.first().focus(); }, 300);
            }
        }
    }
    $('.column-link').on('keydown', function (e) {
        var code = e.keyCode || e.which;
        if (code !== 9) return;
        if ($('.column-link').last().is($(document.activeElement))) return;
        e.preventDefault();
        let nextElem = getNextFocusElement(e);
        if (currentSelectSubMenuSection == null) return;
        if (!$(currentSelectSubMenuSection).has($(nextElem)).length > 0) {
            setTimeout(() => {
                let dataId = e.target.parentElement.dataset.id;
                if (!e.shiftKey) {
                    dataId++;
                }
                $('.column-link').attr('tabindex', '-1');
                currentSelectSubMenuSection = null;
                let itemMenuNext = $('.nav-menu__list-item[data-id= ' + dataId + ']')[0];
                itemMenuNext.focus();
                setTimeout(() => {
                    if (!$(document.activeElement).is($(itemMenuNext))) {
                        $(itemMenuNext).find('a').first().focus();
                    }
                }, 100);
            }, 100);
        } else {
            $(nextElem).focus();
        }
    });
    function getNextFocusElement(event) {
        let elems = getFocusingElems();
        let index = elems.index(document.activeElement);
        if (!event.shiftKey) {
            index++;
        } else {
            index--;
        }
        return elems[index];
    }
    function getPrevFocusElement() {
        let elems = getFocusingElems();
        let index = elems.index(document.activeElement);
        index--;
        let parent = $(elems[index]).closest('.nav-menu__column');
        let newFocus = $(parent).find('.nav-menu__column-list');
        newFocus = $(newFocus).find('.nav-menu__list-item').first();
        if ($(newFocus).attr('tabindex') != '0') {
            newFocus = $(newFocus).find('a');
        }
        return newFocus;
    }
    function getFocusingElems() {
        return $(document).find('button, a, input, select, textarea, [tabindex]:not([tabindex="-1"])')
            .filter((i, e) => $(e).is(":visible"));
    }
    function simulateTabKey(element, shift) {
        shift = shift ?? false;
        return new Promise((resolve) => {
            const tabKeyEvent = new KeyboardEvent("keydown", {
                key: "Tab",
                code: "Tab",
                keyCode: 9,
                which: 9,
                shiftKey: shift,
            });
            element.addEventListener("keydown", function eventHandler(e) {
                if (e.defaultPrevented) {
                    resolve(false);
                    element.removeEventListener("keydown", eventHandler);
                }
            });
            element.dispatchEvent(tabKeyEvent);
            resolve(true);
        });
    }
    function simulateTabKeyDefaultNotPrevented(defaultNotPrevented, inputElement, shift) {
        if (defaultNotPrevented) {
            const focusableElements = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
            const focusable = Array.from(document.querySelectorAll(focusableElements))
                .filter(el => !el.disabled && !el.hidden && el.tabIndex >= 0);
            const currentIndex = focusable.indexOf(inputElement);
            const nextIndex = !shift ? (currentIndex + 1) % focusable.length : (currentIndex - 1) % focusable.length;
            focusable[nextIndex].focus();
        }
    }
    function openMenuFocus() {
        let menu = $('.nav-menu__column')[0];
        let items = $(menu).find('.nav-menu__list-item');
        setTimeout(() => {
            if (window.innerWidth <= 768) {
                $(".nav-menu__close").focus();
            } else {
                items[0].focus();
            }
        }, 300);
    }
    searchTabElem?.forEach((el, i) => {
        el.addEventListener('blur', (ev) => {
            setTimeout(() => {
                if (document.activeElement.closest('.search-block') === null) {
                    searchClose.focus()
                }
            }, 0)
        })
    })
    /*E.S. Do Not Remove start */
    //Global Function (Called also from accessibility handler)
    openMainMenu = function (open) {
        const handleCloseMenu = () => {
            burger.classList.remove('open');
            navMenu.classList.remove('open');
            body.classList.remove('menu-is-open');
            burger.setAttribute('aria-expanded', 'false');
            burger.setAttribute('title', '');
            document.querySelectorAll('.nav-menu__column--inner').forEach(column => {
                column.classList.remove('is-show');
            });
            navMenu.removeEventListener('keydown', handleEscapePress);
        }
        const handleEscapePress = (event) => {
            if (event.key === 'Escape') {
                handleCloseMenu();
            }
        }
        if (!open) {
            handleCloseMenu();
        }
        else {
            /*E.s Do not remove*/
            //var $firstItem = $('.nav-menu .nav-menu__column:first-child .nav-menu__column-list:first-child .nav-menu__list-item:first-child');
            //setTimeout(() => {
            //    console.log($firstItem)
            //    $firstItem.focus();
            //}, 0)
            burger.classList.add('open');
            searchButton.classList.remove('open');
            searchBlock.classList.remove('open');
            navMenu.classList.add('open');
            body.classList.add('menu-is-open');
            body.classList.remove('search-is-open');
            burger.setAttribute('aria-expanded', 'true');
            burger.setAttribute('title', 'סגור תפריט');
            openMenuFocus();
            navMenu.addEventListener('keydown', handleEscapePress);
        }
    };
    /*E.S. Do Not Remove end */
    /*E.S. Do Not Remove start */
    // open menu
    burger?.addEventListener('click', (event) => {
        openMainMenu(!event.currentTarget.classList.contains('open'));
        //if (event.currentTarget.classList.contains('open')) {
        //    event.currentTarget.classList.remove('open');
        //    navMenu.classList.remove('open');
        //    body.classList.remove('menu-is-open');
        //    burger.setAttribute('aria-expanded', 'false');
        //burger.setAttribute('title', '');
        //    document.querySelectorAll('.nav-menu__column--inner').forEach(column => {
        //        column.classList.remove('is-show');
        //    });
        //} else {
        //    /*E.s Do not remove*/
        //    //var $firstItem = $('.nav-menu .nav-menu__column:first-child .nav-menu__column-list:first-child .nav-menu__list-item:first-child');
        //    //setTimeout(() => {
        //    //    console.log($firstItem)
        //    //    $firstItem.focus();
        //    //}, 0)
        //    openMenuFocus();
        //    event.currentTarget.classList.add('open');
        //    searchButton.classList.remove('open');
        //    searchBlock.classList.remove('open');
        //    navMenu.classList.add('open');
        //    body.classList.add('menu-is-open');
        //    body.classList.remove('search-is-open');
        //    burger.setAttribute('aria-expanded', 'true');
        //    burger.setAttribute('title', 'סגור תפריט');
        //}
    });
    /*E.S. Do Not Remove end */
    // E.S add the check  ? - not delete
    // search widget
    searchButton?.addEventListener('click', (event) => {
        if (event.currentTarget.classList.contains('open')) {
            event.currentTarget.classList.remove('open');
            navMenu.classList.remove('open');
            searchBlock.classList.remove('open');
            searchBlock.classList.add('not-open');
            body.classList.remove('search-is-open');
        } else {
            burger.classList.remove('open');
            navMenu.classList.remove('open');
            searchBlock.classList.add('open');
            searchBlock.querySelector(".js-typeahead-search-Header").setAttribute("aria-hidden", "false");
            searchBlock.querySelector(".button--submit.button--default-hover").setAttribute("aria-hidden", "false");
            searchBlock.classList.remove('not-open');
            body.classList.add('search-is-open');
            setTimeout(() => {
                if (searchBlock.querySelector(".close-mob-search").classList.contains("mobile"))
                    searchBlock.querySelector(".close-mob-search").focus()
                else
                    searchClose.focus()
            }, 100)
        }
    });
    // E.S add the check  ? - not delete
    searchClose?.addEventListener('click', () => {
        searchBlock.classList.remove('open');
        body.classList.remove('search-is-open');
        body.classList.remove('menu-is-open');
    })
    if (menuClose != null) {
        menuClose.addEventListener('click', () => {
            navMenu.classList.remove('open');
            body.classList.remove('menu-is-open');
            burger.classList.remove('open');
        })
    }
    SmoothScroll({
        animationTime: 800,
        stepSize: 75,
        accelerationDelta: 30,
        accelerationMax: 2,
        keyboardSupport: true,
        arrowScroll: 50,
        pulseAlgorithm: true,
        pulseScale: 4,
        pulseNormalize: 1,
        touchpadSupport: true,
    })
    const elem = document.querySelectorAll('.js-close-outside')
    if (elem !== null) {
        elem.forEach((el) => {
            document.addEventListener('click', function (event) {
                if (!el.contains(event.target)) {
                    el.classList.remove('open')
                }
            });
        })
    }
    window.addEventListener('resize', () => {
        const headerJHeight = document.querySelector('.header')?.offsetHeight;
        document.body.style.paddingTop = headerJHeight + 'px';
    })
    // mobile-detect
    function getMobileOperatingSystem() {
        var userAgent = navigator.userAgent || navigator.vendor || window.opera;
        // Windows Phone must come first because its UA also contains "Android"
        if (/windows phone/i.test(userAgent)) {
            return "Windows Phone";
        }
        if (/android/i.test(userAgent)) {
            return "Android";
        }
        // iOS detection from: http://stackoverflow.com/a/9039885/177710
        if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
            return "iOS";
        }
        return "unknown";
    }
    if (getMobileOperatingSystem() === "iOS") {
        $('body').addClass('ios-detect')
    }
    if (getMobileOperatingSystem() === "Android") {
        $('body').addClass('android-detect')
    }
    $('body').on('click', '.js-clear-selectSearch', () => {
    })
    $('body').on('click', '.js-close-popup', () => {
        $.magnificPopup.close();
        $('close-popup-tooltip').hide()
    });
    $(window).on('beforeunload', function () {
        $(window).scrollTop(0);
    });
    // copied block
    window.testMethod = function () { alert('from andrey code') };
    function copyToClipboard(element) {
        let copyText = element.nextElementSibling;
        copyText.select();
        document.execCommand("copy");
        element.innerText = 'מוּעֲתָק!'
        element.classList.add('copied')
    }
    let copyBtn = document.querySelectorAll('.js-copy-button');
    if (copyBtn !== null) {
        copyBtn.forEach((el) => {
            el.addEventListener('click', function () {
                copyToClipboard(el);
            })
        })
    }
    window.copyBtnBinding = function (e) {
        copyToClipboard(e);
    }
    $('body').on('click', '.custom-select-item', (e) => {
        let text = $(e.currentTarget).find('.custom-select-item__name').text();
        let textSimple = $(e.currentTarget).text();
        const value = $(e.currentTarget).closest('.inp_select').find('.custom-select').val();
        const dropWrap = $(e.currentTarget).closest('.inp_select').find('.drop-block');
        const textDrop = dropWrap.find('.drop-block__text');
        let newVal
        if ($(e.currentTarget).hasClass('js-custom-select-item-multiple')) {
            if ($(e.currentTarget).hasClass('active')) {
                $(e.currentTarget).removeClass('active')
                if (value.match(text) !== null) {
                    newVal = value.replace(text, '');
                }
                if (value.match(', ' + text) !== null) {
                    newVal = value.replace(', ' + text, '');
                }
                $(e.currentTarget).closest('.inp_select').find('.custom-select').val(newVal);
                textDrop.text(newVal)
                if (value.length < 10) {
                    dropWrap.addClass('hide')
                } else {
                    dropWrap.removeClass('hide')
                }
            } else {
                if ($(e.currentTarget.closest('.inp__dropdown')).find('.custom-select-item.active').length > 0) {
                    $(e.currentTarget).closest('.inp_select').find('.custom-select').val(value + ', ' + text);
                    textDrop.text(value + ', ' + text);
                } else {
                    $(e.currentTarget).closest('.inp_select').find('.custom-select').val(value + text);
                    textDrop.text(value + text);
                }
                $(e.currentTarget).addClass('active')
                if (value.length < 10) {
                    dropWrap.addClass('hide')
                } else {
                    dropWrap.removeClass('hide')
                }
            }
        } else {
            $(e.currentTarget).closest('.inp_select').find('.custom-select').val(textSimple)
        }
        $(e.target).closest('.inp_select').find('.custom-select').prev().addClass('has-value')
        $(e.target).closest('.inp_select').find('.custom-select-drop').removeClass('show')
    })
    $('.custom-select').not('.with-checkboxes').on('click', (e) => {
        $(e.target).closest('.inp_select').addClass('opened')
        $('.inp__label').addClass('focus')
    })
    $('.custom-select-item').each(function () {
        let text = $(this).text()
        $(this).on('click', function () {
            $('.custom-select').not('.with-checkboxes').val(text)
            $('.custom-select').not('.with-checkboxes').prev().addClass('has-value')
            $('.custom-select-drop').not('.with-checkboxes').removeClass('show')
        })
    })
    $(document).on('click', function (e) {
        if ($(e.target).closest(".custom-select").length === 0) {
            $('.custom-select').not('.with-checkboxes').closest('.inp_select').removeClass('opened');
            $('.inp__label').not('.with-checkboxes').removeClass('focus')
        }
    });
    $('input, textarea').each(function (i, item) {
        $(item).on('change', (el) => {
            if ($(item).val().length > 0) {
                $(item).addClass('has-value')
                $(item).prev('.inp__label').addClass('has-value')
            } else {
                $(item).removeClass('has-value')
                $(item).prev('.inp__label').removeClass('has-value')
            }
        })
    });
    $.typeahead({
        input: '.js-typeahead-search-1',
        minLength: 1,
        dynamic: true,
        // maxItem: 15,
        hint: true,
        //group: {
        //    template: '{{group}}'
        //},
        maxItemPerGroup: 5,
        //backdrop: '',
        // href: "/beers/{{group|slugify}}/{{display|slugify}}/",
        //   dropdownFilter: "",
        // emptyTemplate: $("#home-page-no-results-text").val() +": '" +'{{query}}'+"'",
        source: {
            ajax: {
                url: "/umbraco/api/SearchApi/SearchForAutoComplete?cultureCode=" + $("#currentCultureCode").val() + "&term={{query}}",
                callback: {
                    done: function (data) {
                        var result = [];
                        $.each(data, function (index, value) {
                            result.push({
                                "name": data[index].title, "groupName": data[index].groupName, "url": data[index].absoluteUrl
                            });
                        });
                        return result;
                    }
                }
            }
        },
        templateValue: "{{name}}",
        display: ["name"],
        filter: false,
        group: { key: "groupName" },
        callback: {
            onNavigateAfter: function (node, lis, a, item, query, event) {
                if (~[38, 40].indexOf(event.keyCode)) {
                    var resultList = node.closest("form").find("ul.typeahead__list"),
                        activeLi = lis.filter("li.active"),
                        offsetTop = activeLi[0] && activeLi[0].offsetTop - (resultList.height() / 2) || 0;
                    resultList.scrollTop(offsetTop);
                }
            },
            onClickAfter: function (node, a, item, event) {
                event.preventDefault();
                if (item.url != undefined)
                    window.location.href = item.url;
            }
        }
    });
    typeof $.typeahead === 'function' && $.typeahead({
        input: '.js-typeahead-search-3',
        minLength: 1,
        maxItem: 8,
        maxItemPerGroup: 6,
        hint: true,
        searchOnFocus: true,
        blurOnTab: false,
        matcher: function (item, displayKey) {
            if (item.id === "BOS") {
                // Disable Boston for X reason
                item.disabled = true;
            }
            // Add all items matched items
            return true;
        },
        multiselect: {
            limit: 10,
            limitTemplate: 'You can\'t select more than 10 teams',
            matchOn: ["id"],
            cancelOnBackspace: true,
            data: function () {
                var deferred = $.Deferred();
                setTimeout(function () {
                    deferred.resolve([{
                        "matchedKey": "name",
                        "name": "פסיכולוגיה",
                        "img": "canadiens",
                        "city": "Montreal",
                        "id": "MTL",
                        "conference": "Eastern",
                        "division": "Northeast",
                        "group": "teams"
                    }]);
                }, 2000);
                deferred.always(function () {
                    console.log('data loaded from promise');
                });
                return deferred;
            },
            callback: {
                onClick: function (node, item, event) {
                    console.log(item);
                    alert(item.name + ' Clicked!');
                },
                onCancel: function (node, item, event) {
                    console.log(item);
                    alert(item.name + ' Removed!');
                }
            }
        },
        templateValue: "{{name}}",
        display: ["name", "city"],
        emptyTemplate: 'no result for {{query}}',
        source: {
            teams: {
                url: "/search-second.json"
            }
        },
        callback: {
            onNavigateAfter: function (node, lis, a, item, query, event) {
                if (~[38, 40].indexOf(event.keyCode)) {
                    var resultList = node.closest("form").find("ul.typeahead__list"),
                        activeLi = lis.filter("li.active"),
                        offsetTop = activeLi[0] && activeLi[0].offsetTop - (resultList.height() / 2) || 0;
                    resultList.scrollTop(offsetTop);
                }
            },
            onClick: function (node, a, item, event) {
                console.log(item.name + ' Added!')
            },
            onSubmit: function (node, form, items, event) {
                event.preventDefault();
                alert(JSON.stringify(items))
            }
        },
        debug: true
    });
    var navigateNoResultsHandler = function (event) {
        if (event.keyCode === 38 || event.keyCode === 40) {
            var emptySuggestion = $('.typeahead__empty');
            if (emptySuggestion.length) {
                event.preventDefault();
                emptySuggestion.toggleClass('active');
            }
        }
    }
    $('.js-typeahead-search-1').on('keydown', navigateNoResultsHandler);
    $('.js-typeahead-search-2').on('keydown', navigateNoResultsHandler);
    $('.js-typeahead-search-3').on('keydown', navigateNoResultsHandler);
    $(document).click(function (event) {
        let $target = $(event.target);
        if (!$target.hasClass('js-open-drop') && !$target.closest('.js-drop').length) {
            $('.js-drop').removeClass("open");
            /*E.S Do not remove - added by Elipaz*/
            $('.js-drop').attr("aria-expanded", "false");
            /*E.S Do not remove - added by Elipaz*/
            $('body').removeClass('drop-opened')
            /* $('body').removeClass('filter-opened')*/
            $('.js-drop').closest('.swiper-slide').css('z-index', '1');
            $('section').removeClass('z-top')
        }
    });
    // help-popup
    $('body').on('click', '.js-open-drop', (event) => {
        let $this = $(event.currentTarget);
        let $wrap = $this.closest('.js-help')
        /*E.S Do not remove - added by Elipaz*/
        let $wrap2 = $('.popup--preview')
        let $drop = $wrap.find('.js-drop')
        $drop.attr("aria-expanded", "true");
        let $close = $wrap.find('.js-drop-close')
        /*E.S Do not remove - added by Elipaz*/
        let $close2 = $wrap2.find('.js-close-popup')
        $('.js-drop').removeClass('open')
        $drop.toggleClass('open');
        $this.closest('section').addClass('z-top')
        $('.swiper-slide').removeClass('z-top')
        $this.closest('.swiper-slide').addClass('z-top')
        let innerItems = $drop.find('[tabindex]');
        setTimeout(function () {
            $drop.find(".share-link").first().focus()
        }, 30)
        if ($this.closest('.popup').length) {
            $this.closest('.popup').find('.close-popup-tooltip').css('display', 'flex');
            $drop.closest('li').css('position', 'initial');
        }
        if ($wrap.hasClass('js-help-popup')) {
            $('body').addClass('drop-opened')
        }
        //if (window.outerWidth < 1025) {
        //    document.body.classList.add('simple-overflow')
        //}
        //  //E.S Do not remove - removed by Elipaz
        //if(window.outerWidth < 1025 && !$wrap.hasClass('link--dop')) {
        //  document.body.classList.add('filter-opened')
        //}
        if ($this.closest('.popup').length && window.outerWidth > 1024) {
            const popupW = $this.closest('.popup').width();
            const posLeft = $this.offsetParent()[0].offsetLeft
            if (posLeft > popupW / 2) {
                $drop.addClass('reverse')
            }
        }
        $close.focus()
        /*E.S Do not remove - added by Elipaz*/
        setTimeout(() => {
            $close2.focus()
        }, 0)
        innerItems.each(function (i, el) {
            $(this).on('blur', function () {
                setTimeout(() => {
                    if (i + 1 === innerItems.length && document.activeElement.closest('.js-drop') === null || i === 0 && document.activeElement.closest('.js-drop') === null) {
                        $drop.removeClass("open")
                        $this.closest('section').removeClass('z-top')
                    }
                }, 0)
            })
        })
        //innerItems.each(function (i, el) {
        //    $(this).on('blur', function (event) {
        //        setTimeout(() => {
        //            if (i + 1 === innerItems.length && document.activeElement.closest('.ac-panel') === null || i === 0 && document.activeElement.closest('.ac-panel') === null) {
        //                $parent.removeClass('is-active');
        //                $block.slideUp(400);
        //                $parentMini.removeClass('opened');
        //                $button.attr('aria-expanded', 'false').prop('aria-expanded', 'false');
        //            }
        //        }, 0)
        //    })
        //});
    })
    // awiper-drop
    $('body').on('click', '.js-swiper-drop', (event) => {
        let $this = $(event.currentTarget);
        let $drop = $this.find('.include-item__drop');
        $this.toggleClass('show');
        $drop.toggleClass('show');
        if ($this.hasClass('show')) {
            $this.attr('aria-expanded', 'true').prop('aria-expanded', 'true');
        } else {
            $this.attr('aria-expanded', 'false').prop('aria-expanded', 'false');
        }
    })
    $('body').on('click', '.js-drop-close', (event) => {
        let $this = $(event.currentTarget);
        let $drop = $this.closest('.js-drop');
        let $wrap = $this.closest('.js-help')
        $drop.removeClass("open")
        $this.closest('section').removeClass('z-top')
        if ($this.closest('.popup').length) {
            $this.closest('.popup').find('.close-popup-tooltip').css('display', 'none');
            $this.closest('.popup').find('.js-help').each(function () {
                $(this).closest('li').css('position', 'relative');
            })
        }
        if ($wrap.hasClass('js-help-popup')) {
            $('body').removeClass('drop-opened')
        }
        if (window.outerWidth < 1025) {
            document.body.classList.remove('simple-overflow')
        }
        if (window.outerWidth < 1025) {
            document.body.classList.remove('filter-opened')
        }
    })
    // thanks form
    /*E.S. Do Not Remove Start*/
    /* $('body').on('click', '.js-thank', (event) => {
       let $this = $(event.currentTarget);
       let form = $this.closest('form');
       let preloader = form.find('.preloader')
     let $parent = $this.closest('.js-wrap-form');
     let $thank = $parent.find('.thanks-block')
       preloader.addClass('show');
         setTimeout(() => {
           $parent.addClass('finish')
           preloader.hide();
       }, 3000)
   });*/
    /*E.S. Do Not Remove End*/
    // open/close multi-select2 mobile
    $('body').on('click', '.js-mobile-search-trigger', (event) => {
        let $this = $(event.currentTarget);
        const $parent = $this.closest('.js-catalog-wrap');
        const $search = $parent.find('.js-mobile-search');
        const $section = $parent.closest('.section--top');
        $section.css('z-index', '12');
        $search.addClass("open");
        $parent.addClass('open');
        $search.find('input').focus();
        $search.find('.select2-selection').trigger('click');
        $('body').addClass('filter-opened');
        // if ($('.js-choosed').find('.js-choosed-item').length > 0) {
        //   $('body').addClass('ios-pos')
        // } else {
        //   $('body').removeClass('ios-pos')
        // }
        disableBodyScroll(window, {
            allowTouchMove: (el) => {
                while (el && el !== document.body) {
                    if (el.getAttribute('body-scroll-lock-ignore') !== null) {
                        return true;
                    }
                    el = el.parentNode;
                }
            }
        });
    });
    $('body').on('click', '.close-mob-search', (event) => {
        let $this = $(event.currentTarget);
        const $parent = $this.closest('.js-mobile-search');
        const $section = $parent.closest('.section--top');
        $section.css('z-index', 'initial');
        $parent.removeClass('open')
        $('.js-catalog-wrap').removeClass('open')
        $('body').removeClass('filter-opened search-is-open');
        $this.closest('.search-block').removeClass('open')
        clearAllBodyScrollLocks();
    });
    // multi-select2 mobile
    $('body').on('click', '.js-choosed-item', (event) => {
        let $this = $(event.currentTarget);
        let $id = $this.data('select2-id');
        $('.js-mobile-search').find('.select2-selection__choice[data-select2-id="' + $id + '"]').find('.select2-selection__choice__remove').trigger('click');
        let choosed = $('.js-mobile-search').find('.select2-selection__rendered').html()
        let length = $('.js-mobile-search').find('.select2-selection__rendered .select2-selection__choice').length;
        $('.js-mob-count-selected').text(length)
        $('.js-choosed').html(choosed);
        $('.js-choosed').find('.select2-selection__choice').addClass('js-choosed-item')
    });
    // magnific popups
    //.E.S. Removed and wrapped by us again - Do not uncomment (28-11-2022)
    $('body').on('click', '.js-dmi[data-mfp]', (event) => {
        let $this = event.currentTarget;
        let $modalId = $($this).data('mfp-src');
        $.magnificPopup.open({
            mainClass: 'mfp-with-zoom',
            items: {
                src: $modalId, // can be a HTML string, jQuery object, or CSS selector
                type: 'inline'
            },
            callbacks: {
                open() {
                    if (window.event.pointerType !== 'mouse') {
                        $(this.content).find('.js-close-popup').focus()
                    }
                    if ($(this.content).find('.youtube-video')) {
                        const src = $(this.content).find('.youtube-video').data('src')
                        setTimeout(() => {
                            function onYouTubeIframeAPIReady() {
                                window.player = new YT.Player('ytplayer', {
                                    width: '100%',
                                    videoId: src,
                                    playerVars: { 'autoplay': 1, 'playsinline': 1, 'showinfo': 0, 'enablejsapi': 1 },
                                    events: {
                                        'onReady': onPlayerReady
                                    }
                                });
                            }
                            onYouTubeIframeAPIReady();
                            function onPlayerReady(event) {
                                event.target.playVideo();
                                document.querySelector('.swiper-preloader[data-id="youtube-popup"]').style.display = 'none';
                            }
                        }, 0)
                    }
                    $(this.content).find('[tabindex]').each((i, el) => {
                        $(el).on('blur', () => {
                            setTimeout(() => {
                                if (document.activeElement.closest('.popup') === null) {
                                    // why remove? i need this for accessibility
                                    $(this.content).find('.js-close-popup').focus()
                                }
                            }, 0)
                        })
                    })
                    $('body').css('overflow', 'hidden');
                    disableBodyScroll(window, {
                        allowTouchMove: (el) => {
                            while (el && el !== document.body) {
                                if (el.getAttribute('body-scroll-lock-ignore') !== null) {
                                    return true;
                                }
                                el = el.parentNode;
                            }
                        }
                    });
                },
                close() {
                    if ($(this.content).find('.youtube-video')) {
                        setTimeout(() => {
                            document.querySelector('#ytplayer').contentWindow.postMessage('{"event":"command", "func":"stopVideo", "args":""}', '*');
                        }, 1000)
                    }
                    clearAllBodyScrollLocks();
                    $('body').css('overflow', 'initial');
                }
            }
        });
    })
    // page favorites
    $('body').on('click', '.js-button-fav', (event) => {
        const $this = $(event.currentTarget);
        const $text = $this.find('.button__text');
        const $status = $this.data('add-fav');
        const $addText = $this.data('text-add');
        const $defText = $this.data('text-default');
        if ($this.hasClass('added-fav')) {
            $this.removeClass('added-fav')
            $this.attr('data-add-fav', 'false');
            $text.text($defText);
            $text.setAttribute("aria-label", $defText)
        } else {
            $this.addClass('added-fav')
            $text.text($addText);
            $text.setAttribute("aria-label", $addText)
            $this.attr('data-add-fav', 'true');
        }
    });
    /*E.S. Encapsulations */
    window.openPopup = function ($sender, modalId) {
        let $this = $sender
        let $modalId;
        if ($this != null)
            $modalId = $($this).data('mfp-src');
        else {
            $modalId = modalId
        }
        $.magnificPopup.open({
            mainClass: 'mfp-with-zoom',
            items: {
                src: $modalId, // can be a HTML string, jQuery object, or CSS selector
                type: 'inline'
            },
            callbacks: {
                open() {
                    $('body').css('overflow', 'hidden');
                    disableBodyScroll(window, {
                        allowTouchMove: (el) => {
                            while (el && el !== document.body) {
                                if (el.getAttribute('body-scroll-lock-ignore') !== null) {
                                    return true;
                                }
                                el = el.parentNode;
                            }
                        }
                    });
                },
                close() {
                    clearAllBodyScrollLocks();
                    $('body').css('overflow', 'initial');
                }
            }
        });
    };
    // combination selects
    $('body').on('click', '.js-combinations-fake', (event) => {
        const $this = $(event.currentTarget);
        let $search = $('.js-combinations-search').addClass('open')
        $search.show();
        $search.find($('.js-select')).select2('open');
        $('body').addClass('comb-search');
    });
    //let filter = document.querySelectorAll('.js-filter-check');
    //if (filter !== null) {
    //    filter.forEach((el) => {
    //        el.addEventListener('click', () => {
    //            if (el.classList.contains('is-active')) {
    //                el.classList.remove('is-active');
    //                el.setAttribute('aria-checked', 'false');
    //            } else {
    //                el.classList.add('is-active');
    //                el.setAttribute('aria-checked', 'true');
    //            }
    //        })
    //    })
    //}
    if (nextSection.length > 0) {
        nextSection.forEach((el, i) => {
            el.addEventListener('click', () => {
                const elem = el.getAttribute('data-scroll-to')
                $('html, body').animate({
                    scrollTop: $(elem).offset().top - headerJHeight + 1
                }, 1200);
            })
        })
    }
    // inview
    const blockInView = document.querySelectorAll('.js-inview');
    blockInView.forEach((el, i) => {
        $(el).bind('inview', function (event, visible, visiblePartX, visiblePartY) {
            if (visible) {
                setTimeout(() => {
                    el.classList.add('showed')
                }, 50)
            }
        });
    });
    // favorites
    const favoriteItem = document.querySelectorAll('.js-favorite');
    if (favoriteItem.length > 0) {
        favoriteItem.forEach((el, i) => {
            el.addEventListener('click', () => {
                if (el.classList.contains('active')) {
                    el.classList.remove('active');
                } else {
                    el.classList.add('active');
                }
            })
        })
    }
    // masonry
    window.masonry = function () {
        let container = document.querySelector('.js-masonry-grid');
        if (container !== null) {
            let gutter;
            if (window.innerWidth < 1200 && window.innerWidth > 1024) {
                gutter = 60
            } else if (window.innerWidth > 1200) {
                gutter = 124
            } else if (window.innerWidth < 1024) {
                gutter = 40
            }
            window.addEventListener('resize', () => {
                if (window.innerWidth < 1200 && window.innerWidth > 1024) {
                    gutter = 60
                } else if (window.innerWidth > 1200) {
                    gutter = 124
                } else if (window.innerWidth < 1024) {
                    gutter = 40
                }
            })
            let msnry = new Masonry(container, {
                columnWidth: '.js-masonry-item',
                itemSelector: '.js-masonry-item',
                gutter: gutter,
                horizontalOrder: true,
                percentPosition: true,
                originLeft: false
            });
            if (window.innerWidth < 639) {
                msnry.destroy()
            }
            window.addEventListener('resize', () => {
                let msnry = new Masonry(container, {
                    columnWidth: '.js-masonry-item',
                    itemSelector: '.js-masonry-item',
                    gutter: gutter,
                    horizontalOrder: true,
                    percentPosition: true,
                    originLeft: false
                });
                if (window.innerWidth < 639) {
                    msnry.destroy()
                }
            })
        }
    }
    // fly-favorites
    window.favorites = function (element, context = 'body') {
        function executionTimeout(timeout = 1000) {
            let timer;
            return function (callback, data) {
                clearTimeout(timer);
                timer = setTimeout(callback.bind(data), timeout)
            }
        }
        let clickTimeout = executionTimeout(300);
        $(element, context).on('click', function (event) {
            event.preventDefault();
            clickTimeout(function () {
                //$(element).addClass('is-active');
                // var favCount = $('.js-favorites-count');
                var flyIconFav = $(element).find('svg');
                var iconFav = $('.js-head-favorite').find('svg');
                if ($('.button__count').text() > '0') {
                    $('.js-head-favorite')[0].classList.add('is-active')
                } else {
                    $('.js-head-favorite')[0].classList.remove('is-active')
                }
                var $window = $(window);
                var create = flyIconFav.clone().appendTo('html').addClass('fly-icon-fav');
                var timeout = 10;
                var length = Math.sqrt(((flyIconFav[0].getBoundingClientRect().top - iconFav[0].getBoundingClientRect().top) ** 2 + (flyIconFav[0].getBoundingClientRect().left - iconFav[0].getBoundingClientRect().left) ** 2));
                var duration = "1";
                var time = length / duration + timeout;
                create.css({
                    "transition-duration": duration + 's',
                    "top": flyIconFav[0].getBoundingClientRect().top,
                    "left": flyIconFav[0].getBoundingClientRect().left,
                });
                setTimeout(function () {
                    create.css({
                        "top": iconFav[0].getBoundingClientRect().top,
                        "left": iconFav[0].getBoundingClientRect().left,
                        "width": iconFav.width(),
                        "height": iconFav.height(),
                    });
                }, timeout);
                $window.on('scroll.buy', function () {
                    if (length < 1) {
                        create.remove();
                        $window.off('scroll.buy');
                        clearInterval(interval);
                    }
                    time = length / duration;
                    create.css({
                        "transition-duration": duration + 's',
                        "top": iconFav[0].getBoundingClientRect().top,
                        "left": iconFav[0].getBoundingClientRect().left,
                    });
                });
                var interval = setInterval(() => {
                    if (iconFav[0].getBoundingClientRect().top === create[0].getBoundingClientRect().top && iconFav[0].getBoundingClientRect().left === create[0].getBoundingClientRect().left) {
                        create.remove();
                        $window.off('scroll.buy');
                        // favCount.text(data.favoriteCount);
                        clearInterval(interval);
                    }
                }, 100);
            })
        });
    }
    // open-filter
    window.openFilter = function () {
        const filterButton = document.querySelector('.js-open-filter');
        if (filterButton !== null) {
            const filterBlock = document.querySelector('.js-filter-sidebar');
            const filterClose = document.querySelector('.js-close-filter');
            // open filter
            filterButton.addEventListener('click', (event) => {
                filterBlock.classList.add('open');
                document.querySelector('body').classList.add('filter-opened');
                document.querySelector('.header').classList.add('filt');
            });
            filterClose?.addEventListener('click', (event) => {
                filterBlock.classList.remove('open');
                document.querySelector('body').classList.remove('filter-opened');
                document.querySelector('.header').classList.remove('filt');
            });
        }
    }
    // accordion
    window.accordions = function () {
        $('body').find('.ac-trigger').each((i, el) => {
            let $this = $(el);
            let $parent = $this.closest('.ac');
            let $block = $parent.find('.ac-panel');
            let $button = $parent.find('.ac-trigger');
            let innerItems = $block.find('[tabindex]');
            let $parentMini = $parent.closest('.js-accordion-wrap');
            // show if .ac hasClass "is-active"
            if ($parent.hasClass('is-active')) {
                $block.show()
                $button.attr('aria-expanded', 'true').prop('aria-expanded', 'true');
            }
            if (!$parent.hasClass('more-info')) {
                innerItems.each(function (i, el) {
                    $(this).on('blur',
                        function () {
                            setTimeout(() => {
                                if (i + 1 === innerItems.length &&
                                    document.activeElement.closest('.ac-panel') === null ||
                                    i === 0 && document.activeElement.closest('.ac-panel') === null) {
                                    $parent.removeClass('is-active');
                                    $block.slideUp(400);
                                    $parentMini.removeClass('opened');
                                    $button.attr('aria-expanded', 'false').prop('aria-expanded', 'false');
                                }
                            },
                                0);
                        });
                });
            }
        });
        $('body').on('click',
            '.ac-trigger',
            (event) => {
                let $this = $(event.currentTarget);
                let $parent = $this.closest('.ac');
                let $parentMini = $parent.closest('.js-accordion-wrap');
                let $parentWrap = $parent.closest('.js-accordion');
                let $block = $parent.find('.ac-panel');
                let mitiple = $parentWrap.data('multiple');
                let innerItems = $block.find('[tabindex]');
                const tabindex = $this.attr('tabindex');
                if ($parent.hasClass('is-active')) {
                    $parent.removeClass('is-active');
                    $parentMini.removeClass('opened');
                    $block.slideUp(400);
                    $this.attr('aria-expanded', 'false').prop('aria-expanded', 'false');
                    innerItems.each(function (el) {
                        if (!$(el).hasClass('link--footer-column')) {
                            $(this).attr('tabindex', '-1').prop('tabindex', '-1');
                        }
                    })
                    $parentWrap.find('.ac-panel').attr("aria-hidden", "true")
                } else {
                    if (!mitiple) {
                        $parentWrap.find('.ac-panel').slideUp(400);
                        $parentWrap.find('.ac').removeClass('is-active');
                    }
                    $parent.addClass('is-active');
                    $parentMini.addClass('opened');
                    $block.slideDown(400)
                    $this.attr('aria-expanded', 'true').prop('aria-expanded', 'true');
                    innerItems.each(function (i) {
                        $(this).attr('tabindex', tabindex).prop('tabindex', tabindex);
                        if ($this.hasClass('ac-card')) {
                            if (i === 0) {
                                $(this).focus();
                            }
                        }
                    });
                    $parentWrap.find('.ac-panel').attr("aria-hidden", "false")
                }
            });
    }
    //select2
    window.customSelect = function () {
        // select2
        let query = {};
        $('.select2-selection__choice').each(function () {
            $(this).removeAttr('title');
        });
        let height = window.innerHeight;
        $('.js-close-combinations-search').on('click',
            (event) => {
                const parent = $(event.currentTarget).closest('.js-combinations-search')
                $('body').removeClass('comb-search');
                parent.removeClass('open')
            });
        $('.js-select').each((i, el) => {
            $(el).select2({
                allowClear: true,
                placeholder: $(this).data('placeholder'),
                minimumResultsForSearch: 10,
                dropdownPosition: 'below',
                dropdownParent: $(el).parent(),
                maximumSelectionLength: $(el).data('max-length'),
                language: {
                    noResults: () => {
                        return 'לא נמצאו תוצאות';
                    },
                    maximumSelected: () => {
                        return + $(el).data('max-length') + ' ' +
                            'באפשרותך לבחור עד ';
                    },
                    searching: function (params) {
                        query = params;
                        return 'Searching…';
                    }
                },
                templateResult: function (item) {
                    if (item.loading) {
                        return item.text;
                    }
                    var term = query.term || '';
                    var $result = markMatch(item.text, term);
                    return $result;
                },
                // ajax: {
                //   url: '/select2.json',
                //   dataType: 'json'
                // }
            });
            /*E.S Do not remove - added by Elipaz*/
            if ($('#payment-select').length) {
                $("html, body").animate({ scrollTop: 500 }, 500);
            }
            function markMatch(text, term) {
                var match = text.toUpperCase().indexOf(term.toUpperCase());
                var $result = $('<span></span>');
                if (match < 0) {
                    return $result.text(text);
                }
                $result.text(text.substring(0, match));
                var $match = $('<span class="select2-rendered__match"></span>');
                $match.text(text.substring(match, match + term.length));
                $result.append($match);
                $result.append(text.substring(match + term.length));
                return $result;
            }
            // clone and append choises
            $('.select2-search__field').on('blur', () => {
                $('body').removeClass('ios-pos')
            })
            $(el).on('select2:select', function (e) {
                if ($(this).hasClass('js-multi-mob')) {
                    const parent = $(this).closest('div')
                    let choosed = parent.find('.select2-selection__rendered').html();
                    $('.js-choosed').html(choosed);
                    $('.js-choosed').find('.select2-selection__choice').addClass('js-choosed-item');
                    let length = $('.js-mobile-search').find('.select2-selection__rendered .select2-selection__choice').length;
                    $('.js-mob-count-selected').text(length)
                    $('body').addClass('ios-pos')
                    if ($('.js-choosed').find('.js-choosed-item').length > 0) {
                        $('.button--select').css('display', 'flex');
                    } else {
                        $('.button--select').css('display', 'none');
                    }
                }
                if ($(this).hasClass('js-select-search-comb')) {
                    const parent = $(this).closest('.js-combinations-search')
                    const id = parent.data('id')
                    $('body').removeClass('comb-search');
                    parent.removeClass('open')
                    let selectedText = $(this).find(':selected').text();
                    $('.js-combinations-fake[data-id="' + id + '"]').find('.select2-selection__rendered').text(selectedText)
                }
                if ($(this).hasClass('js-select-payment')) {
                    const parent = $(this).closest('.js-combinations-search')
                    const id = parent.data('id')
                    $('body').removeClass('comb-search');
                    parent.removeClass('open')
                    let selectedValue = $(this).find(':selected').attr("value");
                    if (selectedValue != "")
                        window.location.href = selectedValue;
                    else {
                        $('.js-combinations-fake[data-id="' + id + '"]').find('.select2-selection__rendered').text(selectedText)
                    }
                }
                $('.select2-selection__choice').each(function () {
                    $(this).removeAttr('title');
                })
            })
            $(el).on('select2:unselect', function (e) {
                console.log("unselect")
                if ($(this).hasClass('js-multi-mob')) {
                    const parent = $(this).closest('div')
                    let choosed = parent.find('.select2-selection__rendered').html();
                    $('.js-choosed').html(choosed);
                    $('.js-choosed').find('.select2-selection__choice').addClass('js-choosed-item');
                    let length = $('.js-mobile-search').find('.select2-selection__rendered .select2-selection__choice').length;
                    $('.js-mob-count-selected').text(length)
                }
            })
            $(el).on('select2:open', function (e) {
                const parent = $(this).closest('div');
                const dropWown = parent.find('.select2-dropdown').closest('.select2-container');
                dropWown.addClass('imp')
                setTimeout(() => {
                    parent.find('.select2-results__option--selected').on('click', (event) => {
                        if ($(event.currentTarget).closest('.js-select-search')) {
                            $('.js-close-combinations-search').trigger('click')
                        }
                    })
                }, 500)
                if ($(this).hasClass('js-multi-mob')) {
                    const parent = $(this).closest('div');
                    const choosed = parent.find('.select2-selection__rendered');
                    const drop = parent.find('.select2-dropdown').closest('.select2-container');
                    const posTop = 8 + choosed.height() + 'px';
                    $('body').addClass('ios-pos')
                    setTimeout(() => {
                        drop.css('top', 'calc(100% + ' + posTop + ')')
                    }, 0)
                }
                if ($(this).hasClass('js-select-search')) {
                    const parent = $(this).closest('div')
                    const input = parent.find('.select2-search__field')
                    const selectClesr = document.createElement('div');
                    selectClesr.classList.add('js-clear-selectSearch');
                    $('<div>', {
                        class: 'js-clear-selectSearch',
                    }).appendTo(parent.find('.select2-search'));
                    input.on('input', function () {
                        let $val = $(this).val()
                        if ($val.length > 0) {
                            $(this).next('.js-clear-selectSearch').addClass('show');
                        } else {
                            $(this).next('.js-clear-selectSearch').removeClass('show');
                        }
                    })
                    input.next('.js-clear-selectSearch').on('click', () => {
                        input.val('');
                        input.next('.js-clear-selectSearch').removeClass('show');
                    })
                }
                if (e.target.dataset.dropdownInfoText) {
                    $('.select2-results').prepend('<div class="select-2-dropdown-info-text">' + e.target.dataset.dropdownInfoText + '</div>');
                }
            })
            $(el).on('select2:closing', function () {
                const parent = $(this).closest('div')
                const input = parent.find('.select2-search__field')
                input.next('.js-clear-selectSearch').remove();
                $('.select-2-dropdown-info-text').remove();
            })
        })
    }
    // tabs
    window.tabsFunc = function () {
        const parent = document.querySelector('[data-tabs]');
        if (parent !== null) {
            const tabButton = parent.querySelectorAll('.js-tab-button.big-tabs__button');
            const buttonsWrap = parent.querySelector('.big-tabs__buttons');
            parent.querySelectorAll('.js-tab-block').forEach((el) => {
                if (!el.classList.contains('active')) {
                    el.setAttribute('aria-hidden', 'true')
                    el.querySelectorAll('[tabindex]').forEach((tabindex) => {
                        tabindex.setAttribute('tabindex', '-1');
                        tabindex.setAttribute('aria-disabled', 'true')
                    })
                    setTimeout(() => {
                        el.querySelectorAll('.select2-selection').forEach((select) => {
                            select.setAttribute('tabindex', '-1');
                        })
                    }, 0)
                }
            })
            tabButton.forEach((el, i) => {
                const id = el.getAttribute('data-id');
                const tabindex = el.getAttribute('tabindex')
                const prev = el.previousElementSibling;
                const next = el.nextElementSibling;
                const index = i;
                el.addEventListener('click', () => {
                    document.querySelectorAll('.js-tab-block.big-tabs__content').forEach((elenemt) => {
                        elenemt.classList.remove('active');
                        elenemt.querySelectorAll('[tabindex]').forEach((el) => {
                            el.setAttribute('tabindex', '-1')
                            el.setAttribute('aria-disabled', 'true')
                        })
                        setTimeout(() => {
                            el.querySelectorAll('.select2-selection').forEach((select) => {
                                select.setAttribute('tabindex', '9');
                            })
                        }, 0)
                    })
                    document.querySelectorAll('.js-tab-button').forEach((elenemt) => {
                        elenemt.classList.remove('active');
                        elenemt.setAttribute('aria-selected', 'false');
                        elenemt.setAttribute('tabindex', '-1');
                    })
                    el.classList.add('active');
                    el.setAttribute('tabindex', '9');
                    el.setAttribute('aria-selected', 'true');
                    if (el.classList.contains('js-line-detect')) {
                        const topBHeight = document.querySelector('.js-uniq-top').offsetHeight;
                        if (window.pageYOffset > topBHeight) {
                            $('html, body').animate({
                                scrollTop: topBHeight - 70
                            }, 600);
                        }
                    }
                    setTimeout(() => {
                        parent.querySelector('.js-tab-block[data-id="' + id + '"]')?.classList.add('active');
                        parent.querySelector('.js-tab-button[data-id="' + id + '"]')?.classList.add('active');
                        parent.querySelector('.js-tab-block[data-id="' + id + '"]')?.querySelectorAll('.swiper-slide').forEach((visible, i) => {
                            if (!visible.classList.contains('swiper-slide-visible')) {
                                visible.querySelectorAll('[tabindex]').forEach((elenIn) => {
                                    elenIn.setAttribute('tabindex', '-1')
                                })
                            }
                        })
                        parent.querySelector('.js-tab-block[data-id="' + id + '"]')?.querySelectorAll('[tabindex]').forEach((el) => {
                            el.setAttribute('tabindex', '9')
                            el.setAttribute('aria-disabled', 'false')
                        })
                    }, 0)
                    setTimeout(() => {
                        parent.classList.remove('loading')
                    }, 300)
                })
                el.addEventListener('keyup', (event) => {
                    switch (event.key) {
                        case 'ArrowLeft':
                            if (next !== null) {
                                next.click()
                                next.focus()
                            } else {
                                tabButton.forEach((btns, i) => {
                                    if (i === 0) {
                                        btns.click()
                                        btns.focus()
                                    }
                                })
                            }
                            break;
                        case 'ArrowRight':
                            if (prev !== null) {
                                prev.click()
                                prev.focus()
                            } else {
                                tabButton.forEach((btns, i) => {
                                    if (i === tabButton.length - 1) {
                                        btns.click()
                                        btns.focus()
                                    }
                                })
                            }
                            break;
                        default:
                            break;
                    }
                })
            })
        }
    }
    /*E.S Do not remove - added by Elipaz*/
    // tabs 2 admission-process tabs
    window.tabsFuncAdmissionProcess = function () {
        const parent = document.querySelector('[data-tabs-admission-process]');
        if (parent !== null) {
            const tabButton = parent.querySelectorAll('.js-tab-button');
            const buttonsWrap = parent.querySelector('.big-tabs__buttons');
            parent.querySelectorAll('.number-tabs__content.js-tab-block').forEach((el) => {
                if (!el.classList.contains('active')) {
                    el.setAttribute('aria-hidden', 'true')
                    el.querySelectorAll('[tabindex]').forEach((tabindex) => {
                        tabindex.setAttribute('tabindex', '-1');
                        tabindex.setAttribute('aria-disabled', 'true')
                    })
                    setTimeout(() => {
                        el.querySelectorAll('.select2-selection').forEach((select) => {
                            select.setAttribute('tabindex', '-1');
                        })
                    }, 0)
                }
            })
            tabButton.forEach((el, i) => {
                const id = el.getAttribute('data-id');
                const tabindex = el.getAttribute('tabindex')
                const prev = el.previousElementSibling;
                const next = el.nextElementSibling;
                const index = i;
                el.addEventListener('click', () => {
                    document.querySelectorAll('.number-tabs__content.js-tab-block').forEach((elenemt) => {
                        elenemt.classList.remove('active');
                        elenemt.querySelectorAll('[tabindex]').forEach((el) => {
                            el.setAttribute('tabindex', '-1')
                            el.setAttribute('aria-disabled', 'true')
                        })
                        setTimeout(() => {
                            el.querySelectorAll('.select2-selection').forEach((select) => {
                                select.setAttribute('tabindex', '9');
                            })
                        }, 0)
                    })
                    document.querySelectorAll('.number-button.js-tab-button').forEach((elenemt) => {
                        elenemt.classList.remove('active');
                        elenemt.setAttribute('aria-selected', 'false');
                        elenemt.setAttribute('tabindex', '-1');
                    })
                    el.classList.add('active');
                    el.setAttribute('tabindex', '9');
                    el.setAttribute('aria-selected', 'true');
                    if (el.classList.contains('js-line-detect')) {
                        const topBHeight = document.querySelector('.js-uniq-top').offsetHeight;
                        if (window.pageYOffset > topBHeight) {
                            $('html, body').animate({
                                scrollTop: topBHeight - 70
                            }, 600);
                        }
                    }
                    setTimeout(() => {
                        parent.querySelector('.js-tab-block[data-id="' + id + '"]')?.classList.add('active');
                        parent.querySelector('.js-tab-button[data-id="' + id + '"]')?.classList.add('active');
                        parent.querySelector('.js-tab-block[data-id="' + id + '"]')?.querySelectorAll('.swiper-slide').forEach((visible, i) => {
                            if (!visible.classList.contains('swiper-slide-visible')) {
                                visible.querySelectorAll('[tabindex]').forEach((elenIn) => {
                                    elenIn.setAttribute('tabindex', '-1')
                                })
                            }
                        })
                        parent.querySelector('.js-tab-block[data-id="' + id + '"]')?.querySelectorAll('[tabindex]').forEach((el) => {
                            el.setAttribute('tabindex', '9')
                            el.setAttribute('aria-disabled', 'false')
                        })
                    }, 0)
                    setTimeout(() => {
                        parent.classList.remove('loading')
                    }, 300)
                })
                el.addEventListener('keyup', (event) => {
                    switch (event.key) {
                        case 'ArrowLeft':
                            if (next !== null) {
                                next.click()
                                next.focus()
                            } else {
                                tabButton.forEach((btns, i) => {
                                    if (i === 0) {
                                        btns.click()
                                        btns.focus()
                                    }
                                })
                            }
                            break;
                        case 'ArrowRight':
                            if (prev !== null) {
                                prev.click()
                                prev.focus()
                            } else {
                                tabButton.forEach((btns, i) => {
                                    if (i === tabButton.length - 1) {
                                        btns.click()
                                        btns.focus()
                                    }
                                })
                            }
                            break;
                        default:
                            break;
                    }
                })
            })
        }
    }
    //  js-short-top
    window.shortTop = function () {
        const shortTop = document.querySelector('.js-uniq-top');
        if (shortTop !== null) {
            window.addEventListener('scroll', () => {
                /*E.S Do not remove - changed by Elipaz*/
                const headerJHeight = document.querySelector('.header').offsetHeight - 2;
                const elHeight = shortTop.offsetHeight;
                const fixedBlock = document.querySelector('.js-short-top');
                if (fixedBlock !== null) {
                    if (window.pageYOffset > elHeight - fixedBlock.offsetHeight * 1.2) {
                        fixedBlock.style.top = headerJHeight + 'px';
                        fixedBlock.style.opacity = 1;
                        fixedBlock.querySelector(".favorite-save").setAttribute("tabindex", "0")
                        fixedBlock.querySelector(".button--simple").setAttribute("tabindex", "0")
                    } else {
                        fixedBlock.style.opacity = 0;
                        fixedBlock.querySelector(".favorite-save").setAttribute("tabindex", "-1")
                        fixedBlock.querySelector(".button--simple").setAttribute("tabindex", "-1")
                        fixedBlock.style.top = -140 + 'px';
                    }
                }
            })
        }
    }
    //  js-short-top
    window.bigTabsButtonsWrap = function () {
        if (document.querySelector('.big-tabs__buttons-wrap') !== null) {
            let tabLeft = document.querySelector('.js-tabs-prev');
            let tabRight = document.querySelector('.js-tabs-next');
            tabRight.style.display = 'none';
            tabLeft.style.display = 'none';
            tabLeft.addEventListener('click', (event) => {
                document.querySelector('.big-tabs__buttons-wrap').scrollLeft -= 300;
                document.querySelector('.big-tabs__buttons-top').classList.add('left');
                event.currentTarget.style.display = 'none'
                tabRight.style.display = 'block';
            })
            tabRight.addEventListener('click', (event) => {
                document.querySelector('.big-tabs__buttons-wrap').scrollLeft += 300;
                document.querySelector('.big-tabs__buttons-top').classList.remove('left');
                event.currentTarget.style.display = 'none';
                tabLeft.style.display = 'block';
            })
            document.querySelector('.big-tabs__buttons-wrap').addEventListener('scroll', (event) => {
                if (event.currentTarget.scrollLeft < 0) {
                    document.querySelector('.big-tabs__buttons-top').classList.add('left');
                    tabLeft.style.display = 'none';
                    tabRight.style.display = 'block';
                } else {
                    document.querySelector('.big-tabs__buttons-top').classList.remove('left');
                    tabLeft.style.display = 'block';
                    tabRight.style.display = 'none';
                }
            })
        }
    }
    // lang-block
    window.langSwitch = function () {
        const parent = document.querySelector('[data-lang]');
        const langItem = document.querySelectorAll('.js-lang-item');
        const langName = document.querySelector('.js-lang-name');
        //var isExpandButtonLanguage = function (event) {
        //    if (parent.classList.contains('open')) {
        //        parent.classList.remove('open')
        //        event.currentTarget.setAttribute('aria-expanded', 'false');
        //    } else {
        //        parent.classList.add('open')
        //        event.currentTarget.setAttribute('aria-expanded', 'true');
        //    }
        //}
        //parent.querySelector('.lang-block__body').addEventListener('click', (event) => {
        //    isExpandButtonLanguage(event);
        //});
        //parent.querySelector('.lang-block__body').addEventListener('blur', (event) => {
        //    isExpandButtonLanguage(event);
        //});
        parent?.querySelector('.lang-block__body').addEventListener('click', (event) => {
            if (parent.classList.contains('open')) {
                parent.classList.remove('open')
                event.currentTarget.setAttribute('aria-expanded', 'false');
            } else {
                parent.classList.add('open')
                event.currentTarget.setAttribute('aria-expanded', 'true');
            }
        })
        parent?.addEventListener('keydown', (event) => {
            var code = event.keyCode || event.which;
            if (code === 40) {
                event.preventDefault()
                langItem.forEach((el, i) => {
                    if (i === 0) {
                        el.focus()
                    }
                })
            }
        });
        langItem.forEach((el, i) => {
            const name = el.getAttribute('data-name')
            const id = el.getAttribute('id');
            el.addEventListener('blur', (ev) => {
                setTimeout(() => {
                    if (i + 1 === langItem.length && !document.activeElement.classList.contains('lang-block__item') || i === 0 && !document.activeElement.classList.contains('lang-block__item')) {
                        parent.classList.remove('open')
                        parent.querySelector('.lang-block__body').setAttribute('aria-expanded', 'false');
                        el.closest('ul').removeAttribute('aria-activedescendant')
                    }
                }, 0)
            })
            el.addEventListener('click', (event) => {
                langName.innerText = name;
                parent.classList.remove('open');
                document.querySelectorAll('.js-lang-item').forEach((elenemt) => {
                    elenemt.classList.remove('is-current');
                    elenemt.removeAttribute('aria-selected');
                })
                el.classList.add('is-current');
                el.setAttribute('aria-selected', 'true');
            });
            el.addEventListener('keydown', (event) => {
                var code = event.keyCode || event.which;
                const next = event.currentTarget.nextElementSibling;
                const prev = event.currentTarget.previousElementSibling;
                if (code === 13) {
                    langName.innerText = name;
                    document.querySelectorAll('.js-lang-item').forEach((elenemt) => {
                        elenemt.classList.remove('is-current');
                        elenemt.removeAttribute('aria-selected');
                    })
                    el.classList.add('is-current');
                    el.setAttribute('aria-selected', 'true');
                    setTimeout(() => {
                        parent.classList.remove('open');
                    }, 0)
                }
                if (code === 40) {
                    event.preventDefault()
                    if (next !== null) {
                        setTimeout(() => {
                            next.focus()
                        }, 0)
                    }
                }
                if (code === 38) {
                    event.preventDefault()
                    if (prev !== null) {
                        setTimeout(() => {
                            prev.focus()
                        }, 0)
                    } else {
                        setTimeout(() => {
                            next.focus()
                        }, 0)
                    }
                }
            });
        })
    }
    //Elipaz software dont delete
    // wave-surfer
    window.waveSurfer = function () {
        if (document.querySelectorAll('.wave-block') !== null) {
            let waveBlockWrap = document.querySelectorAll('.wave-block');
            waveBlockWrap.forEach((waveBlock) => {
                let height = waveBlock.getAttribute('data-height');
                let source = waveBlock.getAttribute('data-source');
                let bgc = waveBlock.getAttribute('data-bgc');
                let wcolor = waveBlock.getAttribute('data-wcolor');
                let pxPer = waveBlock.getAttribute('data-px-per');
                let barWMob = waveBlock.getAttribute('data-barw-mobile');
                let barHMob = waveBlock.getAttribute('data-barH-mobile');
                const surf = waveBlock.querySelector('.waveform')
                var wavesurfer = WaveSurfer.create({
                    container: surf,
                    scrollParent: true,
                    height: height,
                    backgroundColor: bgc,
                    barWidth: window.outerWidth < 980 ? Number(barWMob) : 2,
                    barGap: window.outerWidth < 980 ? Number(barWMob) : 2,
                    barHeight: window.outerWidth < 980 ? Number(barHMob) : 0.7,
                    cursorWidth: 0,
                    progressColor: window.outerWidth < 980 ? '#f90' : 'white',
                    waveColor: window.outerWidth < 980 ? '#CFD6DA' : '#9b9da0',
                    responsive: true,
                    minPxPerSec: pxPer,
                    fillParent: true,
                });
                wavesurfer.load(source);
                const formatFunc = function (value) {
                    const minutes = Math.floor(value / 60);
                    let seconds = Math.floor(value - minutes * 60);
                    if (seconds < 10) seconds = '0' + seconds;
                    return Number(minutes) + ':' + seconds
                }
                wavesurfer.on('ready', function () {
                    const containerWave = wavesurfer.container;
                    const parent = containerWave.closest('.wave-block');
                    const currentTime = parent.querySelector('.js-wave-current');
                    const durationTime = parent.querySelector('.js-wave-duration');
                    currentTime.innerHTML = formatFunc(wavesurfer.getCurrentTime());
                    durationTime.innerHTML = formatFunc(wavesurfer.getDuration());
                    //    /*E.S Do not remove - changed by Elipaz*/
                    waveBlock.parentElement.parentElement.parentElement.querySelector('.js-play-audio').addEventListener('click', (ev) => {
                        document.querySelectorAll('.js-play-audio').forEach((el) => {
                            if (el.classList.contains('pause') && el !== ev.currentTarget) {
                                el.click()
                                el.classList.remove('pause')
                            }
                        })
                        if (ev.currentTarget.classList.contains('pause')) {
                            ev.currentTarget.classList.remove('pause')
                            wavesurfer.pause();
                        } else {
                            ev.currentTarget.classList.add('pause')
                            wavesurfer.play();
                        }
                    })
                    if (document.querySelector('.js-open-audio-podcast') !== null) {
                        document.querySelector('.js-open-audio-podcast').addEventListener('click', (ev) => {
                            document.querySelector('.audio-block').classList.add('open')
                        })
                        document.querySelector('.js-close-audio').addEventListener('click', (ev) => {
                            document.querySelector('.audio-block').classList.remove('open');
                            document.querySelector('.js-play-audio').classList.remove('pause');
                            wavesurfer.pause();
                        })
                    }
                    wavesurfer.setVolume(0.2)
                    var volumeInput = document.querySelector('#volume');
                    volumeInput.value = 0.2;
                    volumeInput.addEventListener('input', (e) => {
                        wavesurfer.setVolume(e.target.value)
                        e.target.style.background = `linear-gradient(to right, #f90 0%, #f90 ${e.target.value * 100}%, #CFD6DA ${e.target.value * 100}%, #CFD6DA 100%)`
                    })
                });
                wavesurfer.on('finish', function () {
                    document.querySelector('.js-play-audio').classList.remove('pause');
                });
                wavesurfer.on('audioprocess', function () {
                    const containerWave = wavesurfer.container;
                    const parent = containerWave.closest('.wave-block');
                    const currentTime = parent.querySelector('.js-wave-current');
                    currentTime.innerHTML = formatFunc(wavesurfer.getCurrentTime());
                });
                // Why you remove this?
                window.pauseWave = function () {
                    wavesurfer.pause()
                }
            })
        }
    }
    if (document.querySelector('.js-open-audio') !== null) {
        const auidoTabElem = document.querySelector('.audio-block').querySelectorAll('[tabindex]');
        document.querySelector('.js-open-audio').addEventListener('click', (ev) => {
            const tabindex = ev.currentTarget.getAttribute('tabindex')
            document.querySelector('.audio-block').classList.add('open');
            document.querySelector('.audio-block').querySelector('.js-close-audio').focus();
            auidoTabElem.forEach((el, i) => {
                el.setAttribute('tabindex', tabindex)
            })
        })
        auidoTabElem.forEach((el, i) => {
            el.addEventListener('blur', (ev) => {
                setTimeout(() => {
                    if (i + 1 === auidoTabElem.length && !document.activeElement.closest('.audio-block') || i === 0 && !document.activeElement.closest('.audio-block')) {
                        document.querySelector('.audio-block').querySelector('.js-close-audio').focus();
                    }
                }, 0)
            })
        })
        document.querySelector('.js-close-audio').addEventListener('click', (ev) => {
            document.querySelector('.audio-block').classList.remove('open');
            document.querySelector('.js-play-audio').classList.remove('pause');
            window.pauseWave()
            auidoTabElem.forEach((el, i) => {
                el.setAttribute('tabindex', '-1')
            })
            setTimeout(() => {
                document.querySelector('.ac-trigger').focus()
            }, 500)
        })
    }
    // useful dropdowns
    window.usefulDrop = function () {
        const usefulDrop = document.querySelectorAll('.js-useful-drop');
        if (usefulDrop !== null) {
            usefulDrop.forEach((el) => {
                const parent = el.closest('.useful-drop');
                const dropdown = parent.querySelector('.useful-drop__dropdown');
                const dropdownItem = parent.querySelectorAll('.js-useful-choose');
                const nameFiled = parent.querySelector('.js-useful-field');
                el.addEventListener('click', (event) => {
                    if (parent.classList.contains('open')) {
                        parent.classList.remove('open')
                        dropdownItem.forEach((item) => {
                            item.setAttribute('tabindex', '-1');
                            el.setAttribute('aria-expanded', 'false');
                        })
                    } else {
                        parent.classList.add('open')
                        dropdownItem.forEach((item) => {
                            item.setAttribute('tabindex', '9');
                            el.setAttribute('aria-expanded', 'true');
                        })
                    }
                });
                dropdownItem.forEach((item, i) => {
                    const grg = item
                    const text = item.innerText;
                    item.addEventListener('click', (event) => {
                        dropdownItem.forEach((itemSec) => {
                            itemSec.classList.remove('is-current')
                        })
                        event.currentTarget.classList.add('is-current')
                        nameFiled.innerText = text;
                        parent.classList.remove('open')
                        setTimeout(() => {
                            nameFiled.focus()
                        }, 10)
                    });
                    item.addEventListener('blur', (ev) => {
                        setTimeout(() => {
                            if (i + 1 === dropdownItem.length && !document.activeElement.classList.contains('js-useful-choose' || i === 0 && !document.activeElement.classList.contains('js-useful-choose'))) {
                                parent.classList.remove('open')
                                parent.setAttribute('aria-expanded', 'false');
                            }
                        }, 0)
                    })
                })
            })
        }
    }
    // fixed widget
    widgetFunc();
    document.querySelectorAll('.checkbox-item').forEach((label) => {
        label.addEventListener('keyup', (event) => {
            var code = event.keyCode || event.which;
            if (code === 13) {
                label.querySelector('input').click()
                if (label.querySelector('input').checked) {
                    label.setAttribute('aria-checked', 'true');
                } else {
                    label.setAttribute('aria-checked', 'false');
                }
            }
        })
        label.addEventListener('click', (event) => {
            if (label.querySelector('input').checked) {
                label.setAttribute('aria-checked', 'true');
            } else {
                label.setAttribute('aria-checked', 'false');
            }
        })
    })
    if (document.querySelector('.js-print-article') !== null) {
        document.querySelector('.js-print-article').addEventListener('click', () => {
            window.print();
        })
    }
    let parseText = function (text, limit) {
        if (text.length > limit)
            for (let i = limit; i > 0; i--) {
                if (text.charAt(i) === ' ' && (text.charAt(i - 1) != ',' || text.charAt(i - 1) != '.' || text.charAt(i - 1) != ';')) {
                    return text.substring(0, i) + '...';
                }
            }
        else
            return text;
    };
    $('.js-cut-text').each((i, el) => {
        const col = $(el).data('symbols')
        $(el).text(parseText($(el).html(), col))
    })
    $('.js-show-all').on('click', () => {
        $('.js-show-list').addClass('show-all')
        $('.js-show-all').hide()
    })
    if ($('.js-dynamic-grid li').length === 4) {
        $('.js-dynamic-grid').addClass('double')
    }
    $('.js-overlay-map').on('click', (ev) => {
        $(ev.currentTarget).remove()
    })
    $('.js-all-text-button').each((i, el) => {
        const block = $(el).prev('.js-all-text-block')
        const blockHeight = $(el).prev('.js-all-text-block').height()
        const blockHeightTwo = Number(block.data('height'))
        block.css('height', blockHeightTwo + 'px')
        $(el).on('click', (ev) => {
            if ($(el).hasClass("is-active")) {
                block.css('height', blockHeightTwo + 'px')
                $(ev.currentTarget).removeClass('is-active')
            } else {
                block.css('height', blockHeight)
                $(ev.currentTarget).addClass('is-active')
            }
        })
    })
    // about page avatar amimation
    if (document.querySelector('.js-about-anim') !== null) {
        (function () {
            const A = {};
            window.aboutAnimate = A;
            (A.photo = $('.about-item--first .about-item__img img')).css({ "transform-origin": "top left", right: "unset", bottom: "unset" });
            (A.photoContainer = A.photo.parent()).css({ overflow: "visible" });
            A.photo.closest('.section').css({ "z-index": 10 });
            A.baseWidth = A.photo.data('basewidth') || A.photo.width();
            A.clipRadius = A.photo.data('clipradius') || Math.min(A.photo.width(), A.photo.height()) / 2;
            A.clipCX = A.photo.data('clipcx') || (A.photo.width() / 2);
            A.clipCY = A.photo.data('clipcy') || (A.photo.height() / 2);
            A.avatar = $('.facultet-item__avatar img');
            (A.avatarContainer = A.avatar.parent()).css({ "z-index": 10 });
            A.avatar.closest('.section').css({ "z-index": 9 });
            A.avatarRadius = A.avatar.width() / 2;
            (A.card = A.avatar.closest('.facultet-item')).css({ opacity: 0 });
            A.chatAvatar = $('.sms-item--user .sms-item__avatar img').css({ opacity: 0 });;
            A.chatMainItem = A.chatAvatar.closest('.sms-item');
            (A.chatItems = A.chatAvatar.closest('.section').find('.sms-item, .about-item__bottom button')).css({ position: "relative", top: 50, opacity: 0 });
            A.chat = A.chatAvatar.closest('.sms-block');
            A.stage = 0;
            A.animating = 0;
            A.photoAnimateStep = function (t, fx) {
                if (t < 1) {
                    const tAvatarScale = t <= 0 ? 1 : (t < 1 ? A.avatarScale * t + 1 - t : A.avatarScale);
                    A.photo.css({
                        "clip-path": "circle(" + ((A.clipRadius * t + 500 * (1 - t)) * A.photoScale) + "px at " + (A.clipCX * A.photoScale) + "px " + (A.clipCY * A.photoScale) + "px)",
                        top: (A.avatarTop - A.photoTop - (A.clipCY - A.clipRadius) * A.photoScale * tAvatarScale) * t,
                        left: (A.avatarLeft - A.photoLeft - (A.clipCX - A.clipRadius) * A.photoScale * tAvatarScale) * t,
                        transform: `scale(${tAvatarScale})`,
                    });
                }
                else {
                    const t2 = t - 1;
                    A.photo.css({
                        "clip-path": "circle(" + (A.clipRadius * A.photoScale) + "px at " + (A.clipCX * A.photoScale) + "px " + (A.clipCY * A.photoScale) + "px)",
                        top: A.avatarTop - A.photoTop - (A.clipCY - A.clipRadius) * A.photoScale * A.avatarScale + (A.chatAvatarTop - A.avatarTop) * t2,
                        left: A.avatarLeft - A.photoLeft - (A.clipCX - A.clipRadius) * A.photoScale * A.avatarScale + (A.chatAvatarLeft - A.avatarLeft) * t2,
                        transform: `scale(${A.avatarScale})`,
                    });
                }
            }
            A.avatarAnimateStep = function (t, fx) {
                const t2 = t - 1;
                A.avatarContainer.css({
                    top: (A.chatAvatarTop - A.avatarTop) * t2,
                    left: (A.chatAvatarLeft - A.avatarLeft) * t2,
                });
            }
            A.onResize = function () {
                let o;
                A.windowHeight = $(window).height();
                A.viewportGreyZone = Math.min(100, A.windowHeight / 3);
                A.cardHeight = A.card.height();
                A.chatHeight = A.chat.height();
                o = A.chat.offset();
                A.chatTop = o.top;
                A.photoVisible = A.photo.is(':visible');
                if (A.photoVisible) {
                    A.avatar.css({ opacity: 0 });
                    A.photoWidth = A.photo.width();
                    A.photoScale = A.photoWidth / A.baseWidth;
                    A.avatarScale = A.avatarRadius / (A.clipRadius * A.photoScale);
                    o = A.photoContainer.css({ top: 0, left: 0 }).offset();
                    window.setTimeout(() => A.photoAnimateStep(A.stage), 1);
                    A.photoTop = o.top;
                    A.photoLeft = o.left;
                }
                else {
                    A.avatar.css({ opacity: 1 });
                }
                o = A.avatarContainer.css({ top: 0, left: 0 }).offset();
                window.setTimeout(() => A.avatarAnimateStep(A.stage), 1);
                A.avatarTop = o.top;
                A.avatarLeft = o.left;
                o = A.chatAvatar.offset();
                A.chatAvatarTop = o.top - parseInt(A.chatMainItem.css('top'));
                A.chatAvatarLeft = o.left;
                A.onScroll();
            }
            A.onScroll = function () {
                if (!A.windowHeight) {
                    A.onResize();
                    return;
                }
                if (A.animating) return;
                const scrollTop = $(window).scrollTop();
                if (!A.photoVisible || scrollTop + A.windowHeight / 2 > (A.avatarTop + A.photoTop) / 2) {
                    if (A.stage < 2 && ((scrollTop + A.windowHeight > A.chatTop + A.chatHeight) || (scrollTop + A.windowHeight / 2 > A.chatTop))) {
                        if (A.stage != 2) {
                            console.log([scrollTop, A.windowHeight, A.chatTop, A.chatHeight])
                            //$(window).animate({scrollTop, A.chatAvatarTop + 150}, 150);
                            //A.chat[0].scrollIntoView({align: "bottom", behavior: 'smooth'});
                            if (A.photoVisible) A.photo.stop().animate({ stage: 2 }, { step: A.photoAnimateStep, duration: 600, start: A.animationStart, complete: A.animationComplete });
                            else A.avatar.stop().animate({ stage: 2 }, { step: A.avatarAnimateStep, duration: 600, start: A.animationStart, complete: A.animationComplete });
                            A.card.stop().animate({ opacity: 1 }, { duration: 300, start: A.animationStart, complete: A.animationComplete });
                            A.chatItems.each(function (i) {
                                A.animationStart();
                                $(this).stop().css({ top: 50, opacity: 0 }).delay(500 + i * 100).animate({ top: 0, opacity: 1 }, 200, A.animationComplete);
                            });
                            A.stage = 2;
                        }
                    }
                    else if ((A.stage > 1 && scrollTop + A.viewportGreyZone < A.avatarTop) || (A.stage < 1 && scrollTop + A.windowHeight > A.avatarTop + Math.min(A.cardHeight * 0.8, A.windowHeight * 0.5))) {
                        if (A.stage != 1) {
                            if (A.photoVisible) A.photo.stop().animate({ stage: 1 }, { step: A.photoAnimateStep, duration: 600, start: A.animationStart, complete: A.animationComplete });
                            else A.avatar.stop().animate({ stage: 1 }, { step: A.avatarAnimateStep, duration: 600, start: A.animationStart, complete: A.animationComplete });
                            A.card.stop().delay(500).animate({ opacity: 1 }, { duration: 300, start: A.animationStart, complete: A.animationComplete });
                            A.chatItems.each(function (i) {
                                A.animationStart();
                                $(this).stop().delay(i * 100).animate({ top: -50, opacity: 0 }, 200, A.animationComplete);
                            });
                            A.stage = 1;
                        }
                    }
                }
                else {
                    if (A.stage != 0) {
                        A.photo.stop().animate({ stage: 0 }, { step: A.photoAnimateStep, duration: 600, start: A.animationStart, complete: A.animationComplete });
                        A.card.stop().animate({ opacity: 0 }, { duration: 300, start: A.animationStart, complete: A.animationComplete });
                        A.stage = 0;
                    }
                }
                A.scrollTop = scrollTop;
            }
            A.animationStart = function () {
                A.animating++;
            }
            A.animationComplete = function () {
                A.animating--;
                if (A.animating <= 0) {
                    A.animating = 0;
                    A.onScroll();
                }
            }
            window.setTimeout(() => A.onScroll(), 200);
            $(window).on('scroll', function () {
                A.onScroll();
            })
                .on('resize', function () {
                    A.onResize();
                });
        })();
    }
    $('.popup-gallery').magnificPopup({
        delegate: 'a',
        type: 'image',
        tLoading: 'Loading image #%curr%...',
        mainClass: 'mfp-img-mobile',
        gallery: {
            enabled: true,
            navigateByImgClick: true,
            preload: [0, 1] // Will preload 0 - before current, and 1 after the current image
        },
        image: {
            tError: '<a href="%url%">The image #%curr%</a> could not be loaded.',
            titleSrc: function (item) {
                return item.el.attr('title');
            }
        },
    });
    $('.js-detect-grid').each((i, el) => {
        const $el = $(el);
        const $col = $el.children().length;
        $el.addClass('grid-' + $col)
    })
    $('.js-symbol-count').each((i, el) => {
        const $el = $(el);
        const $field = $el.find('textarea');
        const $current = $el.find('.js-symbol-current');
        $field.on('keyup', (e) => {
            $current.text($field.val().length)
        })
    })
    $('body').on('click', '.open-kabala-item', (ev) => {
        let next = $(ev.currentTarget).next('.ac').find('.ac-panel').html()
        $('.js-kabala-paste').html($.parseHTML(next))
        $('.kabala-popup').addClass('show')
    })
    $('body').on('click', '.js-kabala-close', (ev) => {
        let parent = $(ev.currentTarget).closest('.kabala-popup')
        parent.removeClass('show')
    })
    if ($('.bakalavr-block').find('.bakalavr-block__img').length === 0) {
        $('.bakalavr-block').find('.bakalavr-block__content').addClass('center')
    }
    /*E.S Do not remove - added by Elipaz*/
    window.detectGrid = function () {
        $('.js-detect-grid').each((i, el) => {
            const $el = $(el);
            const $col = $el.children().length;
            $el.addClass('grid-' + $col)
        })
    }
    /*E.S Do not remove - added by Elipaz*/
    const includedFormRootElement = document.getElementById('tu-form-root');
    if (includedFormRootElement !== null) {
        const shadowRoot = includedFormRootElement.shadowRoot;
        if (shadowRoot !== null) {
            setTimeout(() => {
                const allInputElements = shadowRoot.querySelectorAll('input');
                allInputElements.forEach(inputElement => {
                    inputElement.addEventListener('keydown',
                        event => {
                            if (event.key === ' ') {
                                event.preventDefault();
                                const currentCursorPosition = inputElement.selectionStart;
                                const inputValue = inputElement.value;
                                const newValue =
                                    `${inputValue.substring(0, currentCursorPosition)} ${inputValue.substring(
                                        currentCursorPosition)}`;
                                inputElement.value = newValue;
                                const elementType = inputElement.getAttribute('type');
                                if (elementType !== 'email' && elementType !== 'tel') {
                                    inputElement.setSelectionRange(currentCursorPosition + 1, currentCursorPosition + 1);
                                }
                            }
                        });
                });
            }, 1000)
        }
    }
};
window.bindCallFunctions = function() {
    document.querySelectorAll('.js-favorite').forEach((el) => {
        window.favorites(el);
    });
//select2
    window.customSelect();
//tabs
    window.tabsFunc();
    /*E.S Do not remove - added by Elipaz*/
    //tabs AdmissionProcess
    window.tabsFuncAdmissionProcess();
// accordions
    window.accordions();
// short-top
    window.shortTop();
//open-filter
    window.openFilter()
// lang-block
    window.langSwitch();
// masonry
    window.masonry()
    // useful dropdowns 
    /*E.S leave in comments Fo not remove*/
    /* window.usefulDrop();*/
    window.waveSurfer()
    // sliders
// main-slider
    window.mainSlider();
// mini-slider
    window.miniSlider();
// card-slider
    window.cardSlider()
// card-slider
    window.smallCardsSlider();
// cards slider
    window.cardsSlider()
// study slider
    window.studySlider()
// article slider
    window.articleSlider()
// gallerySlider
    window.gallerySlider()
// interests
    window.interestsSlider()
// programSlider
    window.programSlider()
// science Slider
    window.scienceSlider()
// department Slider
    window.departmentSlider()
// specialization
    window.specializationSlider()
// science Slider
    window.scienceBigSlider()
// programSecondSlider
    window.programSecondSlider()
// faculties
    window.facultiesSlider()
// filter
    window.filterSlider()
//sidebar
    window.sidebarSlider()
    // lobby
    window.lobbySlider()
    // include
    window.includeSlider();
    //fitNav
    window.fitSlider();
    window.detectGrid();
    window.mastersSlider();
};
window.youtubePopupHandler = function () {
    var hoursText = $("#hours-text").val();
    var secondsText = $("#seconds-text").val();
    var minutesText = $("#minutes-text").val();
    var $popUpYt = $("#popup-yt");
    var shortedMinuteText = $("#shortedMinuteText").val();
    var googleApiKey = globalVarsHandler.getGoogleMapKey();
    var convertDuration = function convert_time(duration) {
        var a = duration.match(/\d+/g);
        if (duration.indexOf('M') >= 0 && duration.indexOf('H') == -1 && duration.indexOf('S') == -1) {
            a = [0, a[0], 0];
        }
        if (duration.indexOf('H') >= 0 && duration.indexOf('M') == -1) {
            a = [a[0], 0, a[1]];
        }
        if (duration.indexOf('H') >= 0 && duration.indexOf('M') == -1 && duration.indexOf('S') == -1) {
            a = [a[0], 0, 0];
        }
        duration = 0;
        if (a.length == 3) {
            duration = duration + parseInt(a[0]) * 3600;
            duration = duration + parseInt(a[1]) * 60;
            duration = duration + parseInt(a[2]);
        }
        if (a.length == 2) {
            duration = duration + parseInt(a[0]) * 60;
            duration = duration + parseInt(a[1]);
        }
        if (a.length == 1) {
            duration = duration + parseInt(a[0]);
        }
        var h = Math.floor(duration / 3600);
        var m = Math.floor(duration % 3600 / 60);
        var s = Math.floor(duration % 3600 % 60);
        var text = (h > 0 ? h + ":" + (m < 10 ? "0" : "") : "") + m + ":" + (s < 10 ? "0" : "") + s;
        var accessibilityText = (h > 0 ? h + " " + hoursText + (m < 10 ? "0" : "") : "0 "+ hoursText+" ") + m + " " + minutesText + (s < 10 ? "0" : "") + s + " " + secondsText;
        return { 'text': text, 'accessibilityText': accessibilityText };
    }
    var getDurationApiGoogleYouTube = function (youtubeIds) {
        for (var i = 0; i < youtubeIds.length; i++) {
            var youtubeId = $(youtubeIds[i]).attr("youtube-id");
            if (youtubeId != undefined) {
                var url = "https://www.googleapis.com/youtube/v3/videos?part=contentDetails&key=" + googleApiKey + "&id=" + youtubeId;
                $.ajax({
                    async: false,
                    type: 'GET',
                    url: url,
                    success: function (data) {
                        if (data.items.length > 0) {
                            var duration = data.items[0];
                            var durationConvertText = convertDuration(duration.contentDetails.duration);
                            if ($(youtubeIds[i]).find("[append-duration]").length > 0) {
                                $(youtubeIds[i]).find("[youtube-duration]")
                                    .append(" (" + durationConvertText.text + " " + shortedMinuteText + ")");
                            } else {
                                $(youtubeIds[i]).find("[youtube-duration]")
                                    .text(durationConvertText.text + " " + shortedMinuteText);
                            }
                            if ($(youtubeIds[i]).find(".timer") != undefined) {
                                $(youtubeIds[i]).find(".timer")
                                    .text(durationConvertText.accessibilityText);
                            }
                            //$("#subTitle").attr("aria-label", durationConvertText.accessibilityText)
                            $("#youtube-time-description").append(durationConvertText.accessibilityText)
                        }
                    }
                });
            }
        }
    }
    var getPreviewImageYouTubeGoogleApi = function (youtubeIds) {
        for (var i = 0; i < youtubeIds.length; i++) {
            var youtubeId = $(youtubeIds[i]).attr("youtube-id");
            if (youtubeId != undefined) {
                $.ajax(
                    {
                        async: false,
                        url: "https://www.googleapis.com/youtube/v3/videos",
                        type: "GET",
                        data: {
                            key: googleApiKey,
                            part: "snippet",
                            id: youtubeId
                        },
                        success: function (response) {
                            if (response != undefined) {
                                var previewImageUrl = response.items[0].snippet.thumbnails.medium.url;
                                if (previewImageUrl != '') {
                                    $(youtubeIds[i]).css("background-image", previewImageUrl);
                                    $(youtubeIds[i]).css("background-size", "cover");
                                    $(youtubeIds[i]).attr("data-background-image", previewImageUrl);
                                }
                            }
                        }
                    });
            }
        }
    }
    var initInstagramPopup = function () {
        $(".more-item__file.lazy.js-dmi[instagram-url]").bind("click", function () {
            var $this = $(this);
            var instagramUrl = $this.attr("instagram-url");
            var instagramId = $this.attr("instagram-id");
            var $popUpInstagram = $("#popup-instagram");
            var src = $popUpInstagram.find(".popup__iframe .instagram-video").attr("src");
            src = src.replace('{video-id}', instagramId);
            $popUpInstagram.find(".popup__iframe .instagram-video").attr("src", src);
        });
    };
    var initTikTokPopup = function () {
        $(".more-item__file.lazy.js-dmi[tiktok-url]").bind("click", function () {
            var $this = $(this);
            var tiltokUrl = $this.attr("tiktok-url");
            var tiktokId = $this.attr("tiktok-id");
            var $popUpTiktok = $("#popup-tiktok");
            var src = $popUpTiktok.find(".popup__iframe .tiktok-video").attr("src");
            src = src.replace('{video-id}', tiktokId);
            $popUpTiktok.find(".popup__iframe .tiktok-video").attr("src", src);
        });
    };
    var initYoutubePopup = function () {
        $(".more-item__file.lazy.js-dmi[youtube-url], .play-block.js-dmi[youtube-url],.mus-block.js-dmi[youtube-url]").bind("click", function () {
            var $this = $(this);
            var youTubUrl = $this.attr("youtube-url");
            var youtubeId = $this.attr("youtube-id");
            $popUpYt.find(".popup__iframe .youtube-video").attr("data-src", youtubeId);
        });
    };
    var getYoutubeIds = function () {
        var youtubeIds = $("div [youtube-id]");
        getDurationApiGoogleYouTube(youtubeIds);
        getPreviewImageYouTubeGoogleApi($(".article-wrap__content, .information-block").find("div [youtube-id]"));
    }
    return {
        init: function () {
            initInstagramPopup();
            initTikTokPopup();
            initYoutubePopup();
            getYoutubeIds();
        }
    };
}();
$(document).ready(function () {
    window.youtubePopupHandler.init();
});;
generalHandler = function() {
    var initDegreeTags = function() {
        var $runLine = $('.run-line');
        var activeTab = $('.js-line-detect.active')[0];
        if (activeTab != undefined) {
            var leftOffset = activeTab.offsetLeft;
            var width = activeTab.offsetWidth;
            $runLine.css("left", leftOffset);
            $runLine.css("width", width);
            $runLine.css("opacity", "1");
        }
    };
    return {
        init: function() {
            initDegreeTags();
          //  initConsoleLogForCurrentFocusedElement();
        }
    };
}();
$(document).ready(function() {
    generalHandler.init();
});;
rteHandler = function() {
    var addDownloadToMediaLinks = function() {
        $('.article-wrap__content a[href^="/media/"]').each(function() {
            var $this = $(this);
            var href = $this.attr('href');
            var lastIndexOf = href.lastIndexOf('/');
            var fileName = href.slice(lastIndexOf + 1);
            $this.attr('download', fileName);
            $this.removeAttr("title");
            //var dotLastIndexOf = href.lastIndexOf('.');
            //var fileExtension = href.slice(dotLastIndexOf + 1);
            //$this.attr('aria-label', fileName + " " + fileExtension + " " + downloadAriaLabel);
        });
    }
   var addIconNextToMediaLink=function() {
       var mediaLinks = $('.article-wrap__content a[href^="/media/"]');
       mediaLinks.each(function() {
           var $this = $(this);
           var href = $this.attr('href');
            var match = href.match('^.*\.(docx|DOcX|doc|DOC|pdf|PDF|xls|XLS|xlsx|XLSX)$');
           if (match == null)
               return;
           var ext = match[1].toLowerCase();
           var imageName = "";
               switch (ext) {
               case 'pdf':
                   imageName = "PDF.svg";
                   break;
               case 'docx':
                   imageName = "DOCS.svg";
                   break;
               case 'doc':
                   imageName = "DOCS.svg";
                   break;
               case 'xls':
                   imageName = "XLS.svg";
                   break;
               case 'xlsx':
                   imageName = "XLS.svg";
                   break;
               case 'ppt':
                   imageName = "PPT.svg";
                   break;
               }
           var imageUrl = "/Content/images/icons/" + imageName;
           var text = $this.text();
           $this.text("");
           $this.append("<img src=\"" + imageUrl + " \"/><span>"+text+"</span>");
           var html = $this.html();
       });
    }
    var listStyles=function() {
        var $listStyleType = $("ul[style*='list-style-type'], ol[style *= 'list-style-type']");
        $listStyleType.addClass("clear-ul-style");
        //var parents = $listStyleType.parents("ol,ul");
        //parents.addClass("clear-ul-style");
    }
    return {
        init: function() {
            addDownloadToMediaLinks();
            addIconNextToMediaLink();
            listStyles();
        }
    };
}();
$(document).ready(function() {
    rteHandler.init();
});;
disclaimerHandler = function () {
    return {
        init: function () {
            //check client approval
            clientApprovalPopupsHandler.checkDisclaimerTermsOfUseApproval();
        }
    };
}();
$(document).ready(function () {
    disclaimerHandler.init();
});;
