vendor: 15,125 bytes, lines 1-2
1/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */ 2!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,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},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.0",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=v.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:y}),"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,v,s,c,y,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+")*)|.*)\\)|)",B=new RegExp(M+"+","g"),$=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))&&y(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+" "]&&(!v||!v.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)&&ye(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($,"$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 ve(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 ye(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=[],v=[],(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&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.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&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.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)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=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&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(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))&&(!v||!v.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),y(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}
vendor: 4,356 bytes, line 2
2: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(B," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,v){var y="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===v?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=y!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(y){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-=v)===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($,"$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:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ve(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];
vendor: 10,068 bytes, line 2
2if(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,v,y,e){return v&&!v[S]&&(v=Ce(v)),y&&!y[S]&&(y=Ce(y,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?y||(e?d:l||v)?[]:t:f;if(g&&g(f,p,n,r),v){i=Te(p,u),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(y||d){if(y){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);y(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=y?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),y?y(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($,"$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($," ")}),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,v,y,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,(v=o,m=0<(y=i).length,x=0<v.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=v[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=y[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+y.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)&&ye(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)&&ye(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="pe
vendor: 8,547 bytes, line 2
2nding",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 B(){E.removeEventListener("DOMContentLoaded",B),C.removeEventListener("load",B),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",B),C.addEventListener("load",B));var $=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)$(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)}):$(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),y.checkClone
vendor: 51,404 bytes, line 2
2=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",y.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 ve(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 ye(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,y.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=ve(f.appendChild(o),"script"),l&&ye(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,v=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=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.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,v=Y.hasData(e)&&Y.get(e);if(v&&(u=v.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,v.handle)||S.removeEvent(e,d,v.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(e,t){S.event.special[e]={setup:function(){return Se(this,e,Ce),!1},trigger:function(){return Se(this,e),!0},_default:function(){return!0},delegateType:t}}),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&&!y.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(ve(e,"script"),De)).length;c<f;c++)u=e,c!==p&&(u=S.clone(u,!0,!0),s&&S.merge(a,ve(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(ve(r)),r.parentNode&&(n&&ie(r)&&ye(ve(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(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(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||ve(e),a=a||ve(c),r=0,i=o.length;r<i;r++)Le(o[r],a[r]);else Le(e,c);return 0<(a=ve(c,"script")).length&&ye(a,!f&&ve(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 $(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(ve(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 $(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(ve(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(ve(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=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},Me=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},Ie=new RegExp(ne.join("|"),"i");function We(e,t,n){var r,i,o,a,s=e.style;return(n=n||Re(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||ie(e)||(a=S.style(e,t)),!y.pixelBoxStyles()&&Pe.test(a)&&Ie.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function Fe(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="",y.clearCloneStyle="content-box"===l.style.backgroundClip,S.extend(y,{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 Be=["Webkit","Moz","ms"],$e=E.createElement("div").style,_e={};function ze(e){var t=S.cssProps[e]||_e[e];return t||(e in $e?e:_e[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=Be.length;while(n--)if((e=Be[n]+t)in $e)return e}(e)||e)}var Ue=/^(none|table(?!-c[ea]).+)/,Xe=/^--/,Ve={position:"absolute",visibility:"hidden",display:"block"},Ge={letterSpacing:"0",fontWeight:"400"};function Ye(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Qe(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 Je(e,t,n){var r=Re(e),i=(!y.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=i,a=We(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Pe.test(a)){if(!n)return a;a="auto"}return(!y.boxSizingReliable()&&i||!y.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)+Qe(e,t,n||(i?"border":"content"),o,r,a)+"px"}function Ke(e,t,n,r,i){return new Ke.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=We(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=Xe.test(t),l=e.style;if(u||(t=ze(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")),y.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 Xe.test(t)||(t=ze(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=We(e,t,r)),"normal"===i&&t in Ge&&(i=Ge[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!Ue.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Je(e,u,n):Me(e,Ve,function(){return Je(e,u,n)})},set:function(e,t,n){var r,i=Re(e),o=!y.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===S.css(e,"boxSizing",!1,i),s=n?Qe(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-Qe(e,u,"border",!1,i)-.5)),s&&(r=te.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=S.css(e,u)),Ye(0,t,s)}}}),S.cssHooks.marginLeft=Fe(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(We(e,"marginLeft"))||e.getBoundingClientRect().left-Me(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=Ye)}),S.fn.extend({css:function(e,t){return $(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Re(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=Ke).prototype={constructor:Ke,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=Ke.propHooks[this.prop];return e&&e.get?e.get(this):Ke.propHooks._default.get(this)},run:function(e){var t,n=Ke.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):Ke.propHooks._default.set(this),this}}).init.prototype=Ke.prototype,(Ke.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[ze(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=Ke.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=Ke.prototype.init,S.fx.step={};var Ze,et,tt,nt,rt=/^(?:toggle|show|hide)$/,it=/queueHooks$/;function ot(){et&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(ot):C.setTimeout(ot,S.fx.interval),S.fx.tick())}function at(){return C.setTimeout(function(){Ze=void 0}),Ze=Date.now()}function st(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 ut(e,t,n){for(var r,i=(lt.tweeners[t]||[]).concat(lt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function lt(o,e,t){var n,a,r=0,i=lt.prefilters.length,s=S.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=Ze||at(),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:Ze||at(),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=lt.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,ut,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(lt,{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],lt.tweeners[n]=lt.tweeners[n]||[],lt.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),v=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],rt.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[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=v&&v.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||(v?"hidden"in v&&(g=v.hidden):v=Y.access(e,"fxshow",{display:l}),o&&(v.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=ut(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?lt.prefilters.unshift(e):lt.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=lt(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&&it.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(st(r,!0),e,t,n)}}),S.each({slideDown:st("show"),slideUp:st("hide"),slideToggle:st("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(Ze=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),Ze=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){et||(et=!0,ot())},S.fx.stop=function(){et=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)}})},tt=E.createElement("input"),nt=E.createElement("select").appendChild(E.createElement("option")),tt.type="checkbox",y.checkOn=""!==tt.value,y.optSelected=nt.selected,(tt=E.createElement("input")).value="t",tt.type="radio",y.radioValue="t"===tt.value;var ct,ft=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return $(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)?ct: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(!y.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)}}),ct={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=ft[t]||S.find.attr;ft[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=ft[o],ft[o]=r,r=null!=a(e,t,n)?o:null,ft[o]=i),r}});var pt=/^(?:input|select|textarea|button)$/i,dt=/^(?:a|area)$/i;function ht(e){return(e.match(P)||[]).join(" ")}function gt(e){return e.getAttribute&&e.getAttribute("class")||""}function vt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}S.fn.extend({prop:function(e,t){return $(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):pt.test(e.nodeName)||dt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),y.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,s,u=0;if(m(t))return this.each(function(e){S(this).addClass(t.call(this,e,gt(this)))});if((e=vt(t)).length)while(n=this[u++])if(i=gt(n),r=1===n.nodeType&&" "+ht(i)+" "){a=0;while(o=e[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=ht(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).removeClass(t.call(this,e,gt(this)))});if(!arguments.length)return this.attr("class","");if((e=vt(t)).length)while(n=this[u++])if(i=gt(n),r=1===n.nodeType&&" "+ht(i)+" "){a=0;while(o=e[a++])while(-1<r.indexOf(" "+o+" "))r=r.replace(" "+o+" "," ");i!==(s=ht(r))&&n.setAttribute("class",s)}return this},toggleClass:function(i,t){var o=typeof i,a="string"===o||Array.isArray(i);return"boolean"==typeof t&&a?t?this.addClass(i):this.removeClass(i):m(i)?this.each(function(e){S(this).toggleClass(i.call(this,e,gt(this),t),t)}):this.each(function(){var e,t,n,r;if(a){t=0,n=S(this),r=vt(i);while(e=r[t++])n.hasClass(e)?n.removeClass(e):n.addClass(e)}else void 0!==i&&"boolean"!==o||((e=gt(this))&&Y.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===i?"":Y.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+ht(gt(n))+" ").indexOf(t))return!0;return!1}});var yt=/\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(yt,""):null==e?"":e:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:ht(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)}},y.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),y.focusin="onfocusin"in C;var mt=/^(?:focusinfocus|focusoutblur)$/,xt=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=v.call(e,"type")?e.type:e,h=v.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!mt.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,mt.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,xt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,xt),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)}}),y.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 bt=C.location,wt={guid:Date.now()},Tt=/\?/;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 Ct=/\[\]$/,Et=/\r?\n/g,St=/^(?:submit|button|image|reset|file)$/i,kt=/^(?:input|select|textarea|keygen)/i;function At(n,e,r,i){var t;if(Array.isArray(e))S.each(e,function(e,t){r||Ct.test(n)?i(n,t):At(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)At(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)At(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")&&kt.test(this.nodeName)&&!St.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(Et,"\r\n")}}):{name:t.name,value:n.replace(Et,"\r\n")}}).get()}});var Nt=/%20/g,jt=/#.*$/,Dt=/([?&])_=[^&]*/,qt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Lt=/^(?:GET|HEAD)$/,Ht=/^\/\//,Ot={},Pt={},Rt="*/".concat("*"),Mt=E.createElement("a");function It(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 Wt(t,i,o,a){var s={},u=t===Pt;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 Ft(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}Mt.href=bt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:bt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(bt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Rt,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?Ft(Ft(e,S.ajaxSettings),t):Ft(S.ajaxSettings,e)},ajaxPrefilter:It(Ot),ajaxTransport:It(Pt),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,v=S.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?S(y):S.event,x=S.Deferred(),b=S.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=qt.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&&(v.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),v.url=((e||v.url||bt.href)+"").replace(Ht,bt.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(P)||[""],null==v.crossDomain){r=E.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Mt.protocol+"//"+Mt.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=S.param(v.data,v.traditional)),Wt(Ot,v,t,T),h)return T;for(i in(g=S.event&&v.global)&&0==S.active++&&S.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Lt.test(v.type),f=v.url.replace(jt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(Nt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(Tt.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(Dt,"$1"),o=(Tt.test(f)?"&":"?")+"_="+wt.guid+++o),v.url=f+o),v.ifModified&&(S.lastModified[f]&&T.setRequestHeader("If-Modified-Since",S.lastModified[f]),S.etag[f]&&T.setRequestHeader("If-None-Match",S.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+Rt+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Wt(Pt,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},v.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]}(v,T,n)),!i&&-1<S.inArray("script",v.dataTypes)&&S.inArray("json",v.dataTypes)<0&&(v.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}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(S.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(S.etag[f]=u)),204===e||"HEAD"===v.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(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--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 Bt={0:200,1223:204},$t=S.ajaxSettings.xhr();y.cors=!!$t&&"withCredentials"in $t,y.ajax=$t=!!$t,S.ajaxTransport(function(i){var o,a;if(y.cors||$t&&!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(Bt[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 _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.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(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.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,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.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=ht(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 $(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]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(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 $(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 Xt=/^[\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(Xt,"")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return S});var Vt=C.jQuery,Gt=C.$;return S.noConflict=function(e){return C.$===S&&(C.$=Gt),e&&C.jQuery===S&&(C.jQuery=Vt),S},"undefined"==typeof e&&(C.jQuery=C.$=S),S});
2 3/*! 4 * jQuery Form Plugin 5 * version: 3.37.0-2013.07.11 6 * @requires jQuery v1.5 or later 7 * Copyright (c) 2013 M. Alsup 8 * Examples and documentation at: http://malsup.com/jquery/form/ 9 * Project repository: https://github.com/malsup/form 10 * Dual licensed under the MIT and GPL licenses. 11 * https://github.com/malsup/form#copyright-and-license 12 */ 13/*global ActiveXObject */ 14;(function($) { 15"use strict"; 16 17/* 18 Usage Note: 19 ----------- 20 Do not use both ajaxSubmit and ajaxForm on the same form. These 21 functions are mutually exclusive. Use ajaxSubmit if you want 22 to bind your own submit handler to the form. For example, 23 24 $(document).ready(function() { 25 $('#myForm').on('submit', function(e) { 26 e.preventDefault(); // <-- important 27 $(this).ajaxSubmit({ 28 target: '#output' 29 }); 30 }); 31 }); 32 33 Use ajaxForm when you want the plugin to manage all the event binding 34 for you. For example, 35 36 $(document).ready(function() { 37 $('#myForm').ajaxForm({ 38 target: '#output' 39 }); 40 }); 41 42 You can also use ajaxForm with delegation (requires jQuery v1.7+), so the 43 form does not have to exist when you invoke ajaxForm: 44 45 $('#myForm').ajaxForm({ 46 delegation: true, 47 target: '#output' 48 }); 49 50 When using ajaxForm, the ajaxSubmit function will be invoked for you 51 at the appropriate time. 52*/ 53 54/** 55 * Feature detection 56 */ 57var feature = {}; 58feature.fileapi = $("<input type='file'/>").get(0).files !== undefined; 59feature.formdata = window.FormData !== undefined; 60 61var hasProp = !!$.fn.prop; 62 63// attr2 uses prop when it can but checks the return type for 64// an expected string. this accounts for the case where a form 65// contains inputs with names like "action" or "method"; in those 66// cases "prop" returns the element 67$.fn.attr2 = function() { 68 if ( ! hasProp ) 69 return this.attr.apply(this, arguments); 70 var val = this.prop.apply(this, arguments); 71 if ( ( val && val.jquery ) || typeof val === 'string' ) 72 return val; 73 return this.attr.apply(this, arguments); 74}; 75 76/** 77 * ajaxSubmit() provides a mechanism for immediately submitting 78 * an HTML form using AJAX. 79 */ 80$.fn.ajaxSubmit = function(options) { 81 /*jshint scripturl:true */ 82 83 // fast fail if nothing selected (http://dev.jquery.com/ticket/2752) 84 if (!this.length) { 85 log('ajaxSubmit: skipping submit process - no element selected'); 86 return this; 87 } 88 89 var method, action, url, $form = this; 90 91 if (typeof options == 'function') { 92 options = { success: options }; 93 } 94 else if ( options === undefined ) { 95 options = {}; 96 } 97 98 method = options.type || this.attr2('method'); 99 action = options.url || this.attr2('action'); 100 101 url = (typeof action === 'string') ? $.trim(action) : ''; 102 url = url || window.location.href || ''; 103 if (url) { 104 // clean url (don't include hash vaue) 105 url = (url.match(/^([^#]+)/)||[])[1]; 106 } 107 108 options = $.extend(true, { 109 url: url, 110 success: $.ajaxSettings.success, 111 type: method || 'GET', 112 iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank' 113 }, options); 114 115 // hook for manipulating the form data before it is extracted; 116 // convenient for use with rich editors like tinyMCE or FCKEditor 117 var veto = {}; 118 this.trigger('form-pre-serialize', [this, options, veto]); 119 if (veto.veto) { 120 log('ajaxSubmit: submit vetoed via form-pre-serialize trigger'); 121 return this; 122 } 123 124 // provide opportunity to alter form data before it is serialized 125 if (options.beforeSerialize && options.beforeSerialize(this, options) === false) { 126 log('ajaxSubmit: submit aborted via beforeSerialize callback'); 127 return this; 128 } 129 130 var traditional = options.traditional; 131 if ( traditional === undefined ) { 132 traditional = $.ajaxSettings.traditional; 133 } 134 135 var elements = []; 136 var qx, a = this.formToArray(options.semantic, elements); 137 if (options.data) { 138 options.extraData = options.data; 139 qx = $.param(options.data, traditional); 140 } 141 142 // give pre-submit callback an opportunity to abort the submit 143 if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) { 144 log('ajaxSubmit: submit aborted via beforeSubmit callback'); 145 return this; 146 } 147 148 // fire vetoable 'validate' event 149 this.trigger('form-submit-validate', [a, this, options, veto]); 150 if (veto.veto) { 151 log('ajaxSubmit: submit vetoed via form-submit-validate trigger'); 152 return this; 153 } 154 155 var q = $.param(a, traditional); 156 if (qx) { 157 q = ( q ? (q + '&' + qx) : qx ); 158 } 159 if (options.type.toUpperCase() == 'GET') { 160 options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q; 161 options.data = null; // data is null for 'get' 162 } 163 else { 164 options.data = q; // data is the query string for 'post' 165 } 166 167 var callbacks = []; 168 if (options.resetForm) { 169 callbacks.push(function() { $form.resetForm(); }); 170 } 171 if (options.clearForm) { 172 callbacks.push(function() { $form.clearForm(options.includeHidden); }); 173 } 174 175 // perform a load on the target only if dataType is not provided 176 if (!options.dataType && options.target) { 177 var oldSuccess = options.success || function(){}; 178 callbacks.push(function(data) { 179 var fn = options.replaceTarget ? 'replaceWith' : 'html'; 180 $(options.target)[fn](data).each(oldSuccess, arguments); 181 }); 182 } 183 else if (options.success) { 184 callbacks.push(options.success); 185 } 186 187 options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg 188 var context = options.context || this ; // jQuery 1.4+ supports scope context 189 for (var i=0, max=callbacks.length; i < max; i++) { 190 callbacks[i].apply(context, [data, status, xhr || $form, $form]); 191 } 192 }; 193 194 if (options.error) { 195 var oldError = options.error; 196 options.error = function(xhr, status, error) { 197 var context = options.context || this; 198 oldError.apply(context, [xhr, status, error, $form]); 199 }; 200 } 201 202 if (options.complete) { 203 var oldComplete = options.complete; 204 options.complete = function(xhr, status) { 205 var context = options.context || this; 206 oldComplete.apply(context, [xhr, status, $form]); 207 }; 208 } 209 210 // are there files to upload? 211 212 // [value] (issue #113), also see comment: 213 // https://github.com/malsup/form/commit/588306aedba1de01388032d5f42a60159eea9228#commitcomment-2180219 214 var fileInputs = $('input[type=file]:enabled[value!=""]', this); 215 216 var hasFileInputs = fileInputs.length > 0; 217 var mp = 'multipart/form-data'; 218 var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp); 219 220 var fileAPI = feature.fileapi && feature.formdata; 221 log("fileAPI :" + fileAPI); 222 var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI; 223 224 var jqxhr; 225 226 // options.iframe allows user to force iframe mode 227 // 06-NOV-09: now defaulting to iframe mode if file input is detected 228 if (options.iframe !== false && (options.iframe || shouldUseFrame)) { 229 // hack to fix Safari hang (thanks to Tim Molendijk for this) 230 // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d 231 if (options.closeKeepAlive) { 232 $.get(options.closeKeepAlive, function() { 233 jqxhr = fileUploadIframe(a); 234 }); 235 } 236 else { 237 jqxhr = fileUploadIframe(a); 238 } 239 } 240 else if ((hasFileInputs || multipart) && fileAPI) { 241 jqxhr = fileUploadXhr(a); 242 } 243 else { 244 jqxhr = $.ajax(options); 245 } 246 247 $form.removeData('jqxhr').data('jqxhr', jqxhr); 248 249 // clear element array 250 for (var k=0; k < elements.length; k++) 251 elements[k] = null; 252 253 // fire 'notify' event 254 this.trigger('form-submit-notify', [this, options]); 255 return this; 256 257 // utility fn for deep serialization 258 function deepSerialize(extraData){ 259 var serialized = $.param(extraData, options.traditional).split('&'); 260 var len = serialized.length; 261 var result = []; 262 var i, part; 263 for (i=0; i < len; i++) { 264 // #252; undo param space replacement 265 serialized[i] = serialized[i].replace(/\+/g,' '); 266 part = serialized[i].split('='); 267 // #278; use array instead of object storage, favoring array serializations 268 result.push([decodeURIComponent(part[0]), decodeURIComponent(part[1])]); 269 } 270 return result; 271 } 272 273 // XMLHttpRequest Level 2 file uploads (big hat tip to francois2metz) 274 function fileUploadXhr(a) { 275 var formdata = new FormData(); 276 277 for (var i=0; i < a.length; i++) { 278 formdata.append(a[i].name, a[i].value); 279 } 280 281 if (options.extraData) { 282 var serializedData = deepSerialize(options.extraData); 283 for (i=0; i < serializedData.length; i++) 284 if (serializedData[i]) 285 formdata.append(serializedData[i][0], serializedData[i][1]); 286 } 287 288 options.data = null; 289 290 var s = $.extend(true, {}, $.ajaxSettings, options, { 291 contentType: false, 292 processData: false, 293 cache: false, 294 type: method || 'POST' 295 }); 296 297 if (options.uploadProgress) { 298 // workaround because jqXHR does not expose upload property 299 s.xhr = function() { 300 var xhr = $.ajaxSettings.xhr(); 301 if (xhr.upload) { 302 xhr.upload.addEventListener('progress', function(event) { 303 var percent = 0; 304 var position = event.loaded || event.position; /*event.position is deprecated*/ 305 var total = event.total; 306 if (event.lengthComputable) {
307 percent = Math.ceil(position / total * 100); 308 } 309 options.uploadProgress(event, position, total, percent); 310 }, false); 311 } 312 return xhr; 313 }; 314 } 315 316 s.data = null; 317 var beforeSend = s.beforeSend; 318 s.beforeSend = function(xhr, o) { 319 o.data = formdata; 320 if(beforeSend) 321 beforeSend.call(this, xhr, o); 322 }; 323 return $.ajax(s); 324 } 325 326 // private function for handling file uploads (hat tip to YAHOO!) 327 function fileUploadIframe(a) { 328 var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle; 329 var deferred = $.Deferred(); 330 331 if (a) { 332 // ensure that every serialized input is still enabled 333 for (i=0; i < elements.length; i++) { 334 el = $(elements[i]); 335 if ( hasProp ) 336 el.prop('disabled', false); 337 else 338 el.removeAttr('disabled'); 339 } 340 } 341 342 s = $.extend(true, {}, $.ajaxSettings, options); 343 s.context = s.context || s; 344 id = 'jqFormIO' + (new Date().getTime()); 345 if (s.iframeTarget) { 346 $io = $(s.iframeTarget); 347 n = $io.attr2('name'); 348 if (!n) 349 $io.attr2('name', id); 350 else 351 id = n; 352 } 353 else { 354 $io = $('<iframe name="' + id + '" src="'+ s.iframeSrc +'" />'); 355 $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' }); 356 } 357 io = $io[0]; 358 359 360 xhr = { // mock object 361 aborted: 0, 362 responseText: null, 363 responseXML: null, 364 status: 0, 365 statusText: 'n/a', 366 getAllResponseHeaders: function() {}, 367 getResponseHeader: function() {}, 368 setRequestHeader: function() {}, 369 abort: function(status) { 370 var e = (status === 'timeout' ? 'timeout' : 'aborted'); 371 log('aborting upload... ' + e); 372 this.aborted = 1; 373 374 try { // #214, #257 375 if (io.contentWindow.document.execCommand) { 376 io.contentWindow.document.execCommand('Stop'); 377 } 378 } 379 catch(ignore) {} 380 381 $io.attr('src', s.iframeSrc); // abort op in progress 382 xhr.error = e; 383 if (s.error) 384 s.error.call(s.context, xhr, e, status); 385 if (g) 386 $.event.trigger("ajaxError", [xhr, s, e]); 387 if (s.complete) 388 s.complete.call(s.context, xhr, e); 389 } 390 }; 391 392 g = s.global; 393 // trigger ajax global events so that activity/block indicators work like normal 394 if (g && 0 === $.active++) { 395 $.event.trigger("ajaxStart"); 396 } 397 if (g) { 398 $.event.trigger("ajaxSend", [xhr, s]); 399 } 400 401 if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) { 402 if (s.global) { 403 $.active--; 404 } 405 deferred.reject(); 406 return deferred; 407 } 408 if (xhr.aborted) { 409 deferred.reject(); 410 return deferred; 411 } 412 413 // add submitting element to data if we know it 414 sub = form.clk; 415 if (sub) { 416 n = sub.name; 417 if (n && !sub.disabled) { 418 s.extraData = s.extraData || {}; 419 s.extraData[n] = sub.value; 420 if (sub.type == "image") { 421 s.extraData[n+'.x'] = form.clk_x; 422 s.extraData[n+'.y'] = form.clk_y; 423 } 424 } 425 } 426 427 var CLIENT_TIMEOUT_ABORT = 1; 428 var SERVER_ABORT = 2; 429 430 function getDoc(frame) { 431 /* it looks like contentWindow or contentDocument do not 432 * carry the protocol property in ie8, when running under ssl 433 * frame.document is the only valid response document, since 434 * the protocol is know but not on the other two objects. strange? 435 * "Same origin policy" http://en.wikipedia.org/wiki/Same_origin_policy 436 */ 437 438 var doc = null; 439 440 // IE8 cascading access check 441 try { 442 if (frame.contentWindow) { 443 doc = frame.contentWindow.document; 444 } 445 } catch(err) { 446 // IE8 access denied under ssl & missing protocol 447 log('cannot get iframe.contentWindow document: ' + err); 448 } 449 450 if (doc) { // successful getting content 451 return doc; 452 } 453 454 try { // simply checking may throw in ie8 under ssl or mismatched protocol 455 doc = frame.contentDocument ? frame.contentDocument : frame.document; 456 } catch(err) { 457 // last attempt 458 log('cannot get iframe.contentDocument: ' + err); 459 doc = frame.document; 460 } 461 return doc; 462 } 463 464 // Rails CSRF hack (thanks to Yvan Barthelemy) 465 var csrf_token = $('meta[name=csrf-token]').attr('content'); 466 var csrf_param = $('meta[name=csrf-param]').attr('content'); 467 if (csrf_param && csrf_token) { 468 s.extraData = s.extraData || {}; 469 s.extraData[csrf_param] = csrf_token; 470 } 471 472 // take a breath so that pending repaints get some cpu time before the upload starts 473 function doSubmit() { 474 // make sure form attrs are set 475 var t = $form.attr2('target'), a = $form.attr2('action'); 476 477 // update form attrs in IE friendly way 478 form.setAttribute('target',id);
479 if (!method) { 480 form.setAttribute('method', 'POST'); 481 } 482 if (a != s.url) { 483 form.setAttribute('action', s.url); 484 } 485 486 // ie borks in some cases when setting encoding 487 if (! s.skipEncodingOverride && (!method || /post/i.test(method))) { 488 $form.attr({ 489 encoding: 'multipart/form-data', 490 enctype: 'multipart/form-data' 491 }); 492 } 493 494 // support timout 495 if (s.timeout) { 496 timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout); 497 } 498 499 // look for server aborts 500 function checkState() { 501 try { 502 var state = getDoc(io).readyState; 503 log('state = ' + state); 504 if (state && state.toLowerCase() == 'uninitialized') 505 setTimeout(checkState,50); 506 } 507 catch(e) { 508 log('Server abort: ' , e, ' (', e.name, ')'); 509 cb(SERVER_ABORT); 510 if (timeoutHandle) 511 clearTimeout(timeoutHandle); 512 timeoutHandle = undefined; 513 } 514 } 515 516 // add "extra" data to form if provided in options 517 var extraInputs = []; 518 try { 519 if (s.extraData) { 520 for (var n in s.extraData) { 521 if (s.extraData.hasOwnProperty(n)) { 522 // if using the $.param format that allows for multiple values with the same name 523 if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) { 524 extraInputs.push( 525 $('<input type="hidden" name="'+s.extraData[n].name+'">').val(s.extraData[n].value) 526 .appendTo(form)[0]); 527 } else { 528 extraInputs.push( 529 $('<input type="hidden" name="'+n+'">').val(s.extraData[n]) 530 .appendTo(form)[0]); 531 } 532 } 533 } 534 } 535 536 if (!s.iframeTarget) { 537 // add iframe to doc and submit the form 538 $io.appendTo('body'); 539 if (io.attachEvent) 540 io.attachEvent('onload', cb); 541 else 542 io.addEventListener('load', cb, false); 543 } 544 setTimeout(checkState,15); 545 546 try { 547 form.submit(); 548 } catch(err) { 549 // just in case form has element with name/id of 'submit' 550 var submitFn = document.createElement('form').submit; 551 submitFn.apply(form); 552 } 553 } 554 finally { 555 // reset attrs and remove "extra" input elements 556 form.setAttribute('action',a); 557 if(t) { 558 form.setAttribute('target', t); 559 } else { 560 $form.removeAttr('target'); 561 } 562 $(extraInputs).remove(); 563 } 564 } 565 566 if (s.forceSync) { 567 doSubmit(); 568 } 569 else { 570 setTimeout(doSubmit, 10); // this lets dom updates render 571 } 572 573 var data, doc, domCheckCount = 50, callbackProcessed; 574 575 function cb(e) { 576 if (xhr.aborted || callbackProcessed) { 577 return; 578 } 579 580 doc = getDoc(io); 581 if(!doc) { 582 log('cannot access response document'); 583 e = SERVER_ABORT; 584 } 585 if (e === CLIENT_TIMEOUT_ABORT && xhr) { 586 xhr.abort('timeout'); 587 deferred.reject(xhr, 'timeout'); 588 return; 589 } 590 else if (e == SERVER_ABORT && xhr) { 591 xhr.abort('server abort'); 592 deferred.reject(xhr, 'error', 'server abort'); 593 return; 594 } 595 596 if (!doc || doc.location.href == s.iframeSrc) { 597 // response not received yet 598 if (!timedOut) 599 return; 600 } 601 if (io.detachEvent) 602 io.detachEvent('onload', cb); 603 else 604 io.removeEventListener('load', cb, false); 605 606 var status = 'success', errMsg; 607 try { 608 if (timedOut) { 609 throw 'timeout'; 610 } 611 612 var isXml = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc); 613 log('isXml='+isXml); 614 if (!isXml && window.opera && (doc.body === null || !doc.body.innerHTML)) { 615 if (--domCheckCount) { 616 // in some browsers (Opera) the iframe DOM is not always traversable when 617 // the onload callback fires, so we loop a bit to accommodate 618 log('requeing onLoad callback, DOM not available'); 619 setTimeout(cb, 250); 620 return; 621 } 622 // let this fall through because server response could be an empty document 623 //log('Could not access iframe DOM after mutiple tries.'); 624 //throw 'DOMException: not available'; 625 } 626 627 //log('response detected'); 628 var docRoot = doc.body ? doc.body : doc.documentElement; 629 xhr.responseText = docRoot ? docRoot.innerHTML : null; 630 xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc; 631 if (isXml) 632 s.dataType = 'xml'; 633 xhr.getResponseHeader = function(header){ 634 var headers = {'content-type': s.dataType}; 635 return headers[header]; 636 }; 637 // support for XHR 'status' & 'statusText' emulation : 638 if (docRoot) { 639 xhr.status = Number( docRoot.getAttribute('status') ) || xhr.status; 640 xhr.statusText = docRoot.getAttribute('statusText') || xhr.statusText; 641 } 642 643 var dt = (s.dataType || '').toLowerCase(); 644 var scr = /(json|script|text)/.test(dt); 645 if (scr || s.textarea) { 646 // see if user embedded response in textarea 647 var ta = doc.getElementsByTagName('textarea')[0]; 648 if (ta) { 649 xhr.responseText = ta.value; 650 // support for XHR 'status' & 'statusText' emulation : 651 xhr.status = Number( ta.getAttribute('status') ) || xhr.status; 652 xhr.statusText = ta.getAttribute('statusText') || xhr.statusText; 653 } 654 else if (scr) { 655 // account for browsers injecting pre around json response 656 var pre = doc.getElementsByTagName('pre')[0]; 657 var b = doc.getElementsByTagName('body')[0]; 658 if (pre) { 659 xhr.responseText = pre.textContent ? pre.textContent : pre.innerText; 660 } 661 else if (b) { 662 xhr.responseText = b.textContent ? b.textContent : b.innerText; 663 } 664 } 665 } 666 else if (dt == 'xml' && !xhr.responseXML && xhr.responseText) { 667 xhr.responseXML = toXml(xhr.responseText); 668 } 669 670 try { 671 data = httpData(xhr, dt, s); 672 } 673 catch (err) { 674 status = 'parsererror'; 675 xhr.error = errMsg = (err || status); 676 } 677 } 678 catch (err) { 679 log('error caught: ',err); 680 status = 'error'; 681 xhr.error = errMsg = (err || status); 682 } 683 684 if (xhr.aborted) { 685 log('upload aborted'); 686 status = null; 687 } 688 689 if (xhr.status) { // we've set xhr.status 690 status = (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) ? 'success' : 'error'; 691 } 692 693 // ordering of these callbacks/triggers is odd, but that's how $.ajax does it 694 if (status === 'success') { 695 if (s.success) 696 s.success.call(s.context, data, 'success', xhr); 697 deferred.resolve(xhr.responseText, 'success', xhr); 698 if (g) 699 $.event.trigger("ajaxSuccess", [xhr, s]); 700 } 701 else if (status) { 702 if (errMsg === undefined) 703 errMsg = xhr.statusText; 704 if (s.error) 705 s.error.call(s.context, xhr, status, errMsg); 706 deferred.reject(xhr, 'error', errMsg); 707 if (g) 708 $.event.trigger("ajaxError", [xhr, s, errMsg]); 709 } 710 711 if (g)
712 $.event.trigger("ajaxComplete", [xhr, s]); 713 714 if (g && ! --$.active) { 715 $.event.trigger("ajaxStop"); 716 } 717 718 if (s.complete) 719 s.complete.call(s.context, xhr, status); 720 721 callbackProcessed = true; 722 if (s.timeout) 723 clearTimeout(timeoutHandle); 724 725 // clean up 726 setTimeout(function() { 727 if (!s.iframeTarget) 728 $io.remove(); 729 xhr.responseXML = null; 730 }, 100); 731 } 732 733 var toXml = $.parseXML || function(s, doc) { // use parseXML if available (jQuery 1.5+) 734 if (window.ActiveXObject) { 735 doc = new ActiveXObject('Microsoft.XMLDOM'); 736 doc.async = 'false'; 737 doc.loadXML(s); 738 } 739 else { 740 doc = (new DOMParser()).parseFromString(s, 'text/xml'); 741 } 742 return (doc && doc.documentElement && doc.documentElement.nodeName != 'parsererror') ? doc : null; 743 }; 744 var parseJSON = $.parseJSON || function(s) { 745 /*jslint evil:true */ 746 return window['eval']('(' + s + ')'); 747 }; 748 749 var httpData = function( xhr, type, s ) { // mostly lifted from jq1.4.4 750 751 var ct = xhr.getResponseHeader('content-type') || '', 752 xml = type === 'xml' || !type && ct.indexOf('xml') >= 0, 753 data = xml ? xhr.responseXML : xhr.responseText; 754 755 if (xml && data.documentElement.nodeName === 'parsererror') { 756 if ($.error) 757 $.error('parsererror'); 758 } 759 if (s && s.dataFilter) { 760 data = s.dataFilter(data, type); 761 } 762 if (typeof data === 'string') { 763 if (type === 'json' || !type && ct.indexOf('json') >= 0) { 764 data = parseJSON(data); 765 } else if (type === "script" || !type && ct.indexOf("javascript") >= 0) { 766 $.globalEval(data); 767 } 768 } 769 return data; 770 }; 771 772 return deferred; 773 } 774}; 775 776/** 777 * ajaxForm() provides a mechanism for fully automating form submission. 778 * 779 * The advantages of using this method instead of ajaxSubmit() are: 780 * 781 * 1: This method will include coordinates for <input type="image" /> elements (if the element 782 * is used to submit the form). 783 * 2. This method will include the submit element's name/value data (for the element that was 784 * used to submit the form). 785 * 3. This method binds the submit() method to the form for you. 786 * 787 * The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely 788 * passes the options argument along after properly binding events for submit elements and 789 * the form itself. 790 */ 791$.fn.ajaxForm = function(options) { 792 options = options || {}; 793 options.delegation = options.delegation && $.isFunction($.fn.on); 794 795 // in jQuery 1.3+ we can fix mistakes with the ready state 796 if (!options.delegation && this.length === 0) { 797 var o = { s: this.selector, c: this.context }; 798 if (!$.isReady && o.s) { 799 log('DOM not ready, queuing ajaxForm'); 800 $(function() { 801 $(o.s,o.c).ajaxForm(options); 802 }); 803 return this; 804 } 805 // is your DOM ready? http://docs.jquery.com/Tutorials:Introducing_$(document).ready() 806 log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)')); 807 return this; 808 } 809 810 if ( options.delegation ) { 811 $(document) 812 .off('submit.form-plugin', this.selector, doAjaxSubmit) 813 .off('click.form-plugin', this.selector, captureSubmittingElement) 814 .on('submit.form-plugin', this.selector, options, doAjaxSubmit) 815 .on('click.form-plugin', this.selector, options, captureSubmittingElement); 816 return this; 817 } 818 819 return this.ajaxFormUnbind() 820 .bind('submit.form-plugin', options, doAjaxSubmit) 821 .bind('click.form-plugin', options, captureSubmittingElement); 822}; 823 824// private event handlers 825function doAjaxSubmit(e) { 826 /*jshint validthis:true */ 827 var options = e.data; 828 if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed 829 e.preventDefault(); 830 $(this).ajaxSubmit(options); 831 } 832} 833 834function captureSubmittingElement(e) { 835 /*jshint validthis:true */ 836 var target = e.target; 837 var $el = $(target); 838 if (!($el.is("[type=submit],[type=image]"))) { 839 // is this a child element of the submit el? (ex: a span within a button) 840 var t = $el.closest('[type=submit]'); 841 if (t.length === 0) { 842 return; 843 } 844 target = t[0]; 845 } 846 var form = this; 847 form.clk = target; 848 if (target.type == 'image') { 849 if (e.offsetX !== undefined) { 850 form.clk_x = e.offsetX; 851 form.clk_y = e.offsetY; 852 } else if (typeof $.fn.offset == 'function') { 853 var offset = $el.offset(); 854 form.clk_x = e.pageX - offset.left; 855 form.clk_y = e.pageY - offset.top; 856 } else { 857 form.clk_x = e.pageX - target.offsetLeft; 858 form.clk_y = e.pageY - target.offsetTop; 859 } 860 } 861 // clear form vars 862 setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100); 863} 864 865 866// ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm 867$.fn.ajaxFormUnbind = function() { 868 return this.unbind('submit.form-plugin click.form-plugin'); 869}; 870 871/** 872 * formToArray() gathers form element data into an array of objects that can 873 * be passed to any of the following ajax functions: $.get, $.post, or load. 874 * Each object in the array has both a 'name' and 'value' property. An example of 875 * an array for a simple login form might be: 876 * 877 * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ] 878 * 879 * It is this array that is passed to pre-submit callback functions provided to the 880 * ajaxSubmit() and ajaxForm() methods. 881 */ 882$.fn.formToArray = function(semantic, elements) { 883 var a = []; 884 if (this.length === 0) { 885 return a; 886 } 887 888 var form = this[0]; 889 var els = semantic ? form.getElementsByTagName('*') : form.elements; 890 if (!els) { 891 return a; 892 } 893 894 var i,j,n,v,el,max,jmax; 895 for(i=0, max=els.length; i < max; i++) { 896 el = els[i]; 897 n = el.name; 898 if (!n || el.disabled) { 899 continue; 900 } 901 902 if (semantic && form.clk && el.type == "image") { 903 // handle image inputs on the fly when semantic == true 904 if(form.clk == el) { 905 a.push({name: n, value: $(el).val(), type: el.type }); 906 a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y}); 907 } 908 continue; 909 } 910 911 v = $.fieldValue(el, true); 912 if (v && v.constructor == Array) { 913 if (elements) 914 elements.push(el); 915 for(j=0, jmax=v.length; j < jmax; j++) { 916 a.push({name: n, value: v[j]}); 917 } 918 } 919 else if (feature.fileapi && el.type == 'file') { 920 if (elements) 921 elements.push(el); 922 var files = el.files; 923 if (files.length) { 924 for (j=0; j < files.length; j++) { 925 a.push({name: n, value: files[j], type: el.type}); 926 } 927 } 928 else { 929 // #180 930 a.push({ name: n, value: '', type: el.type }); 931 } 932 } 933 else if (v !== null && typeof v != 'undefined') { 934 if (elements) 935 elements.push(el); 936 a.push({name: n, value: v, type: el.type, required: el.required}); 937 } 938 } 939 940 if (!semantic && form.clk) { 941 // input type=='image' are not found in elements array! handle it here 942 var $input = $(form.clk), input = $input[0]; 943 n = input.name; 944 if (n && !input.disabled && input.type == 'image') { 945 a.push({name: n, value: $input.val()}); 946 a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y}); 947 } 948 } 949 return a; 950}; 951 952/** 953 * Serializes form data into a 'submittable' string. This method will return a string 954 * in the format: name1=value1&name2=value2 955 */
956$.fn.formSerialize = function(semantic) { 957 //hand off to jQuery.param for proper encoding 958 return $.param(this.formToArray(semantic)); 959}; 960 961/** 962 * Serializes all field elements in the jQuery object into a query string. 963 * This method will return a string in the format: name1=value1&name2=value2 964 */ 965$.fn.fieldSerialize = function(successful) { 966 var a = []; 967 this.each(function() { 968 var n = this.name; 969 if (!n) { 970 return; 971 } 972 var v = $.fieldValue(this, successful); 973 if (v && v.constructor == Array) { 974 for (var i=0,max=v.length; i < max; i++) { 975 a.push({name: n, value: v[i]}); 976 } 977 } 978 else if (v !== null && typeof v != 'undefined') { 979 a.push({name: this.name, value: v}); 980 } 981 }); 982 //hand off to jQuery.param for proper encoding 983 return $.param(a); 984}; 985 986/** 987 * Returns the value(s) of the element in the matched set. For example, consider the following form: 988 * 989 * <form><fieldset> 990 * <input name="A" type="text" /> 991 * <input name="A" type="text" /> 992 * <input name="B" type="checkbox" value="B1" /> 993 * <input name="B" type="checkbox" value="B2"/> 994 * <input name="C" type="radio" value="C1" /> 995 * <input name="C" type="radio" value="C2" /> 996 * </fieldset></form> 997 * 998 * var v = $('input[type=text]').fieldValue(); 999 * // if no values are entered into the text inputs 1000 * v == ['',''] 1001 * // if values entered into the text inputs are 'foo' and 'bar' 1002 * v == ['foo','bar'] 1003 * 1004 * var v = $('input[type=checkbox]').fieldValue(); 1005 * // if neither checkbox is checked 1006 * v === undefined 1007 * // if both checkboxes are checked 1008 * v == ['B1', 'B2'] 1009 * 1010 * var v = $('input[type=radio]').fieldValue(); 1011 * // if neither radio is checked 1012 * v === undefined 1013 * // if first radio is checked 1014 * v == ['C1'] 1015 * 1016 * The successful argument controls whether or not the field element must be 'successful' 1017 * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls). 1018 * The default value of the successful argument is true. If this value is false the value(s) 1019 * for each element is returned. 1020 * 1021 * Note: This method *always* returns an array. If no valid value can be determined the 1022 * array will be empty, otherwise it will contain one or more values. 1023 */ 1024$.fn.fieldValue = function(successful) { 1025 for (var val=[], i=0, max=this.length; i < max; i++) { 1026 var el = this[i]; 1027 var v = $.fieldValue(el, successful); 1028 if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) { 1029 continue; 1030 } 1031 if (v.constructor == Array) 1032 $.merge(val, v); 1033 else 1034 val.push(v); 1035 } 1036 return val; 1037}; 1038 1039/** 1040 * Returns the value of the field element. 1041 */ 1042$.fieldValue = function(el, successful) { 1043 var n = el.name, t = el.type, tag = el.tagName.toLowerCase(); 1044 if (successful === undefined) { 1045 successful = true; 1046 } 1047 1048 if (successful && (!n || el.disabled || t == 'reset' || t == 'button' || 1049 (t == 'checkbox' || t == 'radio') && !el.checked || 1050 (t == 'submit' || t == 'image') && el.form && el.form.clk != el || 1051 tag == 'select' && el.selectedIndex == -1)) { 1052 return null; 1053 } 1054 1055 if (tag == 'select') { 1056 var index = el.selectedIndex; 1057 if (index < 0) { 1058 return null; 1059 } 1060 var a = [], ops = el.options; 1061 var one = (t == 'select-one'); 1062 var max = (one ? index+1 : ops.length); 1063 for(var i=(one ? index : 0); i < max; i++) { 1064 var op = ops[i]; 1065 if (op.selected) { 1066 var v = op.value; 1067 if (!v) { // extra pain for IE... 1068 v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value; 1069 } 1070 if (one) { 1071 return v; 1072 } 1073 a.push(v); 1074 } 1075 } 1076 return a; 1077 } 1078 return $(el).val(); 1079}; 1080 1081/** 1082 * Clears the form data. Takes the following actions on the form's input fields: 1083 * - input text fields will have their 'value' property set to the empty string 1084 * - select elements will have their 'selectedIndex' property set to -1 1085 * - checkbox and radio inputs will have their 'checked' property set to false 1086 * - inputs of type submit, button, reset, and hidden will *not* be effected 1087 * - button elements will *not* be effected 1088 */ 1089$.fn.clearForm = function(includeHidden) { 1090 return this.each(function() { 1091 $('input,select,textarea', this).clearFields(includeHidden); 1092 }); 1093}; 1094 1095/** 1096 * Clears the selected form elements. 1097 */ 1098$.fn.clearFields = $.fn.clearInputs = function(includeHidden) { 1099 var re = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i; // 'hidden' is not in this list 1100 return this.each(function() { 1101 var t = this.type, tag = this.tagName.toLowerCase(); 1102 if (re.test(t) || tag == 'textarea') { 1103 this.value = ''; 1104 } 1105 else if (t == 'checkbox' || t == 'radio') { 1106 this.checked = false;
1107 } 1108 else if (tag == 'select') { 1109 this.selectedIndex = -1; 1110 } 1111 else if (t == "file") { 1112 if (/MSIE/.test(navigator.userAgent)) { 1113 $(this).replaceWith($(this).clone(true)); 1114 } else { 1115 $(this).val(''); 1116 } 1117 } 1118 else if (includeHidden) { 1119 // includeHidden can be the value true, or it can be a selector string 1120 // indicating a special test; for example: 1121 // $('#myForm').clearForm('.special:hidden') 1122 // the above would clean hidden inputs that have the class of 'special' 1123 if ( (includeHidden === true && /hidden/.test(t)) || 1124 (typeof includeHidden == 'string' && $(this).is(includeHidden)) ) 1125 this.value = ''; 1126 } 1127 }); 1128}; 1129 1130/** 1131 * Resets the form data. Causes all form elements to be reset to their original value. 1132 */ 1133$.fn.resetForm = function() { 1134 return this.each(function() { 1135 // guard against an input with the name of 'reset' 1136 // note that IE reports the reset function as an 'object' 1137 if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) { 1138 this.reset(); 1139 } 1140 }); 1141}; 1142 1143/** 1144 * Enables or disables any matching elements. 1145 */ 1146$.fn.enable = function(b) { 1147 if (b === undefined) { 1148 b = true; 1149 } 1150 return this.each(function() { 1151 this.disabled = !b; 1152 }); 1153}; 1154 1155/** 1156 * Checks/unchecks any matching checkboxes or radio buttons and 1157 * selects/deselects and matching option elements. 1158 */ 1159$.fn.selected = function(select) { 1160 if (select === undefined) { 1161 select = true; 1162 } 1163 return this.each(function() { 1164 var t = this.type; 1165 if (t == 'checkbox' || t == 'radio') { 1166 this.checked = select; 1167 } 1168 else if (this.tagName.toLowerCase() == 'option') { 1169 var $sel = $(this).parent('select'); 1170 if (select && $sel[0] && $sel[0].type == 'select-one') { 1171 // deselect all other options 1172 $sel.find('option').selected(false); 1173 } 1174 this.selected = select; 1175 } 1176 }); 1177}; 1178 1179// expose debug var 1180$.fn.ajaxSubmit.debug = false; 1181 1182// helper fn for console logging 1183function log() { 1184 if (!$.fn.ajaxSubmit.debug) 1185 return; 1186 var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,''); 1187 if (window.console && window.console.log) { 1188 window.console.log(msg); 1189 } 1190 else if (window.opera && window.opera.postError) { 1191 window.opera.postError(msg); 1192 } 1193} 1194 1195})(jQuery); 1196(function($,document,undefined){var pluses=/\+/g;function raw(s){return s}function decoded(s){return decodeURIComponent(s.replace(pluses,' '))}var config=$.cookie=function(key,value,options){if(value!==undefined){options=$.extend({},config.defaults,options);if(value===null){options.expires=-1}if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setDate(t.getDate()+days)}value=config.json?JSON.stringify(value):String(value);return(document.cookie=[encodeURIComponent(key),'=',config.raw?value:encodeURIComponent(value),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''))}var decode=config.raw?raw:decoded;var cookies=document.cookie.split('; ');for(var i=0,l=cookies.length;i<l;i++){var parts=cookies[i].split('=');if(decode(parts.shift())===key){var cookie=decode(parts.join('='));return config.json?JSON.parse(cookie):cookie}}return null};config.defaults={};$.removeCookie=function(key,options){if($.cookie(key)!==null){$.cookie(key,null,options);return true}return false}})(jQuery,document); 1197/*! 1198 * calendar.js 1199*/ 1200; 1201 var calendar = {}; 1202 1203 calendar.init = function() { 1204 var mths= new Array('ÑнваÑÑ','ÑевÑалÑ','маÑÑа','апÑелÑ','маÑ','иÑнÑ','иÑлÑ','авгÑÑÑа','ÑенÑÑбÑÑ','окÑÑбÑÑ','ноÑбÑÑ','декабÑÑ'); 1205 var dw = new Array('воÑкÑеÑенÑе','понеделÑник','вÑоÑник','ÑÑеда','ÑеÑвеÑг','пÑÑниÑа','ÑÑббоÑа'); 1206 var dt = new Date(); 1207 this.currentDate=dt.getDate()+' '+mths[dt.getMonth()]+' '+dt.getFullYear(); 1208 this.dowd=dt.getDay(); 1209 this.dow=dw[this.dowd]; 1210 this.h=dt.getHours(); 1211 if (this.h<=9) this.h='0'+this.h; 1212 this.m=dt.getMinutes(); 1213 if (this.m<=9) this.m='0'+this.m; 1214 this.s=dt.getSeconds(); 1215 if (this.s<=9) this.s='0'+this.s; 1216 this.tm=this.h+':'+ this.m+':'+this.s; 1217 this.tmws=this.h+':'+ this.m; 1218 }; 1219 1220 calendar.measure = function(l,v) { 1221 var unit = []; 1222 unit[1] = ['ÑекÑнда','ÑекÑндÑ','ÑекÑнд']; 1223 unit[2] = ['минÑÑа','минÑÑÑ','минÑÑ']; 1224 unit[3] = ['ÑаÑ','ÑаÑа','ÑаÑов']; 1225 unit[4] = ['денÑ','днÑ','дней']; 1226 unit[5] = ['неделÑ','недели','неделÑ']; 1227 var cases = [2, 0, 1, 1, 1, 2]; 1228 var titles=unit[l]; 1229 var id,i; 1230 if (v%100 >4 && v%100< 20) id=2; 1231 else { 1232 i=Math.min(v%10, 5); 1233 id=(cases[i]); 1234 } 1235 1236 return titles[id]; 1237 1238 }; 1239 1240 1241 calendar.backdate = function(tms) { 1242 var ht=''; 1243 var cdt=new Date(); 1244 var ctms=parseInt(cdt.getTime()/1000);//ÑекÑÑий ÑаймÑÑамп 1245 var df=tms-ctms; 1246 //console.log(df); 1247 1248 if (df>=604800) { 1249 ht=parseInt(df/604800); 1250 return ht+=' нед.'; 1251 } 1252 else if (df<604800 && df>=86400) { 1253 ht=parseInt(df/86400); 1254 return ht+=' дн.'; 1255 } 1256 else if (df<86400 && df>=3600) { 1257 ht=parseInt(df/3600); 1258 var mn=parseInt((df-(ht*3600))/60); 1259 if (mn<9) mn='0'+mn; 1260 var sc=df-(ht*3600)-(mn*60); 1261 if (sc<9) sc='0'+sc; 1262 return ht+=':'+mn+':'+sc; 1263 } 1264 else if (df<3600 && df>0) { 1265 var mn=parseInt(df/60); 1266 if (mn<=9) mn='0'+mn; 1267 var sc=df-(mn*60); 1268 if (sc<=9) sc='0'+sc; 1269 return mn+':'+sc; 1270 } 1271 else if (df<=0) { 1272 window.location.href=window.location.href; 1273 } 1274 else return false;
1275 }; 1276 1277 calendar.countdown = function() { 1278 $('.countdown').each(function(index) { 1279 var tms=$(this).attr('date-utime'); 1280 if (tms==0) $(this).text('-'); 1281 else { 1282 var v=calendar.backdate(tms); 1283 $(this).text(v); 1284 } 1285 }); 1286 }; 1287 1288 calendar.date = function(tms,cls) { //ÑоÑÐ¼Ð°Ñ Ð¿ÑедÑÑÐ°Ð²Ð»ÐµÐ½Ð¸Ñ Ð´Ð°ÑÑ, на Ð²Ñ Ð¾Ð´Ðµ tms + паÑамеÑÑ 1289 var dt = new Date(); 1290 dt.setTime(tms*1000); 1291 cdt=new Date(); 1292 this.ctms=parseInt(cdt.getTime()/1000); 1293 this.h=dt.getDay(); 1294 1295 if (this.h<=9) this.h='0'+this.h; 1296 this.i=dt.getMinutes(); 1297 if (this.i<=9) this.i='0'+this.i; 1298 this.s=dt.getSeconds(); 1299 if (this.s<=9) this.s='0'+this.s; 1300 this.day=dt.getDate(); 1301 if (this.day<=9) this.day='0'+this.day; 1302 1303 this.month=parseInt(dt.getMonth())+parseInt(1); 1304 if (this.month<=9) this.month='0'+this.month; 1305 1306 this.fullyear=dt.getFullYear(); 1307 var chp=new String(this.fullyear); 1308 this.year=chp.substr(2,2); 1309 1310 //пеÑвÑй ÑоÑÐ¼Ð°Ñ Ð¿ÑедÑÑÐ°Ð²Ð»ÐµÐ½Ð¸Ñ dd.mm.yyyy 1311 var out; 1312 if (cls=='dmy') out=this.day+'.'+this.month +'.'+this.year; 1313 if (cls=='dmfy') out=this.day+'.'+this.month+'.'+this.fullyear; 1314 if (cls=='dmyhi') out=this.day+'.'+this.month +'.'+this.year+' '+this.h+':'+this.i; 1315 if (cls=='dmfyhi') out=this.day+'.'+this.month +'.'+this.fullyear+' '+this.h+':'+this.i; 1316 if (cls=='fb') { //ÑолÑко ÑÑо, 2 ÑаÑа назад и Ñ.д. 1317 1318 var df=this.ctms-tms; 1319 1320 if (df<=5) { l=0; v=df; } 1321 else if (df>5 && df<60) {l=1; v=df; } 1322 else if (df>=60 && df<3600) {l=2;v=parseInt(df/60);} //минÑÑÑ 1323 else if (df>=3600 && df<86400) {l=3;v=parseInt(df/3600);} //ÑаÑÑ 1324 else if (df>=86400 && df<604800) {l=4;v=parseInt(df/3600);} //дни (до 7 ми) 1325 else if (df>=604800 && df<2592000) {l=5;v=parseInt(df/604800);} //недели 4.2(до 30 дней) 1326 else if (df>=2592000 && df<=31536000) {l=6;v=parseInt(df/2592000);} //меÑÑÑÑ 12 (365 дней) (до года) 1327 else {l=7;v=parseInt(df/31536000);} //Ð³Ð¾Ð´Ñ 1328 if (df>5) out=v + ' '+this.measure(l,v)+' назад'; 1329 else out='ÑолÑко ÑÑо'; 1330 1331 } 1332 1333 return out; 1334 }; 1335/** 1336 * jQuery.browser.mobile (http://detectmobilebrowser.com/) 1337 * 1338 * jQuery.browser.mobile will be true if the browser is a mobile device 1339 * 1340 **/ 1341;(function(a){(jQuery.browser=jQuery.browser||{}).mobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
1341sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))})(navigator.userAgent||navigator.vendor||window.opera); 1342/*! 1343 * jQuery.selection - jQuery Plugin 1344 * 1345 * Copyright (c) 2010-2014 IWASAKI Koji (@madapaja). 1346 * http://blog.madapaja.net/ 1347 * Under The MIT License 1348 * 1349 * Permission is hereby granted, free of charge, to any person obtaining 1350 * a copy of this software and associated documentation files (the 1351 * "Software"), to deal in the Software without restriction, including 1352 * without limitation the rights to use, copy, modify, merge, publish, 1353 * distribute, sublicense, and/or sell copies of the Software, and to 1354 * permit persons to whom the Software is furnished to do so, subject to 1355 * the following conditions: 1356 * 1357 * The above copyright notice and this permission notice shall be 1358 * included in all copies or substantial portions of the Software. 1359 * 1360 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 1361 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 1362 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 1363 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 1364 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 1365 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 1366 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 1367 */ 1368(function($, win, doc) { 1369 /** 1370 * get caret status of the selection of the element 1371 * 1372 * @param {Element} element target DOM element 1373 * @return {Object} return 1374 * @return {String} return.text selected text 1375 * @return {Number} return.start start position of the selection 1376 * @return {Number} return.end end position of the selection 1377 */ 1378 var _getCaretInfo = function(element){ 1379 var res = { 1380 text: '', 1381 start: 0, 1382 end: 0 1383 }; 1384 1385 if (!element.value) { 1386 /* no value or empty string */ 1387 return res; 1388 } 1389 1390 try { 1391 if (win.getSelection) { 1392 /* except IE */ 1393 res.start = element.selectionStart; 1394 res.end = element.selectionEnd; 1395 res.text = element.value.slice(res.start, res.end); 1396 } else if (doc.selection) { 1397 /* for IE */ 1398 element.focus(); 1399 1400 var range = doc.selection.createRange(), 1401 range2 = doc.body.createTextRange(); 1402 1403 res.text = range.text; 1404 1405 try { 1406 range2.moveToElementText(element); 1407 range2.setEndPoint('StartToStart', range); 1408 } catch (e) { 1409 range2 = element.createTextRange(); 1410 range2.setEndPoint('StartToStart', range); 1411 } 1412 1413 res.start = element.value.length - range2.text.length; 1414 res.end = res.start + range.text.length; 1415 } 1416 } catch (e) { 1417 /* give up */ 1418 } 1419 1420 return res; 1421 }; 1422 1423 /** 1424 * caret operation for the element 1425 * @type {Object} 1426 */ 1427 var _CaretOperation = { 1428 /** 1429 * get caret position 1430 * 1431 * @param {Element} element target element 1432 * @return {Object} return 1433 * @return {Number} return.start start position for the selection 1434 * @return {Number} return.end end position for the selection 1435 */ 1436 getPos: function(element) { 1437 var tmp = _getCaretInfo(element); 1438 return {start: tmp.start, end: tmp.end}; 1439 }, 1440 1441 /** 1442 * set caret position 1443 * 1444 * @param {Element} element target element 1445 * @param {Object} toRange caret position 1446 * @param {Number} toRange.start start position for the selection 1447 * @param {Number} toRange.end end position for the selection
1448 * @param {String} caret caret mode: any of the following: "keep" | "start" | "end" 1449 */ 1450 setPos: function(element, toRange, caret) { 1451 caret = this._caretMode(caret); 1452 1453 if (caret === 'start') { 1454 toRange.end = toRange.start; 1455 } else if (caret === 'end') { 1456 toRange.start = toRange.end; 1457 } 1458 1459 element.focus(); 1460 try { 1461 if (element.createTextRange) { 1462 var range = element.createTextRange(); 1463 1464 if (win.navigator.userAgent.toLowerCase().indexOf("msie") >= 0) { 1465 toRange.start = element.value.substr(0, toRange.start).replace(/\r/g, '').length; 1466 toRange.end = element.value.substr(0, toRange.end).replace(/\r/g, '').length; 1467 } 1468 1469 range.collapse(true); 1470 range.moveStart('character', toRange.start); 1471 range.moveEnd('character', toRange.end - toRange.start); 1472 1473 range.select(); 1474 } else if (element.setSelectionRange) { 1475 element.setSelectionRange(toRange.start, toRange.end); 1476 } 1477 } catch (e) { 1478 /* give up */ 1479 } 1480 }, 1481 1482 /** 1483 * get selected text 1484 * 1485 * @param {Element} element target element 1486 * @return {String} return selected text 1487 */ 1488 getText: function(element) { 1489 return _getCaretInfo(element).text; 1490 }, 1491 1492 /** 1493 * get caret mode 1494 * 1495 * @param {String} caret caret mode 1496 * @return {String} return any of the following: "keep" | "start" | "end" 1497 */ 1498 _caretMode: function(caret) { 1499 caret = caret || "keep"; 1500 if (caret === false) { 1501 caret = 'end'; 1502 } 1503 1504 switch (caret) { 1505 case 'keep': 1506 case 'start': 1507 case 'end': 1508 break; 1509 1510 default: 1511 caret = 'keep'; 1512 } 1513 1514 return caret; 1515 }, 1516 1517 /** 1518 * replace selected text 1519 * 1520 * @param {Element} element target element 1521 * @param {String} text replacement text 1522 * @param {String} caret caret mode: any of the following: "keep" | "start" | "end" 1523 */ 1524 replace: function(element, text, caret) { 1525 var tmp = _getCaretInfo(element), 1526 orig = element.value, 1527 pos = $(element).scrollTop(), 1528 range = {start: tmp.start, end: tmp.start + text.length}; 1529 1530 element.value = orig.substr(0, tmp.start) + text + orig.substr(tmp.end); 1531 1532 $(element).scrollTop(pos); 1533 this.setPos(element, range, caret); 1534 }, 1535 1536 /** 1537 * insert before the selected text 1538 * 1539 * @param {Element} element target element 1540 * @param {String} text insertion text 1541 * @param {String} caret caret mode: any of the following: "keep" | "start" | "end" 1542 */ 1543 insertBefore: function(element, text, caret) { 1544 var tmp = _getCaretInfo(element), 1545 orig = element.value, 1546 pos = $(element).scrollTop(), 1547 range = {start: tmp.start + text.length, end: tmp.end + text.length}; 1548 1549 element.value = orig.substr(0, tmp.start) + text + orig.substr(tmp.start); 1550 1551 $(element).scrollTop(pos); 1552 this.setPos(element, range, caret); 1553 }, 1554 1555 /** 1556 * insert after the selected text 1557 * 1558 * @param {Element} element target element 1559 * @param {String} text insertion text 1560 * @param {String} caret caret mode: any of the following: "keep" | "start" | "end" 1561 */ 1562 insertAfter: function(element, text, caret) { 1563 var tmp = _getCaretInfo(element), 1564 orig = element.value, 1565 pos = $(element).scrollTop(), 1566 range = {start: tmp.start, end: tmp.end}; 1567 1568 element.value = orig.substr(0, tmp.end) + text + orig.substr(tmp.end); 1569 1570 $(element).scrollTop(pos); 1571 this.setPos(element, range, caret); 1572 } 1573 }; 1574 1575 /* add jQuery.selection */ 1576 $.extend({ 1577 /** 1578 * get selected text on the window 1579 *
1580 * @param {String} mode selection mode: any of the following: "text" | "html" 1581 * @return {String} return 1582 */ 1583 selection: function(mode) { 1584 var getText = ((mode || 'text').toLowerCase() === 'text'); 1585 1586 try { 1587 if (win.getSelection) { 1588 if (getText) { 1589 // get text 1590 return win.getSelection().toString(); 1591 } else { 1592 // get html 1593 var sel = win.getSelection(), range; 1594 1595 if (sel.getRangeAt) { 1596 range = sel.getRangeAt(0); 1597 } else { 1598 range = doc.createRange(); 1599 range.setStart(sel.anchorNode, sel.anchorOffset); 1600 range.setEnd(sel.focusNode, sel.focusOffset); 1601 } 1602 1603 return $('<div></div>').append(range.cloneContents()).html(); 1604 } 1605 } else if (doc.selection) { 1606 if (getText) { 1607 // get text 1608 return doc.selection.createRange().text; 1609 } else { 1610 // get html 1611 return doc.selection.createRange().htmlText; 1612 } 1613 } 1614 } catch (e) { 1615 /* give up */ 1616 } 1617 1618 return ''; 1619 } 1620 }); 1621 1622 /* add selection */ 1623 $.fn.extend({ 1624 selection: function(mode, opts) { 1625 opts = opts || {}; 1626 1627 switch (mode) { 1628 /** 1629 * selection('getPos') 1630 * get caret position 1631 * 1632 * @return {Object} return 1633 * @return {Number} return.start start position for the selection 1634 * @return {Number} return.end end position for the selection 1635 */ 1636 case 'getPos': 1637 return _CaretOperation.getPos(this[0]); 1638 1639 /** 1640 * selection('setPos', opts) 1641 * set caret position 1642 * 1643 * @param {Number} opts.start start position for the selection 1644 * @param {Number} opts.end end position for the selection 1645 */ 1646 case 'setPos': 1647 return this.each(function() { 1648 _CaretOperation.setPos(this, opts); 1649 }); 1650 1651 /** 1652 * selection('replace', opts) 1653 * replace the selected text 1654 * 1655 * @param {String} opts.text replacement text 1656 * @param {String} opts.caret caret mode: any of the following: "keep" | "start" | "end" 1657 */ 1658 case 'replace': 1659 return this.each(function() { 1660 _CaretOperation.replace(this, opts.text, opts.caret); 1661 }); 1662 1663 /** 1664 * selection('insert', opts) 1665 * insert before/after the selected text 1666 * 1667 * @param {String} opts.text insertion text 1668 * @param {String} opts.caret caret mode: any of the following: "keep" | "start" | "end" 1669 * @param {String} opts.mode insertion mode: any of the following: "before" | "after" 1670 */ 1671 case 'insert': 1672 return this.each(function() { 1673 if (opts.mode === 'before') { 1674 _CaretOperation.insertBefore(this, opts.text, opts.caret); 1675 } else { 1676 _CaretOperation.insertAfter(this, opts.text, opts.caret); 1677 } 1678 }); 1679 1680 /** 1681 * selection('get') 1682 * get selected text 1683 * 1684 * @return {String} return 1685 */ 1686 case 'get': 1687 /* falls through */ 1688 default: 1689 return _CaretOperation.getText(this[0]); 1690 } 1691 1692 return this; 1693 } 1694 }); 1695})(jQuery, window, window.document);; 1696// -------------------------------
1697// js/main/app.js 1698// ------------------------------- 1699$(function () { 1700 /* some global function */ 1701 1702 /* load SVG sprites */ 1703 let spriteLoader = $('<div style="width:0;height:0;overflow:hidden"></div>').prependTo(document.body); 1704 $('link[data-type="sprite"]').each(function () { 1705 let spriteLink = $(this).attr('href'); 1706 if (spriteLink !== '') { 1707 $.get(spriteLink, function (t) { 1708 spriteLoader.append("undefined" != typeof XMLSerializer ? (new XMLSerializer).serializeToString(t.documentElement) : $(t.documentElement).html()); 1709 }); 1710 } 1711 }); 1712 1713 /* FORMS VALIDATION */ 1714 /* Russian error messages */ 1715 jQuery.validityRussian = function (object) { 1716 let validity = object.validity; 1717 let message = ''; 1718 let russianMessages = { 1719 valueMissing: 'ÐаполниÑе ÑÑо поле', 1720 valueMissingSelect: 'ÐÑбеÑиÑе не пеÑвÑй пÑнкÑ', 1721 typeMismatch: 'ÐевеÑнÑе знаÑениÑ, не ÑÐ¾Ð²Ð¿Ð°Ð´Ð°ÐµÑ Ñип даннÑÑ ', 1722 patternMismatch: 'ÐведиÑе даннÑе по маÑке', 1723 tooLong: 'СлиÑком длинное знаÑение', 1724 tooShort: 'СлиÑком коÑоÑкое знаÑение', 1725 rangeUnderflow: 'ÐнаÑение ниже диапазона', 1726 rangeOverflow: 'ÐнаÑение вÑÑе диапазона', 1727 stepMismatch: 'Шаг не ÑовпадаеÑ', 1728 badInput: 'ÐекоÑÑекÑнÑй ввод', 1729 customError: object.validationMessage, 1730 valid: true, 1731 }; 1732 1733 $.each(validity, function (indexInArray, value) { 1734 let messageKey = indexInArray; 1735 if (object.type === 'select-one' && messageKey === 'valueMissing') { 1736 messageKey = 'valueMissingSelect'; 1737 } 1738 if (value === true && russianMessages[messageKey] !== undefined) { 1739 message = russianMessages[messageKey]; 1740 } 1741 }); 1742 return message; 1743 }; 1744 1745 /* Validation input object and visual state */ 1746 jQuery.checkInputValidity = function (object) { 1747 let message = $.validityRussian(object); 1748 let parentField = $(object).closest($('.field')); 1749 let messageClass = 'invalid-message'; 1750 let messageHtml = '<ins class="' + messageClass + '" data-content=""></ins>'; 1751 let messageObject = null; 1752 1753 if (message === true) { 1754 // field valid 1755 $(object).removeClass('invalid'); 1756 if ($(parentField).length > 0) { 1757 messageObject = $(parentField).find($('.' + messageClass)); 1758 } else { 1759 messageObject = $(object).next('.' + messageClass); 1760 } 1761 if ($(messageObject).length > 0) { 1762 $(messageObject).remove(); 1763 } 1764 } else { 1765 // field not valid 1766 $(object).addClass('invalid'); 1767 if ($(parentField).length > 0 && $(messageObject).length === 0) { 1768 messageObject = $(parentField).find( $('.' + messageClass) ); 1769 if ($(messageObject).length === 0) { 1770 $(parentField).append(messageHtml); 1771 messageObject = $(parentField).find($('.' + messageClass)); 1772 } 1773 } else { 1774 messageObject = $(object).next($('.' + messageClass)); 1775 if ($(messageObject).length === 0) { 1776 $(object).after(messageHtml); 1777 messageObject = $(object).next('.' + messageClass); 1778 } 1779 } 1780 $(messageObject).data('content', message).attr('data-content', message); 1781 } 1782 return true; 1783 }; 1784 1785 /* Bind form validation catch to prevent defaults bubbles */ 1786 let forms = document.querySelectorAll('form'); 1787 $.each(forms, function () { 1788 this.addEventListener("invalid", function (event) { 1789 event.preventDefault(); 1790 let invalidElement = event.target; 1791 $.checkInputValidity(invalidElement); 1792 }, true); 1793 }); 1794 1795 /* Validation fields on events */ 1796 $('body').on('invalid change focus blur keyup', ':input:not([type=button]):not
1796([type=submit]):not([type=reset]):not([type=search])', function (e) { 1797 e.preventDefault(); 1798 $.checkInputValidity(this); 1799 }); 1800 1801 // initial data-type="password" from text to password 1802 $('input[data-type="password"]').each(function () { 1803 let type = $(this).prop('type'); 1804 if ( type !== 'password' ) { 1805 $(this).prop('type','password'); 1806 } 1807 }) 1808 1809 /* PASSWORDS VIEW */ 1810 $('.password-view').on('click',function(){ 1811 let inputObj = $(this).parent().find( $('input#password, input[name="password"], input[data-name="password"], input[data-type="password"]') ); 1812 let svgUse = $(this).find( $('svg use') ); 1813 let showIcon = $(this).data('show-icon'); 1814 let hideIcon = $(this).data('hide-icon'); 1815 if ( $(inputObj).length > 0 ) { 1816 let type = $(inputObj).prop('type'); 1817 if ( type === 'password' ) { 1818 $(inputObj).prop('type','text'); 1819 $(svgUse).attr('xlink:href',hideIcon); 1820 } else { 1821 $(inputObj).prop('type','password'); 1822 $(svgUse).attr('xlink:href',showIcon); 1823 } 1824 } 1825 }); 1826 1827 /* INPUT MASKS */ 1828 $('input[data-mask]').each(function () { 1829 let mask = $(this).data('mask'); 1830 if (mask !== '' && mask !== undefined) { 1831 $(this).inputmask(mask); 1832 } 1833 }); 1834 1835 /* NEWS COVER */ 1836 $.setCoverNewsTabActive = function (target) { 1837 $('[data-news-tab-switch]').each(function(){ 1838 let thisObject = $(this); 1839 $(thisObject).removeClass('active'); 1840 let currentSwitchTarget = $(this).data('target'); 1841 if ( currentSwitchTarget === target ) { 1842 $(thisObject).addClass('active'); 1843 } 1844 }); 1845 $('[data-news-cover-block]').each(function(){ 1846 $(this).removeClass('active').addClass('not-active'); 1847 1848 }); 1849 let targetElementID = '#cover_'+target; 1850 $(targetElementID).removeClass('not-active').addClass('active'); 1851 $.cookie('newsCoverActiveTab', target, { expires: 365, path: '/', domain: window.location.hostname }); 1852 return true; 1853 } 1854 1855 $.getCoverNewsTabActive = function () { 1856 let activeBlock; 1857 let currentBlock = null; 1858 let cookieBlock = $.cookie('newsCoverActiveTab'); 1859 if ( cookieBlock === null ) { 1860 activeBlock = 'ekb'; 1861 } else { 1862 $('[data-news-tab-switch]').each(function(){ 1863 let thisObject = $(this); 1864 let currentSwitchTarget = $(thisObject).data('target'); 1865 if ( cookieBlock === currentSwitchTarget ) { 1866 currentBlock = currentSwitchTarget; 1867 } 1868 if ( currentBlock === null ) { 1869 activeBlock = 'ekb'; 1870 } else { 1871 activeBlock = currentBlock; 1872 } 1873 }); 1874 } 1875 return activeBlock; 1876 } 1877 1878 let coverNewsActiveTab = $.getCoverNewsTabActive(); 1879 $.setCoverNewsTabActive(coverNewsActiveTab); 1880 1881 $('[data-news-tab-switch]').on('click',function(event){ 1882 event.preventDefault(); 1883 let target = $(this).data('target'); 1884 $.setCoverNewsTabActive(target); 1885 }); 1886 1887 /* close modals on ESC */ 1888 function observeKeyPress(e) { 1889 if ((e.keyCode === 27 || (e.DOM_VK_ESCAPE === 27 && e.which === 0))) $.closeModal(e); 1890 } 1891 1892 /* set selector value */ 1893 function setSelectValue(selectorObj, value) { 1894 $(selectorObj).find($('option')).each(function () { 1895 if ($(this).prop('value') === value) { 1896 $(this).prop('selected', true).attr('selected', true); 1897 } else { 1898 $(this).prop('selected', false).attr('selected', false); 1899 } 1900 }); 1901 // check if pseudo selector and set title 1902 if ($(selectorObj).parent().find('.title').length > 0) { 1903 let currentLabel = $(selectorObj).find($('option:selected')).text(); 1904 $(selectorObj).parent().find('.title').text(currentLabel); 1905 } 1906 } 1907 1908 function imageIsUralwebChecked( imageObj ) { 1909 let re = /check-uralweb|smiles/i; 1910 let tsrc = $(imageObj).attr('src'); 1911 return tsrc.match(re); 1912 } 1913 1914 jQuery.ajaxErrorHandler = function (err) { 1915 console.log(err); 1916 if (err.status === 403) { 1917 $.alertMessage('ÐÑ Ð½Ðµ имееÑе пÑав на ÑÑо дейÑÑвие, ÑÑебÑеÑÑÑ Ð°Ð²ÑоÑизаÑиÑ',true); 1918 } 1919 if (err.status === 404) { 1920 $.alertMessage('ÐбÑÐµÐºÑ Ð½Ðµ найден',true); 1921 } 1922 if (err.status === 406) { 1923 $.alertMessage('Ðе ÑÐºÐ°Ð·Ð°Ð½Ñ Ð½ÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼Ñе даннÑе',true); 1924 } 1925 } 1926 1927 jQuery.getMessageStringFromResponse = function (messageObj){ 1928 let message = ''; 1929 if ( typeof messageObj === 'string') { 1930 message = messageObj; 1931 } else if ( typeof messageObj.text === 'string') { 1932 message = messageObj.text; 1933 } 1934 return message; 1935 } 1936 1937 jQuery.autoHideAlertMessage = function (message = '', error = false, floating=false) { 1938 let alertMessageObj = $.alertMessage(message, error, floating); 1939 setTimeout(function (){ 1940 $.alertMessageHide(alertMessageObj); 1941 },3000); 1942 } 1943 1944 /* alert-message */ 1945 jQuery.alertMessage = function (message = '', error = false, floating=false) { 1946 let alertSelector = 'body .alert-message';
1947 if ( floating === true ) { 1948 alertSelector = alertSelector+'.floating'; 1949 } 1950 let alertMessageObj = $(alertSelector); 1951 if ($(alertMessageObj).length > 0) { 1952 if (error === true) { 1953 $(alertMessageObj).addClass('error'); 1954 } 1955 $(alertMessageObj).text(message); 1956 $(alertMessageObj).on('click', function () { 1957 $.alertMessageHide(alertMessageObj); 1958 }); 1959 return alertMessageObj; 1960 } else { 1961 return undefined; 1962 } 1963 } 1964 jQuery.alertMessageHide = function (alertMessageObj){ 1965 if ( alertMessageObj === undefined ) { 1966 alertMessageObj = $('body .alert-message'); 1967 } 1968 if ($(alertMessageObj).length > 0) { 1969 $(alertMessageObj).text(''); 1970 $(alertMessageObj).removeClass('error'); 1971 $(alertMessageObj).off('click'); 1972 } 1973 } 1974 1975 jQuery.classIsDropDownTarget = function (object) { 1976 let classList = $(object).attr('class').split(/\s+/); 1977 for (let i in classList) { 1978 let objectWithTarget = $('[data-dropdown-target="'+classList[i]+'"]'); 1979 if ( $(objectWithTarget).length > 0 ) { 1980 let openedClass = $(objectWithTarget).data('opened-class'); 1981 if ( openedClass !== undefined ) { 1982 return openedClass; 1983 } 1984 } 1985 } 1986 return undefined; 1987 } 1988 1989 jQuery.closeModalOnResize = function () { 1990 let openerObject = $('[data-opener-active=true]'); 1991 let openedObject = $('[data-opened=true]'); 1992 1993 if ($(openerObject).css('display') === 'none' && $(openedObject).hasClass('opened')) { 1994 $.closeModal(openedObject); 1995 } 1996 } 1997 1998 jQuery.isInViewport = function (el) { 1999 if ( el === null ) return false; 2000 const rect = el.getBoundingClientRect(); 2001 let recTop = parseInt(rect.top); 2002 let recLeft = parseInt(rect.left); 2003 let rectBottom = parseInt(rect.bottom); 2004 let rectRight = parseInt(rect.right); 2005 let isInViewport = ( 2006 recTop >= 0 && recLeft >= 0 && 2007 rectBottom <= (window.innerHeight || document.documentElement.clientHeight) && 2008 rectRight <= (window.innerWidth || document.documentElement.clientWidth) 2009 ); 2010 return isInViewport; 2011 } 2012 2013 jQuery.openModal = function (targetObject) { 2014 let bodyObj = $('body'); 2015 $(targetObject).addClass('opened').data('opened', true).attr('data-opened', 'true'); 2016 $(bodyObj).addClass('overflow-hidden'); 2017 $(bodyObj).append('<div class="modal-overlay"></div>'); 2018 // bind target .close class close 2019 $(targetObject).on('click', '.close', function () { 2020 $.closeModal(targetObject); 2021 }); 2022 // bind keyboadrd close 2023 window.addEventListener('keyup', observeKeyPress); 2024 // bind overlay click close 2025 $('.modal-overlay').on('click', function (e) { 2026 $.closeModal(targetObject); 2027 }); 2028 } 2029 2030 /* close modal element */ 2031 jQuery.closeModal = function (eventOrObject) { 2032 let openedObject; 2033 if (eventOrObject instanceof Event && eventOrObject.type === 'keyup') { 2034 // keyboard event, find opened element 2035 openedObject = $('[data-opened=true]'); 2036 } else { 2037 // object here 2038 openedObject = eventOrObject; 2039 } 2040 // remove opened state from target 2041 $(openedObject).removeClass('opened').data('opened', false).attr('data-opened', 'false'); 2042 // check if hide on close then add hidden 2043 if ($(openedObject).data('hide-on-close') === true) { 2044 $(openedObject).addClass('hidden'); 2045 } 2046 // get opener 2047 let openerObject = $('[data-opener-active=true]'); 2048 let openerTarget = $(openerObject).data('target'); 2049 // remove opener state 2050 $(openerObject).removeClass('opened').data('opener-active', false).attr('data-opener-active', 'false'); 2051 // remove body overflow 2052 $('body').removeClass('overflow-hidden'); 2053 // remove overlay 2054 $('.modal-overlay').remove(); 2055 // unbind kkeyboard listener 2056 window.removeEventListener('keyup', observeKeyPress); 2057 $(openedObject).trigger('modal:close'); 2058 } 2059 2060 /* global actions */ 2061 /* to top button visibility */ 2062 $(window).on('scroll', function() { 2063 let toTopScrollCheck= null; 2064 let toTopScrollCheckerJQ = $('header'); 2065 if ( $(toTopScrollCheckerJQ).length > 0 ) { 2066 toTopScrollCheck = $(toTopScrollCheckerJQ).get()[0]; 2067 } 2068 let toTopButton = $('.to-top'); 2069 if (toTopScrollCheck !== null && $.isInViewport(toTopScrollCheck)) { 2070 $(toTopButton).addClass('hide'); 2071 $(toTopButton).off('click'); 2072 } else { 2073 $(toTopButton).removeClass('hide'); 2074 $(toTopButton).on('click',function(){ 2075 $(window).scrollTop(0); 2076 }); 2077 } 2078 }); 2079 2080 /* uw-navigation */ 2081 let expanderMode = false;
2082 2083 jQuery.zeroLinkEvent = function (eventObj,event) { 2084 let targetObj = event.target; 2085 let isExpander = $(targetObj).hasClass('expander'); 2086 let parentUl = $(eventObj).closest($('ul')); 2087 let parentLi = $(eventObj).closest($('li')); 2088 2089 if ( isExpander === true ) { 2090 event.preventDefault(); 2091 expanderMode = true; 2092 if ( expanderMode === true && event.type === 'click') { 2093 console.log('expander click'); 2094 $(parentUl).find( $('li') ).removeClass('hovered').removeClass('active'); 2095 $(parentLi).addClass('hovered'); 2096 $(parentLi).get(0).scrollIntoView({ behavior: "smooth" }); 2097 expanderMode = false; 2098 } 2099 } else { 2100 if ( expanderMode === false ) { 2101 let hoverClass = $(parentLi).data('hover-class'); 2102 if (event.type === 'mouseenter') { 2103 $(parentLi).addClass(hoverClass); 2104 $(parentUl).find($('[data-hover-class]')).removeClass('active'); 2105 } 2106 if (event.type === 'mouseleave') { 2107 $(parentLi).removeClass(hoverClass); 2108 $(parentUl).find($('[data-active]')).addClass('active'); 2109 } 2110 } 2111 } 2112 } 2113 2114 $('.uw-navigation [data-hover-class]').on('mouseenter mouseleave click',function (event){ 2115 $.zeroLinkEvent($(this),event); 2116 }); 2117 2118 $('.mobile-menu-expander').on('click', 'button',function (event){ 2119 let expanderObj = $(this).closest( $('.mobile-menu-expander') ); 2120 let target = $(expanderObj).data('target'); 2121 let openedClass = $(expanderObj).data('opened-class'); 2122 let targetObj = $('.'+target); 2123 if ( $(targetObj).length > 0 ) { 2124 let bodyObj = $('body'); 2125 if ( $(expanderObj).hasClass(openedClass) && $(targetObj).hasClass(openedClass) ) { 2126 $(expanderObj).removeClass(openedClass); 2127 $(targetObj).removeClass(openedClass); 2128 $(bodyObj).removeClass('no-scroll'); 2129 } else { 2130 $(expanderObj).addClass(openedClass); 2131 $(targetObj).addClass(openedClass); 2132 $(bodyObj).addClass('no-scroll'); 2133 // close all dropdowns 2134 $('.dropdown-menu.opened').removeClass('opened'); 2135 } 2136 } 2137 }); 2138 2139 $('[data-dropdown-target]').on('click',function (){ 2140 let target = $(this).data('dropdown-target'); 2141 let openedClass = $(this).data('opened-class'); 2142 let targetObj = $('.'+target); 2143 if ( $(targetObj).length > 0 ) { 2144 if ( $(targetObj).hasClass(openedClass) ) { 2145 $(targetObj).removeClass(openedClass); 2146 } else { 2147 $(targetObj).addClass(openedClass); 2148 } 2149 } 2150 }) 2151 2152 $('body').on('click','.nav-tabs [data-toggle]',function (e){ 2153 e.preventDefault(); 2154 let target = $(this).data('target'); 2155 let targetObj = $(target); 2156 let parentLi = $(this).closest($('li') ); 2157 let parentNav = $(this).closest($('.nav') ); 2158 let tabContents = $(parentNav).next($('.tab-content') ); 2159 if ( $(tabContents).length > 0 && $(targetObj).length > 0 && $(parentNav).length > 0 ) { 2160 $(parentNav).find( $('li') ).removeClass('active'); 2161 $(parentLi).addClass('active'); 2162 $(tabContents).find( $('.tab-pane') ).removeClass('active'); 2163 $(targetObj).addClass('active'); 2164 } 2165 }); 2166 2167 /* sync out form element from out element -> form */ 2168 $('body').on('change', ':input[data-target]', function () { 2169 let targetFormId = $(this).data('target'); 2170 if (targetFormId !== undefined && targetFormId !== '') { 2171 let elementName = $(this).attr('name'); 2172 let elementValue = $(this).val(); 2173 let targetElement = null; 2174 if (targetFormId === 'self') { 2175 targetElement = $(this); 2176 } else { 2177 targetElement = $('form#' + targetFormId + ' [name="' + elementName + '"]'); 2178 } 2179 if ($(targetElement).length > 0) { 2180 if ($(targetElement).prop('type') === 'select-one') { 2181 setSelectValue($(targetElement), elementValue); 2182 } else { 2183 $(targetElement).val(elementValue); 2184 } 2185 if (targetFormId !== 'self') { 2186 $(targetElement).trigger('change'); 2187 } 2188 } 2189 } 2190 }); 2191 2192 /* sync self-targeted pseudo selector initial value */ 2193 $(':input[data-target="self"]').each(function () { 2194 let targetElement = $(this); 2195 let elementValue = $(this).val(); 2196 if ($(targetElement).prop('type') === 'select-one') { 2197 setSelectValue($(targetElement), elementValue); 2198 } 2199 }); 2200 2201 $('body').on('click','.sticked .closer',function (e){ 2202 console.log('closer'); 2203 $(this).parent().hide(); 2204 }); 2205 2206 $('[data-toggle="collapse"]').on('click',function (e){ 2207 e.preventDefault(); 2208 let hideClass = 'hide'; 2209 let hideClassData = $(this).data('hide-class'); 2210 let hrefTarget = $(this).attr('href'); 2211 let targetData = $(this).data('target'); 2212 let parent = $(this).data('parent'); 2213 let target; 2214 if ( hideClassData !== undefined ) { 2215 hideClass = hideClassData; 2216 } 2217 if ( (hrefTarget === undefined || hrefTarget === '') && targetData !== undefined ) { 2218 target = targetData; 2219 } else { 2220 target = hrefTarget; 2221 } 2222 2223 if ( parent !== undefined && $(parent).length > 0 ) { 2224 // accodeon mode 2225 $(parent).find( $('.collapsed') ).addClass(hideClass); 2226 $(target).removeClass(hideClass); 2227 } else { 2228 // single mode 2229 $(target).toggleClass(hideClass); 2230 } 2231 }); 2232 2233 /* drop down */ 2234 $('body').on('click', '[data-dropdown="true"]', function (e) { 2235 console.log('click to [data-dropdown="true"]'); 2236 let ddSelector = '.dropdown-menu'; 2237 let objToToggle = $(this).find($(ddSelector)); 2238 if ($(e.target).closest(ddSelector).length === 0) { 2239 e.preventDefault(); 2240 // click on opener, not in dropdown 2241 $('.dropdown-menu').each(function () { 2242 if ($(this).is($(objToToggle))) { 2243 $(objToToggle).toggle(); 2244 $(objToToggle).find($('.close')).on('click', function () { 2245 $(objToToggle).hide(); 2246 $(objToToggle).find($('.close')).off('click'); 2247 }); 2248 // bind click outside 2249 $('html').on('click', function (e) { 2250 let target = e.target; 2251 if ($(target).parents('[data-dropdown]').length === 0) { 2252 $(objToToggle).hide(); 2253 $('html').off('click'); 2254 $(objToToggle).find($('.close')).off('click'); 2255 } 2256 }); 2257 } else { 2258 let openedClass = $.classIsDropDownTarget($(this)); 2259 if ( openedClass !== undefined ) { 2260 $(this).removeClass(openedClass); 2261 } else { 2262 $(this).hide(); 2263 } 2264 $(this).find($('.close')).off('click'); 2265 } 2266 }); 2267 } 2268 }); 2269 2270 /* head alerts click */ 2271 $('.user-alerts').on('click','a[data-url]',function (e){ 2272 e.preventDefault(); 2273 let url = $(this).data('url'); 2274 if ( url !== undefined && url !== '' ) { 2275 window.location.href=url; 2276 } 2277 }); 2278 2279 2280 $('form.search-form input[name="query"]').on('keyup search',function (e){ 2281 let formObj = $(this).closest( $('form') ); 2282 let thisObj = $(this); 2283 let thisQuery = $(thisObj).val(); 2284 let searchResult = $(formObj).find ( $('[data-role="search-result"]') ); 2285 if ( thisQuery.length>=3 && $(formObj).length > 0) { 2286 let formAction = $(formObj).attr('action'); 2287 let formMethod = $(formObj).attr('method'); 2288 $.ajax({ 2289 type: formMethod, 2290 url: formAction, 2291 dataType: 'json', 2292 data: { 2293 query: thisQuery, 2294 type:'json', 2295 src:'form', 2296 }, 2297 success: function(response){ 2298 if ( response.error === 0 ) { 2299 $(searchResult).html(response.content); 2300 $(searchResult).show(); 2301 $(document).on('click',function(event) { 2302 $(searchResult).hide(); 2303 $(searchResult).html(''); 2304 event.stopPropagation(); 2305 }); 2306 } else { 2307 $(searchResult).hide(); 2308 $(searchResult).html(''); 2309 $(document).off('click'); 2310 } 2311 } 2312 }); 2313 } else { 2314 // заÑиÑÑиÑÑ ÑезÑлÑÑÐ°Ñ Ð¸ ÑкÑÑÑÑ 2315 $(searchResult).hide(); 2316 $(searchResult).html(''); 2317 } 2318 }); 2319 2320 $(window).on('keydown',function (e){ 2321 let goLink; 2322 let neighborObj = $('nav.neighbor'); 2323 if ( $(neighborObj).length > 0 ) { 2324 let laterLink = $(neighborObj).find( $('li.later a') ); 2325 let beforeLink = $(neighborObj).find( $('li.before a') ); 2326 if ( (e.ctrlKey) && (e.key === 'ArrowRight' || e.key === 'ArrowLeft') ) { 2327 if ( $(laterLink).length > 0 && e.key === 'ArrowLeft' ) { 2328 goLink = $(laterLink).attr('href'); 2329 } 2330 if ( $(beforeLink).length > 0 && e.key === 'ArrowRight' ) { 2331 goLink = $(beforeLink).attr('href'); 2332 } 2333 if ( goLink !== '' && goLink !== undefined ) { 2334 window.location.href = goLink; 2335 } 2336 } 2337 } 2338 }); 2339 2340 /* content decorators */ 2341 $('.content-detail-body table').each(function(){ 2342 let thisTable = $(this); 2343 let tableBorder = $(thisTable).attr('border'); 2344 let classes = 'table table-condensed'; 2345 if ( tableBorder !== undefined && tableBorder > 0 ) { 2346 classes = classes + ' table-bordered'; 2347 } 2348 $(thisTable).removeClass('table table-condensed table-bordered').removeAttr('border').removeAttr('cellpadding').removeAttr('cellspacing').removeAttr('style').removeAttr('width');
2349 $(thisTable).addClass(classes); 2350 }); 2351 2352 $('.content-detail-body a').each(function(){ 2353 let linkHref = $(this).attr('href'); 2354 if ( linkHref ) { 2355 let pos = linkHref.indexOf("/link?"); 2356 if ( pos === 0 ) { 2357 $(this).attr('target','_blank'); 2358 } 2359 } 2360 }); 2361 2362 /* 2 img in one paragraph with no text */ 2363 $('.content-detail-body p:has(img)').each(function(){ 2364 let paragraphObj = $(this); 2365 let imagesList = $(paragraphObj).find( $('img') ); 2366 let imagesCount = $(imagesList).length; 2367 let paragraphText = $(paragraphObj).text().trim(); 2368 // еÑли каÑÑинки 2 и ÑекÑÑа Ð½ÐµÑ 2369 if ( imagesCount === 2 && paragraphText === '' ) { 2370 $(paragraphObj).addClass('paragraph-two-images'); 2371 $(imagesList).removeAttr('style'); 2372 } 2373 }); 2374 2375 /* images with no class */ 2376 $('.content-detail-body img:not([class])').each(function(){ 2377 // image object 2378 let imageObject = $(this); 2379 let parentObject = $(imageObject).parent(); 2380 let parentWidth = $(parentObject).width(); 2381 // alt text 2382 let altText = $(imageObject).attr('alt'); 2383 // float attribute 2384 let floatedType = $(imageObject).css('float'); 2385 2386 // image width 2387 let cssWidth = $(imageObject).width(); 2388 let attrWidth = $(imageObject).attr('width'); 2389 let tWidth = cssWidth; 2390 let wrapClass; 2391 let needNoted = false; 2392 2393 tWidth = attrWidth > 0 ? attrWidth : cssWidth; 2394 2395 // ÑиÑÑим ненÑжное 2396 $(imageObject).removeAttr('vspace').removeAttr('hspace').removeAttr('align').removeAttr('style'); 2397 2398 wrapClass = (tWidth <= parentWidth / 1.5) ? 'normal-image' : 'full-width-image'; 2399 2400 // need to be noted 2401 needNoted = !((floatedType === 'left' && tWidth <= parentWidth/2) || floatedType === 'right'); 2402 // check is uwChecked Image 2403 let imagesIsUWChecked = imageIsUralwebChecked($(imageObject)); 2404 // images plain, 2405 if ( imagesIsUWChecked === null ) { 2406 // no uwChecked Image, wrap this 2407 // if parent is not DIV 2408 if ( $(parentObject).prop('tagName') !== 'DIV') { 2409 // wrap noted 2410 if ( needNoted === true ) { 2411 $(this).wrap(function() { 2412 return '<div class="noted-img '+wrapClass+'"></div>'; 2413 }); 2414 } else { 2415 $(this).wrap(function() { 2416 return '<div class="clean-img '+wrapClass+'"></div>'; 2417 }); 2418 } 2419 } 2420 } else { 2421 // uwChecked Image, no wrap noted 2422 $(this).wrap(function() { 2423 return '<div class="clean-img '+wrapClass+'"></div>'; 2424 }); 2425 } 2426 2427 // еÑли ÑиÑина болÑÑе полÑÑоÑа ÑиÑин конÑейнеÑа и еÑÑÑ alt, Ñо ÑÐ½Ð¸Ð·Ñ Ð¿Ð¾Ñле каÑÑинки вÑÑкаеÑÑÑ Ð°Ð»ÑÑ-ÑекÑÑ ÐºÐ°Ðº подпиÑÑ 2428 if ( (tWidth >= parentWidth / 1.5) && altText !== '' && altText !== undefined ) { 2429 $(imageObject).after('<div class="alt-text">'+altText+'</div>'); 2430 } 2431 }); 2432 2433 /* Modals Windows opener */ 2434 $('[data-mode="modal"]').on('click', function () { 2435 let openerObject = $(this); 2436 let target = $(this).data('target'); 2437 if ( target.startsWith('#') === false ) { 2438 target = '.' + target; 2439 } 2440 let targetObject = $(target); 2441 if ( $(targetObject).length > 1 ) { 2442 targetObject = $(this).closest(targetObject); 2443 } 2444 if ($(targetObject).length === 1) { 2445 // check opener state is not opened 2446 if ($(openerObject).data('opener-active') !== true) { 2447 // add opener state 2448 $(openerObject).addClass('opened').data('opener-active', true).attr('data-opener-active', 'true'); 2449 // check if target hide on close and have hidden class 2450 if ($(targetObject).data('hide-on-close') === true && $(targetObject).hasClass('hidden')) { 2451 // remove hidden class 2452 $(targetObject).removeClass('hidden'); 2453 } 2454 // bind rezize 2455 window.addEventListener('resize', $.closeModalOnResize); 2456 // open modal 2457 $.openModal(targetObject); 2458 } 2459 } 2460 }); 2461 2462 /* input text maxlength */ 2463 $(':input[maxlength]').on('keyup change', function () { 2464 let maxLength = $(this).prop('maxlength'); 2465 let count = $(this).val().length; 2466 let counterObj = $(this).next('.counter'); 2467 if ($(counterObj).length > 0) { 2468 if (count > 0) { 2469 $(counterObj).text(count); 2470 } else { 2471 $(counterObj).text(''); 2472 } 2473 this.reportValidity(); 2474 } 2475 }); 2476 2477 $('.video-player iframe').removeAttr('height').removeAttr('width'); 2478 2479 // play vk videos in playlist 2480 $('[data-role="vk-video-frame-link"]').on('click',function (){ 2481 let vkVideoFrame = $('[data-role="vk-video-player"]'); 2482 let vkVideoUrl = $(this).data('url'); 2483 let vkVideoId = $(this).data('video-id'); 2484 if ( $(vkVideoFrame).length > 0 && vkVideoId && vkVideoUrl ) { 2485 $(vkVideoFrame).data('videoid',vkVideoId).attr('data-videoid', vkVideoId); 2486 $(vkVideoFrame).attr('src', vkVideoUrl); 2487 } 2488 }); 2489 2490 // author avatar move 2491 let newsAuthorData = $('.news-author-data'); 2492 let newsAuthorBody = $('.news-author-body'); 2493 if ( $(newsAuthorBody).length > 0 ) { 2494 let imageInsideParagraph = $(newsAuthorBody).find($('p:has(img) img') ); 2495 if ( $(imageInsideParagraph).length > 0 ) { 2496 $(imageInsideParagraph).removeAttr('style'); 2497 $(newsAuthorData).prepend( $(imageInsideParagraph)[0] ); 2498 $(newsAuthorBody).find( $('p:empty') ).remove(); 2499 } 2500 } 2501 2502 $('[data-read-more]').on('click', function (){ 2503 let hiddenTextObject = $('.text-hidden'); 2504 if ( $(hiddenTextObject).length > 0 ) { 2505 if ( $(hiddenTextObject).hasClass('no-show') ) { 2506 $(hiddenTextObject).removeClass('no-show'); 2507 } 2508 if ( $(hiddenTextObject).css('display') === 'none' ) { 2509 $(hiddenTextObject).css('display', 'block'); 2510 } 2511 $(this).remove(); 2512 } 2513 }); 2514 2515 $('[data-role="search-activate-button"]').on('click',function (e){ 2516 e.preventDefault(); 2517 let formInPageWrapper = $('.page-wrapper').find( $('.search-form') ); 2518 let formSearchModalMode = $('[ data-role="modal-search-form-container"]'); 2519 2520 if ( $(formInPageWrapper).length > 0 ) { 2521 // иÑем Ñам query и ÑокÑÑимÑÑ ÑÑда 2522 let searchInput = $(formInPageWrapper).find( $('input[type="search"]') ); 2523 $(searchInput).trigger('focus'); 2524 } else if ( $(formSearchModalMode).length > 0 ) { 2525 let formInModalContainer = $(formSearchModalMode).find( $('.search-form') ); 2526 let searchInput = $(formInModalContainer).find( $('input[type="search"]') ); 2527 // bind rezize 2528 window.addEventListener('resize', $.closeModalOnResize); 2529 // open search modal 2530 $.openModal( formSearchModalMode ); 2531 $(searchInput).trigger('focus'); 2532 2533 if ( typeof $.touch === 'function' ) { 2534 // bind swipeUp on body to close modal 2535 $('.modal-overlay').touch({ 2536 swipeThreshold: 50, 2537 }).on('swipeUp', function (e, info) { 2538 $.closeModal( formSearchModalMode ); 2539 $(formSearchModalMode).trigger('blur'); 2540 }); 2541 } 2542 $(searchInput).on('search',function (event){ 2543 $.closeModal( formSearchModalMode ); 2544 }); 2545 } else { 2546 window.location.href = '/news/search'; 2547 } 2548 }); 2549 2550});; 2551 2552let loaded_pages_auto = []; 2553let loaded_dates_auto = []; 2554let loaded_urls_auto = []; 2555 2556loaded_urls_auto.push(window.location.pathname + window.location.search); 2557; 2558(function( $ ) { 2559 2560 $.fn.hyphenate = function() { 2561 var all = "[абвгдеÑжзийклмнопÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑ]", 2562 glas = "[аеÑиоÑÑÑÑ\Ñ]", 2563 sogl = "[бвгджзклмнпÑÑÑÑÑ ÑÑÑÑ]", 2564 zn = "[йÑÑ]", 2565 shy = "\xAD", 2566 re = []; 2567 2568 re[1] = new RegExp("("+zn+")("+all+all+")","ig"); 2569 re[2] = new RegExp("("+glas+")("+glas+all+")","ig"); 2570 re[3] = new RegExp("("+glas+sogl+")("+sogl+glas+")","ig"); 2571 re[4] = new RegExp("("+sogl+glas+")("+sogl+glas+")","ig"); 2572 re[5] = new RegExp("("+glas+sogl+")("+sogl+sogl+glas+")","ig"); 2573 re[6] = new RegExp("("+glas+sogl+sogl+")("+sogl+sogl+glas+")","ig"); 2574 return this.each(function() { 2575 var text = $(this).html(); 2576 for (var i = 1; i < 7; ++i) { 2577 text = text.replace(re[i], "$1"+shy+"$2"); 2578 } 2579 $(this).html(text); 2580 }); 2581 }; 2582 2583}( window.jQuery ));/* 2584* $ lightbox_me 2585* By: Buck Wilson 2586* Version : 2.4 2587* 2588* Licensed under the Apache License, Version 2.0 (the "License");
2589* you may not use this file except in compliance with the License. 2590* You may obtain a copy of the License at 2591* 2592* http://www.apache.org/licenses/LICENSE-2.0 2593* 2594* Unless required by applicable law or agreed to in writing, software 2595* distributed under the License is distributed on an "AS IS" BASIS, 2596* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2597* See the License for the specific language governing permissions and 2598* limitations under the License. 2599*/ 2600 2601 2602;(function($) { 2603 2604 $.fn.lightbox_me = function(options) { 2605 2606 return this.each(function() { 2607 2608 var 2609 opts = $.extend({}, $.fn.lightbox_me.defaults, options), 2610 $overlay = $(), 2611 $self = $(this), 2612 $iframe = $('<iframe id="foo" style="z-index: ' + (opts.zIndex + 1) + ';border: none; margin: 0; padding: 0; position: absolute; width: 100%; height: 100%; top: 0; left: 0; filter: mask();"/>'); 2613 2614 if (opts.showOverlay) { 2615 //check if there's an existing overlay, if so, make subequent ones clear 2616 var $currentOverlays = $(".js_lb_overlay:visible"); 2617 if ($currentOverlays.length > 0){ 2618 $overlay = $('<div class="lb_overlay_clear js_lb_overlay"/>'); 2619 } else { 2620 $overlay = $('<div class="' + opts.classPrefix + '_overlay js_lb_overlay"/>'); 2621 } 2622 } 2623 2624 /*---------------------------------------------------- 2625 DOM Building 2626 ---------------------------------------------------- */ 2627 $('body').append($self.hide()).append($overlay); 2628 2629 2630 /*---------------------------------------------------- 2631 Overlay CSS stuffs 2632 ---------------------------------------------------- */ 2633 2634 // set css of the overlay 2635 if (opts.showOverlay) { 2636 setOverlayHeight(); // pulled this into a function because it is called on window resize. 2637 $overlay.css({ position: 'absolute', width: '100%', top: 0, left: 0, right: 0, bottom: 0, zIndex: (opts.zIndex + 2), display: 'none' }); 2638 if (!$overlay.hasClass('lb_overlay_clear')){ 2639 $overlay.css(opts.overlayCSS); 2640 } 2641 } 2642 2643 /*---------------------------------------------------- 2644 Animate it in. 2645 ---------------------------------------------------- */ 2646 // 2647 if (opts.showOverlay) { 2648 $overlay.fadeIn(opts.overlaySpeed, function() { 2649 setSelfPosition(); 2650 $self[opts.appearEffect](opts.lightboxSpeed, function() { setOverlayHeight(); setSelfPosition(); opts.onLoad()}); 2651 }); 2652 } else { 2653 setSelfPosition(); 2654 $self[opts.appearEffect](opts.lightboxSpeed, function() { opts.onLoad()}); 2655 } 2656 2657 /*---------------------------------------------------- 2658 Hide parent if parent specified (parentLightbox should be jquery reference to any parent lightbox) 2659 ---------------------------------------------------- */ 2660 if (opts.parentLightbox) { 2661 opts.parentLightbox.fadeOut(200); 2662 } 2663 2664 2665 /*---------------------------------------------------- 2666 Bind Events 2667 ---------------------------------------------------- */ 2668 2669 $(window).resize(setOverlayHeight) 2670 .resize(setSelfPosition) 2671 .scroll(setSelfPosition); 2672 2673 $(window).bind('keyup.lightbox_me', observeKeyPress); 2674 2675 if (opts.closeClick) { 2676 $overlay.click(function(e) { closeLightbox(); e.preventDefault; }); 2677 } 2678 $self.delegate(opts.closeSelector, "click", function(e) { 2679 closeLightbox(); e.preventDefault(); 2680 }); 2681 $self.bind('close', closeLightbox); 2682 $self.bind('reposition', setSelfPosition); 2683 2684 2685 2686 /*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2687 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- */ 2688 2689 2690 /*---------------------------------------------------- 2691 Private Functions 2692 ---------------------------------------------------- */ 2693 2694 /* Remove or hide all elements */ 2695 function closeLightbox() { 2696 var s = $self[0].style; 2697 if (opts.destroyOnClose) { 2698 $self.add($overlay).remove(); 2699 } else { 2700 $self.add($overlay).hide(); 2701 } 2702 2703 //show the hidden parent lightbox 2704 if (opts.parentLightbox) { 2705 opts.parentLightbox.fadeIn(200); 2706 } 2707 if (opts.preventScroll) { 2708 $('body').css('overflow', ''); 2709 } 2710 $iframe.remove(); 2711 2712 // clean up events. 2713 $self.undelegate(opts.closeSelector, "click"); 2714 $self.unbind('close', closeLightbox); 2715 $self.unbind('repositon', setSelfPosition); 2716 2717 $(window).unbind('resize', setOverlayHeight); 2718 $(window).unbind('resize', setSelfPosition); 2719 $(window).unbind('scroll', setSelfPosition); 2720 $(window).unbind('keyup.lightbox_me'); 2721 opts.onClose(); 2722 } 2723 2724 2725 /* Function to bind to the window to observe the escape/enter key press */ 2726 function observeKeyPress(e) {
2727 if((e.keyCode == 27 || (e.DOM_VK_ESCAPE == 27 && e.which==0)) && opts.closeEsc) closeLightbox(); 2728 } 2729 2730 2731 /* Set the height of the overlay 2732 : if the document height is taller than the window, then set the overlay height to the document height. 2733 : otherwise, just set overlay height: 100% 2734 */ 2735 function setOverlayHeight() { 2736 if ($(window).height() < $(document).height()) { 2737 $overlay.css({height: $(document).height() + 'px'}); 2738 $iframe.css({height: $(document).height() + 'px'}); 2739 } else { 2740 $overlay.css({height: '100%'}); 2741 } 2742 } 2743 2744 2745 /* Set the position of the modal'd window ($self) 2746 : if $self is taller than the window, then make it absolutely positioned 2747 : otherwise fixed 2748 */ 2749 function setSelfPosition() { 2750 var s = $self[0].style; 2751 2752 // reset CSS so width is re-calculated for margin-left CSS 2753 $self.css({left: '50%', marginLeft: ($self.outerWidth() / 2) * -1, zIndex: (opts.zIndex + 3) }); 2754 2755 2756 /* we have to get a little fancy when dealing with height, because lightbox_me 2757 is just so fancy. 2758 */ 2759 2760 // if the height of $self is bigger than the window and self isn't already position absolute 2761 if (($self.height() + 80 >= $(window).height()) && ($self.css('position') != 'absolute')) { 2762 2763 // we are going to make it positioned where the user can see it, but they can still scroll 2764 // so the top offset is based on the user's scroll position. 2765 var topOffset = $(document).scrollTop() + 40; 2766 $self.css({position: 'absolute', top: topOffset + 'px', marginTop: 0}) 2767 } else if ($self.height()+ 80 < $(window).height()) { 2768 //if the height is less than the window height, then we're gonna make this thing position: fixed. 2769 if (opts.centered) { 2770 $self.css({ position: 'fixed', top: '50%', marginTop: ($self.outerHeight() / 2) * -1}) 2771 } else { 2772 $self.css({ position: 'fixed'}).css(opts.modalCSS); 2773 } 2774 if (opts.preventScroll) { 2775 $('body').css('overflow', 'hidden'); 2776 } 2777 } 2778 } 2779 2780 }); 2781 2782 2783 2784 }; 2785 2786 $.fn.lightbox_me.defaults = { 2787 2788 // animation 2789 appearEffect: "fadeIn", 2790 appearEase: "", 2791 overlaySpeed: 250, 2792 lightboxSpeed: 300, 2793 2794 // close 2795 closeSelector: ".close", 2796 closeClick: true, 2797 closeEsc: true, 2798 2799 // behavior 2800 destroyOnClose: false, 2801 showOverlay: true, 2802 parentLightbox: false, 2803 preventScroll: false, 2804 2805 // callbacks 2806 onLoad: function() {}, 2807 onClose: function() {}, 2808 2809 // style 2810 classPrefix: 'lb', 2811 zIndex: 999, 2812 centered: false, 2813 modalCSS: {top: '40px'}, 2814 overlayCSS: {background: 'black', opacity: .3} 2815 } 2816})(jQuery);/*! 2817 * dist/jquery.inputmask 2818 * https://github.com/RobinHerbots/Inputmask 2819 * Copyright (c) 2010 - 2022 Robin Herbots 2820 * Licensed under the MIT license 2821 * Version: 5.0.8-beta.24 2822 */ 2823!function(e, t) { 2824 if ("object" == typeof exports && "object" == typeof module) module.exports = t(require("jquery")); else if ("function" == typeof define && define.amd) define([ "jquery" ], t); else { 2825 var i = "object" == typeof exports ? t(require("jquery")) : t(e.jQuery); 2826 for (var a in i) ("object" == typeof exports ? exports : e)[a] = i[a]; 2827 } 2828}(self || this, (function(e) { 2829 return function() { 2830 "use strict"; 2831 var t = { 2832 3046: function(e, t, i) { 2833 var a; 2834 Object.defineProperty(t, "__esModule", { 2835 value: !0 2836 }), t.default = void 0, i(3851), i(219), i(207), i(5296); 2837 var n = ((a = i(2394)) && a.__esModule ? a : { 2838 default: a 2839 }).default; 2840 t.default = n; 2841 }, 2842 8741: function(e, t) { 2843 Object.defineProperty(t, "__esModule", { 2844 value: !0 2845 }), t.default = void 0; 2846 var i = !("undefined" == typeof window || !window.document || !window.document.createElement); 2847 t.default = i; 2848 }, 2849 3976: function(e, t, i) { 2850 Object.defineProperty(t, "__esModule", { 2851 value: !0 2852 }), t.default = void 0; 2853 var a, n = (a = i(5581)) && a.__esModule ? a : { 2854 default: a 2855 }; 2856 var r = { 2857 _maxTestPos: 500, 2858 placeholder: "_", 2859 optionalmarker: [ "[", "]" ], 2860 quantifiermarker: [ "{", "}" ], 2861 groupmarker: [ "(", ")" ], 2862 alternatormarker: "|", 2863 escapeChar: "\\", 2864 mask: null, 2865 regex: null, 2866 oncomplete: function() {}, 2867 onincomplete: function() {}, 2868 oncleared: function() {}, 2869 repeat: 0, 2870 greedy: !1, 2871 autoUnmask: !1, 2872 removeMaskOnSubmit: !1, 2873 clearMaskOnLostFocus: !0, 2874 insertMode: !0, 2875 insertModeVisual: !0, 2876 clearIncomplete: !1, 2877 alias: null, 2878 onKeyDown: function() {}, 2879 onBeforeMask: null, 2880 onBeforePaste: function(e, t) { 2881 return "function" == typeof t.onBeforeMask ? t.onBeforeMask.call(this, e, t) : e; 2882 }, 2883 onBeforeWrite: null, 2884 onUnMask: null, 2885 showMaskOnFocus: !0, 2886 showMaskOnHover: !0, 2887 onKeyValidation: function() {}, 2888 skipOptionalPartCharacter: " ", 2889 numericInput: !1, 2890 rightAlign: !1, 2891 undoOnEscape: !0, 2892 radixPoint: "", 2893 _radixDance: !1, 2894 groupSeparator: "", 2895 keepStatic: null, 2896 positionCaretOnTab: !0, 2897 tabThrough: !1, 2898 supportsInputType: [ "text", "tel", "url", "password", "search" ], 2899 ignorables: [ n.default.BACKSPACE, n.default.TAB, n.default["PAUSE/BREAK"], n.default.ESCAPE, n.default.PAGE_UP, n.default.PAGE_DOWN, n.default.END, n.default.HOME, n.default.LEFT, n.default.UP, n.default.RIGHT, n.default.DOWN, n.default.INSERT, n.default.DELETE, 93, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 0, 229 ], 2900 isComplete: null, 2901 preValidation: null, 2902 postValidation: null, 2903 staticDefinitionSymbol: void 0, 2904 jitMasking: !1, 2905 nullable: !0, 2906 inputEventOnly: !1, 2907 noValuePatching: !1, 2908 positionCaretOnClick: "lvp", 2909 casing: null, 2910 inputmode: "text", 2911 importDataAttributes: !0, 2912 shiftPositions: !0, 2913 usePrototypeDefinitions: !0, 2914 validationEventTimeOut: 3e3, 2915 substitutes: {} 2916 }; 2917 t.default = r; 2918 }, 2919 7392: function(e, t) { 2920 Object.defineProperty(t, "__esModule", { 2921 value: !0 2922 }), t.default = void 0; 2923 t.default = { 2924 9: { 2925 validator: "[0-9\uff10-\uff19]", 2926 definitionSymbol: "*" 2927 }, 2928 a: { 2929 validator: "[A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]", 2930 definitionSymbol: "*" 2931 }, 2932 "*": { 2933 validator: "[0-9\uff10-\uff19A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]" 2934 } 2935 }; 2936 }, 2937 3287: function(e, t, i) { 2938 Object.defineProperty(t, "__esModule", { 2939 value: !0 2940 }), t.default = void 0; 2941 var a, n = (a = i(7957)) && a.__esModule ? a : { 2942 default: a 2943 }; 2944 if (void 0 === n.default) throw "jQuery not loaded!"; 2945 var r = n.default; 2946 t.default = r; 2947 }, 2948 9845: function(e, t, i) { 2949 Object.defineProperty(t, "__esModule", { 2950 value: !0 2951 }), t.mobile = t.iphone = t.iemobile = t.ie = void 0; 2952 var a, n = (a = i(9380)) && a.__esModule ? a : { 2953 default: a 2954 }; 2955 var r = n.default.navigator && n.default.navigator.userAgent || "", o = r.indexOf("MSIE ") > 0 || r.indexOf("Trident/") > 0, s = n.default.navigator && n.default.navigator.maxTouchPoints || "ontouchstart" in n.default, l = /iemobile/i.test(r), u = /iphone/i.test(r) && !l; 2956 t.iphone = u, t.iemobile = l, t.mobile = s, t.ie = o; 2957 }, 2958 7184: function(e, t) { 2959 Object.defineProperty(t, "__esModule", { 2960 value: !0 2961 }), t.default = function(e) { 2962 return e.replace(i, "\\$1"); 2963 }; 2964 var i = new RegExp("(\\" + [ "/", ".", "*", "+", "?", "|", "(", ")", "[", "]", "{", "}", "\\", "$", "^" ].join("|\\") + ")", "gim"); 2965 }, 2966 6030: function(e, t, i) { 2967 Object.defineProperty(t, "__esModule", { 2968 value: !0 2969 }), t.EventHandlers = void 0; 2970 var a, n = i(8711), r = (a = i(5581)) && a.__esModule ? a : { 2971 default: a 2972 }, o = i(9845), s = i(7215), l = i(7760), u = i(4713); 2973 function c(e, t) { 2974 var i = "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"]; 2975 if (!i) { 2976 if (Array.isArray(e) || (i = function(e, t) { 2977 if (!e) return; 2978 if ("string" == typeof e) return f(e, t); 2979 var i = Object.prototype.toString.call(e).slice(8, -1); 2980 "Object" === i && e.constructor && (i = e.constructor.name); 2981 if ("Map" === i || "Set" === i) return Array.from(e); 2982 if ("Arguments" === i || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)) return f(e, t); 2983 }(e)) || t && e && "number" == typeof e.length) { 2984 i && (e = i); 2985 var a = 0, n = function() {}; 2986 return { 2987 s: n, 2988 n: function() { 2989 return a >= e.length ? { 2990 done: !0 2991 } : { 2992 done: !1, 2993 value: e[a++] 2994 }; 2995 }, 2996 e: function(e) { 2997 throw e; 2998 }, 2999 f: n 3000 }; 3001 } 3002 throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 3003 } 3004 var r, o = !0, s = !1; 3005 return { 3006 s: function() { 3007 i = i.call(e); 3008 }, 3009 n: function() { 3010 var e = i.next(); 3011 return o = e.done, e; 3012 }, 3013 e: function(e) { 3014 s = !0, r = e; 3015 }, 3016 f: function() { 3017 try { 3018 o || null == i.return || i.return(); 3019 } finally { 3020 if (s) throw r; 3021 } 3022 } 3023 }; 3024 } 3025 function f(e, t) { 3026 (null == t || t > e.length) && (t = e.length); 3027 for (var i = 0, a = new Array(t); i < t; i++) a[i] = e[i]; 3028 return a; 3029 } 3030 var d = { 3031 keydownEvent: function(e) { 3032 var t = this.inputmask, i = t.opts, a = t.dependencyLib, c = t.maskset, f = this, d = a(f), p = e.keyCode, h = n.caret.call(t, f), v = i.onKeyDown.call(this, e, n.getBuffer.call(t), h, i); 3033 if (void 0 !== v) return v; 3034 if (p === r.default.BACKSPACE || p === r.default.DELETE || o.iphone && p === r.default.BACKSPACE_SAFARI || e.ctrlKey && p === r.default.X && !("oncut" in f)) e.preventDefault(), 3035 s.handleRemove.call(t, f, p, h), (0, l.writeBuffer)(f, n.getBuffer.call(t, !0), c.p, e, f.inputmask._valueGet() !== n.getBuffer.call(t).join("")); else if (p === r.default.END || p === r.default.PAGE_DOWN) { 3036 e.preventDefault(); 3037 var m = n.seekNext.call(t, n.getLastValidPosition.call(t)); 3038 n.caret.call(t, f, e.shiftKey ? h.begin : m, m, !0); 3039 } else p === r.default.HOME && !e.shiftKey || p === r.default.PAGE_UP ? (e.preventDefault(), 3040 n.caret.call(t, f, 0, e.shiftKey ? h.begin : 0, !0)) : i.undoOnEscape && p === r.default.ESCAPE && !0 !== e.altKey ? ((0, 3041 l.checkVal)(f, !0, !1, t.undoValue.split("")), d.trigger("click")) : p !== r.default.INSERT || e.shiftKey || e.ctrlKey || void 0 !== t.userOptions.insertMode ? !0 === i.tabThrough && p === r.default.TAB ? !0 === e.shiftKey ? (h.end = n.seekPrevious.call(t, h.end, !0), 3042 !0 === u.getTest.call(t, h.end - 1).match.static && h.end--, h.begin = n.seekPrevious.call(t, h.end, !0), 3043 h.begin >= 0 && h.end > 0 && (e.preventDefault(), n.caret.call(t, f, h.begin, h.end))) : (h.begin = n.seekNext.call(t, h.begin, !0), 3044 h.end = n.seekNext.call(t, h.begin, !0), h.end < c.maskLength && h.end--, h.begin <= c.maskLength && (e.preventDefault(), 3045 n.caret.call(t, f, h.begin, h.end))) : e.shiftKey || i.insertModeVisual && !1 === i.insertMode && (p === r.default.RIGHT ? setTimeout((function() { 3046 var e = n.caret.call(t, f); 3047 n.caret.call(t, f, e.begin); 3048 }), 0) : p === r.default.LEFT && setTimeout((function() { 3049 var e = n.translatePosition.call(t, f.inputmask.caretPos.begin); 3050 n.translatePosition.call(t, f.inputmask.caretPos.end); 3051 t.isRTL ? n.caret.call(t, f, e + (e === c.maskLength ? 0 : 1)) : n.caret.call(t, f, e - (0 === e ? 0 : 1)); 3052 }), 0)) : s.isSelection.call(t, h) ? i.insertMode = !i.insertMode : (i.insertMode = !i.insertMode, 3053 n.caret.call(t, f, h.begin, h.begin)); 3054 t.ignorable = i.ignorables.includes(p); 3055 }, 3056 keypressEvent: function(e, t, i, a, o) { 3057 var u = this.inputmask || this, c = u.opts, f = u.dependencyLib, d = u.maskset, p = u.el, h = f(p), v = e.keyCode; 3058 if (!(!0
3058 === t || e.ctrlKey && e.altKey) && (e.ctrlKey || e.metaKey || u.ignorable)) return v === r.default.ENTER && u.undoValue !== u._valueGet(!0) && (u.undoValue = u._valueGet(!0), 3059 setTimeout((function() { 3060 h.trigger("change"); 3061 }), 0)), u.skipInputEvent = !0, !0; 3062 if (v) { 3063 44 !== v && 46 !== v || 3 !== e.location || "" === c.radixPoint || (v = c.radixPoint.charCodeAt(0)); 3064 var m, g = t ? { 3065 begin: o, 3066 end: o 3067 } : n.caret.call(u, p), k = String.fromCharCode(v); 3068 k = c.substitutes[k] || k, d.writeOutBuffer = !0; 3069 var y = s.isValid.call(u, g, k, a, void 0, void 0, void 0, t); 3070 if (!1 !== y && (n.resetMaskSet.call(u, !0), m = void 0 !== y.caret ? y.caret : n.seekNext.call(u, y.pos.begin ? y.pos.begin : y.pos), 3071 d.p = m), m = c.numericInput && void 0 === y.caret ? n.seekPrevious.call(u, m) : m, 3072 !1 !== i && (setTimeout((function() { 3073 c.onKeyValidation.call(p, v, y); 3074 }), 0), d.writeOutBuffer && !1 !== y)) { 3075 var b = n.getBuffer.call(u); 3076 (0, l.writeBuffer)(p, b, m, e, !0 !== t); 3077 } 3078 if (e.preventDefault(), t) return !1 !== y && (y.forwardPosition = m), y; 3079 } 3080 }, 3081 keyupEvent: function(e) { 3082 var t = this.inputmask; 3083 t.isComposing && (e.keyCode !== r.default.KEY_229 && e.keyCode !== r.default.ENTER || t.$el.trigger("input")); 3084 }, 3085 pasteEvent: function(e) { 3086 var t, i = this.inputmask, a = i.opts, r = i._valueGet(!0), o = n.caret.call(i, this); 3087 i.isRTL && (t = o.end, o.end = n.translatePosition.call(i, o.begin), o.begin = n.translatePosition.call(i, t)); 3088 var s = r.substr(0, o.begin), u = r.substr(o.end, r.length); 3089 if (s == (i.isRTL ? n.getBufferTemplate.call(i).slice().reverse() : n.getBufferTemplate.call(i)).slice(0, o.begin).join("") && (s = ""), 3090 u == (i.isRTL ? n.getBufferTemplate.call(i).slice().reverse() : n.getBufferTemplate.call(i)).slice(o.end).join("") && (u = ""), 3091 window.clipboardData && window.clipboardData.getData) r = s + window.clipboardData.getData("Text") + u; else { 3092 if (!e.clipboardData || !e.clipboardData.getData) return !0; 3093 r = s + e.clipboardData.getData("text/plain") + u; 3094 } 3095 var f = r; 3096 if (i.isRTL) { 3097 f = f.split(""); 3098 var d, p = c(n.getBufferTemplate.call(i)); 3099 try { 3100 for (p.s(); !(d = p.n()).done; ) { 3101 var h = d.value; 3102 f[0] === h && f.shift(); 3103 } 3104 } catch (e) { 3105 p.e(e); 3106 } finally { 3107 p.f(); 3108 } 3109 f = f.join(""); 3110 } 3111 if ("function" == typeof a.onBeforePaste) { 3112 if (!1 === (f = a.onBeforePaste.call(i, f, a))) return !1; 3113 f || (f = r); 3114 } 3115 (0, l.checkVal)(this, !0, !1, f.toString().split(""), e), e.preventDefault(); 3116 }, 3117 inputFallBackEvent: function(e) { 3118 var t = this.inputmask, i = t.opts, a = t.dependencyLib; 3119 var s = this, c = s.inputmask._valueGet(!0), f = (t.isRTL ? n.getBuffer.call(t).slice().reverse() : n.getBuffer.call(t)).join(""), p = n.caret.call(t, s, void 0, void 0, !0); 3120 if (f !== c) { 3121 c = function(e, i, a) { 3122 if (o.iemobile) { 3123 var r = i.replace(n.getBuffer.call(t).join(""), ""); 3124 if (1 === r.length) { 3125 var s = i.split(""); 3126 s.splice(a.begin, 0, r), i = s.join(""); 3127 } 3128 } 3129 return i; 3130 }(0, c, p); 3131 var h = function(e, a, r) { 3132 for (var o, s, l, c = e.substr(0, r.begin).split(""), f = e.substr(r.begin).split(""), d = a.substr(0, r.begin).split(""), p = a.substr(r.begin).split(""), h = c.length >= d.length ? c.length : d.length, v = f.length >= p.length ? f.length : p.length, m = "", g = [], k = "~"; c.length < h; ) c.push(k); 3133 for (;d.length < h; ) d.push(k); 3134 for (;f.length < v; ) f.unshift(k); 3135 for (;p.length < v; ) p.unshift(k);
3136 var y = c.concat(f), b = d.concat(p); 3137 for (s = 0, o = y.length; s < o; s++) switch (l = u.getPlaceholder.call(t, n.translatePosition.call(t, s)), 3138 m) { 3139 case "insertText": 3140 b[s - 1] === y[s] && r.begin == y.length - 1 && g.push(y[s]), s = o; 3141 break; 3142 3143 case "insertReplacementText": 3144 case "deleteContentBackward": 3145 y[s] === k ? r.end++ : s = o; 3146 break; 3147 3148 default: 3149 y[s] !== b[s] && (y[s + 1] !== k && y[s + 1] !== l && void 0 !== y[s + 1] || (b[s] !== l || b[s + 1] !== k) && b[s] !== k ? b[s + 1] === k && b[s] === y[s + 1] ? (m = "insertText", 3150 g.push(y[s]), r.begin--, r.end--) : y[s] !== l && y[s] !== k && (y[s + 1] === k || b[s] !== y[s] && b[s + 1] === y[s + 1]) ? (m = "insertReplacementText", 3151 g.push(y[s]), r.begin--) : y[s] === k ? (m = "deleteContentBackward", (n.isMask.call(t, n.translatePosition.call(t, s), !0) || b[s] === i.radixPoint) && r.end++) : s = o : (m = "insertText", 3152 g.push(y[s]), r.begin--, r.end--)); 3153 } 3154 return { 3155 action: m, 3156 data: g, 3157 caret: r 3158 }; 3159 }(c, f, p); 3160 switch ((s.inputmask.shadowRoot || s.ownerDocument).activeElement !== s && s.focus(), 3161 (0, l.writeBuffer)(s, n.getBuffer.call(t)), n.caret.call(t, s, p.begin, p.end, !0), 3162 h.action) { 3163 case "insertText": 3164 case "insertReplacementText": 3165 h.data.forEach((function(e, i) { 3166 var n = new a.Event("keypress"); 3167 n.keyCode = e.charCodeAt(0), t.ignorable = !1, d.keypressEvent.call(s, n); 3168 })), setTimeout((function() { 3169 t.$el.trigger("keyup"); 3170 }), 0); 3171 break; 3172 3173 case "deleteContentBackward": 3174 var v = new a.Event("keydown"); 3175 v.keyCode = r.default.BACKSPACE, d.keydownEvent.call(s, v); 3176 break; 3177 3178 default: 3179 (0, l.applyInputValue)(s, c); 3180 } 3181 e.preventDefault(); 3182 } 3183 }, 3184 compositionendEvent: function(e) { 3185 var t = this.inputmask; 3186 t.isComposing = !1, t.$el.trigger("input"); 3187 }, 3188 setValueEvent: function(e) { 3189 var t = this.inputmask, i = this, a = e && e.detail ? e.detail[0] : arguments[1]; 3190 void 0 === a && (a = i.inputmask._valueGet(!0)), (0, l.applyInputValue)(i, a), (e.detail && void 0 !== e.detail[1] || void 0 !== arguments[2]) && n.caret.call(t, i, e.detail ? e.detail[1] : arguments[2]); 3191 }, 3192 focusEvent: function(e) { 3193 var t = this.inputmask, i = t.opts, a = this, r = a.inputmask._valueGet(); 3194 i.showMaskOnFocus && r !== n.getBuffer.call(t).join("") && (0, l.writeBuffer)(a, n.getBuffer.call(t), n.seekNext.call(t, n.getLastValidPosition.call(t))), 3195 !0 !== i.positionCaretOnTab || !1 !== t.mouseEnter || s.isComplete.call(t, n.getBuffer.call(t)) && -1 !== n.getLastValidPosition.call(t) || d.clickEvent.apply(a, [ e, !0 ]), 3196 t.undoValue = t._valueGet(!0); 3197 }, 3198 invalidEvent: function(e) { 3199 this.inputmask.validationEvent = !0; 3200 }, 3201 mouseleaveEvent: function() { 3202 var e = this.inputmask, t = e.opts, i = this; 3203 e.mouseEnter = !1, t.clearMaskOnLostFocus && (i.inputmask.shadowRoot || i.ownerDocument).activeElement !== i && (0, 3204 l.HandleNativePlaceholder)(i, e.originalPlaceholder); 3205 }, 3206 clickEvent: function(e, t) { 3207 var i = this.inputmask, a = this; 3208 if ((a.inputmask.shadowRoot || a.ownerDocument).activeElement === a) { 3209 var r = n.determineNewCaretPosition.call(i, n.caret.call(i, a), t); 3210 void 0 !== r && n.caret.call(i, a, r); 3211 } 3212 }, 3213 cutEvent: function(e) { 3214 var t = this.inputmask, i = t.maskset, a = this, o = n.caret.call(t, a), u = t.isRTL ? n.getBuffer.call(t).slice(o.end, o.begin) : n.getBuffer.call(t).slice(o.begin, o.end), c = t.isRTL ? u.reverse().join("") : u.join(""); 3215 window.navigator.clipboard ? window.navigator.clipboard.writeText(c) : window.clipboardData && window.clipboardData.getData && window.clipboardData.setData("Text", c), 3216 s.handleRemove.call(t, a, r.default.DELETE, o), (0, l.writeBuffer)(a, n.getBuffer.call(t), i.p, e, t.undoValue !== t._valueGet(!0)); 3217 }, 3218 blurEvent: function(e) { 3219 var t = this.inputmask, i = t.opts, a = (0, t.depen
3219dencyLib)(this), r = this; 3220 if (r.inputmask) { 3221 (0, l.HandleNativePlaceholder)(r, t.originalPlaceholder); 3222 var o = r.inputmask._valueGet(), u = n.getBuffer.call(t).slice(); 3223 "" !== o && (i.clearMaskOnLostFocus && (-1 === n.getLastValidPosition.call(t) && o === n.getBufferTemplate.call(t).join("") ? u = [] : l.clearOptionalTail.call(t, u)), 3224 !1 === s.isComplete.call(t, u) && (setTimeout((function() { 3225 a.trigger("incomplete"); 3226 }), 0), i.clearIncomplete && (n.resetMaskSet.call(t), u = i.clearMaskOnLostFocus ? [] : n.getBufferTemplate.call(t).slice())), 3227 (0, l.writeBuffer)(r, u, void 0, e)), t.undoValue !== t._valueGet(!0) && (t.undoValue = t._valueGet(!0), 3228 a.trigger("change")); 3229 } 3230 }, 3231 mouseenterEvent: function() { 3232 var e = this.inputmask, t = e.opts, i = this; 3233 if (e.mouseEnter = !0, (i.inputmask.shadowRoot || i.ownerDocument).activeElement !== i) { 3234 var a = (e.isRTL ? n.getBufferTemplate.call(e).slice().reverse() : n.getBufferTemplate.call(e)).join(""); 3235 e.placeholder !== a && i.placeholder !== e.originalPlaceholder && (e.originalPlaceholder = i.placeholder), 3236 t.showMaskOnHover && (0, l.HandleNativePlaceholder)(i, a); 3237 } 3238 }, 3239 submitEvent: function() { 3240 var e = this.inputmask, t = e.opts; 3241 e.undoValue !== e._valueGet(!0) && e.$el.trigger("change"), -1 === n.getLastValidPosition.call(e) && e._valueGet && e._valueGet() === n.getBufferTemplate.call(e).join("") && e._valueSet(""), 3242 t.clearIncomplete && !1 === s.isComplete.call(e, n.getBuffer.call(e)) && e._valueSet(""), 3243 t.removeMaskOnSubmit && (e._valueSet(e.unmaskedvalue(), !0), setTimeout((function() { 3244 (0, l.writeBuffer)(e.el, n.getBuffer.call(e)); 3245 }), 0)); 3246 }, 3247 resetEvent: function() { 3248 var e = this.inputmask; 3249 e.refreshValue = !0, setTimeout((function() { 3250 (0, l.applyInputValue)(e.el, e._valueGet(!0)); 3251 }), 0); 3252 } 3253 }; 3254 t.EventHandlers = d; 3255 }, 3256 9716: function(e, t, i) { 3257 Object.defineProperty(t, "__esModule", { 3258 value: !0 3259 }), t.EventRuler = void 0; 3260 var a = s(i(2394)), n = s(i(5581)), r = i(8711), o = i(7760); 3261 function s(e) { 3262 return e && e.__esModule ? e : { 3263 default: e 3264 }; 3265 } 3266 var l = { 3267 on: function(e, t, i) { 3268 var s = e.inputmask.dependencyLib, l = function(t) { 3269 t.originalEvent && (t = t.originalEvent || t, arguments[0] = t); 3270 var l, u = this, c = u.inputmask, f = c ? c.opts : void 0; 3271 if (void 0 === c && "FORM" !== this.nodeName) { 3272 var d = s.data(u, "_inputmask_opts"); 3273 s(u).off(), d && new a.default(d).mask(u); 3274 } else { 3275 if ([ "submit", "reset", "setvalue" ].includes(t.type) || "FORM" === this.nodeName || !(u.disabled || u.readOnly && !("keydown" === t.type && t.ctrlKey && 67 === t.keyCode || !1 === f.tabThrough && t.keyCode === n.default.TAB))) { 3276 switch (t.type) { 3277 case "input": 3278 if (!0 === c.skipInputEvent || t.inputType && "insertCompositionText" === t.inputType) return c.skipInputEvent = !1, 3279 t.preventDefault(); 3280 break; 3281 3282 case "keydown": 3283 c.skipKeyPressEvent = !1, c.skipInputEvent = c.isComposing = t.ke
3283yCode === n.default.KEY_229; 3284 break; 3285 3286 case "keyup": 3287 case "compositionend": 3288 c.isComposing && (c.skipInputEvent = !1); 3289 break; 3290 3291 case "keypress": 3292 if (!0 === c.skipKeyPressEvent) return t.preventDefault(); 3293 c.skipKeyPressEvent = !0; 3294 break; 3295 3296 case "click": 3297 case "focus": 3298 return c.validationEvent ? (c.validationEvent = !1, e.blur(), (0, o.HandleNativePlaceholder)(e, (c.isRTL ? r.getBufferTemplate.call(c).slice().reverse() : r.getBufferTemplate.call(c)).join("")), 3299 setTimeout((function() { 3300 e.focus(); 3301 }), f.validationEventTimeOut), !1) : (l = arguments, void setTimeout((function() { 3302 e.inputmask && i.apply(u, l); 3303 }), 0)); 3304 } 3305 var p = i.apply(u, arguments); 3306 return !1 === p && (t.preventDefault(), t.stopPropagation()), p; 3307 } 3308 t.preventDefault(); 3309 } 3310 }; 3311 [ "submit", "reset" ].includes(t) ? (l = l.bind(e), null !== e.form && s(e.form).on(t, l)) : s(e).on(t, l), 3312 e.inputmask.events[t] = e.inputmask.events[t] || [], e.inputmask.events[t].push(l); 3313 }, 3314 off: function(e, t) { 3315 if (e.inputmask && e.inputmask.events) { 3316 var i = e.inputmask.dependencyLib, a = e.inputmask.events; 3317 for (var n in t && ((a = [])[t] = e.inputmask.events[t]), a) { 3318 for (var r = a[n]; r.length > 0; ) { 3319 var o = r.pop(); 3320 [ "submit", "reset" ].includes(n) ? null !== e.form && i(e.form).off(n, o) : i(e).off(n, o); 3321 } 3322 delete e.inputmask.events[n]; 3323 } 3324 } 3325 } 3326 }; 3327 t.EventRuler = l; 3328 }, 3329 219: function(e, t, i) { 3330 var a = d(i(2394)), n = d(i(5581)), r = d(i(7184)), o = i(8711), s = i(4713); 3331 function l(e) { 3332 return l = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { 3333 return typeof e; 3334 } : function(e) { 3335 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; 3336 }, l(e); 3337 } 3338 function u(e, t) { 3339 return function(e) { 3340 if (Array.isArray(e)) return e; 3341 }(e) || function(e, t) { 3342 var i = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"]; 3343 if (null == i) return; 3344 var a, n, r = [], o = !0, s = !1; 3345 try { 3346 for (i = i.call(e); !(o = (a = i.next()).done) && (r.push(a.value), !t || r.length !== t); o = !0) ; 3347 } catch (e) { 3348 s = !0, n = e; 3349 } finally { 3350 try { 3351 o || null == i.return || i.return(); 3352 } finally { 3353 if (s) throw n; 3354 } 3355 } 3356 return r; 3357 }(e, t) || function(e, t) { 3358 if (!e) return; 3359 if ("string" == typeof e) return c(e, t); 3360 var i = Object.prototype.toString.call(e).slice(8, -1); 3361 "Object" === i && e.constructor && (i = e.constructor.name); 3362 if ("Map" === i || "Set" === i) return Array.from(e); 3363 if ("Arguments" === i || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)) return c(e, t); 3364 }(e, t) || function() { 3365 throw new TypeError("Invalid attempt to de
3365structure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 3366 }(); 3367 } 3368 function c(e, t) { 3369 (null == t || t > e.length) && (t = e.length); 3370 for (var i = 0, a = new Array(t); i < t; i++) a[i] = e[i]; 3371 return a; 3372 } 3373 function f(e, t) { 3374 for (var i = 0; i < t.length; i++) { 3375 var a = t[i]; 3376 a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), 3377 Object.defineProperty(e, a.key, a); 3378 } 3379 } 3380 function d(e) { 3381 return e && e.__esModule ? e : { 3382 default: e 3383 }; 3384 } 3385 var p = a.default.dependencyLib, h = function() { 3386 function e(t, i, a) { 3387 !function(e, t) { 3388 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); 3389 }(this, e), this.mask = t, this.format = i, this.opts = a, this._date = new Date(1, 0, 1), 3390 this.initDateObject(t, this.opts); 3391 } 3392 var t, i, a; 3393 return t = e, (i = [ { 3394 key: "date", 3395 get: function() { 3396 return void 0 === this._date && (this._date = new Date(1, 0, 1), this.initDateObject(void 0, this.opts)), 3397 this._date; 3398 } 3399 }, { 3400 key: "initDateObject", 3401 value: function(e, t) { 3402 var i; 3403 for (P(t).lastIndex = 0; i = P(t).exec(this.format); ) { 3404 var a = new RegExp("\\d+$").exec(i[0]), n = a ? i[0][0] + "x" : i[0], r = void 0; 3405 if (void 0 !== e) { 3406 if (a) { 3407 var o = P(t).lastIndex, s = O(i.index, t); 3408 P(t).lastIndex = o, r = e.slice(0, e.indexOf(s.nextMatch[0])); 3409 } else r = e.slice(0, g[n] && g[n][4] || n.length); 3410 e = e.slice(r.length); 3411 } 3412 Object.prototype.hasOwnProperty.call(g, n) && this.setValue(this, r, n, g[n][2], g[n][1]); 3413 } 3414 } 3415 }, { 3416 key: "setValue", 3417 value: function(e, t, i, a, n) { 3418 if (void 0 !== t && (e[a] = "ampm" === a ? t : t.replace(/[^0-9]/g, "0"), e["raw" + a] = t.replace(/\s/g, "_")), 3419 void 0 !== n) { 3420 var r = e[a]; 3421 ("day" === a && 29 === parseInt(r) || "month" === a && 2 === parseInt(r)) && (29 !== parseInt(e.day) || 2 !== parseInt(e.month) || "" !== e.year && void 0 !== e.year || e._date.setFullYear(2012, 1, 29)), 3422 "day" === a && (m = !0, 0 === parseInt(r) && (r = 1)), "month" === a && (m = !0), 3423 "year" === a && (m = !0, r.length < 4 && (r = w(r, 4, !0))), "" === r || isNaN(r) || n.call(e._date, r), 3424 "ampm" === a && n.call(e._date, r); 3425 } 3426 } 3427 }, { 3428 key: "reset", 3429 value: function() { 3430 this._date = new Date(1, 0, 1); 3431 } 3432 }, { 3433 key: "reInit", 3434 value: function() { 3435 this._date = void 0, this.date; 3436 } 3437 } ]) && f(t.prototype, i), a && f(t, a), Object.defineProperty(t, "prototype", { 3438 writable: !1 3439 }), e; 3440 }(), v = (new Date).getFullYear(), m = !1, g = { 3441 d: [ "[1-9]|[12][0-9]|3[01]", Date.prototype.setDate, "day", Date.prototype.getDate ], 3442 dd: [ "0[1-9]|[12][0-9]|3[01]", Date.prototype.setDate, "day", function() { 3443 return w(Date.prototype.getDate.call(this), 2); 3444 } ], 3445 ddd: [ "" ], 3446 dddd: [ "" ], 3447 m: [ "[1-9]|1[012]", function(e) { 3448 var t = e ? parseInt(e) : 0; 3449 return t > 0 && t--, Date.prototype.setMonth.call(this, t); 3450 }, "month", function() { 3451 return Date.prototype.getMonth.call(this) + 1; 3452 } ], 3453 mm: [ "0[1-9]|1[012]", function(e) { 3454 var t = e ? parseInt(e) : 0; 3455 return t > 0 && t--, Date.prototype.setMonth.call(this, t); 3456 }, "month", function() { 3457 return w(Date.prototype.getMonth.call(this) + 1, 2); 3458 } ], 3459 mmm: [ "" ], 3460 mmmm: [ "" ], 3461 yy: [ "[0-9]{2}", Date.prototype.setFullYear, "year", function() { 3462 return w(Date.prototype.getFullYear.call(this), 2); 3463 } ], 3464 yyyy: [ "[0-9]{4}", Date.prototype.setFullYear, "year", function() { 3465 return w(Date.prototype.getFullYear.call(this), 4); 3466 } ], 3467 h: [ "[1-9]|1[0-2]", Date.prototype.setHours, "hours", Date.prototype.getHours ], 3468 hh: [ "0[1-9]|1[0-2]", Date.prototype.setHours, "hours", function() { 3469 return w(Date.prototype.getHours.call(this), 2); 3470 } ], 3471 hx: [ function(e) { 3472 return "[0-9]{".concat(e, "}"); 3473 }, Date.prototype.setHours, "hours", function(e) { 3474 return Date.prototype.getHours; 3475 } ], 3476 H: [ "1?[0-9]|2[0-3]", Date.prototype.setHours, "hours", Date.prototype.getHours ], 3477 HH: [ "0[0-9]|1[0-9]|2[0-3]", Date.prototype.setHours, "hours", function() { 3478 return w(Date.prototype.getHours.call(this), 2); 3479 } ], 3480 Hx: [ function(e) { 3481 return "[0-9]{".concat(e, "}"); 3482 }, Date.prototype.setHours, "hours", function(e) { 3483 return function() { 3484 return w(Date.prototype.getHours.call(this), e); 3485 }; 3486 } ], 3487 M: [ "[1-5]?[0-9]", Date.prototype.setMinutes, "minutes", Date.prototype.getMinutes ], 3488 MM: [ "0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]", Date.prototype.setMinutes, "minutes", function() { 3489 return w(Date.prototype.getMinutes.call(this), 2); 3490 } ], 3491 s: [ "[1-5]?[0-9]", Date.prototype.setSeconds, "seconds", Date.prototype.getSeconds ], 3492 ss: [ "0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]", Date.prototype.setSeconds, "seconds", function() { 3493 return w(Date.prototype.getSeconds.call(this), 2); 3494 } ], 3495 l: [ "[0-9]{3}", Date.prototype.setMilliseconds, "milliseconds", function() { 3496 return w(Date.prototype.getMilliseconds.call(this), 3); 3497 }, 3 ], 3498 L: [ "[0-9]{2}", Date.prototype.setMilliseconds, "milliseconds", function() { 3499 return w(Date.prototype.getMilliseconds.call(this), 2); 3500 }, 2 ], 3501 t: [ "[ap]", y, "ampm", b, 1 ], 3502 tt: [ "[ap]m", y, "ampm", b, 2 ], 3503 T: [ "[AP]", y, "ampm", b, 1 ], 3504 TT: [ "[AP]M", y, "ampm", b, 2 ], 3505 Z: [ ".*", void 0, "Z", function() { 3506 var e = this.toString().match(/\((.+)\)/)[1]; 3507 e.includes(" ") && (e = (e = e.replace("-", " ").toUpperCase()).split(" ").map((function(e) { 3508 return u(e, 1)[0]; 3509 })).join("")); 3510 return e; 3511 } ], 3512 o: [ "" ], 3513 S: [ "" ] 3514 }, k = { 3515 isoDate: "yyyy-mm-dd", 3516 isoTime: "HH:MM:ss", 3517 isoDateTime: "yyyy-mm-dd'T'HH:MM:ss", 3518 isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'" 3519 }; 3520 function y(e) { 3521 var t = this.getHours(); 3522 e.toLowerCase().includes("p") ? this.setHours(t + 12) : e.toLowerCase().includes("a") && t >= 12 && this.setHours(t - 12); 3523 } 3524 function b() { 3525 var e = this.getHours(); 3526 return (e = e || 12) >= 12 ? "PM" : "AM"; 3527 } 3528 function x(e) { 3529 var t = new RegExp("\\d+$").exec(e[0]); 3530 if (t && void 0 !== t[0]) { 3531 var i = g[e[0][0] + "x"].slice(""); 3532 return i[0] = i[0](t[0]), i[3] = i[3](t[0]), i; 3533 } 3534 if (g[e[0]]) return g[e[0]]; 3535 } 3536 function P(e) { 3537 if (!e.tokenizer) { 3538 var t = [], i = []; 3539 for (var a in g) if (/\.*x$/.test(a)) { 3540 var n = a[0] + "\\d+"; 3541 -1 === i.indexOf(n) && i.push(n); 3542 } else -1 === t.indexOf(a[0]) && t.push(a[0]); 3543 e.tokenizer = "(" + (i.length > 0 ? i.join("|") + "|" : "") + t.join("+|") + ")+?|.", 3544 e.tokenizer = new RegExp(e.tokenizer, "g"); 3545 } 3546 return e.tokenizer; 3547 } 3548 function E(e, t, i) { 3549 if (!m) return !0; 3550 if (void 0 === e.rawday || !isFinite(e.rawday) && new Date(e.date.getFullYear(), isFinite(e.rawmonth) ? e.month : e.date.getMonth() + 1, 0).getDate() >= e.day || "29" == e.day && (!isFinite(e.rawyear) || void 0 === e.rawyear || "" === e.rawyear) || new Date(e.date.getFullYear(), isFinite(e.rawmonth) ? e.month : e.date.getMonth() + 1, 0).getDate() >= e.day) return t; 3551 if ("29" == e.day) { 3552 var a = O(t.pos, i); 3553 if ("yyyy" === a.targetMatch[0] && t.pos - a.targetMatchIndex == 2) return t.remove = t.pos + 1, 3554 t; 3555 } else if ("02" == e.month && "30" == e.day && void 0 !== t.c) return e.day = "03", 3556 e.date.setDate(3), e.date.setMonth(1), t.insert = [ { 3557 pos: t.pos, 3558 c: "0" 3559 }, { 3560 pos: t.pos + 1, 3561 c: t.c 3562 } ], t.caret = o.seekNext.call(this, t.pos + 1), t; 3563 return !1; 3564 } 3565 function S(e, t, i, a) { 3566 var n, o, s = ""; 3567 for (P(i).lastIndex = 0; n = P(i).exec(e); ) { 3568 if (void 0 === t) if (o = x(n)) s += "(" + o[0] + ")"; else switch (n[0]) { 3569 case "[": 3570 s += "("; 3571 break; 3572 3573 case "]": 3574 s += ")?"; 3575 break; 3576 3577 default: 3578 s += (0, r.default)(n[0]); 3579 } else if (o = x(n)) if (!0 !== a && o[3]) s += o[3].call(t.date); else o[2] ? s += t["raw" + o[2]] : s += n[0]; else s += n[0]; 3580 } 3581 return s; 3582 } 3583 function w(e, t, i) { 3584 for (e = String(e), t = t || 2; e.length < t; ) e = i ? e + "0" : "0" + e; 3585 return e; 3586 } 3587 function _(e, t, i) { 3588 return "string" == typeof e ? new h(e, t, i) : e && "object" === l(e) && Object.prototype.hasOwnProperty.call(e, "date") ? e : void 0; 3589 } 3590 function M(e, t) { 3591 return S(t.inputFormat, { 3592 date: e 3593 }, t); 3594 } 3595 function O(e, t) { 3596 var i, a, n = 0, r = 0; 3597 for (P(t).lastIndex = 0; a = P(t).exec(t.inputFormat); ) { 3598 var o = new RegExp("\\d+$").exec(a[0]); 3599 if ((n += r = o ? parseInt(o[0]) : a[0].length) >= e + 1) { 3600 i = a, a = P(t).exec(t.inputFormat); 3601 break; 3602 } 3603 } 3604 return { 3605 targetMatchIndex: n - r, 3606 nextMatch: a, 3607 targetMatch: i 3608 }; 3609 } 3610 a.default.extendAliases({ 3611 datetime: { 3612 mask: function(e) { 3613 return e.numericInput = !1, g.S = e.i18n.ordinalSuffix.join("|"), e.inputFormat = k[e.inputFormat] || e.inputFormat, 3614 e.displayFormat = k[e.displayFormat] || e.displayFormat || e.inputFormat, e.outputFormat = k[e.outputFormat] || e.outputFormat || e.inputFormat, 3615 e.placeholder = "" !== e.placeholder ? e.placeholder : e.inputFormat.replace(/[[\]]/, ""), 3616 e.regex = S(e.inputFormat, void 0, e), e.min = _(e.min, e.inputFormat, e), e.max = _(e.max, e.inputFormat, e), 3617 null; 3618 }, 3619 placeholder: "", 3620 inputFormat: "isoDateTime", 3621 displayFormat: null, 3622 outputFormat: null, 3623 min: null, 3624 max: null, 3625 skipOptionalPartCharacter: "", 3626 i18n: { 3627 dayNames: [ "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ], 3628 monthNames: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "
3628November", "December" ], 3629 ordinalSuffix: [ "st", "nd", "rd", "th" ] 3630 }, 3631 preValidation: function(e, t, i, a, n, r, o, s) { 3632 if (s) return !0; 3633 if (isNaN(i) && e[t] !== i) { 3634 var l = O(t, n); 3635 if (l.nextMatch && l.nextMatch[0] === i && l.targetMatch[0].length > 1) { 3636 var u = g[l.targetMatch[0]][0]; 3637 if (new RegExp(u).test("0" + e[t - 1])) return e[t] = e[t - 1], e[t - 1] = "0", 3638 { 3639 fuzzy: !0, 3640 buffer: e, 3641 refreshFromBuffer: { 3642 start: t - 1, 3643 end: t + 1 3644 }, 3645 pos: t + 1 3646 }; 3647 } 3648 } 3649 return !0; 3650 }, 3651 postValidation: function(e, t, i, a, n, r, o, l) { 3652 var u, c; 3653 if (o) return !0; 3654 if (!1 === a && (((u = O(t + 1, n)).targetMatch && u.targetMatchIndex === t && u.targetMatch[0].length > 1 && void 0 !== g[u.targetMatch[0]] || (u = O(t + 2, n)).targetMatch && u.targetMatchIndex === t + 1 && u.targetMatch[0].length > 1 && void 0 !== g[u.targetMatch[0]]) && (c = g[u.targetMatch[0]][0]), 3655 void 0 !== c && (void 0 !== r.validPositions[t + 1] && new RegExp(c).test(i + "0") ? (e[t] = i, 3656 e[t + 1] = "0", a = { 3657 pos: t + 2, 3658 caret: t 3659 }) : new RegExp(c).test("0" + i) && (e[t] = "0", e[t + 1] = i, a = { 3660 pos: t + 2 3661 })), !1 === a)) return a; 3662 if (a.fuzzy && (e = a.buffer, t = a.pos), (u = O(t, n)).targetMatch && u.targetMatch[0] && void 0 !== g[u.targetMatch[0]]) { 3663 var f = g[u.targetMatch[0]]; 3664 c = f[0]; 3665 var d = e.slice(u.targetMatchIndex, u.targetMatchIndex + u.targetMatch[0].length); 3666 if (!1 === new RegExp(c).test(d.join("")) && 2 === u.targetMatch[0].length && r.validPositions[u.targetMatchIndex] && r.validPositions[u.targetMatchIndex + 1] && (r.validPositions[u.targetMatchIndex + 1].input = "0"), 3667 "year" == f[2]) for (var p = s.getMaskTemplate.call(this, !1, 1, void 0, !0), h = t + 1; h < e.length; h++) e[h] = p[h], 3668 delete r.validPositions[h]; 3669 } 3670 var m = a, k = _(e.join(""), n.inputFormat, n); 3671 return m && !isNaN(k.date.getTime()) && (n.prefillYear && (m = function(e, t, i) { 3672 if (e.year !== e.rawyear) { 3673 var a = v.toString(), n = e.rawyear.replace(/[^0-9]/g, ""), r = a.slice(0, n.length), o = a.slice(n.length); 3674 if (2 === n.length && n === r) { 3675 var s = new Date(v, e.month - 1, e.day); 3676 e.day == s.getDate() && (!i.max || i.max.date.getTime() >= s.getTime()) && (e.date.setFullYear(v), 3677 e.year = a, t.insert = [ { 3678 pos: t.pos + 1, 3679 c: o[0] 3680 }, { 3681 pos: t.pos + 2, 3682 c: o[1] 3683 } ]); 3684 } 3685 } 3686 return t; 3687 }(k, m, n)), m = function(e, t, i, a, n) { 3688 if (!t) return t; 3689 if (t && i.min && !isNaN(i.min.date.getTime())) { 3690 var r; 3691 for (e.reset(), P(i).lastIndex = 0; r = P(i).exec(i.inputFormat); ) { 3692 var o; 3693 if ((o = x(r)) && o[3]) { 3694 for (var s = o[1], l = e[o[2]], u = i.min[o[2]], c = i.max ? i.max[o[2]] : u, f = [], d = !1, p = 0; p < u.length; p++) void 0 !== a.validPositions[p + r.index] || d ? (f[p] = l[p], 3695 d = d || l[p] > u[p]) : (f[p] = u[p], "year" === o[2] && l.length - 1 == p && u != c && (f = (parseInt(f.join("")) + 1).toString().split("")), 3696 "ampm" === o[2] && u != c && i.min.date.getTime() > e.date.getTime() && (f[p] = c[p])); 3697 s.call(e._date, f.join("")); 3698 } 3699 } 3700 t = i.min.date.getTime() <= e.date.getTime(), e.reInit(); 3701 } 3702 return t && i.max && (isNaN(i.max.date.getTime()) || (t = i.max.date.getTime() >= e.date.getTime())), 3703 t; 3704 }(k, m = E.call(this, k, m, n), n, r)), void 0 !== t && m && a.pos !== t ? { 3705 buffer: S(n.inputFormat, k, n).split(""), 3706 refreshFromBuffer: { 3707 start: t, 3708 end: a.pos 3709 }, 3710 pos: a.caret || a.pos 3711 } : m; 3712 }, 3713 onKeyDown: function(e, t, i, a) { 3714 e.ctrlKey && e.keyCode === n.default.RIGHT && (this.inputmask._valueSet(M(new Date, a)), 3715 p(this).trigger("setvalue")); 3716 }, 3717 onUnMask: function(e, t, i) { 3718 return t ? S(i.outputFormat, _(e, i.inputFormat, i), i, !0) : t; 3719 }, 3720 casing: function(e, t, i, a) { 3721 return 0 == t.nativeDef.indexOf("[ap]") ? e.toLowerCase() : 0 == t.nativeDef.indexOf("[AP]") ? e.toUpperCase() : e; 3722 }, 3723 onBeforeMask: function(e, t) { 3724 return "[object Date]" === Object.prototype.toString.call(e) && (e = M(e, t)), e; 3725 }, 3726 insertMode: !1, 3727 shiftPositions: !1, 3728 keepStatic: !1, 3729 inputmode: "numeric", 3730 prefillYear: !0 3731 } 3732 }); 3733 }, 3734 3851: function(e, t, i) { 3735 var a, n = (a = i(2394)) && a.__esModule ? a : { 3736 default: a 3737 }, r = i(8711), o = i(4713); 3738 n.default.extendDefinitions({ 3739 A: { 3740 validator: "[A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]", 3741 casing: "upper" 3742 }, 3743 "&": { 3744 validator: "[0-9A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]", 3745 casing: "upper" 3746 }, 3747 "#": { 3748 validator: "[0-9A-Fa-f]", 3749 casing: "upper" 3750 } 3751 }); 3752 var s = new RegExp("25[0-5]|2[0-4][0-9]|[01][0-9][0-9]"); 3753 function l(e, t, i, a, n) { 3754 return i - 1 > -1 && "." !== t.buffer[i - 1] ? (e = t.buffer[i - 1] + e, e = i - 2 > -1 && "." !== t.buffer[i - 2] ? t.buffer[i - 2] + e : "0" + e) : e = "00" + e, 3755 s.test(e); 3756 } 3757 n.default.extendAliases({ 3758 cssunit: { 3759 regex: "[+-]?[0-9]+\\.?([0-9]+)?(px|em|rem|ex|%|in|cm|mm|pt|pc)" 3760 }, 3761 url: { 3762 regex: "(https?|ftp)://.*", 3763 autoUnmask: !1, 3764 keepStatic: !1, 3765 tabThrough: !0 3766 }, 3767 ip: { 3768 mask: "i{1,3}.j{1,3}.k{1,3}.l{1,3}", 3769 definitions: { 3770 i: { 3771 validator: l 3772 }, 3773 j: { 3774 validator: l 3775 }, 3776 k: { 3777 validator: l 3778 }, 3779 l: { 3780 validator: l 3781 } 3782 }, 3783 onUnMask: function(e, t, i) { 3784 return e; 3785 }, 3786 inputmode: "decimal", 3787 substitutes: { 3788 ",": "." 3789 } 3790 }, 3791 email: { 3792 mask: function(e) { 3793 var t = "*{1,64}[.*{1,64}][.*{1,64}][.*{1,63}]@-{1,63}.-{1,63}[.-{1,63}][.-{1,63}]", i = t; 3794 if (e.separator) for (var a = 0; a < e.quantifier; a++) i += "[".concat(e.separator).concat(t, "]"); 3795 return i; 3796 }, 3797 greedy: !1, 3798 casing: "lower", 3799 separator: null, 3800 quantifier: 5, 3801 skipOptionalPartCharacter: "", 3802 onBeforePaste: function(e, t) { 3803 return (e = e.toLowerCase()).replace("mailto:", ""); 3804 }, 3805 definitions: { 3806 "*": { 3807 validator: "[0-9\uff11-\uff19A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5!#$%&'*+/=?^_`{|}~-]" 3808 }, 3809 "-": { 3810 validator: "[0-9A-Za-z-]" 3811 } 3812 }, 3813 onUnMask: function(e, t, i) { 3814 return e; 3815 }, 3816 inputmode: "email" 3817 }, 3818 mac: {
3819 mask: "##:##:##:##:##:##" 3820 }, 3821 vin: { 3822 mask: "V{13}9{4}", 3823 definitions: { 3824 V: { 3825 validator: "[A-HJ-NPR-Za-hj-npr-z\\d]", 3826 casing: "upper" 3827 } 3828 }, 3829 clearIncomplete: !0, 3830 autoUnmask: !0 3831 }, 3832 ssn: { 3833 mask: "999-99-9999", 3834 postValidation: function(e, t, i, a, n, s, l) { 3835 var u = o.getMaskTemplate.call(this, !0, r.getLastValidPosition.call(this), !0, !0); 3836 return /^(?!219-09-9999|078-05-1120)(?!666|000|9.{2}).{3}-(?!00).{2}-(?!0{4}).{4}$/.test(u.join("")); 3837 } 3838 } 3839 }); 3840 }, 3841 207: function(e, t, i) { 3842 var a = s(i(2394)), n = s(i(5581)), r = s(i(7184)), o = i(8711); 3843 function s(e) { 3844 return e && e.__esModule ? e : { 3845 default: e 3846 }; 3847 } 3848 var l = a.default.dependencyLib; 3849 function u(e, t) { 3850 for (var i = "", n = 0; n < e.length; n++) a.default.prototype.definitions[e.charAt(n)] || t.definitions[e.charAt(n)] || t.optionalmarker[0] === e.charAt(n) || t.optionalmarker[1] === e.charAt(n) || t.quantifiermarker[0] === e.charAt(n) || t.quantifiermarker[1] === e.charAt(n) || t.groupmarker[0] === e.charAt(n) || t.groupmarker[1] === e.charAt(n) || t.alternatormarker === e.charAt(n) ? i += "\\" + e.charAt(n) : i += e.charAt(n); 3851 return i; 3852 } 3853 function c(e, t, i, a) { 3854 if (e.length > 0 && t > 0 && (!i.digitsOptional || a)) { 3855 var n = e.indexOf(i.radixPoint), r = !1; 3856 i.negationSymbol.back === e[e.length - 1] && (r = !0, e.length--), -1 === n && (e.push(i.radixPoint), 3857 n = e.length - 1); 3858 for (var o = 1; o <= t; o++) isFinite(e[n + o]) || (e[n + o] = "0"); 3859 } 3860 return r && e.push(i.negationSymbol.back), e; 3861 } 3862 function f(e, t) { 3863 var i = 0; 3864 for (var a in "+" === e && (i = o.seekNext.call(this, t.validPositions.length - 1)), 3865 t.tests) if ((a = parseInt(a)) >= i) for (var n = 0, r = t.tests[a].length; n < r; n++) if ((void 0 === t.validPositions[a] || "-" === e) && t.tests[a][n].match.def === e) return a + (void 0 !== t.validPositions[a] && "-" !== e ? 1 : 0); 3866 return i; 3867 } 3868 function d(e, t) { 3869 for (var i = -1, a = 0, n = t.validPositions.length; a < n; a++) { 3870 var r = t.validPositions[a]; 3871 if (r && r.match.def === e) { 3872 i = a; 3873 break; 3874 } 3875 } 3876 return i; 3877 } 3878 function p(e, t, i, a, n) { 3879 var r = t.buffer ? t.buffer.indexOf(n.radixPoint) : -1, o = (-1 !== r || a && n.jitMasking) && new RegExp(n.definitions[9].validator).test(e); 3880 return n._radixDance && -1 !== r && o && null == t.validPositions[r] ? { 3881 insert: { 3882 pos: r === i ? r + 1 : r, 3883 c: n.radixPoint 3884 }, 3885 pos: i 3886 } : o; 3887 } 3888 a.default.extendAliases({ 3889 numeric: { 3890 mask: function(e) { 3891 e.repeat = 0, e.groupSeparator === e.radixPoint && e.digits && "0" !== e.digits && ("." === e.radixPoint ? e.groupSeparator = "," : "," === e.radixPoint ? e.groupSeparator = "." : e.groupSeparator = ""), 3892 " " === e.groupSeparator && (e.skipOptionalPartCharacter = void 0), e.placeholder.length > 1 && (e.placeholder = e.placeholder.charAt(0)), 3893 "radixFocus" === e.positionCaretOnClick && "" === e.placeholder && (e.positionCaretOnClick = "lvp"); 3894 var t = "0", i = e.radixPoint; 3895 !0 === e.numericInput && void 0 === e.__financeInput ? (t = "1", e.positionCaretOnClick = "radixFocus" === e.positionCaretOnClick ? "lvp" : e.positionCaretOnClick, 3896 e.digitsOptional = !1, isNaN(e.digits) && (e.digits = 2), e._radixDance = !1, i = "," === e.radixPoint ? "?" : "!", 3897 "" !== e.radixPoint && void 0 === e.definitions[i] && (e.definitions[i] = {}
3897, e.definitions[i].validator = "[" + e.radixPoint + "]", 3898 e.definitions[i].placeholder = e.radixPoint, e.definitions[i].static = !0, e.definitions[i].generated = !0)) : (e.__financeInput = !1, 3899 e.numericInput = !0); 3900 var a, n = "[+]"; 3901 if (n += u(e.prefix, e), "" !== e.groupSeparator ? (void 0 === e.definitions[e.groupSeparator] && (e.definitions[e.groupSeparator] = {}, 3902 e.definitions[e.groupSeparator].validator = "[" + e.groupSeparator + "]", e.definitions[e.groupSeparator].placeholder = e.groupSeparator, 3903 e.definitions[e.groupSeparator].static = !0, e.definitions[e.groupSeparator].generated = !0), 3904 n += e._mask(e)) : n += "9{+}", void 0 !== e.digits && 0 !== e.digits) { 3905 var o = e.digits.toString().split(","); 3906 isFinite(o[0]) && o[1] && isFinite(o[1]) ? n += i + t + "{" + e.digits + "}" : (isNaN(e.digits) || parseInt(e.digits) > 0) && (e.digitsOptional || e.jitMasking ? (a = n + i + t + "{0," + e.digits + "}", 3907 e.keepStatic = !0) : n += i + t + "{" + e.digits + "}"); 3908 } else e.inputmode = "numeric"; 3909 return n += u(e.suffix, e), n += "[-]", a && (n = [ a + u(e.suffix, e) + "[-]", n ]), 3910 e.greedy = !1, function(e) { 3911 void 0 === e.parseMinMaxOptions && (null !== e.min && (e.min = e.min.toString().replace(new RegExp((0, 3912 r.default)(e.groupSeparator), "g"), ""), "," === e.radixPoint && (e.min = e.min.replace(e.radixPoint, ".")), 3913 e.min = isFinite(e.min) ? parseFloat(e.min) : NaN, isNaN(e.min) && (e.min = Number.MIN_VALUE)), 3914 null !== e.max && (e.max = e.max.toString().replace(new RegExp((0, r.default)(e.groupSeparator), "g"), ""), 3915 "," === e.radixPoint && (e.max = e.max.replace(e.radixPoint, ".")), e.max = isFinite(e.max) ? parseFloat(e.max) : NaN, 3916 isNaN(e.max) && (e.max = Number.MAX_VALUE)), e.parseMinMaxOptions = "done"); 3917 }(e), "" !== e.radixPoint && e.substituteRadixPoint && (e.substitutes["." == e.radixPoint ? "," : "."] = e.radixPoint), 3918 n; 3919 }, 3920 _mask: function(e) { 3921 return "(" + e.groupSeparator + "999){+|1}"; 3922 }, 3923 digits: "*", 3924 digitsOptional: !0, 3925 enforceDigitsOnBlur: !1, 3926 radixPoint: ".", 3927 positionCaretOnClick: "radixFocus", 3928 _radixDance: !0, 3929 groupSeparator: "", 3930 allowMinus: !0, 3931 negationSymbol: { 3932 front: "-", 3933 back: "" 3934 }, 3935 prefix: "", 3936 suffix: "", 3937 min: null, 3938 max: null, 3939 SetMaxOnOverflow: !1, 3940 step: 1, 3941 inputType: "text", 3942 unmaskAsNumber: !1, 3943 roundingFN: Math.round, 3944 inputmode: "decimal", 3945 shortcuts: { 3946 k: "1000", 3947 m: "1000000" 3948 }, 3949 placeholder: "0", 3950 greedy: !1, 3951 rightAlign: !0, 3952 insertMode: !0, 3953 autoUnmask: !1, 3954 skipOptionalPartCharacter: "", 3955 usePrototypeDefinitions: !1, 3956 stripLeadingZeroes: !0, 3957 substituteRadixPoint: !0, 3958 definitions: { 3959 0: { 3960 validator: p 3961 }, 3962 1: { 3963 validator: p, 3964 definitionSymbol: "9" 3965 }, 3966 9: { 3967 validator: "[0-9\uff10-\uff19\u0660-\u0669\u06f0-\u06f9]", 3968 definitionSymbol: "*" 3969 }, 3970 "+": { 3971 validator: function(e, t, i, a, n) { 3972 return n.allowMinus && ("-" === e || e === n.negationSymbol.front); 3973 } 3974 }, 3975 "-": { 3976 validator: function(e, t, i, a, n) { 3977 return n.allowMinus && e === n.negationSymbol.back; 3978 } 3979 } 3980 }, 3981 preValidation: function(e, t, i, a, n, r, o, s) { 3982 if (!1 !== n.__financeInput && i === n.radixPoint) return !1; 3983 var l = e.indexOf(n.radixPoint), u = t; 3984 if (t = function(e, t, i, a, n) { 3985 return n._radixDance && n.numericInput && t !== n.negationSymbol.back && e <= i && (i > 0 || t == n.radixPoint) && (void 0 === a.validPositions[e - 1] || a.validPositions[e - 1].input !== n.negationSymbol.back) && (e -= 1), 3986 e; 3987 }(t, i, l, r, n), "-" === i || i === n.negationSymbol.front) { 3988 if (!0 !== n.allowMinus) return !1; 3989 var c = !1, p = d("+", r), h = d("-", r); 3990 return -1 !== p && (c = [ p, h ]), !1 !== c ? { 3991 remove: c, 3992 caret: u - n.negationSymbol.back.length 3993 } : { 3994 insert: [ { 3995 pos: f.call(this, "+", r), 3996 c: n.negationSymbol.front, 3997 fromIsValid: !0 3998 }, { 3999 pos: f.call(this, "-", r), 4000 c: n.negationSymbol.back, 4001 fromIsValid: void 0 4002 } ], 4003 caret: u + n.negationSymbol.back.length 4004 }; 4005 } 4006 if (i === n.groupSeparator) return { 4007 caret: u 4008 }; 4009 if (s) return !0; 4010 if (-1 !== l && !0 === n._radixDance && !1 === a && i === n.radixPoint && void 0 !== n.digits && (isNaN(n.digits) || parseInt(n.digits) > 0) && l !== t) return { 4011 caret: n._radixDance && t === l - 1 ? l + 1 : l 4012 }; 4013 if (!1 === n.__financeInput) if (a) { 4014 if (n.digitsOptional) return { 4015 rewritePosition: o.end 4016 }; 4017 if (!n.digitsOptional) { 4018 if (o.begin > l && o.end <= l) return i === n.radixPoint ? { 4019 insert: { 4020 pos: l + 1, 4021 c: "0", 4022 fromIsValid: !0 4023 }, 4024 rewritePosition: l 4025 } : { 4026 rewritePosition: l + 1 4027 }; 4028 if (o.begin < l) return { 4029 rewritePosition: o.begin - 1 4030 }; 4031 } 4032 } else if (!n.showMaskOnHover && !n.showMaskOnFocus && !n.digitsOptional && n.digits > 0 && "" === this.__valueGet.call(this.el)) return { 4033 rewritePosition: l 4034 }; 4035 return { 4036 rewritePosition: t 4037 }; 4038 }, 4039 postValidation: function(e, t, i, a, n, r, o) { 4040 if (!1 === a) return a; 4041 if (o) return !0; 4042 if (null !== n.min || null !== n.max) { 4043 var s = n.onUnMask(e.slice().reverse().join(""), void 0, l.extend({}, n, { 4044 unmaskAsNumber: !0 4045 })); 4046 if (null !== n.min && s < n.min && (s.toString().length > n.min.toString().length || s < 0)) return !1; 4047 if (null !== n.max && s >
4047 n.max) return !!n.SetMaxOnOverflow && { 4048 refreshFromBuffer: !0, 4049 buffer: c(n.max.toString().replace(".", n.radixPoint).split(""), n.digits, n).reverse() 4050 }; 4051 } 4052 return a; 4053 }, 4054 onUnMask: function(e, t, i) { 4055 if ("" === t && !0 === i.nullable) return t; 4056 var a = e.replace(i.prefix, ""); 4057 return a = (a = a.replace(i.suffix, "")).replace(new RegExp((0, r.default)(i.groupSeparator), "g"), ""), 4058 "" !== i.placeholder.charAt(0) && (a = a.replace(new RegExp(i.placeholder.charAt(0), "g"), "0")), 4059 i.unmaskAsNumber ? ("" !== i.radixPoint && -1 !== a.indexOf(i.radixPoint) && (a = a.replace(r.default.call(this, i.radixPoint), ".")), 4060 a = (a = a.replace(new RegExp("^" + (0, r.default)(i.negationSymbol.front)), "-")).replace(new RegExp((0, 4061 r.default)(i.negationSymbol.back) + "$"), ""), Number(a)) : a; 4062 }, 4063 isComplete: function(e, t) { 4064 var i = (t.numericInput ? e.slice().reverse() : e).join(""); 4065 return i = (i = (i = (i = (i = i.replace(new RegExp("^" + (0, r.default)(t.negationSymbol.front)), "-")).replace(new RegExp((0, 4066 r.default)(t.negationSymbol.back) + "$"), "")).replace(t.prefix, "")).replace(t.suffix, "")).replace(new RegExp((0, 4067 r.default)(t.groupSeparator) + "([0-9]{3})", "g"), "$1"), "," === t.radixPoint && (i = i.replace((0, 4068 r.default)(t.radixPoint), ".")), isFinite(i); 4069 }, 4070 onBeforeMask: function(e, t) { 4071 var i = t.radixPoint || ","; 4072 isFinite(t.digits) && (t.digits = parseInt(t.digits)), "number" != typeof e && "number" !== t.inputType || "" === i || (e = e.toString().replace(".", i)); 4073 var a = "-" === e.charAt(0) || e.charAt(0) === t.negationSymbol.front, n = e.split(i), o = n[0].replace(/[^\-0-9]/g, ""), s = n.length > 1 ? n[1].replace(/[^0-9]/g, "") : "", l = n.length > 1; 4074 e = o + ("" !== s ? i + s : s); 4075 var u = 0; 4076 if ("" !== i && (u = t.digitsOptional ? t.digits < s.length ? t.digits : s.length : t.digits, 4077 "" !== s || !t.digitsOptional)) { 4078 var f = Math.pow(10, u || 1); 4079 e = e.replace((0, r.default)(i), "."), isNaN(parseFloat(e)) || (e = (t.roundingFN(parseFloat(e) * f) / f).toFixed(u)), 4080 e = e.toString().replace(".", i); 4081 } 4082 if (0 === t.digits && -1 !== e.indexOf(i) && (e = e.substring(0, e.indexOf(i))), 4083 null !== t.min || null !== t.max) { 4084 var d = e.toString().replace(i, "."); 4085 null !== t.min && d < t.min ? e = t.min.toString().replace(".", i) : null !== t.max && d > t.max && (e = t.max.toString().replace(".", i)); 4086 } 4087 return a && "-" !== e.charAt(0) && (e = "-" + e), c(e.toString().split(""), u, t, l).join(""); 4088 }, 4089 onBeforeWrite: function(e, t, i, a) { 4090 function n(e, t) { 4091 if (!1 !== a.__financeInput || t) { 4092 var i = e.indexOf(a.radixPoint); 4093 -1 !== i && e.splice(i, 1); 4094 } 4095 if ("" !== a.groupSeparator) for (;-1 !== (i = e.indexOf(a.groupSeparator)); ) e.splice(i, 1); 4096 return e; 4097 } 4098 var o, s;
4099 if (a.stripLeadingZeroes && (s = function(e, t) { 4100 var i = new RegExp("(^" + ("" !== t.negationSymbol.front ? (0, r.default)(t.negationSymbol.front) + "?" : "") + (0, 4101 r.default)(t.prefix) + ")(.*)(" + (0, r.default)(t.suffix) + ("" != t.negationSymbol.back ? (0, 4102 r.default)(t.negationSymbol.back) + "?" : "") + "$)").exec(e.slice().reverse().join("")), a = i ? i[2] : "", n = !1; 4103 return a && (a = a.split(t.radixPoint.charAt(0))[0], n = new RegExp("^[0" + t.groupSeparator + "]*").exec(a)), 4104 !(!n || !(n[0].length > 1 || n[0].length > 0 && n[0].length < a.length)) && n; 4105 }(t, a))) for (var u = t.join("").lastIndexOf(s[0].split("").reverse().join("")) - (s[0] == s.input ? 0 : 1), f = s[0] == s.input ? 1 : 0, d = s[0].length - f; d > 0; d--) delete this.maskset.validPositions[u + d], 4106 delete t[u + d]; 4107 if (e) switch (e.type) { 4108 case "blur": 4109 case "checkval": 4110 if (null !== a.min) { 4111 var p = a.onUnMask(t.slice().reverse().join(""), void 0, l.extend({}, a, { 4112 unmaskAsNumber: !0 4113 })); 4114 if (null !== a.min && p < a.min) return { 4115 refreshFromBuffer: !0, 4116 buffer: c(a.min.toString().replace(".", a.radixPoint).split(""), a.digits, a).reverse() 4117 }; 4118 } 4119 if (t[t.length - 1] === a.negationSymbol.front) { 4120 var h = new RegExp("(^" + ("" != a.negationSymbol.front ? (0, r.default)(a.negationSymbol.front) + "?" : "") + (0, 4121 r.default)(a.prefix) + ")(.*)(" + (0, r.default)(a.suffix) + ("" != a.negationSymbol.back ? (0, 4122 r.default)(a.negationSymbol.back) + "?" : "") + "$)").exec(n(t.slice(), !0).reverse().join("")); 4123 0 == (h ? h[2] : "") && (o = { 4124 refreshFromBuffer: !0, 4125 buffer: [ 0 ] 4126 }); 4127 } else if ("" !== a.radixPoint) { 4128 t.indexOf(a.radixPoint) === a.suffix.length && (o && o.buffer ? o.buffer.splice(0, 1 + a.suffix.length) : (t.splice(0, 1 + a.suffix.length), 4129 o = { 4130 refreshFromBuffer: !0, 4131 buffer: n(t) 4132 })); 4133 } 4134 if (a.enforceDigitsOnBlur) { 4135 var v = (o = o || {}) && o.buffer || t.slice().reverse(); 4136 o.refreshFromBuffer = !0, o.buffer = c(v, a.digits, a, !0).reverse(); 4137 } 4138 } 4139 return o; 4140 }, 4141 onKeyDown: function(e, t, i, a) { 4142 var r, o = l(this); 4143 if (3 != e.location) { 4144 var s, u = String.fromCharCode(e.keyCode).toLowerCase(); 4145 if ((s = a.shortcuts && a.shortcuts[u]) && s.length > 1) return this.inputmask.__valueSet.call(this, parseFloat(this.inputmask.unmaskedvalue()) * parseInt(s)), 4146 o.trigger("setvalue"), !1; 4147 } 4148 if (e.ctrlKey) switch (e.keyCode) { 4149 case n.default.UP: 4150 return this.inputmask.__valueSet.call(this, parseFloat(this.inputmask.unmaskedvalue()) + parseInt(a.step)), 4151 o.trigger("setvalue"), !1; 4152 4153 case n.default.DOWN: 4154 return this.inputmask.__valueSet.call(this, parseFloat(this.inputmask.unmaskedvalue()) - parseInt(a.step)), 4155 o.trigger("setvalue"), !1; 4156 } 4157 if (!e.shiftKey && (e.keyCode === n.default.DELETE || e.keyCode === n.default.BACKSPACE || e.keyCode === n.default.BACKSPACE_SAFARI) && i.begin !== t.length) { 4158 if (t[e.keyCode === n.default.DELETE ? i.begin - 1 : i.end] === a.negationSymbol.front) return r = t.slice().reverse(), 4159 "" !== a.negationSymbol.front && r.shift(), "" !== a.negationSymbol.back && r.pop(), 4160 o.trigger("setvalue", [ r.join(""), i.begin ]), !1; 4161 if (!0 === a._radixDance) { 4162 var f = t.indexOf(a.radixPoint); 4163 if (a.digitsOptional) { 4164 if (0 === f) return (r = t.slice().reverse()).pop(), o.trigger("setvalue", [ r.join(""), i.begin >= r.length ? r.length : i.begin ]), 4165 !1; 4166 } else if (-1 !== f && (i.begin < f || i.end < f || e.keyCode === n.default.DELETE && (i.begin === f || i.begin - 1 === f))) { 4167 var d = void 0; 4168 return i.begin === i.end && (e.keyCode === n.default.BACKSPACE || e.keyCode === n.default.BACKSPACE_SAFARI ? i.begin++ : e.keyCode === n.default.DELETE && i.begin - 1 === f && (d = l.extend({}, i), 4169 i.begin--, i.end--)), (r = t.slice().reverse()).splice(r.length - i.begin, i.begin - i.end + 1), 4170 r = c(r, a.digits, a).join(""), d && (i = d), o.trigger("setvalue", [ r, i.begin >= r.length ? f + 1 : i.begin ]), 4171 !1; 4172 } 4173 } 4174 } 4175 } 4176 }, 4177 currency: { 4178 prefix: "", 4179 groupSeparator: ",", 4180 alias: "numeric", 4181 digits: 2, 4182 digitsOptional: !1 4183 },
4184 decimal: { 4185 alias: "numeric" 4186 }, 4187 integer: { 4188 alias: "numeric", 4189 inputmode: "numeric", 4190 digits: 0 4191 }, 4192 percentage: { 4193 alias: "numeric", 4194 min: 0, 4195 max: 100, 4196 suffix: " %", 4197 digits: 0, 4198 allowMinus: !1 4199 }, 4200 indianns: { 4201 alias: "numeric", 4202 _mask: function(e) { 4203 return "(" + e.groupSeparator + "99){*|1}(" + e.groupSeparator + "999){1|1}"; 4204 }, 4205 groupSeparator: ",", 4206 radixPoint: ".", 4207 placeholder: "0", 4208 digits: 2, 4209 digitsOptional: !1 4210 } 4211 }); 4212 }, 4213 9380: function(e, t, i) { 4214 var a; 4215 Object.defineProperty(t, "__esModule", { 4216 value: !0 4217 }), t.default = void 0; 4218 var n = ((a = i(8741)) && a.__esModule ? a : { 4219 default: a 4220 }).default ? window : {}; 4221 t.default = n; 4222 }, 4223 7760: function(e, t, i) { 4224 Object.defineProperty(t, "__esModule", { 4225 value: !0 4226 }), t.HandleNativePlaceholder = function(e, t) { 4227 var i = e ? e.inputmask : this; 4228 if (l.ie) { 4229 if (e.inputmask._valueGet() !== t && (e.placeholder !== t || "" === e.placeholder)) { 4230 var a = o.getBuffer.call(i).slice(), n = e.inputmask._valueGet(); 4231 if (n !== t) { 4232 var r = o.getLastValidPosition.call(i); 4233 -1 === r && n === o.getBufferTemplate.call(i).join("") ? a = [] : -1 !== r && f.call(i, a), 4234 p(e, a); 4235 } 4236 } 4237 } else e.placeholder !== t && (e.placeholder = t, "" === e.placeholder && e.removeAttribute("placeholder")); 4238 }, t.applyInputValue = c, t.checkVal = d, t.clearOptionalTail = f, t.unmaskedvalue = function(e) { 4239 var t = e ? e.inputmask : this, i = t.opts, a = t.maskset; 4240 if (e) { 4241 if (void 0 === e.inputmask) return e.value; 4242 e.inputmask && e.inputmask.refreshValue && c(e, e.inputmask._valueGet(!0)); 4243 } 4244 for (var n = [], r = a.validPositions, s = 0, l = r.length; s < l; s++) r[s] && r[s].match && (1 != r[s].match.static || Array.isArray(a.metadata) && !0 !== r[s].generatedInput) && n.push(r[s].input); 4245 var u = 0 === n.length ? "" : (t.isRTL ? n.reverse() : n).join(""); 4246 if ("function" == typeof i.onUnMask) { 4247 var f = (t.isRTL ? o.getBuffer.call(t).slice().reverse() : o.getBuffer.call(t)).join(""); 4248 u = i.onUnMask.call(t, f, u, i); 4249 } 4250 return u; 4251 }, t.writeBuffer = p; 4252 var a, n = (a = i(5581)) && a.__esModule ? a : { 4253 default: a 4254 }, r = i(4713), o = i(8711), s = i(7215), l = i(9845), u = i(6030); 4255 function c(e, t) { 4256 var i = e ? e.inputmask : this, a = i.opts; 4257 e.inputmask.refreshValue = !1, "function" == typeof a.onBeforeMask && (t = a.onBeforeMask.call(i, t, a) || t), 4258 d(e, !0, !1, t = t.toString().split("")), i.und
4258oValue = i._valueGet(!0), (a.clearMaskOnLostFocus || a.clearIncomplete) && e.inputmask._valueGet() === o.getBufferTemplate.call(i).join("") && -1 === o.getLastValidPosition.call(i) && e.inputmask._valueSet(""); 4259 } 4260 function f(e) { 4261 e.length = 0; 4262 for (var t, i = r.getMaskTemplate.call(this, !0, 0, !0, void 0, !0); void 0 !== (t = i.shift()); ) e.push(t); 4263 return e; 4264 } 4265 function d(e, t, i, a, n) { 4266 var l = e ? e.inputmask : this, c = l.maskset, f = l.opts, d = l.dependencyLib, h = a.slice(), v = "", m = -1, g = void 0, k = f.skipOptionalPartCharacter; 4267 f.skipOptionalPartCharacter = "", o.resetMaskSet.call(l), c.tests = {}, m = f.radixPoint ? o.determineNewCaretPosition.call(l, { 4268 begin: 0, 4269 end: 0 4270 }, !1, !1 === f.__financeInput ? "radixFocus" : void 0).begin : 0, c.p = m, l.caretPos = { 4271 begin: m 4272 }; 4273 var y = [], b = l.caretPos; 4274 if (h.forEach((function(e, t) { 4275 if (void 0 !== e) { 4276 var a = new d.Event("_checkval"); 4277 a.keyCode = e.toString().charCodeAt(0), v += e; 4278 var n = o.getLastValidPosition.call(l, void 0, !0); 4279 !function(e, t) { 4280 for (var i = r.getMaskTemplate.call(l, !0, 0).slice(e, o.seekNext.call(l, e, !1, !1)).join("").replace(/'/g, ""), a = i.indexOf(t); a > 0 && " " === i[a - 1]; ) a--; 4281 var n = 0 === a && !o.isMask.call(l, e) && (r.getTest.call(l, e).match.nativeDef === t.charAt(0) || !0 === r.getTest.call(l, e).match.static && r.getTest.call(l, e).match.nativeDef === "'" + t.charAt(0) || " " === r.getTest.call(l, e).match.nativeDef && (r.getTest.call(l, e + 1).match.nativeDef === t.charAt(0) || !0 === r.getTest.call(l, e + 1).match.static && r.getTest.call(l, e + 1).match.nativeDef === "'" + t.charAt(0))); 4282 if (!n && a > 0 && !o.isMask.call(l, e, !1, !0)) { 4283 var s = o.seekNext.call(l, e); 4284 l.caretPos.begin < s && (l.caretPos = { 4285 begin: s 4286 }); 4287 } 4288 return n; 4289 }(m, v) ? (g = u.EventHandlers.keypressEvent.call(l, a, !0, !1, i, l.caretPos.begin)) && (m = l.caretPos.begin + 1, 4290 v = "") : g = u.EventHandlers.keypressEvent.call(l, a, !0, !1, i, n + 1), g ? (void 0 !== g.pos && c.validPositions[g.pos] && !0 === c.validPositions[g.pos].match.static && void 0 === c.validPositions[g.pos].alternation && (y.push(g.pos), 4291 l.isRTL || (g.forwardPosition = g.pos + 1)), p.call(l, void 0, o.getBuffer.call(l), g.forwardPosition, a, !1), 4292 l.caretPos = { 4293 begin: g.forwardPosition, 4294 end: g.forwardPosition 4295 }, b = l.caretPos) : void 0 === c.validPositions[t] && h[t] === r.getPlaceholder.call(l, t) && o.isMask.call(l, t, !0) ? l.caretPos.begin++ : l.caretPos = b; 4296 } 4297 })), y.length > 0) { 4298 var x, P, E = o.seekNext.call(l, -1, void 0, !1); 4299 if (!s.isComplete.call(l, o.getBuffer.call(l)) && y.length <= E || s.isComplete.call(l, o.getBuffer.call(l)) && y.length > 0 && y.length !== E && 0 === y[0]) for (var S = E; void 0 !== (x = y.shift()); ) { 4300 var w = new d.Event("_checkval"); 4301 if ((P = c.validPositions[x]).generatedInput = !0, w.keyCode = P.input.charCodeAt(0), 4302 (g = u.EventHandlers.keypressEvent.call(l, w, !0, !1, i, S)) && void 0 !== g.pos && g.pos !== x && c.validPositions[g.pos] && !0 === c.val
4302idPositions[g.pos].match.static) y.push(g.pos); else if (!g) break; 4303 S++; 4304 } 4305 } 4306 t && p.call(l, e, o.getBuffer.call(l), g ? g.forwardPosition : l.caretPos.begin, n || new d.Event("checkval"), n && ("input" === n.type && l.undoValue !== o.getBuffer.call(l).join("") || "paste" === n.type)), 4307 f.skipOptionalPartCharacter = k; 4308 } 4309 function p(e, t, i, a, r) { 4310 var l = e ? e.inputmask : this, u = l.opts, c = l.dependencyLib; 4311 if (a && "function" == typeof u.onBeforeWrite) { 4312 var f = u.onBeforeWrite.call(l, a, t, i, u); 4313 if (f) { 4314 if (f.refreshFromBuffer) { 4315 var d = f.refreshFromBuffer; 4316 s.refreshFromBuffer.call(l, !0 === d ? d : d.start, d.end, f.buffer || t), t = o.getBuffer.call(l, !0); 4317 } 4318 void 0 !== i && (i = void 0 !== f.caret ? f.caret : i); 4319 } 4320 } 4321 if (void 0 !== e && (e.inputmask._valueSet(t.join("")), void 0 === i || void 0 !== a && "blur" === a.type || o.caret.call(l, e, i, void 0, void 0, void 0 !== a && "keydown" === a.type && (a.keyCode === n.default.DELETE || a.keyCode === n.default.BACKSPACE)), 4322 !0 === r)) { 4323 var p = c(e), h = e.inputmask._valueGet(); 4324 e.inputmask.skipInputEvent = !0, p.trigger("input"), setTimeout((function() { 4325 h === o.getBufferTemplate.call(l).join("") ? p.trigger("cleared") : !0 === s.isComplete.call(l, t) && p.trigger("complete"); 4326 }), 0); 4327 } 4328 } 4329 }, 4330 2394: function(e, t, i) { 4331 Object.defineProperty(t, "__esModule", { 4332 value: !0 4333 }), t.default = void 0, i(7149), i(3194); 4334 var a = i(157), n = m(i(3287)), r = m(i(9380)), o = i(2391), s = i(4713), l = i(8711), u = i(7215), c = i(7760), f = i(9716), d = m(i(7392)), p = m(i(3976)), h = m(i(8741)); 4335 function v(e) { 4336 return v = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { 4337 return typeof e; 4338 } : function(e) { 4339 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; 4340 }, v(e); 4341 } 4342 function m(e) { 4343 return e && e.__esModule ? e : { 4344 default: e 4345 }; 4346 } 4347 var g = r.default.document, k = "_inputmask_opts"; 4348 function y(e, t, i) { 4349 if (h.default) { 4350 if (!(this instanceof y)) return new y(e, t, i); 4351 this.dependencyLib = n.default, this.el = void 0, this.events = {}, this.maskset = void 0, 4352 !0 !== i && ("[object Object]" === Object.prototype.toString.call(e) ? t = e : (t = t || {}, 4353 e && (t.alias = e)), this.opts = n.default.extend(!0, {}, this.defaults, t), this.noMasksCache = t && void 0 !== t.definitions, 4354 this.userOptions = t || {}, b(this.opts.alias, t, this.opts)), this.refreshValue = !1, 4355 this.undoValue = void 0, this.$el = void 0, this.skipKeyPressEvent = !1, this.skipInputEvent = !1, 4356 this.validationEvent = !1, this.ignorable = !1, this.maxLength, this.mouseEnter = !1, 4357 this.originalPlaceholder = void 0, this.isComposing = !1; 4358 } 4359 } 4360 function b(e, t, i) { 4361 var a = y.prototype.aliases[e]; 4362 return a ? (a.alias && b(a.alias, void 0, i), n.default.extend(!0, i, a), n.default.extend(!0, i, t), 4363 !0) : (null === i.mask && (i.mask = e), !1); 4364 } 4365 y.prototype = { 4366 dataAttribute: "data-inputmask", 4367 defaults: p.default, 4368 definitions: d.default, 4369 aliases: {}, 4370 masksCache: {}, 4371 get isRTL() { 4372 return this.opts.isRTL || this.opts.numericInput; 4373 }, 4374 mask: function(e) { 4375 var t = this; 4376 return "string" == typeof e && (e = g.getElementById(e) || g.querySelectorAll(e)), 4377 (e = e.nodeName ? [ e ] : Array.isArray(e) ? e : [].slice.call(e)).forEac
4377h((function(e, i) { 4378 var s = n.default.extend(!0, {}, t.opts); 4379 if (function(e, t, i, a) { 4380 function o(t, n) { 4381 var o = "" === a ? t : a + "-" + t; 4382 null !== (n = void 0 !== n ? n : e.getAttribute(o)) && ("string" == typeof n && (0 === t.indexOf("on") ? n = r.default[n] : "false" === n ? n = !1 : "true" === n && (n = !0)), 4383 i[t] = n); 4384 } 4385 if (!0 === t.importDataAttributes) { 4386 var s, l, u, c, f = e.getAttribute(a); 4387 if (f && "" !== f && (f = f.replace(/'/g, '"'), l = JSON.parse("{" + f + "}")), 4388 l) for (c in u = void 0, l) if ("alias" === c.toLowerCase()) { 4389 u = l[c]; 4390 break; 4391 } 4392 for (s in o("alias", u), i.alias && b(i.alias, i, t), t) { 4393 if (l) for (c in u = void 0, l) if (c.toLowerCase() === s.toLowerCase()) { 4394 u = l[c]; 4395 break; 4396 } 4397 o(s, u); 4398 } 4399 } 4400 n.default.extend(!0, t, i), ("rtl" === e.dir || t.rightAlign) && (e.style.textAlign = "right"); 4401 ("rtl" === e.dir || t.numericInput) && (e.dir = "ltr", e.removeAttribute("dir"), 4402 t.isRTL = !0); 4403 return Object.keys(i).length; 4404 }(e, s, n.default.extend(!0, {}, t.userOptions), t.dataAttribute)) { 4405 var l = (0, o.generateMaskSet)(s, t.noMasksCache); 4406 void 0 !== l && (void 0 !== e.inputmask && (e.inputmask.opts.autoUnmask = !0, e.inputmask.remove()), 4407 e.inputmask = new y(void 0, void 0, !0), e.inputmask.opts = s, e.inputmask.noMasksCache = t.noMasksCache, 4408 e.inputmask.userOptions = n.default.extend(!0, {}, t.userOptions), e.inputmask.el = e, 4409 e.inputmask.$el = (0, n.default)(e), e.inputmask.maskset = l, n.default.data(e, k, t.userOptions), 4410 a.mask.call(e.inputmask)); 4411 } 4412 })), e && e[0] && e[0].inputmask || this; 4413 }, 4414 option: function(e, t) { 4415 return "string" == typeof e ? this.opts[e] : "object" === v(e) ? (n.default.extend(this.userOptions, e), 4416 this.el && !0 !== t && this.mask(this.el), this) : void 0; 4417 }, 4418 unmaskedvalue: function(e) { 4419 if (this.maskset = this.maskset || (0, o.generateMaskSet)(this.opts, this.noMasksCache), 4420 void 0 === this.el || void 0 !== e) { 4421 var t = ("function" == typeof this.opts.onBeforeMask && this.opts.onBeforeMask.call(this, e, this.opts) || e).split(""); 4422 c.checkVal.call(this, void 0, !1, !1, t), "function" == typeof this.opts.onBeforeWrite && this.opts.onBeforeWrite.call(this, void 0, l.getBuffer.call(this), 0, this.opts); 4423 } 4424 return c.unmaskedvalue.call(this, this.el); 4425 }, 4426 remove: function() { 4427 if (this.el) { 4428 n.default.data(this.el, k, null); 4429 var e = this.opts.autoUnmask ? (0, c.unmaskedvalue)(this.el) : this._valueGet(this.opts.autoUnmask); 4430 e !== l.getBufferTemplate.call(this).join("") ? this._valueSet(e, this.opts.autoUnmask) : this._valueSet(""), 4431 f.EventRuler.off(this.el), Object.getOwnPropertyDescriptor && Ob
4431ject.getPrototypeOf ? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this.el), "value") && this.__valueGet && Object.defineProperty(this.el, "value", { 4432 get: this.__valueGet, 4433 set: this.__valueSet, 4434 configurable: !0 4435 }) : g.__lookupGetter__ && this.el.__lookupGetter__("value") && this.__valueGet && (this.el.__defineGetter__("value", this.__valueGet), 4436 this.el.__defineSetter__("value", this.__valueSet)), this.el.inputmask = void 0; 4437 } 4438 return this.el; 4439 }, 4440 getemptymask: function() { 4441 return this.maskset = this.maskset || (0, o.generateMaskSet)(this.opts, this.noMasksCache), 4442 (this.isRTL ? l.getBufferTemplate.call(this).reverse() : l.getBufferTemplate.call(this)).join(""); 4443 }, 4444 hasMaskedValue: function() { 4445 return !this.opts.autoUnmask; 4446 }, 4447 isComplete: function() { 4448 return this.maskset = this.maskset || (0, o.generateMaskSet)(this.opts, this.noMasksCache), 4449 u.isComplete.call(this, l.getBuffer.call(this)); 4450 }, 4451 getmetadata: function() { 4452 if (this.maskset = this.maskset || (0, o.generateMaskSet)(this.opts, this.noMasksCache), 4453 Array.isArray(this.maskset.metadata)) { 4454 var e = s.getMaskTemplate.call(this, !0, 0, !1).join(""); 4455 return this.maskset.metadata.forEach((function(t) { 4456 return t.mask !== e || (e = t, !1); 4457 })), e; 4458 } 4459 return this.maskset.metadata; 4460 }, 4461 isValid: function(e) { 4462 if (this.maskset = this.maskset || (0, o.generateMaskSet)(this.opts, this.noMasksCache), 4463 e) { 4464 var t = ("function" == typeof this.opts.onBeforeMask && this.opts.onBeforeMask.call(this, e, this.opts) || e).split(""); 4465 c.checkVal.call(this, void 0, !0, !1, t); 4466 } else e = this.isRTL ? l.getBuffer.call(this).slice().reverse().join("") : l.getBuffer.call(this).join(""); 4467 for (var i = l.getBuffer.call(this), a = l.determineLastRequiredPosition.call(this), n = i.length - 1; n > a && !l.isMask.call(this, n); n--) ; 4468 return i.splice(a, n + 1 - a), u.isComplete.call(this, i) && e === (this.isRTL ? l.getBuffer.call(this).slice().reverse().join("") : l.getBuffer.call(this).join("")); 4469 }, 4470 format: function(e, t) { 4471 this.maskset = this.maskset || (0, o.generateMaskSet)(this.opts, this.noMasksCache); 4472 var i = ("function" == typeof this.opts.onBeforeMask && this.opts.onBeforeMask.call(this, e, this.opts) || e).split(""); 4473 c.checkVal.call(this, void 0, !0, !1, i); 4474 var a = this.isRTL ? l.getBuffer.call(this).slice().reverse().join("") : l.getBuffer.call(this).join(""); 4475 return t ? { 4476 value: a, 4477 metadata: this.getmetadata() 4478 } : a; 4479 }, 4480 setValue: function(e) { 4481 this.el && (0, n.default)(this.el).trigger("setvalue", [ e ]); 4482 }, 4483 analyseMask: o.analyseMask 4484 }, y.extendDefaults = function(e) { 4485 n.default.extend(!0, y.prototype.defaults, e); 4486 }, y.extendDefinitions = function(e) { 4487 n.default.extend(!0, y.prototype.definitions, e); 4488 }, y.extendAliases = function(e) { 4489 n.default.extend(!0, y.prototype.aliases, e); 4490 }, y.format = function(e, t, i) { 4491 return y(t).format(e, i); 4492 }, y.unmask = function(e, t) { 4493 return y(t).unmaskedvalue(e); 4494 }, y.isValid = function(e, t) { 4495 return y(t).isValid(e); 4496 }, y.remove = function(e) { 4497 "string" == typeof e && (e = g.getElementById(e) || g.querySelectorAll(e)), (e = e.nodeName ? [ e ] : e).forEach((function(e) { 4498 e.inputmask && e.inputmask.remove(); 4499 })); 4500 }, y.setValue = function(e, t) { 4501 "string" == typeof e && (e = g.getElementById(e) || g.querySelectorAll(e)), (e = e.nodeName ? [ e ] : e).forEach((function(e) {
4502 e.inputmask ? e.inputmask.setValue(t) : (0, n.default)(e).trigger("setvalue", [ t ]); 4503 })); 4504 }, y.dependencyLib = n.default, r.default.Inputmask = y; 4505 var x = y; 4506 t.default = x; 4507 }, 4508 5296: function(e, t, i) { 4509 function a(e) { 4510 return a = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { 4511 return typeof e; 4512 } : function(e) { 4513 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; 4514 }, a(e); 4515 } 4516 var n = h(i(9380)), r = h(i(2394)), o = h(i(8741)); 4517 function s(e, t) { 4518 for (var i = 0; i < t.length; i++) { 4519 var a = t[i]; 4520 a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), 4521 Object.defineProperty(e, a.key, a); 4522 } 4523 } 4524 function l(e, t) { 4525 if (t && ("object" === a(t) || "function" == typeof t)) return t; 4526 if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined"); 4527 return function(e) { 4528 if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 4529 return e; 4530 }(e); 4531 } 4532 function u(e) { 4533 var t = "function" == typeof Map ? new Map : void 0; 4534 return u = function(e) { 4535 if (null === e || (i = e, -1 === Function.toString.call(i).indexOf("[native code]"))) return e; 4536 var i; 4537 if ("function" != typeof e) throw new TypeError("Super expression must either be null or a function"); 4538 if (void 0 !== t) { 4539 if (t.has(e)) return t.get(e); 4540 t.set(e, a); 4541 } 4542 function a() { 4543 return c(e, arguments, p(this).constructor); 4544 } 4545 return a.prototype = Object.create(e.prototype, { 4546 constructor: { 4547 value: a, 4548 enumerable: !1, 4549 writable: !0, 4550 configurable: !0 4551 } 4552 }), d(a, e); 4553 }, u(e); 4554 } 4555 function c(e, t, i) { 4556 return c = f() ? Reflect.construct : function(e, t, i) { 4557 var a = [ null ]; 4558 a.push.apply(a, t); 4559 var n = new (Function.bind.apply(e, a)); 4560 return i && d(n, i.prototype), n; 4561 }, c.apply(null, arguments); 4562 } 4563 function f() { 4564 if ("undefined" == typeof Reflect || !Reflect.construct) return !1; 4565 if (Reflect.construct.sham) return !1; 4566 if ("function" == typeof Proxy) return !0; 4567 try { 4568 return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {}))), 4569 !0; 4570 } catch (e) { 4571 return !1; 4572 } 4573 } 4574 function d(e, t) { 4575 return d = Object.setPrototypeOf || function(e, t) { 4576 return e.__proto__ = t, e; 4577 }, d(e, t); 4578 } 4579 function p(e) { 4580 return p = Object.setPrototypeOf ? Object.getPrototypeOf : function(e) { 4581 return e.__proto__ || Object.getPrototypeOf(e); 4582 }, p(e); 4583 } 4584 function h(e) {
4585 return e && e.__esModule ? e : { 4586 default: e 4587 }; 4588 } 4589 var v = n.default.document; 4590 if (o.default && v && v.head && v.head.attachShadow && n.default.customElements && void 0 === n.default.customElements.get("input-mask")) { 4591 var m = function(e) { 4592 !function(e, t) { 4593 if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function"); 4594 e.prototype = Object.create(t && t.prototype, { 4595 constructor: { 4596 value: e, 4597 writable: !0, 4598 configurable: !0 4599 } 4600 }), Object.defineProperty(e, "prototype", { 4601 writable: !1 4602 }), t && d(e, t); 4603 }(c, e); 4604 var t, i, a, n, o, u = (t = c, i = f(), function() { 4605 var e, a = p(t); 4606 if (i) { 4607 var n = p(this).constructor; 4608 e = Reflect.construct(a, arguments, n); 4609 } else e = a.apply(this, arguments); 4610 return l(this, e); 4611 }); 4612 function c() { 4613 var e; 4614 !function(e, t) { 4615 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); 4616 }(this, c); 4617 var t = (e = u.call(this)).getAttributeNames(), i = e.attachShadow({ 4618 mode: "closed" 4619 }), a = v.createElement("input"); 4620 for (var n in a.type = "text", i.appendChild(a), t) Object.prototype.hasOwnProperty.call(t, n) && a.setAttribute(t[n], e.getAttribute(t[n])); 4621 var o = new r.default; 4622 return o.dataAttribute = "", o.mask(a), a.inputmask.shadowRoot = i, e; 4623 } 4624 return a = c, n && s(a.prototype, n), o && s(a, o), Object.defineProperty(a, "prototype", { 4625 writable: !1 4626 }), a; 4627 }(u(HTMLElement)); 4628 n.default.customElements.define("input-mask", m); 4629 } 4630 }, 4631 443: function(e, t, i) { 4632 var a = o(i(7957)), n = o(i(2394)); 4633 function r(e) { 4634 return r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { 4635 return typeof e; 4636 } : function(e) { 4637 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; 4638 }, r(e); 4639 } 4640 function o(e) { 4641 return e && e.__esModule ? e : { 4642 default: e 4643 }; 4644 } 4645 void 0 === a.default.fn.inputmask && (a.default.fn.inputmask = function(e, t) { 4646 var i, o = this[0]; 4647 if (void 0 === t && (t = {}), "string" == typeof e) switch (e) { 4648 case "unmaskedvalue": 4649 return o && o.inputmask ? o.inputmask.unmaskedvalue() : (0, a.default)(o).val(); 4650 4651 case "remove": 4652 return this.each((function() { 4653 this.inputmask && this.inputmask.remove(); 4654 })); 4655 4656 case "getemptymask": 4657 return o && o.inputmask ? o.inputmask.getemptymask() : ""; 4658 4659 case "hasMaskedValue": 4660 return !(!o || !o.inputmask) && o.inputmask.hasMaskedValue(); 4661 4662 case "isComplete": 4663 return !o || !o.inputmask || o.inputmask.isComplete(); 4664 4665 case "getmetadata": 4666 return o && o.inputmask ? o.inputmask.getmetadata() : void 0; 4667 4668 case "setvalue": 4669 n.default.setValue(o, t); 4670 break; 4671 4672 case "option": 4673 if ("string" != typeof t) return this.each((function() { 4674 if (void 0 !== this.inputmask) return this.inputmask.option(t); 4675 })); 4676 if (o && void 0 !== o.inputmask) return o.inputmask.option(t); 4677 break; 4678 4679 default: 4680 return t.alias = e, i = new n.default(t), this.each((function() { 4681 i.mask(this); 4682 })); 4683 } else { 4684 if (Array.isArray(e)) return t.alias = e, i = new n.default(t), this.each((function() { 4685 i.mask(this); 4686 })); 4687 if ("object" == r(e)) return i = new n.default(e), void 0 === e.mask && void 0 === e.alias ? this.each((function() { 4688 if (void 0 !== this.inputmask) return this.inputmask.option(e); 4689 i.mask(this); 4690 })) : this.each((function() { 4691 i.mask(this); 4692 })); 4693 if (void 0 === e) return this.each((function() { 4694 (i = new n.default(t)).mask(this); 4695 })); 4696 } 4697 }); 4698 }, 4699 2391: function(e, t, i) { 4700 Object.defineProperty(t, "__esModule", { 4701 value: !0 4702 }), t.analyseMask = function(e, t, i) { 4703 var a, o, s, l, u, c, f = /(?:[?*+]|\{[0-9+*]+(?:,[0-9+*]*)?(?:\|[0-9+*]*)?\})|[^.?*+^${[]()|\\]+|./g, d = /\[\^?]?(?:[^\\\]]+|\\[\S\s]?)*]?|\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\S\s]?)|\((?:\?[:=!]?)?|(?:[?*+]|\{[0-9]+(?:,[0-9]*)?\})\??|[^.?*+^${[()|\\]+|./g, p = !1, h = new n.default, v = [], m = [], g = !1; 4704 function k(e, a, n) { 4705 n = void 0 !== n ? n : e.matches.length; 4706 var o = e.matches[n - 1]; 4707 if (t) 0 === a.indexOf("[") || p && /\\d|\\s|\\w/i.test(a) || "." === a ? e.matches.splice(n++, 0, { 4708 fn: new RegExp(a, i.casing ? "i" : ""), 4709 static: !1, 4710 optionality: !1, 4711 newBlockMarker: void 0 === o ? "master" : o.def !== a, 4712 casing: null, 4713 def: a, 4714 placeholder: void 0, 4715 nativeDef: a 4716 }) : (p && (a = a[a.length - 1]), a.split("").forEach((function(t, a) { 4717 o = e.matches[n - 1], e.matches.splice(n++, 0, { 4718 fn: /[a-z]/i.test(i.staticDefinitionSymbol || t) ? new RegExp("[" + (i.staticDefinitionSymbol || t) + "]", i.casing ? "i" : "") : null, 4719 static: !0, 4720 optionality: !1, 4721 newBlockMarker: void 0 === o ? "master" : o.def !== t && !0 !== o.static, 4722 casing: null, 4723 def: i.staticDefinitionSymbol || t, 4724 placeholder: void 0 !== i.staticDefinitionSymbol ? t : void 0, 4725 nativeDef: (p ? "'" : "") + t 4726 }); 4727 }))), p = !1; else { 4728 var s = i.definitions && i.definitions[a] || i.usePrototypeDefinitions && r.default.prototype.definitions[a]; 4729 s && !p ? e.matches.splice(n++, 0, { 4730 fn: s.validator ? "string" == typeof s.validator ? new RegExp(s.validator, i.casing ? "i" : "") : new function() { 4731 this.test = s.validator; 4732 } : new RegExp("."), 4733 static: s.static || !1, 4734 optionality: s.optional || !1, 4735 defOptionality: s.optional || !1, 4736 newBlockMarker: void 0 === o || s.optional ? "master" : o.def !== (s.definitionSymbol || a), 4737 casing: s.casing, 4738 def: s.definitionSymbol || a, 4739 placeholder: s.placeholder, 4740 nativeDef: a, 4741 generated: s.generated 4742 }) : (e.matches.splice(n++, 0, { 4743 fn: /[a-z]/i.test(i.staticDefinitionSymbol || a) ? new RegExp("[" + (i.staticDefinitionSymbol || a) + "]", i.casing ? "i" : "") : null, 4744 static: !0, 4745 optionality: !1, 4746 newBlockMarker: void 0 === o ? "master" : o.def !== a && !0 !== o.static, 4747 casing: null, 4748 def: i.staticDefinitionSymbol || a, 4749 placeholder: void 0 !== i.staticDefinitionSymbol ? a : void 0, 4750 nativeDef: (p ? "'" : "") + a 4751 }), p = !1); 4752 } 4753 } 4754 function y() { 4755 if (v.length > 0) { 4756 if (k(l = v[v.length - 1], o), l.isAlternator) { 4757 u = v.pop(); 4758 for (var e = 0; e < u.matches.length; e++) u.matches[e].isGroup && (u.matches[e].isGroup = !1); 4759 v.length > 0 ? (l = v[v.length - 1]).matches.push(u) : h.matches.push(u); 4760 } 4761 } else k(h, o); 4762 } 4763 function b(e) { 4764 var t = new n.default(!0); 4765 return t.openGroup = !1, t.matches = e, t; 4766 } 4767 function x() { 4768 if ((s = v.pop()).openGroup = !1, void 0 !== s) if (v.length > 0) { 4769 if ((l = v[v.length - 1]).matches.push(s), l.isAlternator) { 4770 for (var e = (u = v.pop()).matches[0].matches ? u.matches[0].matches.length : 1, t = 0; t < u.matches.length; t++) u.matches[t].isGroup = !1, 4771 u.matches[t].alternatorGroup = !1, null === i.keepStatic && e < (u.matches[t].matches ? u.matches[t].matches.length : 1) && (i.keepStatic = !0), 4772 e = u.matches[t].matches ? u.matches[t].matches.length : 1; 4773 v.length > 0 ? (l = v[v.length - 1]).matches.push(u) : h.matches.push(u); 4774 } 4775 } else h.matches.push(s); else y(); 4776 } 4777 function P(e) { 4778 var t = e.pop(); 4779 return t.isQuantifier && (t = b([ e.pop(), t ])), t; 4780 } 4781 t && (i.optionalmarker[0] = void 0, i.optionalmarker[1] = void 0); 4782 for (;a = t ? d.exec(e) : f.exec(e); ) { 4783 if (o = a[0], t) { 4784 switch (o.charAt(0)) { 4785 case "?": 4786 o = "{0,1}"; 4787 break; 4788 4789 case "+": 4790 case "*": 4791 o = "{" + o + "}"; 4792 break; 4793 4794 case "|": 4795 if (0 === v.length) { 4796 var E = b(h.matches); 4797 E.openGroup = !0, v.push(E), h.matches = [], g = !0; 4798 } 4799 } 4800 if ("\\d" === o) o = "[0-9]"; 4801 } 4802 if (p) y(); else switch (o.charAt(0)) { 4803 case "$": 4804 case "^": 4805 t || y(); 4806 break; 4807 4808 case i.escapeChar: 4809 p = !0, t && y(); 4810 break; 4811 4812 case i.optionalmarker[1]: 4813 case i.groupmarker[1]: 4814 x(); 4815 break; 4816 4817 case i.optionalmarker[0]: 4818 v.push(new n.default(!1, !0)); 4819 break; 4820 4821 case i.groupmarker[0]: 4822 v.push(new n.default(!0)); 4823 break; 4824 4825 case i.quantifiermarker[0]: 4826 var S = new n.default(!1, !1, !0), w = (o = o.replace(/[{}?]/g, "")).split("|"), _ = w[0].split(","), M = isNaN(_[0]) ? _[0] : parseInt(_[0]), O = 1 === _.length ? M : isNaN(_[1]) ? _[1] : parseInt(_[1]), T = isNaN(w[1]) ? w[1] : parseInt(w[1]); 4827 "*" !== M && "+" !== M || (M = "*" === O ? 0 : 1), S.quantifier = { 4828 min: M, 4829 max: O, 4830 jit: T 4831 }; 4832 var A = v.length > 0 ? v[v.length - 1].matches : h.matches; 4833 if ((a = A.pop()).isAlternator) { 4834 A.push(a), A = a.matches; 4835 var C = new n.default(!0), D = A.pop(); 4836 A.push(C), A = C.matches, a = D; 4837 } 4838 a.isGroup || (a = b([ a ])), A.push(a), A.push(S); 4839 break; 4840 4841 case i.alternatormarker: 4842 if (v.length > 0) { 4843 var j = (l = v[v.length - 1]).matches[l.matches.length - 1]; 4844 c = l.openGroup && (void 0 === j.matches || !1 === j.isGroup && !1 === j.isAlternator) ? v.pop() : P(l.matches); 4845 } else c = P(h.matches); 4846 if (c.isAlternator) v.push(c); else if (c.alternatorGroup ? (u = v.pop(), c.alternatorGroup = !1) : u = new n.default(!1, !1, !1, !0), 4847 u.matches.push(c), v.push(u), c.openGroup) { 4848 c.openGroup = !1; 4849 var B = new n.default(!0); 4850 B.alternatorGroup = !0, v.push(B); 4851 } 4852 break; 4853 4854 default: 4855 y(); 4856 } 4857 } 4858 g && x(); 4859 for (;v.length > 0; ) s = v.pop(), h.matches.push(s); 4860 h.matches.length > 0 && (!function e(a) {
4861 a && a.matches && a.matches.forEach((function(n, r) { 4862 var o = a.matches[r + 1]; 4863 (void 0 === o || void 0 === o.matches || !1 === o.isQuantifier) && n && n.isGroup && (n.isGroup = !1, 4864 t || (k(n, i.groupmarker[0], 0), !0 !== n.openGroup && k(n, i.groupmarker[1]))), 4865 e(n); 4866 })); 4867 }(h), m.push(h)); 4868 (i.numericInput || i.isRTL) && function e(t) { 4869 for (var a in t.matches = t.matches.reverse(), t.matches) if (Object.prototype.hasOwnProperty.call(t.matches, a)) { 4870 var n = parseInt(a); 4871 if (t.matches[a].isQuantifier && t.matches[n + 1] && t.matches[n + 1].isGroup) { 4872 var r = t.matches[a]; 4873 t.matches.splice(a, 1), t.matches.splice(n + 1, 0, r); 4874 } 4875 void 0 !== t.matches[a].matches ? t.matches[a] = e(t.matches[a]) : t.matches[a] = ((o = t.matches[a]) === i.optionalmarker[0] ? o = i.optionalmarker[1] : o === i.optionalmarker[1] ? o = i.optionalmarker[0] : o === i.groupmarker[0] ? o = i.groupmarker[1] : o === i.groupmarker[1] && (o = i.groupmarker[0]), 4876 o); 4877 } 4878 var o; 4879 return t; 4880 }(m[0]); 4881 return m; 4882 }, t.generateMaskSet = function(e, t) { 4883 var i; 4884 function n(e, i, n) { 4885 var s, l, u = !1; 4886 return null !== e && "" !== e || ((u = null !== n.regex) ? e = (e = n.regex).replace(/^(\^)(.*)(\$)$/, "$2") : (u = !0, 4887 e = ".*")), 1 === e.length && !1 === n.greedy && 0 !== n.repeat && (n.placeholder = ""), 4888 e = function(e, t) { 4889 if (t.repeat > 0 || "*" === t.repeat || "+" === t.repeat) { 4890 var i = "*" === t.repeat ? 0 : "+" === t.repeat ? 1 : t.repeat; 4891 e = t.groupmarker[0] + e + t.groupmarker[1] + t.quantifiermarker[0] + i + "," + t.repeat + t.quantifiermarker[1]; 4892 } 4893 if (!0 === t.keepStatic) { 4894 var a = e.match(new RegExp("(?<p1>.)\\[(?<p2>[^\\]]*)\\]", "g")); 4895 a && a.forEach((function(t, i) { 4896 var a = t.split("["), n = a[0], r = a[1].replace("]", ""); 4897 e = e.replace(new RegExp("".concat((0, o.default)(n), "\\[").concat((0, o.default)(r), "\\]")), n.charAt(0) === r.charAt(0) ? "(".concat(n, "|").concat(n).concat(r, ")") : "".concat(n, "[").concat(r, "]")); 4898 })); 4899 } 4900 return e; 4901 }(e, n), l = u ? "regex_" + n.regex : n.numericInput ? e.split("").reverse().join("") : e, 4902 null !== n.keepStatic && (l = "ks_" + n.keepStatic + l), void 0 === r.default.prototype.masksCache[l] || !0 === t ? (s = { 4903 mask: e, 4904 maskToken: r.default.prototype.analyseMask(e, u, n), 4905 validPositions: [], 4906 _buffer: void 0, 4907 buffer: void 0, 4908 tests: {}, 4909 excludes: {}, 4910 metadata: i, 4911 maskLength: void 0, 4912 jitOffset: {} 4913 }, !0 !== t && (r.default.prototype.masksCache[l] = s, s = a.default.extend(!0, {}, r.default.prototype.masksCache[l]))) : s = a.default.extend(!0, {}, r.default.prototype.masksCache[l]), 4914 s; 4915 } 4916 "function" == typeof e.mask && (e.mask = e.mask(e)); 4917 if (Array.isArray(e.mask)) { 4918 if (e.mask.length > 1) { 4919 null === e.keepStatic && (e.keepStatic = !0); 4920 var s = e.groupmarker[0]; 4921 return (e.isRTL ? e.mask.reverse() : e.mask).forEac
4921h((function(t) { 4922 s.length > 1 && (s += e.alternatormarker), void 0 !== t.mask && "function" != typeof t.mask ? s += t.mask : s += t; 4923 })), n(s += e.groupmarker[1], e.mask, e); 4924 } 4925 e.mask = e.mask.pop(); 4926 } 4927 i = e.mask && void 0 !== e.mask.mask && "function" != typeof e.mask.mask ? n(e.mask.mask, e.mask, e) : n(e.mask, e.mask, e); 4928 null === e.keepStatic && (e.keepStatic = !1); 4929 return i; 4930 }; 4931 var a = s(i(3287)), n = s(i(9695)), r = s(i(2394)), o = s(i(7184)); 4932 function s(e) { 4933 return e && e.__esModule ? e : { 4934 default: e 4935 }; 4936 } 4937 }, 4938 157: function(e, t, i) { 4939 Object.defineProperty(t, "__esModule", { 4940 value: !0 4941 }), t.mask = function() { 4942 var e = this, t = this.opts, i = this.el, a = this.dependencyLib; 4943 s.EventRuler.off(i); 4944 var f = function(t, i) { 4945 "textarea" !== t.tagName.toLowerCase() && i.ignorables.push(n.default.ENTER); 4946 var l = t.getAttribute("type"), u = "input" === t.tagName.toLowerCase() && i.supportsInputType.includes(l) || t.isContentEditable || "textarea" === t.tagName.toLowerCase(); 4947 if (!u) if ("input" === t.tagName.toLowerCase()) { 4948 var c = document.createElement("input"); 4949 c.setAttribute("type", l), u = "text" === c.type, c = null; 4950 } else u = "partial"; 4951 return !1 !== u ? function(t) { 4952 var n, l; 4953 function u() { 4954 return this.inputmask ? this.inputmask.opts.autoUnmask ? this.inputmask.unmaskedvalue() : -1 !== r.getLastValidPosition.call(e) || !0 !== i.nullable ? (this.inputmask.shadowRoot || this.ownerDocument).activeElement === this && i.clearMaskOnLostFocus ? (e.isRTL ? o.clearOptionalTail.call(e, r.getBuffer.call(e).slice()).reverse() : o.clearOptionalTail.call(e, r.getBuffer.call(e).slice())).join("") : n.call(this) : "" : n.call(this); 4955 } 4956 function c(e) { 4957 l.call(this, e), this.inputmask && (0, o.applyInputValue)(this, e); 4958 } 4959 if (!t.inputmask.__valueGet) { 4960 if (!0 !== i.noValuePatching) { 4961 if (Object.getOwnPropertyDescriptor) { 4962 var f = Object.getPrototypeOf ? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t), "value") : void 0; 4963 f && f.get && f.set ? (n = f.get, l = f.set, Object.defineProperty(t, "value", { 4964 get: u, 4965 set: c, 4966 configurable: !0 4967 })) : "input" !== t.tagName.toLowerCase() && (n = function() { 4968 return this.textContent; 4969 }, l = function(e) { 4970 this.textContent = e; 4971 }, Object.defineProperty(t, "value", { 4972 get: u, 4973 set: c, 4974 configurable: !0 4975 })); 4976 } else document.__lookupGetter__ && t.__lookupGetter__("value") && (n = t.__lookupGetter__("value"), 4977 l = t.__lookupSetter__("value"), t.__defineGetter__("value", u), t.__defineSetter__("value", c)); 4978 t.inputmask.__valueGet = n, t.inputmask.__valueSet = l; 4979 } 4980 t.inputmask._valueGet = function(t) { 4981 return e.isRTL && !0 !== t ? n.call(this.el).split("").reverse().join("") : n.call(this.el); 4982 }, t.inputmask._valueSet = function(t, i) { 4983 l.call(this.el, null == t ? "" : !0 !== i && e.isRTL ? t.split("").reverse().join("") : t); 4984 }, void 0 === n && (n = function() { 4985 return this.value; 4986 }, l = function(e) { 4987 this.value = e; 4988 }, function(t) { 4989 if (a.valHooks && (void 0 === a.valHooks[t] || !0 !== a.valHooks[t].inputmaskpatch)) { 4990 var n = a.valHooks[t] && a.valHooks[t].get ? a.valHooks[t].get : function(e) { 4991 return e.value; 4992 }, s = a.valHooks[t] && a.valHooks[t].set ? a.valHooks[t].set : function(e, t) { 4993 return e.value = t, e; 4994 }; 4995 a.valHooks[t] = { 4996 get: function(t) { 4997 if (t.inputmask) { 4998 if (t.inputmask.opts.autoUnmask) return t.inputmask.unmaskedvalue(); 4999 var a = n(t); 5000 return -1 !== r.getLastValidPosition.call(e, void 0, void 0, t.inputmask.maskset.validPositions) || !0 !== i.nullable ? a : ""; 5001 } 5002 return n(t); 5003 }, 5004 set: function(e, t) { 5005 var i = s(e, t); 5006 return e.inputmask && (0, o.applyInputValue)(e, t), i; 5007 }, 5008 inputmaskpatch: !0 5009 }; 5010 } 5011 }(t.type), function(t) { 5012 s.EventRuler.on(t, "mouseenter", (function() { 5013 var t = this.inputmask._valueGet(!0); 5014 t !== (e.isRTL ? r.getBuffer.call(e).reverse() : r.getBuffer.call(e)).join("") && (0, 5015 o.applyInputValue)(this, t); 5016 })); 5017 }(t)); 5018 } 5019 }(t) : t.inputmask = void 0, u; 5020 }(i, t); 5021 if (!1 !== f) { 5022 e.originalPlaceholder = i.placeholder, e.maxLength = void 0 !== i ? i.maxLength : void 0, 5023 -1 === e.maxLength && (e.maxLength = void 0), "inputMode" in i && null === i.getAttribute("inputmode") && (i.inputMode = t.inputmode, 5024 i.setAttribute("inputmode", t.inputmode)), !0 === f && (t.showMaskOnFocus = t.showMaskOnFocus && -1 === [ "cc-number", "cc-exp" ].indexOf(i.autocomplete), 5025 l.iphone && (t.insertModeVisual = !1, i.setAttribute("autocorrect", "off")), s.EventRuler.on(i, "submit", c.EventHandlers.submitEvent), 5026 s.EventRuler.on(i, "reset", c.EventHandlers.resetEvent), s.EventRuler.on(i, "blur", c.EventHandlers.blurEvent), 5027 s.EventRuler.on(i, "focus", c.EventHandlers.focusEvent), s.EventRuler.on(i, "invalid", c.EventHandlers.invalidEvent), 5028 s.EventRuler.on(i, "click", c.EventHandlers.clickEvent), s.EventRuler.on(i, "mouseleave", c.EventHandlers.mouseleaveEvent), 5029 s.EventRuler.on(i, "mouseenter", c.EventHandlers.mouseenterEvent), s.EventRuler.on(i, "paste", c.EventHandlers.pasteEvent), 5030 s.EventRuler.on(i, "cut", c.EventHandlers.cutEvent), s.EventRuler.on(i, "complete", t.oncomplete), 5031 s.EventRuler.on(i, "incomplete", t.onincomplete), s.EventRuler.on(i, "cleared", t.oncleared), 5032 !0 !== t.inputEventOnly && (s.EventRuler.on(i, "keydown", c.EventHandlers.keydownEvent), 5033 s.EventRuler.on(i, "keypress", c.EventHandlers.keypressEvent), s.EventRuler.on(i, "keyup", c.EventHandlers.keyupEvent)), 5034 (l.mobile || t.inputEventOnly) && i.removeAttribute("maxLength"), s.EventRuler.on(i, "input", c.EventHandlers.inputFallBackEvent), 5035 s.EventRuler.on(i, "compositionend", c.EventHandlers.compositionendEvent)), s.EventRuler.on(i, "setvalue", c.EventHandlers.setValueEvent), 5036 r.getBufferTemplate.call(e).join(""), e.undoValue = e._valueGet(!0); 5037 var d = (i.inputmask.shadowRoot || i.ownerDocument).activeElement; 5038 if ("" !== i.inputmask._valueGet(!0) || !1 === t.clearMaskOnLostFocus || d === i) { 5039 (0, o.applyInputValue)(i, i.inputmask._valueGet(!0), t); 5040 var p = r.getBuffer.call(e).slice(); 5041 !1 === u.isComplete.call(e, p) && t.clearIncomplete && r.resetMaskSet.call(e), t.clearMaskOnLostFocus && d !== i && (-1 === r.getLastValidPosition.call(e) ? p = [] : o.clearOptionalTail.call(e, p)), 5042 (!1 === t.clearMaskOnLostFocus || t.showMaskOnFocus && d === i || "" !== i.inputmask._valueGet(!0)) && (0, 5043 o.writeBuffer)(i, p), d === i && r.caret.call(e, i, r.seekNext.call(e, r.getLastValidPosition.call(e))); 5044 } 5045 } 5046 }; 5047 var a, n = (a = i(5581)) && a.__esModule ? a : { 5048 default: a 5049 }, r = i(8711), o = i(7760), s = i(9716), l = i(9845), u = i(7215), c = i(6030); 5050 }, 5051 9695: function(e, t) { 5052 Object.defineProperty(t, "__esModule", { 5053 value: !0 5054 }), t.default = function(e, t, i, a) { 5055 this.matches = [], this.openGroup = e || !1, this.alternatorGroup = !1, this.isGroup = e || !1, 5056 this.isOptional = t || !1, this.isQuantifier = i || !1, this.isAlternator = a || !1, 5057 this.quantifier = { 5058 min: 1, 5059 max: 1 5060 }; 5061 }; 5062 }, 5063 3194: function() { 5064 Array.prototype.includes || Object.defineProperty(Array.prototype, "includes", { 5065 value: function(e, t) { 5066 if (null == this) throw new TypeError('"this" is null or not defined'); 5067 var i = Object(this), a = i.length >>> 0; 5068 if (0 === a) return !1; 5069 for (var n = 0 | t, r = Math.max(n >= 0 ? n : a - Math.abs(n), 0); r < a; ) { 5070 if (i[r] === e) return !0; 5071 r++; 5072 } 5073 return !1; 5074 } 5075 }); 5076 }, 5077 7149: function() { 5078 function e(t) { 5079 return e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { 5080 return typeof e; 5081 } : function(e) { 5082 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; 5083 }, e(t); 5084 } 5085 "function" != typeof Object.getPrototypeOf && (Object.getPrototypeOf = "object" === e("test".__proto__) ? function(e) { 5086 return e.__proto__; 5087 } : function(e) { 5088 return e.constructor.prototype; 5089 }); 5090 }, 5091 8711: function(e, t, i) { 5092 Object.defineProperty(t, "__esModule", { 5093 value: !0 5094 }), t.caret = function(e, t, i, a, n) { 5095 var r, o = this, s = this.opts; 5096 if (void 0 === t) return "selectionStart" in e && "selectionEnd" in e ? (t = e.selectionStart, 5097 i = e.selectionEnd) : window.getSelection ? (r = window.getSelection().getRangeAt(0)).commonAncestorContainer.parentNode !== e && r.commonAncestorContainer !== e || (t = r.startOffset,
5098 i = r.endOffset) : document.selection && document.selection.createRange && (r = document.selection.createRange(), 5099 t = 0 - r.duplicate().moveStart("character", -e.inputmask._valueGet().length), i = t + r.text.length), 5100 { 5101 begin: a ? t : u.call(o, t), 5102 end: a ? i : u.call(o, i) 5103 }; 5104 if (Array.isArray(t) && (i = o.isRTL ? t[0] : t[1], t = o.isRTL ? t[1] : t[0]), 5105 void 0 !== t.begin && (i = o.isRTL ? t.begin : t.end, t = o.isRTL ? t.end : t.begin), 5106 "number" == typeof t) { 5107 t = a ? t : u.call(o, t), i = "number" == typeof (i = a ? i : u.call(o, i)) ? i : t; 5108 var l = parseInt(((e.ownerDocument.defaultView || window).getComputedStyle ? (e.ownerDocument.defaultView || window).getComputedStyle(e, null) : e.currentStyle).fontSize) * i; 5109 if (e.scrollLeft = l > e.scrollWidth ? l : 0, e.inputmask.caretPos = { 5110 begin: t, 5111 end: i 5112 }, s.insertModeVisual && !1 === s.insertMode && t === i && (n || i++), e === (e.inputmask.shadowRoot || e.ownerDocument).activeElement) if ("setSelectionRange" in e) e.setSelectionRange(t, i); else if (window.getSelection) { 5113 if (r = document.createRange(), void 0 === e.firstChild || null === e.firstChild) { 5114 var c = document.createTextNode(""); 5115 e.appendChild(c); 5116 } 5117 r.setStart(e.firstChild, t < e.inputmask._valueGet().length ? t : e.inputmask._valueGet().length), 5118 r.setEnd(e.firstChild, i < e.inputmask._valueGet().length ? i : e.inputmask._valueGet().length), 5119 r.collapse(!0); 5120 var f = window.getSelection(); 5121 f.removeAllRanges(), f.addRange(r); 5122 } else e.createTextRange && ((r = e.createTextRange()).collapse(!0), r.moveEnd("character", i), 5123 r.moveStart("character", t), r.select()); 5124 } 5125 }, t.determineLastRequiredPosition = function(e) { 5126 var t, i, r = this, s = this.maskset, l = this.dependencyLib, u = a.getMaskTemplate.call(r, !0, o.call(r), !0, !0), c = u.length, f = o.call(r), d = {}, p = s.validPositions[f], h = void 0 !== p ? p.locator.slice() : void 0; 5127 for (t = f + 1; t < u.length; t++) i = a.getTestTemplate.call(r, t, h, t - 1), h = i.locator.slice(), 5128 d[t] = l.extend(!0, {}, i); 5129 var v = p && void 0 !== p.alternation ? p.locator[p.alternation] : void 0; 5130 for (t = c - 1; t > f && (((i = d[t]).match.optionality || i.match.optionalQuantifier && i.match.newBlockMarker || v && (v !== d[t].locator[p.alternation] && 1 != i.match.static || !0 === i.match.static && i.locator[p.alternation] && n.checkAlternationMatch.call(r, i.locator[p.alternation].toString().split(","), v.toString().split(",")) && "" !== a.getTests.call(r, t)[0].def)) && u[t] === a.getPlaceholder.call(r, t, i.match)); t--) c--; 5131 return e ? { 5132 l: c, 5133 def: d[c] ? d[c].match : void 0 5134 } : c; 5135 }, t.determineNewCaretPosition = function(e, t, i) { 5136 var n = this, u = this.maskset, c = this.opts; 5137 t && (n.isRTL ? e.end = e.begin : e.begin = e.end); 5138 if (e.begin === e.end) { 5139 switch (i = i || c.positionCaretOnClick) { 5140 case "none": 5141 break; 5142 5143 case "select": 5144 e = { 5145 begin: 0, 5146 end: r.call(n).length 5147 }; 5148 break; 5149 5150 case "ignore": 5151 e.end = e.begin = l.call(n, o.call(n)); 5152 break; 5153 5154 case "radixFocus": 5155 if (function(e) { 5156 if ("" !== c.radixPoint && 0 !== c.digits) { 5157 var t = u.validPositions; 5158 if (void 0 === t[e] || t[e].input === a.getPlaceholder.call(n, e)) { 5159 if (e < l.call(n, -1)) return !0; 5160 var i = r.call(n).indexOf(c.radixPoint); 5161 if (-1 !== i) { 5162 for (var o = 0, s = t.length; o < s; o++) if (t[o] && i < o && t[o].input !== a.getPlaceholder.call(n, o)) return !1; 5163 return !0; 5164 } 5165 } 5166 } 5167 return !1; 5168 }(e.begin)) { 5169 var f = r.call(n).join("").indexOf(c.radixPoint); 5170 e.end = e.begin = c.numericInput ? l.call(n, f) : f; 5171 break; 5172 } 5173 5174 default:
5175 var d = e.begin, p = o.call(n, d, !0), h = l.call(n, -1 !== p || s.call(n, 0) ? p : -1); 5176 if (d <= h) e.end = e.begin = s.call(n, d, !1, !0) ? d : l.call(n, d); else { 5177 var v = u.validPositions[p], m = a.getTestTemplate.call(n, h, v ? v.match.locator : void 0, v), g = a.getPlaceholder.call(n, h, m.match); 5178 if ("" !== g && r.call(n)[h] !== g && !0 !== m.match.optionalQuantifier && !0 !== m.match.newBlockMarker || !s.call(n, h, c.keepStatic, !0) && m.match.def === g) { 5179 var k = l.call(n, h); 5180 (d >= k || d === h) && (h = k); 5181 } 5182 e.end = e.begin = h; 5183 } 5184 } 5185 return e; 5186 } 5187 }, t.getBuffer = r, t.getBufferTemplate = function() { 5188 var e = this.maskset; 5189 void 0 === e._buffer && (e._buffer = a.getMaskTemplate.call(this, !1, 1), void 0 === e.buffer && (e.buffer = e._buffer.slice())); 5190 return e._buffer; 5191 }, t.getLastValidPosition = o, t.isMask = s, t.resetMaskSet = function(e) { 5192 var t = this.maskset; 5193 t.buffer = void 0, !0 !== e && (t.validPositions = [], t.p = 0); 5194 }, t.seekNext = l, t.seekPrevious = function(e, t) { 5195 var i = this, n = e - 1; 5196 if (e <= 0) return 0; 5197 for (;n > 0 && (!0 === t && (!0 !== a.getTest.call(i, n).match.newBlockMarker || !s.call(i, n, void 0, !0)) || !0 !== t && !s.call(i, n, void 0, !0)); ) n--; 5198 return n; 5199 }, t.translatePosition = u; 5200 var a = i(4713), n = i(7215); 5201 function r(e) { 5202 var t = this.maskset; 5203 return void 0 !== t.buffer && !0 !== e || (t.buffer = a.getMaskTemplate.call(this, !0, o.call(this), !0), 5204 void 0 === t._buffer && (t._buffer = t.buffer.slice())), t.buffer; 5205 } 5206 function o(e, t, i) { 5207 var a = this.maskset, n = -1, r = -1, o = i || a.validPositions; 5208 void 0 === e && (e = -1); 5209 for (var s = 0, l = o.length; s < l; s++) o[s] && (t || !0 !== o[s].generatedInput) && (s <= e && (n = s), 5210 s >= e && (r = s)); 5211 return -1 === n || n == e ? r : -1 == r || e - n < r - e ? n : r; 5212 } 5213 function s(e, t, i) { 5214 var n = this, r = this.maskset, o = a.getTestTemplate.call(n, e).match; 5215 if ("" === o.def && (o = a.getTest.call(n, e).match), !0 !== o.static) return o.fn; 5216 if (!0 === i && void 0 !== r.validPositions[e] && !0 !== r.validPositions[e].generatedInput) return !0; 5217 if (!0 !== t && e > -1) { 5218 if (i) { 5219 var s = a.getTests.call(n, e); 5220 return s.length > 1 + ("" === s[s.length - 1].match.def ? 1 : 0); 5221 } 5222 var l = a.determineTestTemplate.call(n, e, a.getTests.call(n, e)), u = a.getPlaceholder.call(n, e, l.match); 5223 return l.match.def !== u; 5224 } 5225 return !1; 5226 } 5227 function l(e, t, i) { 5228 var n = this; 5229 void 0 === i && (i = !0); 5230 for (var r = e + 1; "" !== a.getTest.call(n, r).match.def && (!0 === t && (!0 !== a.getTest.call(n, r).match.newBlockMarker || !s.call(n, r, void 0, !0)) || !0 !== t && !s.call(n, r, void 0, i)); ) r++; 5231 return r; 5232 } 5233 function u(e) { 5234 var t = this.opts, i = this.el; 5235 return !this.isRTL || "number" != typeof e || t.greedy && "" === t.placeholder || !i || (e = this._valueGet().length - e) < 0 && (e = 0), 5236 e; 5237 } 5238 }, 5239 4713: function(e, t, i) { 5240 Object.defineProperty(t, "__esModule", { 5241 value: !0 5242 }), t.determineTestTemplate = u, t.getDecisionTaker = o, t.getMaskTemplate = function(e, t, i, a, n) { 5243 var r = this, o = this.opts, c = this.maskset, f = o.greedy; 5244 n && o.greedy && (o.greedy = !1, r.maskset.tests = {}); 5245 t = t || 0; 5246 var p, h, v, m, g = [], k = 0; 5247 do { 5248 if (!0 === e && c.validPositions[k]) v = n && c.validPositions[k].match.optionality && void 0 === c.val
5248idPositions[k + 1] && (!0 === c.validPositions[k].generatedInput || c.validPositions[k].input == o.skipOptionalPartCharacter && k > 0) ? u.call(r, k, d.call(r, k, p, k - 1)) : c.validPositions[k], 5249 h = v.match, p = v.locator.slice(), g.push(!0 === i ? v.input : !1 === i ? h.nativeDef : s.call(r, k, h)); else { 5250 v = l.call(r, k, p, k - 1), h = v.match, p = v.locator.slice(); 5251 var y = !0 !== a && (!1 !== o.jitMasking ? o.jitMasking : h.jit); 5252 (m = (m && h.static && h.def !== o.groupSeparator && null === h.fn || c.validPositions[k - 1] && h.static && h.def !== o.groupSeparator && null === h.fn) && c.tests[k] && 1 === c.tests[k].length) || !1 === y || void 0 === y || "number" == typeof y && isFinite(y) && y > k ? g.push(!1 === i ? h.nativeDef : s.call(r, g.length, h)) : m = !1; 5253 } 5254 k++; 5255 } while (!0 !== h.static || "" !== h.def || t > k); 5256 "" === g[g.length - 1] && g.pop(); 5257 !1 === i && void 0 !== c.maskLength || (c.maskLength = k - 1); 5258 return o.greedy = f, g; 5259 }, t.getPlaceholder = s, t.getTest = c, t.getTestTemplate = l, t.getTests = d, t.isSubsetOf = f; 5260 var a, n = (a = i(2394)) && a.__esModule ? a : { 5261 default: a 5262 }; 5263 function r(e, t) { 5264 var i = (null != e.alternation ? e.mloc[o(e)] : e.locator).join(""); 5265 if ("" !== i) for (;i.length < t; ) i += "0"; 5266 return i; 5267 } 5268 function o(e) { 5269 var t = e.locator[e.alternation]; 5270 return "string" == typeof t && t.length > 0 && (t = t.split(",")[0]), void 0 !== t ? t.toString() : ""; 5271 } 5272 function s(e, t, i) { 5273 var a = this.opts, n = this.maskset; 5274 if (void 0 !== (t = t || c.call(this, e).match).placeholder || !0 === i) return "function" == typeof t.placeholder ? t.placeholder(a) : t.placeholder; 5275 if (!0 === t.static) { 5276 if (e > -1 && void 0 === n.validPositions[e]) { 5277 var r, o = d.call(this, e), s = []; 5278 if (o.length > 1 + ("" === o[o.length - 1].match.def ? 1 : 0)) for (var l = 0; l < o.length; l++) if ("" !== o[l].match.def && !0 !== o[l].match.optionality && !0 !== o[l].match.optionalQuantifier && (!0 === o[l].match.static || void 0 === r || !1 !== o[l].match.fn.test(r.match.def, n, e, !0, a)) && (s.push(o[l]), 5279 !0 === o[l].match.static && (r = o[l]), s.length > 1 && /[0-9a-bA-Z]/.test(s[0].match.def))) return a.placeholder.charAt(e % a.placeholder.length); 5280 } 5281 return t.def; 5282 } 5283 return a.placeholder.charAt(e % a.placeholder.length); 5284 } 5285 function l(e, t, i) { 5286 return this.maskset.validPositions[e] || u.call(this, e, d.call(this, e, t ? t.slice() : t, i)); 5287 } 5288 function u(e, t) { 5289 var i = this.opts, a = function(e, t) { 5290 var i = 0, a = !1; 5291 t.forEach((function(e) { 5292 e.match.optionality && (0 !== i && i !== e.match.optionality && (a = !0), (0 === i || i > e.match.optionality) && (i = e.match.optionality)); 5293 })), i && (0 == e || 1 == t.length ? i = 0 : a || (i = 0)); 5294 return i; 5295 }(e, t); 5296 e = e > 0 ? e - 1 : 0; 5297 var n, o, s, l = r(c.call(this, e)); 5298 i.greedy && t.length > 1 && "" === t[t.length - 1].match.def && t.pop(); 5299 for (var u = 0; u < t.length; u++) { 5300 var f = t[u]; 5301 n = r(f, l.length); 5302 var d = Math.abs(n - l); 5303 (void 0 === o || "" !== n && d < o || s && !i.greedy && s.match.optionality && s.match.optionality - a > 0 && "master" === s.match.newBlockMarker && (!f.match.optionality || f.match.optionality - a < 1 || !f.match.newBlockMarker) || s && !i.greedy && s.match.optionalQuantifier && !f.match.optionalQuantifier) && (o = d, 5304 s = f); 5305 } 5306 return s; 5307 } 5308 function c(e, t) { 5309 var i = this.maskset; 5310 return i.validPositions[e] ? i.validPositions[e] : (t || d.call(this, e))[0]; 5311 } 5312 function f(e, t, i) { 5313 function a(e) { 5314 for (var t, i = [], a = -1, n = 0, r = e.length; n < r; n++) if ("-" === e.charAt(n)) for (t = e.charCodeAt(n + 1); ++a < t; ) i.push(String.fromCharCode(a)); else a = e.charCodeAt(n), 5315 i.push(e.charAt(n)); 5316 return i.join(""); 5317 } 5318 return e.match.def === t.match.nativeDef || !(!(i.regex || e.match.fn instanceof RegExp && t.match.fn instanceof RegExp) || !0 === e.match.static || !0 === t.match.static) && -1 !== a(t.match.fn.toString().replace(/[[\]/]/g, "")).indexOf(a(e.match.fn.toString().replace(/[[\]/]/g, ""))); 5319 } 5320 function d(e, t, i) { 5321 var a, r, o = this, s = this.dependencyLib, l = this.maskset, c = this.opts, d = this.el, p = l.maskToken, h = t ? i : 0, v = t ? t.slice() : [ 0 ], m = [], g = !1, k = t ? t.join("") : ""; 5322 function y(t, i, r, o) { 5323 function s(r, o, u) { 5324 function p(e, t) { 5325 var i = 0 === t.matches.indexOf(e); 5326 return i || t.matches.every((function(a, n) { 5327 return !0 === a.isQuantifier ? i = p(e, t.matches[n - 1]) : Object.prototype.hasOwnProperty.call(a, "matches") && (i = p(e, a)), 5328 !i; 5329 })), i; 5330 } 5331 function v(e, t, i) { 5332 var a, n; 5333 if ((l.tests[e] || l.validPositions[e]) && (l.tests[e] || [ l.validPositions[e] ]).every((function(e, r) { 5334 if (e.mloc[t]) return a = e, !1; 5335 var o = void 0 !== i ? i : e.alternation, s = void 0 !== e.locator[o] ? e.locator[o].toString().indexOf(t) : -1; 5336 return (void 0 === n || s < n) && -1 !== s && (a = e, n = s), !0; 5337 })), a) { 5338 var r = a.locator[a.alternation]; 5339 return (a.mloc[t] || a.mloc[r] || a.locator).slice((void 0 !== i ? i : a.alternation) + 1); 5340 } 5341 return void 0 !== i ? v(e, t) : void 0; 5342 } 5343 function b(e, t) { 5344 var i = e.alternation, a = void 0 === t || i === t.alternation && -1 === e.locator[i].toString().indexOf(t.locator[i]); 5345 if (!a && i > t.alternation) for (var n = t.alternation; n < i; n++) if (e.locator[n] !== t.locator[n]) { 5346 i = n, a = !0; 5347 break; 5348 } 5349 if (a) { 5350 e.mloc = e.mloc || {}; 5351 var r = e.locator[i]; 5352 if (void 0 !== r) { 5353 if ("string" == typeof r && (r = r.split(",")[0]), void 0 === e.mloc[r] && (e.mloc[r] = e.locator.slice()), 5354 void 0 !== t) { 5355 for (var o in t.mloc) "string" == typeof o && (o = o.split(",")[0]), void 0 === e.mloc[o] && (e.mloc[o] = t.mloc[o]); 5356 e.locator[i] = Object.keys(e.mloc).join(","); 5357 } 5358 return !0; 5359 } 5360 e.alternation = void 0; 5361 } 5362 return !1; 5363 } 5364 function x(e, t) { 5365 if (e.locator.length !== t.locator.length) return !1; 5366 for (var i = e.alternation + 1; i < e.locator.length; i++) if (e.locator[i] !== t.locator[i]) return !1; 5367 return !0; 5368 } 5369 if (h > e + c._maxTestPos) throw "Inputmask: There is probably an error in your mask definition or in the code. Create an issue on github with an example of the mask you are using. " + l.mask; 5370 if (h === e && void 0 === r.matches) { 5371 if (m.push({ 5372 match: r, 5373 locator: o.reverse(), 5374 cd: k, 5375 mloc: {} 5376 }), !r.optionality || void 0 !== u || !(c.definitions && c.definitions[r.nativeDef] && c.definitions[r.nativeDef].optional || n.default.prototype.definitions[r.nativeDef] && n.default.prototype.definitions[r.nativeDef].optional)) return !0; 5377 g = !0, h = e; 5378 } else if (void 0 !== r.matches) { 5379 if (r.isGroup && u !== r) { 5380 if (r = s(t.matches[t.matches.indexOf(r) + 1], o, u)) return !0; 5381 } else if (r.isOptional) { 5382 var P = r, E = m.length; 5383 if (r = y(r, i, o, u)) { 5384 if (m.forEach((function(e, t) { 5385 t >= E && (e.match.optionality = e.match.optionality ? e.match.optionality + 1 : 1); 5386 })), a = m[m.length - 1].match, void 0 !== u || !p(a, P)) return !0; 5387 g = !0, h = e; 5388 } 5389 } else if (r.isAlternator) { 5390 var S, w = r, _ = [], M = m.slice(), O = o.length, T = !1, A = i.length > 0 ? i.shift() : -1; 5391 if (-1 === A || "string" == typeof A) { 5392 var C, D = h, j = i.slice(), B = []; 5393 if ("string" == typeof A) B = A.split(","); else for (C = 0; C < w.matches.length; C++) B.push(C.toString()); 5394 if (void 0 !== l.excludes[e]) { 5395 for (var R = B.slice(), L = 0, I = l.excludes[e].length; L < I; L++) { 5396 var F = l.excludes[e][L].toString().split(":"); 5397 o.length == F[1] && B.splice(B.indexOf(F[0]), 1); 5398 } 5399 0 === B.length && (delete l.excludes[e], B = R); 5400 } 5401 (!0 === c.keepStatic || isFinite(parseInt(c.keepStatic)) && D >= c.keepStatic) && (B = B.slice(0, 1)); 5402 for (var N = 0; N < B.length; N++) { 5403 C = parseInt(B[N]), m = [], i = "string" == typeof A && v(h, C, O) || j.slice(); 5404 var V = w.matches[C]; 5405 if (V && s(V, [ C ].concat(o), u)) r = !0; else if (0 === N && (T = !0), V && V.matches && V.matches.length > w.matches[0].matches.length) break; 5406 S = m.slice(), h = D, m = []; 5407 for (var G = 0; G < S.length; G++) { 5408 var H = S[G], K = !1; 5409 H.match.jit = H.match.jit || T, H.alternation = H.alternation || O, b(H); 5410 for (var U = 0; U < _.length; U++) { 5411 var $ = _[U]; 5412 if ("string" != typeof A || void 0 !== H.alternation && B.includes(H.locator[H.alternation].toString())) { 5413 if (H.match.nativeDef === $.match.nativeDef) { 5414 K = !0, b($, H); 5415 break; 5416 } 5417 if (f(H, $, c)) { 5418 b(H, $) && (K = !0, _.splice(_.indexOf($), 0, H)); 5419 break; 5420 } 5421 if (f($, H, c)) { 5422 b($, H); 5423 break; 5424 } 5425 if (Z = $, !0
5425=== (W = H).match.static && !0 !== Z.match.static && Z.match.fn.test(W.match.def, l, e, !1, c, !1)) { 5426 x(H, $) || void 0 !== d.inputmask.userOptions.keepStatic ? b(H, $) && (K = !0, _.splice(_.indexOf($), 0, H)) : c.keepStatic = !0; 5427 break; 5428 } 5429 } 5430 } 5431 K || _.push(H); 5432 } 5433 } 5434 m = M.concat(_), h = e, g = m.length > 0, r = _.length > 0, i = j.slice(); 5435 } else r = s(w.matches[A] || t.matches[A], [ A ].concat(o), u); 5436 if (r) return !0; 5437 } else if (r.isQuantifier && u !== t.matches[t.matches.indexOf(r) - 1]) for (var q = r, z = i.length > 0 ? i.shift() : 0; z < (isNaN(q.quantifier.max) ? z + 1 : q.quantifier.max) && h <= e; z++) { 5438 var Q = t.matches[t.matches.indexOf(q) - 1]; 5439 if (r = s(Q, [ z ].concat(o), Q)) { 5440 if ((a = m[m.length - 1].match).optionalQuantifier = z >= q.quantifier.min, a.jit = (z + 1) * (Q.matches.indexOf(a) + 1) > q.quantifier.jit, 5441 a.optionalQuantifier && p(a, Q)) { 5442 g = !0, h = e; 5443 break; 5444 } 5445 return a.jit && (l.jitOffset[e] = Q.matches.length - Q.matches.indexOf(a)), !0; 5446 } 5447 } else if (r = y(r, i, o, u)) return !0; 5448 } else h++; 5449 var W, Z; 5450 } 5451 for (var u = i.length > 0 ? i.shift() : 0; u < t.matches.length; u++) if (!0 !== t.matches[u].isQuantifier) { 5452 var p = s(t.matches[u], [ u ].concat(r), o); 5453 if (p && h === e) return p; 5454 if (h > e) break; 5455 } 5456 } 5457 if (e > -1) { 5458 if (void 0 === t) { 5459 for (var b, x = e - 1; void 0 === (b = l.validPositions[x] || l.tests[x]) && x > -1; ) x--; 5460 void 0 !== b && x > -1 && (v = function(e, t) { 5461 var i, a = []; 5462 return Array.isArray(t) || (t = [ t ]), t.length > 0 && (void 0 === t[0].alternation || !0 === c.keepStatic ? 0 === (a = u.call(o, e, t.slice()).locator.slice()).length && (a = t[0].locator.slice()) : t.forEach((function(e) { 5463 "" !== e.def && (0 === a.length ? (i = e.alternation, a = e.locator.slice()) : e.locator[i] && -1 === a[i].toString().indexOf(e.locator[i]) && (a[i] += "," + e.locator[i])); 5464 }))), a; 5465 }(x, b), k = v.join(""), h = x); 5466 } 5467 if (l.tests[e] && l.tests[e][0].cd === k) return l.tests[e]; 5468 for (var P = v.shift(); P < p.length; P++) { 5469 if (y(p[P], v, [ P ]) && h === e || h > e) break; 5470 } 5471 } 5472 return (0 === m.length || g) && m.push({ 5473 match: { 5474 fn: null, 5475 static: !0, 5476 optionality: !1, 5477 casing: null, 5478 def: "", 5479 placeholder: "" 5480 }, 5481 locator: [], 5482 mloc: {}, 5483 cd: k 5484 }), void 0 !== t && l.tests[e] ? r = s.extend(!0, [], m) : (l.tests[e] = s.extend(!0, [], m), 5485 r = l.tests[e]), m.forEach((function(e) { 5486 e.match.optionality = e.match.defOptionality || !1; 5487 })), r; 5488 } 5489 }, 5490 7215: function(e, t, i) { 5491 Object.defineProperty(t, "__esModule", { 5492 value: !0 5493 }), t.alternate = l, t.checkAlternationMatch = function(e, t, i) { 5494 for (var a, n = this.opts.greedy ? t : t.slice(0, 1), r = !1, o = void 0 !== i ? i.split(",") : [], s = 0; s < o.length; s++) -1 !== (a = e.indexOf(o[s])) && e.splice(a, 1); 5495 for (var l = 0; l < e.length; l++) if (n.includes(e[l])) { 5496 r = !0; 5497 break; 5498 } 5499 return r; 5500 }, t.handleRemove = function(e, t, i, a, s) { 5501 var u = this, c = this.maskset, f = this.opts;
5502 if ((f.numericInput || u.isRTL) && (t === r.default.BACKSPACE ? t = r.default.DELETE : t === r.default.DELETE && (t = r.default.BACKSPACE), 5503 u.isRTL)) { 5504 var d = i.end; 5505 i.end = i.begin, i.begin = d; 5506 } 5507 var p, h = o.getLastValidPosition.call(u, void 0, !0); 5508 i.end >= o.getBuffer.call(u).length && h >= i.end && (i.end = h + 1); 5509 t === r.default.BACKSPACE ? i.end - i.begin < 1 && (i.begin = o.seekPrevious.call(u, i.begin)) : t === r.default.DELETE && i.begin === i.end && (i.end = o.isMask.call(u, i.end, !0, !0) ? i.end + 1 : o.seekNext.call(u, i.end) + 1); 5510 if (!1 !== (p = m.call(u, i))) { 5511 if (!0 !== a && !1 !== f.keepStatic || null !== f.regex && -1 !== n.getTest.call(u, i.begin).match.def.indexOf("|")) { 5512 var v = l.call(u, !0); 5513 if (v) { 5514 var g = void 0 !== v.caret ? v.caret : v.pos ? o.seekNext.call(u, v.pos.begin ? v.pos.begin : v.pos) : o.getLastValidPosition.call(u, -1, !0); 5515 (t !== r.default.DELETE || i.begin > g) && i.begin; 5516 } 5517 } 5518 !0 !== a && (c.p = t === r.default.DELETE ? i.begin + p : i.begin, c.p = o.determineNewCaretPosition.call(u, { 5519 begin: c.p, 5520 end: c.p 5521 }, !1, !1 === f.insertMode && t === r.default.BACKSPACE ? "none" : void 0).begin); 5522 } 5523 }, t.isComplete = c, t.isSelection = f, t.isValid = d, t.refreshFromBuffer = h, 5524 t.revalidateMask = m; 5525 var a, n = i(4713), r = (a = i(5581)) && a.__esModule ? a : { 5526 default: a 5527 }, o = i(8711), s = i(6030); 5528 function l(e, t, i, a, r, s) { 5529 var u, c, f, p, h, v, m, g, k, y, b, x = this, P = this.dependencyLib, E = this.opts, S = x.maskset, w = P.extend(!0, [], S.validPositions), _ = P.extend(!0, {}, S.tests), M = !1, O = !1, T = void 0 !== r ? r : o.getLastValidPosition.call(x); 5530 if (s && (y = s.begin, b = s.end, s.begin > s.end && (y = s.end, b = s.begin)), 5531 -1 === T && void 0 === r) u = 0, c = (p = n.getTest.call(x, u)).alternation; else for (;T >= 0; T--) if ((f = S.validPositions[T]) && void 0 !== f.alternation) { 5532 if (p && p.locator[f.alternation] !== f.locator[f.alternation]) break; 5533 u = T, c = S.validPositions[u].alternation, p = f; 5534 } 5535 if (void 0 !== c) { 5536 m = parseInt(u), S.excludes[m] = S.excludes[m] || [], !0 !== e && S.excludes[m].push((0, 5537 n.getDecisionTaker)(p) + ":" + p.alternation); 5538 var A = [], C = -1; 5539 for (h = m; h < o.getLastValidPosition.call(x, void 0, !0) + 1; h++) -1 === C && e <= h && void 0 !== t && (A.push(t), 5540 C = A.length - 1), (v = S.validPositions[h]) && !0 !== v.generatedInput && (void 0 === s || h < y || h >= b) && A.push(v.input), 5541 delete S.validPositions[h]; 5542 for (-1 === C && void 0 !== t && (A.push(t), C = A.length - 1); void 0 !== S.excludes[m] && S.excludes[m].length < 10; ) { 5543 for (S.tests = {}, o.resetMaskSet.call(x, !0), M = !0, h = 0; h < A.length && (g = M.caret || o.getLastValidPosition.call(x, void 0, !0) + 1, 5544 k = A[h], M = d.call(x, g, k, !1, a, !0)); h++) h === C && (O = M), 1 == e && M && (O = { 5545 caretPos: h 5546 }); 5547 if (M) break; 5548 if (o.resetMaskSet.call(x), p = n.getTest.call(x, m), S.validPositions = P.extend(!0, [], w), 5549 S.tests = P.extend(!0, {}, _), !S.excludes[m]) { 5550 O = l.call(x, e, t, i, a, m - 1, s); 5551 break; 5552 } 5553 var D = (0, n.getDecisionTaker)(p); 5554 if (-1 !== S.excludes[m].indexOf(D + ":" + p.alternation)) { 5555 O = l.call(x, e, t, i, a, m - 1, s); 5556 break; 5557 } 5558 for (S.excludes[m].push(D + ":" + p.alternation), h = m; h < o.getLastValidPosition.call(x, void 0, !0) + 1; h++) delete S.validPositions[h]; 5559 } 5560 } 5561 return O && !1 === E.keepStatic || delete S.excludes[m], O; 5562 } 5563 function u(e, t, i) { 5564 var a = this.opts, n = this.maskset; 5565 switch (a.casing || t.casing) { 5566 case "upper": 5567 e = e.toUpperCase(); 5568 break; 5569 5570 case "lower": 5571 e = e.toLowerCase(); 5572 break; 5573 5574 case "title": 5575 var o = n.validPositions[i - 1]; 5576 e = 0 === i || o && o.input === String.fromCharCode(r.default.SPACE) ? e.toUpperCase() : e.toLowerCase(); 5577 break; 5578 5579 default: 5580 if ("function" == typeof a.casing) { 5581 var s = Array.prototype.slice.call(arguments); 5582 s.push(n.validPositions), e = a.casing.apply(this, s); 5583 } 5584 } 5585 return e; 5586 } 5587 function c(e) { 5588 var t = this, i = this.opts, a = this.maskset; 5589 if ("function" == typeof i.isComplete) return i.isComplete(e, i); 5590 if ("*" !== i.repeat) { 5591 var r = !1, s = o.determineLastRequiredPosition.call(t, !0), l = o.seekPrevious.call(t, s.l); 5592 if (void 0 === s.def || s.def.newBlockMarker || s.def.optionality || s.def.optionalQuantifier) { 5593 r = !0; 5594 for (var u = 0; u <= l; u++) { 5595 var c = n.getTestTemplate.call(t, u).match; 5596 if (!0 !== c.static && void 0 === a.validPositions[u] && !0 !== c.optionality && !0 !== c.optionalQuantifier || !0 === c.static && e[u] !== n.getPlaceholder.call(t, u, c)) { 5597 r = !1; 5598 break; 5599 } 5600 } 5601 } 5602 return r; 5603 } 5604 } 5605 function f(e) { 5606 var t = this.opts.insertMode ? 0 : 1; 5607 return this.isRTL ? e.begin - e.end > t : e.end - e.begin > t; 5608 } 5609 function d(e, t, i, a, r, s, p) { 5610 var g = this, k = this.dependencyLib, y = this.opts, b = g.maskset; 5611 i = !0 === i; 5612 var x = e; 5613 function P(e) { 5614 if (void 0 !== e) { 5615 if (void 0 !== e.remove && (Array.isArray(e.remove) || (e.remove = [ e.remove ]), 5616 e.remove.sort((function(e, t) { 5617 return g.isRTL ? e.pos - t.pos : t.pos - e.pos; 5618 }
5618)).forEach((function(e) { 5619 m.call(g, { 5620 begin: e, 5621 end: e + 1 5622 }); 5623 })), e.remove = void 0), void 0 !== e.insert && (Array.isArray(e.insert) || (e.insert = [ e.insert ]), 5624 e.insert.sort((function(e, t) { 5625 return g.isRTL ? t.pos - e.pos : e.pos - t.pos; 5626 })).forEach((function(e) { 5627 "" !== e.c && d.call(g, e.pos, e.c, void 0 === e.strict || e.strict, void 0 !== e.fromIsValid ? e.fromIsValid : a); 5628 })), e.insert = void 0), e.refreshFromBuffer && e.buffer) { 5629 var t = e.refreshFromBuffer; 5630 h.call(g, !0 === t ? t : t.start, t.end, e.buffer), e.refreshFromBuffer = void 0; 5631 } 5632 void 0 !== e.rewritePosition && (x = e.rewritePosition, e = !0); 5633 } 5634 return e; 5635 } 5636 function E(t, i, r) { 5637 var s = !1; 5638 return n.getTests.call(g, t).every((function(l, c) { 5639 var d = l.match; 5640 if (o.getBuffer.call(g, !0), !1 !== (s = (!d.jit || void 0 !== b.validPositions[o.seekPrevious.call(g, t)]) && (null != d.fn ? d.fn.test(i, b, t, r, y, f.call(g, e)) : (i === d.def || i === y.skipOptionalPartCharacter) && "" !== d.def && { 5641 c: n.getPlaceholder.call(g, t, d, !0) || d.def, 5642 pos: t 5643 }))) { 5644 var p = void 0 !== s.c ? s.c : i, h = t; 5645 return p = p === y.skipOptionalPartCharacter && !0 === d.static ? n.getPlaceholder.call(g, t, d, !0) || d.def : p, 5646 !0 !== (s = P(s)) && void 0 !== s.pos && s.pos !== t && (h = s.pos), !0 !== s && void 0 === s.pos && void 0 === s.c ? !1 : (!1 === m.call(g, e, k.extend({}, l, { 5647 input: u.call(g, p, d, h) 5648 }), a, h) && (s = !1), !1); 5649 } 5650 return !0; 5651 })), s; 5652 } 5653 void 0 !== e.begin && (x = g.isRTL ? e.end : e.begin); 5654 var S = !0, w = k.extend(!0, {}, b.validPositions); 5655 if (!1 === y.keepStatic && void 0 !== b.excludes[x] && !0 !== r && !0 !== a) for (var _ = x; _ < (g.isRTL ? e.begin : e.end); _++) void 0 !== b.excludes[_] && (b.excludes[_] = void 0, 5656 delete b.tests[_]); 5657 if ("function" == typeof y.preValidation && !0 !== a && !0 !== s && (S = P(S = y.preValidation.call(g, o.getBuffer.call(g), x, t, f.call(g, e), y, b, e, i || r))), 5658 !0 === S) { 5659 if (S = E(x, t, i), (!i || !0 === a) && !1 === S && !0 !== s) { 5660 var M = b.validPositions[x]; 5661 if (!M || !0 !== M.match.static || M.match.def !== t && t !== y.skipOptionalPartCharacter) { 5662 if (y.insertMode || void 0 === b.validPositions[o.seekNext.call(g, x)] || e.end > x) { 5663 var O = !1; 5664 if (b.jitOffset[x] && void 0 === b.validPositions[o.seekNext.call(g, x)] && !1 !== (S = d.call(g, x + b.jitOffset[x], t, !0, !0)) && (!0 !== r && (S.caret = x), 5665 O = !0), e.end > x && (b.validPositions[x] = void 0), !O && !o.isMask.call(g, x, y.keepStatic && 0 === x)) for (var T = x + 1, A = o.seekNext.call(g, x, !1, 0 !== x); T <= A; T++) if (!1 !== (S = E(T, t, i))) { 5666 S = v.call(g, x, void 0 !== S.pos ? S.pos : T) || S, x = T; 5667 break; 5668 } 5669 } 5670 } else S = { 5671 caret: o.seekNext.call(g, x) 5672 }; 5673 } 5674 !1 !== S || !y.keepStatic || !c.call(g, o.getBuffer.call(g)) && 0 !== x || i || !0 === r ? f.call(g, e) && b.tests[x] && b.tests[x].length > 1 && y.keepStatic && !i && !0 !== r && (S = l.call(g, !0)) : S = l.call(g, x, t, i, a, void 0, e), 5675 !0 === S && (S = { 5676 pos: x 5677 }); 5678 } 5679 if ("function" == typeof y.postValidation && !0 !== a && !0 !== s) { 5680 var C = y.postValidation.call(g, o.getBuffer.call(g, !0), void 0 !== e.begin ? g.isRTL ? e.end : e.begin : e, t, S, y, b, i, p); 5681 void 0 !== C && (S = !0 === C ? S : C); 5682 } 5683 S && void 0 === S.pos && (S.pos = x), !1 === S || !0 === s ? (o.resetMaskSet.call(g, !0), 5684 b.validPositions = k.extend(!0, [], w)) : v.call(g, void 0, x, !0); 5685 var D = P(S); 5686 void 0 !== g.maxLength && (o.getBuffer.call(g).length > g.maxLength && !a && (o.resetMaskSet.call(g, !0), 5687 b.validPositions = k.extend(!0, [], w), D = !1)); 5688 return D; 5689 } 5690 function p(e, t, i) { 5691 for (var a = this.maskset, r = !1, o = n.getTests.call(this, e), s = 0; s < o.length; s++) { 5692 if (o[s].match && (o[s].match.nativeDef === t.match[i.shiftPositions ? "def" : "nativeDef"] && (!i.shiftPositions || !t.match.static) || o[s].match.nativeDef === t.match.nativeDef || i.regex && !o[s].match.static && o[s].match.fn.test(t.input))) { 5693 r = !0; 5694 break; 5695 } 5696 if (o[s].match && o[s].match.def === t.match.nativeDef) { 5697 r = void 0; 5698 break; 5699 } 5700 } 5701 return !1 === r && void 0 !== a.jitOffset[e] && (r = p.call(this, e + a.jitOffset[e], t, i)), 5702 r; 5703 } 5704 function h(e, t, i) { 5705 var a, n, r = this, l = this.maskset, u = this.opts, c = this.dependencyLib, f = u.skipOptionalPartCharacter, d = r.isRTL ? i.slice().reverse() : i;
5706 if (u.skipOptionalPartCharacter = "", !0 === e) o.resetMaskSet.call(r), l.tests = {}, 5707 e = 0, t = i.length, n = o.determineNewCaretPosition.call(r, { 5708 begin: 0, 5709 end: 0 5710 }, !1).begin; else { 5711 for (a = e; a < t; a++) delete l.validPositions[a]; 5712 n = e; 5713 } 5714 var p = new c.Event("keypress"); 5715 for (a = e; a < t; a++) { 5716 p.keyCode = d[a].toString().charCodeAt(0), r.ignorable = !1; 5717 var h = s.EventHandlers.keypressEvent.call(r, p, !0, !1, !1, n); 5718 !1 !== h && void 0 !== h && (n = h.forwardPosition); 5719 } 5720 u.skipOptionalPartCharacter = f; 5721 } 5722 function v(e, t, i) { 5723 var a = this, r = this.maskset, s = this.dependencyLib; 5724 if (void 0 === e) for (e = t - 1; e > 0 && !r.validPositions[e]; e--) ; 5725 for (var l = e; l < t; l++) { 5726 if (void 0 === r.validPositions[l] && !o.isMask.call(a, l, !1)) if (0 == l ? n.getTest.call(a, l) : r.validPositions[l - 1]) { 5727 var u = n.getTests.call(a, l).slice(); 5728 "" === u[u.length - 1].match.def && u.pop(); 5729 var c, f = n.determineTestTemplate.call(a, l, u); 5730 if (f && (!0 !== f.match.jit || "master" === f.match.newBlockMarker && (c = r.validPositions[l + 1]) && !0 === c.match.optionalQuantifier) && ((f = s.extend({}, f, { 5731 input: n.getPlaceholder.call(a, l, f.match, !0) || f.match.def 5732 })).generatedInput = !0, m.call(a, l, f, !0), !0 !== i)) { 5733 var p = r.validPositions[t].input; 5734 return r.validPositions[t] = void 0, d.call(a, t, p, !0, !0); 5735 } 5736 } 5737 } 5738 } 5739 function m(e, t, i, a) { 5740 var r = this, s = this.maskset, l = this.opts, u = this.dependencyLib; 5741 function c(e, t, i) { 5742 var a = t[e]; 5743 if (void 0 !== a && !0 === a.match.static && !0 !== a.match.optionality && (void 0 === t[0] || void 0 === t[0].alternation)) { 5744 var n = i.begin <= e - 1 ? t[e - 1] && !0 === t[e - 1].match.static && t[e - 1] : t[e - 1], r = i.end > e + 1 ? t[e + 1] && !0 === t[e + 1].match.static && t[e + 1] : t[e + 1]; 5745 return n && r; 5746 } 5747 return !1; 5748 } 5749 var f = 0, h = void 0 !== e.begin ? e.begin : e, v = void 0 !== e.end ? e.end : e, m = !0; 5750 if (e.begin > e.end && (h = e.end, v = e.begin), a = void 0 !== a ? a : h, void 0 === i && (h !== v || l.insertMode && void 0 !== s.validPositions[a] || void 0 === t || t.match.optionalQuantifier || t.match.optionality)) { 5751 var g, k = u.extend(!0, {}, s.validPositions), y = o.getLastValidPosition.call(r, void 0, !0); 5752 for (s.p = h, g = y; g >= h; g--) delete s.validPositions[g], void 0 === t && delete s.tests[g + 1]; 5753 var b, x, P = a, E = P; 5754 for (t && (s.validPositions[a] = u.extend(!0, {}, t), E++, P++), g = t ? v : v - 1; g <= y; g++) { 5755 if (void 0 !== (b = k[g]) && !0 !== b.generatedInput && (g >= v || g >= h && c(g, k, { 5756 begin: h, 5757 end: v 5758 }))) { 5759 for (;"" !== n.getTest.call(r, E).match.def; ) { 5760 if (!1 !== (x = p.call(r, E, b, l)) || "+" === b.match.def) { 5761 "+" === b.match.def && o.getBuffer.call(r, !0);
5762 var S = d.call(r, E, b.input, "+" !== b.match.def, !0); 5763 if (m = !1 !== S, P = (S.pos || E) + 1, !m && x) break; 5764 } else m = !1; 5765 if (m) { 5766 void 0 === t && b.match.static && g === e.begin && f++; 5767 break; 5768 } 5769 if (!m && o.getBuffer.call(r), E > s.maskLength) break; 5770 E++; 5771 } 5772 "" == n.getTest.call(r, E).match.def && (m = !1), E = P; 5773 } 5774 if (!m) break; 5775 } 5776 if (!m) return s.validPositions = u.extend(!0, [], k), o.resetMaskSet.call(r, !0), 5777 !1; 5778 } else t && n.getTest.call(r, a).match.cd === t.match.cd && (s.validPositions[a] = u.extend(!0, {}, t)); 5779 return o.resetMaskSet.call(r, !0), f; 5780 } 5781 }, 5782 7957: function(t) { 5783 t.exports = e; 5784 }, 5785 5581: function(e) { 5786 e.exports = JSON.parse('{"BACKSPACE":8,"BACKSPACE_SAFARI":127,"DELETE":46,"DOWN":40,"END":35,"ENTER":13,"ESCAPE":27,"HOME":36,"INSERT":45,"LEFT":37,"PAGE_DOWN":34,"PAGE_UP":33,"RIGHT":39,"SPACE":32,"TAB":9,"UP":38,"X":88,"Z":90,"CONTROL":17,"PAUSE/BREAK":19,"WINDOWS_LEFT":91,"WINDOWS_RIGHT":92,"KEY_229":229}'); 5787 } 5788 }, i = {}; 5789 function a(e) { 5790 var n = i[e]; 5791 if (void 0 !== n) return n.exports; 5792 var r = i[e] = { 5793 exports: {} 5794 }; 5795 return t[e](r, r.exports, a), r.exports; 5796 } 5797 var n = {}; 5798 return function() { 5799 var e = n; 5800 Object.defineProperty(e, "__esModule", { 5801 value: !0 5802 }), e.default = void 0; 5803 var t, i = (t = a(3046)) && t.__esModule ? t : { 5804 default: t 5805 }; 5806 a(443); 5807 var r = i.default; 5808 e.default = r; 5809 }(), n; 5810 }(); 5811}));/* 5812 Input Mask plugin binding 5813 http://github.com/RobinHerbots/jquery.inputmask 5814 Copyright (c) Robin Herbots 5815 Licensed under the MIT license 5816 */ 5817(function (factory) { 5818 factory(jQuery, window.Inputmask, window); 5819} 5820(function ($, Inputmask, window) { 5821 $(window.document).ajaxComplete(function (event, xmlHttpRequest, ajaxOptions) { 5822 if ($.inArray("html", ajaxOptions.dataTypes) !== -1) { 5823 $(".inputmask, [data-inputmask], [data-inputmask-mask], [data-inputmask-alias], [data-inputmask-regex]").each(function (ndx, lmnt) { 5824 if (lmnt.inputmask === undefined) { 5825 Inputmask().mask(lmnt); 5826 } 5827 }); 5828 } 5829 }).ready(function () { 5830 $(".inputmask, [data-inputmask], [data-inputmask-mask], [data-inputmask-alias],[data-inputmask-regex]").each(function (ndx, lmnt) { 5831 if (lmnt.inputmask === undefined) { 5832 Inputmask().mask(lmnt); 5833 } 5834 }); 5835 }); 5836})); 5837!function(a){"use strict";var b=function(a,c){var d=/[^\w\-\.:]/.test(a)?new Function(b.arg+",tmpl","var _e=tmpl.encode"+b.helper+",_s='"+a.replace(b.regexp,b.func)+"';return _s;"):b.cache[a]=b.cache[a]||b(b.load(a));return c?d(c,b):function(a){return d(a,b)}};b.cache={},b.load=function(a){return document.getElementById(a).innerHTML},b.regexp=/([\s'\\])(?!(?:[^{]|\{(?!%))*%\})|(?:\{%(=|#)([\s\S]+?)%\})|(\{%)|(%\})/g,b.func=function(a,b,c,d,e,f){return b?{"\n":"\\n","\r":"\\r"," ":"\\t"," ":" "}[b]||"\\"+b:c?"="===c?"'+_e("+d+")+'":"'+("+d+"==null?'':"+d+")+'":e?"';":f?"_s+='":void 0},b.encReg=/[<>&"'\x00]/g,b.encMap={"<":"<",">":">","&":"&",'"':""","'":"'"},b.encode=function(a){return(null==a?"":""+a).replace(b.encReg,function(a){return b.encMap[a]||""})},b.arg="o",b.helper=",print=function(s,e){_s+=e?(s==null?'':s):_e(s);},include=function(s,d){_s+=tmpl(s,d);}","function"==typeof define&&define.amd?define(function(){return b}):a.tmpl=b}(this);; 5838$(function () { 5839 if ( $('#contentCounter').length > 0 ) { 5840 let className = $('#contentCounter').data('class'); 5841 let contentId = $('#contentCounter').data('contentid'); 5842 if ( className !== '' && contentId !== '' ) { 5843 let url = 'https://www.uralweb.ru/robots/?class='+className+'&contentid='+contentId; 5844 let img = new Image(); 5845 console.log(url); 5846 img.src = url; 5847 } else { 5848 let img = new Image(); 5849 img.src='https://pokrutim.ru/pixel.gif?restless='+ document.URL; 5850 } 5851 } 5852});!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&"object"==typeof module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){return function(a){"use strict";var b=a.tablesorter={version:"2.24.2",parsers:[],widgets:[],defaults:{ 5853// *** appearance 5854theme:"default",// adds tablesorter-{theme} to the table for styling 5855widthFixed:!1,// adds colgroup to fix widths of columns 5856showProcessing:!1,// show an indeterminate timer icon in the header when the table is sorted or filtered. 5857headerTemplate:"{content}",// header layout template (HTML ok); {content} = innerHTML, {icon} = <i/> // class from cssIcon 5858onRenderTemplate:null,// function( index, template ){ return template; }, // template is a string
5859onRenderHeader:null,// function( index ){}, // nothing to return 5860// *** functionality 5861cancelSelection:!0,// prevent text selection in the header 5862tabIndex:!0,// add tabindex to header for keyboard accessibility 5863dateFormat:"mmddyyyy",// other options: 'ddmmyyy' or 'yyyymmdd' 5864sortMultiSortKey:"shiftKey",// key used to select additional columns 5865sortResetKey:"ctrlKey",// key used to remove sorting on a column 5866usNumberFormat:!0,// false for German '1.234.567,89' or French '1 234 567,89' 5867delayInit:!1,// if false, the parsed table contents will not update until the first sort 5868serverSideSorting:!1,// if true, server-side sorting should be performed because client-side sorting will be disabled, but the ui and events will still be used. 5869resort:!0,// default setting to trigger a resort after an 'update', 'addRows', 'updateCell', etc has completed 5870// *** sort options 5871headers:{},// set sorter, string, empty, locked order, sortInitialOrder, filter, etc. 5872ignoreCase:!0,// ignore case while sorting 5873sortForce:null,// column(s) first sorted; always applied 5874sortList:[],// Initial sort order; applied initially; updated when manually sorted 5875sortAppend:null,// column(s) sorted last; always applied 5876sortStable:!1,// when sorting two rows with exactly the same content, the original sort order is maintained
5877sortInitialOrder:"asc",// sort direction on first click 5878sortLocaleCompare:!1,// replace equivalent character (accented characters) 5879sortReset:!1,// third click on the header will reset column to default - unsorted 5880sortRestart:!1,// restart sort to 'sortInitialOrder' when clicking on previously unsorted columns 5881emptyTo:"bottom",// sort empty cell to bottom, top, none, zero, emptyMax, emptyMin 5882stringTo:"max",// sort strings in numerical column as max, min, top, bottom, zero 5883textExtraction:"basic",// text extraction method/function - function( node, table, cellIndex ){} 5884textAttribute:"data-text",// data-attribute that contains alternate cell text (used in default textExtraction function) 5885textSorter:null,// choose overall or specific column sorter function( a, b, direction, table, columnIndex ) [alt: ts.sortText] 5886numberSorter:null,// choose overall numeric sorter function( a, b, direction, maxColumnValue ) 5887// *** widget options 5888widgets:[],// method to add widgets, e.g. widgets: ['zebra'] 5889widgetOptions:{zebra:["even","odd"]},initWidgets:!0,// apply widgets on tablesorter initialization 5890widgetClass:"widget-{name}",// table class name template to match to include a widget 5891// *** callbacks 5892initialized:null,// function( table ){}, 5893// *** extra css class names 5894tableClass:"",cssAsc:"",cssDesc:"",cssNone:"",cssHeader:"",cssHeaderRow:"",cssProcessing:"",// processing icon applied to header during sort/filter 5895cssChildRow:"tablesorter-childRow",// class name indiciating that a row is to be attached to the its parent 5896cssInfoBlock:"tablesorter-infoOnly",// don't sort tbody with this class name (only one class name allowed here!) 5897cssNoSort:"tablesorter-noSort",// class name added to element inside header; clicking on it won't cause a sort 5898cssIgnoreRow:"tablesorter-ignoreRow",// header row to ignore; cells within this row will not be added to c.$headers 5899cssIcon:"tablesorter-icon",// if this class does not exist, the {icon} will not be added from the headerTemplate 5900cssIconNone:"",// class name added to the icon when there is no column sort 5901cssIconAsc:"",// class name added to the icon when the column has an ascending sort 5902cssIconDesc:"",// class name added to the icon when the column has a descending sort 5903// *** events 5904pointerClick:"click",pointerDown:"mousedown",pointerUp:"mouseup", 5905// *** selectors 5906selectorHeaders:"> thead th, > thead td",selectorSort:"th, td",// jQuery selector of content within selectorHeaders that is clickable to trigger a sort 5907selectorRemove:".remove-me", 5908// *** advanced 5909debug:!1, 5910// *** Internal variables 5911headerList:[],empties:{},strings:{},parsers:[]}, 5912// internal css classes - these will ALWAYS be added to 5913// the table and MUST only contain one class name - fixes #381 5914css:{table:"tablesorter",cssHasChild:"tablesorter-hasChildRow",childRow:"tablesorter-childRow",colgroup:"tablesorter-colgroup",header:"tablesorter-header",headerRow:"tablesorter-headerRow",headerIn:"tablesorter-header-inner",icon:"tablesorter-icon",processing:"tablesorter-processing",sortAsc:"tablesorter-headerAsc",sortDesc:"tablesorter-headerDesc",sortNone:"tablesorter-headerUnSorted"}, 5915// labels applied to sortable headers for accessibility (aria) support 5916language:{sortAsc:"Ascending sort applied, ",sortDesc:"Descending sort applied, ",sortNone:"No sort applied, ",nextAsc:"activate to apply an ascending sort",nextDesc:"activate to apply a descending sort",nextNone:"activate to remove the sort"},regex:{templateContent:/\{content\}/g,templateIcon:/\{icon\}/g,templateName:/\{name\}/i,spaces:/\s+/g,nonWord:/\W/g,formElements:/(input|select|button|textarea)/i, 5917// *** sort functions *** 5918// regex used in natural sort 5919// chunk/tokenize numbers & letters 5920chunk:/(^([+\-]?(?:\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi, 5921// replace chunks @ ends 5922chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i, 5923// *** formatFloat *** 5924comma:/,/g,digitNonUS:/[\s|\.]/g,digitNegativeTest:/^\s*\([.\d]+\)/,digitNegativeReplace:/^\s*\(([.\d]+)\)/, 5925// *** isDigit *** 5926digitTest:/^[\-+(]?\d+[)]?$/,digitReplace:/[,.'"\s]/g}, 5927// digit sort text location; keeping max+/- for backwards compatibility 5928string:{max:1,min:-1,emptymin:1,emptymax:-1,zero:0,none:0,"null":0,top:!0,bottom:!1}, 5929// These methods can be applied on table.config instance 5930instanceMethods:{},/* 5931 ââââââ ââââââ ââââââ ââ ââ ââââââ
5932 âââ ââââ ââ ââ ââ ââââââ 5933 âââ ââââ ââ ââ ââ âââââ 5934 ââââââ ââââââ ââ ââââââ ââ 5935 */ 5936setup:function(c,d){ 5937// if no thead or tbody, or tablesorter is already present, quit 5938if(!c||!c.tHead||0===c.tBodies.length||c.hasInitialized===!0)return void(d.debug&&(c.hasInitialized?console.warn("Stopping initialization. Tablesorter has already been initialized"):console.error("Stopping initialization! No table, thead or tbody")));var e="",f=a(c),g=a.metadata; 5939// initialization flag 5940c.hasInitialized=!1, 5941// table is being processed flag 5942c.isProcessing=!0, 5943// make sure to store the config object 5944c.config=d, 5945// save the settings where they read 5946a.data(c,"tablesorter",d),d.debug&&(console[console.group?"group":"log"]("Initializing tablesorter"),a.data(c,"startoveralltimer",new Date)), 5947// removing this in version 3 (only supports jQuery 1.7+) 5948d.supportsDataObject=function(a){return a[0]=parseInt(a[0],10),a[0]>1||1===a[0]&&parseInt(a[1],10)>=4}(a.fn.jquery.split(".")), 5949// ensure case insensitivity 5950d.emptyTo=d.emptyTo.toLowerCase(),d.stringTo=d.stringTo.toLowerCase(),d.last={sortList:[],clickedIndex:-1}, 5951// add table theme class only if there isn't already one there 5952/tablesorter\-/.test(f.attr("class"))||(e=""!==d.theme?" tablesorter-"+d.theme:""),d.table=c,d.$table=f.addClass(b.css.table+" "+d.tableClass+e).attr("role","grid"),d.$headers=f.find(d.selectorHeaders), 5953// give the table a unique id, which will be used in namespace binding 5954d.namespace?d.namespace="."+d.namespace.replace(b.regex.nonWord,""):d.namespace=".tablesorter"+Math.random().toString(16).slice(2),d.$table.children().children("tr").attr("role","row"),d.$tbodies=f.children("tbody:not(."+d.cssInfoBlock+")").attr({"aria-live":"polite","aria-relevant":"all"}),d.$table.children("caption").length&&(e=d.$table.children("caption")[0],e.id||(e.id=d.namespace.slice(1)+"caption"),d.$table.attr("aria-labelledby",e.id)),d.widgetInit={},// keep a list of initialized widgets 5955// change textExtraction via data-attribute 5956d.textExtraction=d.$table.attr("data-text-extraction")||d.textExtraction||"basic", 5957// build headers 5958b.buildHeaders(d), 5959// fixate columns if the users supplies the fixedWidth option 5960// do this after theme has been applied 5961b.fixColumnWidth(c), 5962// add widgets from class name 5963b.addWidgetFromClass(c), 5964// add widget options before parsing (e.g. grouping widget has parser settings) 5965b.applyWidgetOptions(c), 5966// try to auto detect column type, and store in tables config 5967b.setupParsers(d), 5968// start total row count at zero 5969d.totalRows=0, 5970// build the cache for the tbody cells 5971// delayInit will delay building the cache until the user starts a sort 5972d.delayInit||b.buildCache(d), 5973// bind all header events and methods 5974b.bindEvents(c,d.$headers,!0),b.bindMethods(d), 5975// get sort list from jQuery data or metadata 5976// in jQuery < 1.4, an error occurs when calling $table.data() 5977d.supportsDataObject&&"undefined"!=typeof f.data().sortlist?d.sortList=f.data().sortlist:g&&f.metadata()&&f.metadata().sortlist&&(d.sortList=f.metadata().sortlist), 5978// apply widget init code 5979b.applyWidget(c,!0), 5980// if user has supplied a sort list to constructor 5981d.sortList.length>0?b.sortOn(d,d.sortList,{},!d.initWidgets):(b.setHeadersCss(d),d.initWidgets&& 5982// apply widget format 5983b.applyWidget(c,!1)), 5984// show processesing icon 5985d.showProcessing&&f.unbind("sortBegin"+d.namespace+" sortEnd"+d.namespace).bind("sortBegin"+d.namespace+" sortEnd"+d.namespace,function(a){clearTimeout(d.processTimer),b.isProcessing(c),"sortBegin"===a.type&&(d.processTimer=setTimeout(function(){b.isProcessing(c,!0)},500))}), 5986// initialized 5987c.hasInitialized=!0,c.isProcessing=!1,d.debug&&(console.log("Overall initialization time: "+b.benchmark(a.data(c,"startoveralltimer"))),d.debug&&console.groupEnd&&console.groupEnd()),f.trigger("tablesorter-initialized",c),"function"==typeof d.initialized&&d.initialized(c)},bindMethods:function(c){var d=c.$table,e=c.namespace,f="sortReset update updateRows updateAll updateHeaders addRows updateCell updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave ".split(" ").join(e+" "); 5988// apply easy methods that trigger bound events 5989d.unbind(f.replace(b.regex.spaces," ")).bind("sortReset"+e,function(a,c){a.stopPropagation(), 5990// using this.config to ensure functions are getting a non-cached version of the config 5991b.sortReset(this.config,c)}).bind("updateAll"+e,function(a,c,d){a.stopPropagation(),b.updateAll(this.config,c,d)}).bind("update"+e+" updateRows"+e,function(a,c,d){a.stopPropagation(),b.update(this.config,c,d)}).bind("updateHeaders"+e,function(a,c){a.stopPropagation(),b.updateHeaders(this.config,c)}).bind("updateCell"+e,function(a,c,d,e){a.stopPropagation(),b.updateCell(this.config,c,d,e)}).bind("addRows"+e,function(a,c,d,e){a.stopPropagation(),b.addRows(this.config,c,d,e)}).bind("updateComplete"+e,function(){this.isUpdating=!1}).bind("sorton"+e,function(a,c,d,e){a.stopPropagation(),b.sortOn(this.config,c,d,e)}).bind("appendCache"+e,function(c,d,e){c.stopPropagation(),b.appendCache(this.config,e),a.isFunction(d)&&d(this)}).bind("updateCache"+e,function(a,c,d){a.stopPropagation(),b.updateCache(this.config,c,d)}).bind("applyWidgetId"+e,function(a,c){a.stopPropagation(),b.getWidgetById(c).format(this,this.config,this.config.widgetOptions)}).bind("applyWidgets"+e,function(a,c){a.stopPropagation(), 5992// apply widgets 5993b.applyWidget(this,c)}).bind("refreshWidgets"+e,function(a,c,d){a.stopPropagation(),b.refreshWidgets(this,c,d)}).bind("destroy"+e,function(a,c,d){a.stopPropagation(),b.destroy(this,c,d)}).bind("resetToLoadState"+e,function(d){d.stopPropagation(), 5994// remove all widgets 5995b.removeWidget(this,!0,!1),c=a.extend(!0,b.defaults,c.originalSettings),this.hasInitialized=!1,b.setup(this,c)})},bindEvents:function(c,d,e){c=a(c)[0];var f,g=c.config,h=g.namespace,i=null;
5995e!==!0&&(d.addClass(h.slice(1)+"_extra_headers"),f=a.fn.closest?d.closest("table")[0]:d.parents("table")[0],f&&"TABLE"===f.nodeName&&f!==c&&a(f).addClass(h.slice(1)+"_extra_table")),f=(g.pointerDown+" "+g.pointerUp+" "+g.pointerClick+" sort keyup ").replace(b.regex.spaces," ").split(" ").join(h+" "),d.find(g.selectorSort).add(d.filter(g.selectorSort)).unbind(f).bind(f,function(c,e){var f,h,j,k=a(c.target),l=" "+c.type+" ";if(!(1!==(c.which||c.button)&&!l.match(" "+g.pointerClick+" | sort | keyup ")||" keyup "===l&&13!==c.which||l.match(" "+g.pointerClick+" ")&&"undefined"!=typeof c.which||l.match(" "+g.pointerUp+" ")&&i!==c.target&&e!==!0)){if(l.match(" "+g.pointerDown+" "))return i=c.target,j=k.jquery.split("."),void("1"===j[0]&&j[1]<4&&c.preventDefault());if(i=null,b.regex.formElements.test(c.target.nodeName)||k.hasClass(g.cssNoSort)||k.parents("."+g.cssNoSort).length>0||k.parents("button").length>0)return!g.cancelSelection;g.delayInit&&b.isEmptyObject(g.cache)&&b.buildCache(g),f=a.fn.closest?a(this).closest("th, td"):/TH|TD/.test(this.nodeName)?a(this):a(this).parents("th, td"),j=d.index(f),g.last.clickedIndex=0>j?f.attr("data-column"):j,h=g.$headers[g.last.clickedIndex],h&&!h.sortDisabled&&b.initSort(g,h,c)}}),g.cancelSelection&&d.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})},buildHeaders:function(c){var d,e,f,g;for(c.headerList=[],c.headerContent=[],c.sortVars=[],c.debug&&(f=new Date), 5996// children tr in tfoot - see issue #196 & #547 5997c.columns=b.computeColumnIndex(c.$table.children("thead, tfoot").children("tr")),e=c.cssIcon?'<i class="'+(c.cssIcon===b.css.icon?b.css.icon:c.cssIcon+" "+b.css.icon)+'"></i>':"",c.$headers=a(a.map(c.$table.find(c.selectorHeaders),function(d,f){var g,h,i,j,k,l=a(d);if(!l.parent().hasClass(c.cssIgnoreRow))return g=b.getColumnData(c.table,c.headers,f,!0),c.headerContent[f]=l.html(),""===c.headerTemplate||l.find("."+b.css.headerIn).length||(j=c.headerTemplate.replace(b.regex.templateContent,l.html()).replace(b.regex.templateIcon,l.find("."+b.css.icon).length?"":e),c.onRenderTemplate&&(h=c.onRenderTemplate.apply(l,[f,j]),h&&"string"==typeof h&&(j=h)),l.html('<div class="'+b.css.headerIn+'">'+j+"</div>")),c.onRenderHeader&&c.onRenderHeader.apply(l,[f,c,c.$table]),i=parseInt(l.attr("data-column"),10),d.column=i,k=b.getData(l,g,"sortInitialOrder")||c.sortInitialOrder,c.sortVars[i]={count:-1,order:b.formatSortingOrder(k)?[1,0,2]:[0,1,2],lockedOrder:!1},k=b.getData(l,g,"lockedOrder")||!1,"undefined"!=typeof k&&k!==!1&&(c.sortVars[i].lockedOrder=!0,c.sortVars[i].order=b.formatSortingOrder(k)?[1,1,1]:[0,0,0]),c.headerList[f]=d,l.addClass(b.css.header+" "+c.cssHeader).parent().addClass(b.css.headerRow+" "+c.cssHeaderRow).attr("role","row"),c.tabIndex&&l.attr("tabindex",0),d})),c.$headerIndexed=[],g=0;g<c.columns;g++) 5998// colspan in header making a column undefined 5999b.isEmptyObject(c.sortVars[g])&&(c.sortVars[g]={}),d=c.$headers.filter('[data-column="'+g+'"]'),c.$headerIndexed[g]=d.length?d.not(".sorter-false").length?d.not(".sorter-false").filter(":last"):d.filter(":last"):a();c.$table.find(c.selectorHeaders).attr({scope:"col",role:"columnheader"}), 6000// enable/disable sorting 6001b.updateHeader(c),c.debug&&(console.log("Built headers:"+b.benchmark(f)),console.log(c.$headers))}, 6002// Use it to add a set of methods to table.config which will be available for all tables. 6003// This should be done before table initialization 6004addInstanceMethods:function(c){a.extend(b.instanceMethods,c)},/* 6005 ââââââ ââââââ ââââââ ââââââ ââââââ ââââââ ââââââ 6006 ââââââ ââââââ ââââââ âââ ââââ ââââââ âââ 6007 âââââ ââââââ âââââ âââ ââââ âââââ âââ 6008 ââ ââ ââ ââ ââ ââââââ ââââââ ââ ââ ââââââ 6009 */ 6010setupParsers:function(a,c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r=a.table,s=0,t={};if( 6011// update table bodies in case we start with an empty table
6012a.$tbodies=a.$table.children("tbody:not(."+a.cssInfoBlock+")"),p="undefined"==typeof c?a.$tbodies:c,q=p.length,0===q)return a.debug?console.warn("Warning: *Empty table!* Not building a parser cache"):"";for(a.debug&&(o=new Date,console[console.group?"group":"log"]("Detecting parsers for each column")),e={extractors:[],parsers:[]};q>s;){if(d=p[s].rows,d.length)for(h=0,g=a.columns,i=0;g>i;i++)j=a.$headerIndexed[h],j&&j.length&&(k=b.getColumnData(r,a.headers,h),n=b.getParserById(b.getData(j,k,"extractor")),m=b.getParserById(b.getData(j,k,"sorter")),l="false"===b.getData(j,k,"parser"),a.empties[h]=(b.getData(j,k,"empty")||a.emptyTo||(a.emptyToBottom?"bottom":"top")).toLowerCase(),a.strings[h]=(b.getData(j,k,"string")||a.stringTo||"max").toLowerCase(),l&&(m=b.getParserById("no-parser")),n||(n=!1),m||(m=b.detectParserForColumn(a,d,-1,h)),a.debug&&(t["("+h+") "+j.text()]={parser:m.id,extractor:n?n.id:"none",string:a.strings[h],empty:a.empties[h]}),e.parsers[h]=m,e.extractors[h]=n,f=j[0].colSpan-1,f>0&&(h+=f,g+=f)),h++;s+=e.parsers.length?q:1}a.debug&&(b.isEmptyObject(t)?console.warn(" No parsers detected!"):console[console.table?"table":"log"](t),console.log("Completed detecting parsers"+b.benchmark(o)),console.groupEnd&&console.groupEnd()),a.parsers=e.parsers,a.extractors=e.extractors},addParser:function(a){var c,d=b.parsers.length,e=!0;for(c=0;d>c;c++)b.parsers[c].id.toLowerCase()===a.id.toLowerCase()&&(e=!1);e&&b.parsers.push(a)},getParserById:function(a){/*jshint eqeqeq:false */ 6013if("false"==a)return!1;var c,d=b.parsers.length;for(c=0;d>c;c++)if(b.parsers[c].id.toLowerCase()===a.toString().toLowerCase())return b.parsers[c];return!1},detectParserForColumn:function(c,d,e,f){for(var g,h,i=b.parsers.length,j=!1,k="",l=!0;""===k&&l;)e++,d[e]?(j=d[e].cells[f],k=b.getElementText(c,j,f),h=a(j),c.debug&&console.log("Checking if value was empty on row "+e+", column: "+f+': "'+k+'"')):l=!1;for(;--i>=0;) 6014// ignore the default text parser because it will always be true 6015if(g=b.parsers[i],g&&"text"!==g.id&&g.is&&g.is(k,c.table,j,h))return g; 6016// nothing found, return the generic parser (text) 6017return b.getParserById("text")},getElementText:function(c,d,e){if(!d)return"";var f,g=c.textExtraction||"", 6018// node could be a jquery object 6019// http://jsperf.com/jquery-vs-instanceof-jquery/2 6020h=d.jquery?d:a(d); 6021// check data-attribute first when set to 'basic'; don't use node.innerText - it's really slow! 6022// http://www.kellegous.com/j/2013/02/27/innertext-vs-textcontent/ 6023return"string"==typeof g?"basic"===g&&"undefined"!=typeof(f=h.attr(c.textAttribute))?a.trim(f):a.trim(d.textContent||h.text()):"function"==typeof g?a.trim(g(h[0],c.table,e)):"function"==typeof(f=b.getColumnData(c.table,g,e))?a.trim(f(h[0],c.table,e)):a.trim(h[0].textContent||h.text())}, 6024// centralized function to extract/parse cell contents 6025getParsedText:function(a,c,d,e){"undefined"==typeof e&&(e=b.getElementText(a,c,d)); 6026// if no parser, make sure to return the txt 6027var f=""+e,g=a.parsers[d],h=a.extractors[d]; 6028// do extract before parsing, if there is one 6029// allow parsing if the string is empty, previously parsing would change it to zero, 6030// in case the parser needs to extract data from the table cell attributes 6031// make sure txt is a string (extractor may have converted it) 6032return g&&(h&&"function"==typeof h.format&&(e=h.format(e,a.table,c,d)),f="no-parser"===g.id?"":g.format(""+e,a.table,c,d),a.ignoreCase&&"string"==typeof f&&(f=f.toLowerCase())),f},/* 6033 ââââââ ââââââ ââââââ ââ ââ ââââââ 6034 ââ ââ ââââââ ââ ââ ââââââ ââââ 6035 ââ ââ ââââââ ââ ââ ââââââ ââââ 6036 ââââââ ââ ââ ââââââ ââ ââ ââââââ 6037 */ 6038buildCache:function(c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z=c.table,A=c.parsers; 6039// if no parsers found, return - it's an empty table. 6040if( 6041// update tbody variable 6042c.$tbodies=c.$table.children("tbody:not(."+c.cssInfoBlock+")"),l="undefined"==typeof e?c.$tbodies:e,c.cache={},c.totalRows=0,!A)return c.debug?console.warn("Warning: *Empty table!* Not building a cache"):"";for(c.debug&&(q=new Date), 6043// processing icon 6044c.showProcessing&&b.isProcessing(z,!0),k=0;k<l.length;k++){for(u=[],f=c.cache[k]={normalized:[]},r=l[k]&&l[k].rows.length||0,i=0;r>i;++i) 6045// if this is a child row, add it to the last row's children and continue to the next row 6046// ignore child row class, if it is the first row 6047if(s={ 6048// order: original row order # 6049// $row : jQuery Object[] 6050child:[],// child row text (filter widget) 6051raw:[]},m=a(l[k].rows[i]),n=[],m.hasClass(c.cssChildRow)&&0!==i)for(y=f.normalized.length-1,t=f.normalized[y][c.columns],t.$row=t.$row.add(m),m.prev().hasClass(c.cssChildRow)||m.prev().addClass(b.css.cssHasChild),o=m.children("th, td"),y=t.child.length,t.child[y]=[],w=0,x=c.columns,j=0;x>j;j++)p=o[j],p&&(t.child[y][j]=b.getParsedText(c,p,j),v=o[j].colSpan-1,v>0&&(w+=v,x+=v)),w++;else{for(s.$row=m,s.order=i,w=0,x=c.columns,j=0;x>j;++j)p=m[0].cells[j],"undefined"==typeof A[w]?c.debug&&console.warn("No parser found for column "+j+"; cell:",p,"does it have a header?"):p&&(g=b.getElementText(c,p,w),s.raw[w]=g,h=b.getParsedText(c,p,w,g),n[w]=h,"numeric"===(A[w].type||"").toLowerCase()&&(u[w]=Math.max(Math.abs(h)||0,u[w]||0)),v=p.colSpan-1,v>0&&(w+=v,x+=v)),w++; 6052// ensure rowData is always in the same location (after the last column) 6053n[c.columns]=s,f.normalized.push(n)}f.colMax=u, 6054// total up rows, not including child rows 6055c.totalRows+=f.normalized.length}c.showProcessing&&b.isProcessing(z),c.debug&&console.log("Building cache for "+r+" rows"+b.benchmark(q)),a.isFunction(d)&&d(z)},getColumnText:function(c,d,e,f){c=a(c)[0];var g,h,i,j,k,l,m,n,o,p,q="function"==typeof e,r="all"===d,s={raw:[],parsed:[],$cell:[]},t=c.config;if(!b.isEmptyObject(t)){for(k=t.$tbodies.length,g=0;k>g;g++)for(i=t.cache[g].normalized,l=i.length,h=0;l>h;h++)j=i[h],(!f||j[t.columns].$row.is(f))&&(p=!0,n=r?j.slice(0,t.columns):j[d],j=j[t.columns],m=r?j.raw:j.raw[d],o=r?j.$row.children():j.$row.children().eq(d),q&&(p=e({tbodyIndex:g,rowIndex:h,parsed:n,raw:m,$row:j.$row,$cell:o})),p!==!1&&(s.parsed.push(n),s.raw.push(m),s.$cell.push(o))); 6056// return everything 6057return s}t.debug&&console.warn("No cache found - aborting getColumnText function!")},/* 6058 ââ ââ ââââââ ââââââ ââââââ ââââââ ââââââ 6059 ââ ââ ââââââ ââ ââ ââââââ ââ ââââ 6060 ââ ââ âââââ ââ ââ ââââââ ââ ââââ 6061 ââââââ ââ ââââââ ââ ââ ââ ââââââ 6062 */ 6063setHeadersCss:function(c){var d,e,f,g,h,i,j,k,l=c.sortList,m=l.length,n=b.css.sortNone+" "+c.cssNone,o=[b.css.sortAsc+" "+c.cssAsc,b.css.sortDe
6063sc+" "+c.cssDesc],p=[c.cssIconAsc,c.cssIconDesc,c.cssIconNone],q=["ascending","descending"], 6064// find the footer 6065r=c.$table.find("tfoot tr").children().add(a(c.namespace+"_extra_headers")).removeClass(o.join(" "));for( 6066// remove all header information 6067c.$headers.removeClass(o.join(" ")).addClass(n).attr("aria-sort","none").find("."+b.css.icon).removeClass(p.join(" ")).addClass(p[2]),f=0;m>f;f++) 6068// direction = 2 means reset! 6069if(2!==l[f][1]&&(d=c.$headers.filter(function(d,e){for( 6070// only include headers that are in the sortList (this includes colspans) 6071var f=!0,g=a(e),h=parseInt(g.attr("data-column"),10),i=h+e.colSpan;i>h;h++)f=f?b.isValueInArray(h,c.sortList)>-1:!1;return f}),d=d.not(".sorter-false").filter('[data-column="'+l[f][0]+'"]'+(1===m?":last":"")),d.length)){for(g=0;g<d.length;g++)d[g].sortDisabled||d.eq(g).removeClass(n).addClass(o[l[f][1]]).attr("aria-sort",q[l[f][1]]).find("."+b.css.icon).removeClass(p[2]).addClass(p[l[f][1]]); 6072// add sorted class to footer & extra headers, if they exist 6073r.length&&r.filter('[data-column="'+l[f][0]+'"]').removeClass(n).addClass(o[l[f][1]])}for(m=c.$headers.length,r=c.$headers.not(".sorter-false"),f=0;m>f;f++)h=r.eq(f),h.length&&(e=r[f],g=parseInt(h.attr("data-column"),10),i=c.sortVars[g].order[(c.sortVars[g].count+1)%(c.sortReset?3:2)],k=h.hasClass(b.css.sortAsc)?"sortAsc":h.hasClass(b.css.sortDesc)?"sortDesc":"sortNone",j=a.trim(h.text())+": "+b.language[k]+b.language[0===i?"nextAsc":1===i?"nextDesc":"nextNone"],h.attr("aria-label",j))},updateHeader:function(a){var c,d,e,f,g=a.table,h=a.$headers.length;for(c=0;h>c;c++)e=a.$headers.eq(c),f=b.getColumnData(g,a.headers,c,!0),d="false"===b.getData(e,f,"sorter")||"false"===b.getData(e,f,"parser"),e[0].sortDisabled=d,e[d?"addClass":"removeClass"]("sorter-false").attr("aria-disabled",""+d),a.tabIndex&&(d?e.removeAttr("tabindex"):e.attr("tabindex","0")),g.id&&(d?e.removeAttr("aria-controls"):e.attr("aria-controls",g.id))},updateHeaderSortCount:function(b,c){var d,e,f,g,h,i,j,k,l=c||b.sortList,m=l.length;for(b.sortList=[],g=0;m>g;g++) 6074// prevents error if sorton array is wrong 6075if(j=l[g],d=parseInt(j[0],10),d<b.columns){ 6076// 0/(a)sc (default), 1/(d)esc, (s)ame, (o)pposite, (n)ext 6077switch(k=b.sortVars[d].order,e=(""+j[1]).match(/^(1|d|s|o|n)/),e=e?e[0]:""){case"1":case"d":// descending 6078e=1;break;case"s":// same direction (as primary column) 6079// if primary sort is set to 's', make it ascending 6080e=h||0;break;case"o":i=k[(h||0)%(b.sortReset?3:2)], 6081// opposite of primary column; but resets if primary resets 6082e=0===i?1:1===i?0:2;break;case"n":e=k[++b.sortVars[d].count%(b.sortReset?3:2)];break;default:// ascending 6083e=0}h=0===g?e:h,f=[d,parseInt(e,10)||0],b.sortList.push(f),e=a.inArray(f[1],k),// fixes issue #167 6084b.sortVars[d].count=e>=0?e:f[1]%(b.sortReset?3:2)}},updateAll:function(a,c,d){var e=a.table;e.isUpdating=!0,b.refreshWidgets(e,!0,!0),b.buildHeaders(a),b.bindEvents(e,a.$headers,!0),b.bindMethods(a),b.commonUpdate(a,c,d)},update:function(a,c,d){var e=a.table;e.isUpdating=!0, 6085// update sorting (if enabled/disabled) 6086b.updateHeader(a),b.commonUpdate(a,c,d)}, 6087// simple header update - see #989 6088updateHeaders:function(a,c){a.table.isUpdating=!0,b.buildHeaders(a),b.bindEvents(a.table,a.$headers,!0),b.resortComplete(a,c)},updateCell:function(c,d,e,f){c.table.isUpdating=!0,c.$table.find(c.selectorRemove).remove(); 6089// get position from the dom 6090var g,h,i,j,k,l,m=c.$tbodies,n=a(d), 6091// update cache - format: function( s, table, cell, cellIndex ) 6092// no closest in jQuery v1.2.6 6093o=m.index(a.fn.closest?n.closest("tbody"):n.parents("tbody").filter(":first")),p=c.cache[o],q=a.fn.closest?n.closest("tr"):n.parents("tr").filter(":first");// in case cell is a jQuery object 6094// tbody may not exist if update is initialized while tbody is removed for processing 6095if(d=n[0],m.length&&o>=0){if(i=m.eq(o).find("tr").index(q),k=p.normalized[i],l=q[0].cells.length,l!==c.columns)for(j=0,g=!1,h=0;l>h;h++)g||q[0].cells[h]===d?g=!0:j+=q[0].cells[h].colSpan;else j=n.index();g=b.getElementText(c,d,j),// raw 6096k[c.columns].raw[j]=g,g=b.getParsedText(c,d,j,g),k[j]=g,// parsed 6097k[c.columns].$row=q,"numeric"===(c.parsers[j].type||"").toLowerCase()&&( 6098// update column max value (ignore sign) 6099p.colMax[j]=Math.max(Math.abs(g)||0,p.colMax[j]||0)),g="undefined"!==e?e:c.resort,g!==!1? 6100// widgets will be reapplied 6101b.checkResort(c,g,f): 6102// don't reapply widgets is resort is false, just in case it causes 6103// problems with element focus 6104b.resortComplete(c,f)}},addRows:function(c,d,e,f){var g,h,i,j,k,l,m,n,o,p,q,r, 6105// allow passing a row string if only one non-info tbody exists in the table 6106s="string"==typeof d&&1===c.$tbodies.length&&/<tr/.test(d||""),t=c.table;if(s)d=a(d),c.$tbodies.append(d);else if(!(d&&d instanceof jQuery&&(a.fn.closest?d.closest("table")[0]:d.parents("table")[0])===c.table))return c.debug&&console.error("addRows method requires (1) a jQuery selector reference to rows that have already been added to the table, or (2) row HTML string to be added to a table with only one tbody"),!1;if(t.isUpdating=!0,b.isEmptyObject(c.cache)) 6107// empty table, do an update instead - fixes #450 6108b.updateHeader(c),b.commonUpdate(c,e,f);else{ 6109// add each row 6110for(k=d.filter("tr").attr("role","row").length,i=c.$tbodies.index(d.parents("tbody").filter(":first")),c.parsers&&c.parsers.length||b.setupParsers(c),j=0;k>j;j++){ 6111// add each cell 6112for(n=0,m=d[j].cells.length,p=[],o={child:[],raw:[],$row:d.eq(j),order:c.cache[i].normalized.length},l=0;m>l;l++)q=d[j].cells[l],g=b.getElementText(c,q,n),o.raw[n]=g,h=b.getParsedText(c,q,n,g),p[n]=h,"numeric"===(c.parsers[n].type||"").toLowerCase()&&(c.cache[i].colMax[n]=Math.max(Math.abs(h)||0,c.cache[i].colMax[n]||0)),r=q.colSpan-1,r>0&&(n+=r),n++; 6113// add the row data to the end 6114p[c.columns]=o, 6115// update cache 6116c.cache[i].normalized.push(p)} 6117// resort using current settings 6118b.checkResort(c,e,f)}},updateCache:function(a,c,d){ 6119// rebuild parsers 6120a.parsers&&a.parsers.length||b.setupParsers(a,d), 6121// rebuild the cache map 6122b.buildCache(a,c,d)}, 6123// init flag (true) used by pager plugin to prevent widget application 6124// renamed from appendToTable 6125appendCache:function(a,c){var d,e,f,g,h,i,j,k=a.table,l=a.widgetOptions,m=a.$tbodies,n=[],o=a.cache; 6126// empty table - fixes #206/#346 6127if(b.isEmptyObject(o)) 6128// run pager appender in case the table was just emptied 6129return a.appender?a.appender(k,n):k.isUpdating?a.$table.trigger("updateComplete",k):"";for(a.debug&&(j=new Date),i=0;i<m.length;i++)if(f=m.eq(i),f.length){for(g=b.processTbody(k,f,!0),d=o[i].normalized,e=d.length,h=0;e>h;h++)n.push(d[h][a.columns].$row), 6130// removeRows used by the pager plugin; don't render if using ajax - fixes #411 6131a.appender&&(!a.pager||a.pager.removeRows&&l.pager_removeRows||a.pager.ajax)||g.append(d[h][a.columns].$row); 6132// restore tbody 6133b.processTbody(k,g,!1)}a.appender&&a.appender(k,n),a.debug&&console.log("Rebuilt table"+b.benchmark(j)), 6134// apply table widgets; but not before ajax completes 6135c||a.appender||b.applyWidget(k),k.isUpdating&&a.$table.trigger("updateComplete",k)},commonUpdate:function(a,c,d){ 6136// remove rows/elements before update 6137a.$table.find(a.selectorRemove).remove(), 6138// rebuild parsers 6139b.setupParsers(a), 6140// rebuild the cache map 6141b.buildCache(a),b.checkResort(a,c,d)},/* 6142 ââââââ ââââââ ââââââ ââââââ ââ ââââââ ââââââ
6143 âââ ââ ââ ââââââ ââ ââ ââ ââ ââ âââ 6144 âââ ââ ââ âââââ ââ ââ ââ ââ ââ âââ 6145 ââââââ ââââââ ââ ââ ââ ââ ââ ââ ââââââ 6146 */ 6147initSort:function(c,d,e){if(c.table.isUpdating) 6148// let any updates complete before initializing a sort 6149return setTimeout(function(){b.initSort(c,d,e)},50);var f,g,h,i,j,k,l,m=!e[c.sortMultiSortKey],n=c.table,o=c.$headers.length, 6150// get current column index 6151p=parseInt(a(d).attr("data-column"),10),q=c.sortVars[p].order; 6152// reset all sorts on non-current column - issue #30 6153if( 6154// Only call sortStart if sorting is enabled 6155c.$table.trigger("sortStart",n), 6156// get current column sort order 6157c.sortVars[p].count=e[c.sortResetKey]?2:(c.sortVars[p].count+1)%(c.sortReset?3:2),c.sortRestart)for(k=d,h=0;o>h;h++)l=c.$headers.eq(h),l[0]===k||!m&&l.is("."+b.css.sortDesc+",."+b.css.sortAsc)||(c.sortVars[p].count=-1); 6158// user only wants to sort on one column 6159if(m){if( 6160// flush the sort list 6161c.sortList=[],c.last.sortList=[],null!==c.sortForce)for(f=c.sortForce,g=0;g<f.length;g++)f[g][0]!==p&&c.sortList.push(f[g]);if(i=q[c.sortVars[p].count],2>i&&(c.sortList.push([p,i]),d.colSpan>1))for(g=1;g<d.colSpan;g++)c.sortList.push([p+g,i]), 6162// update count on columns in colSpan 6163c.sortVars[p+g].count=a.inArray(i,q)}else 6164// the user has clicked on an already sorted column 6165if( 6166// get rid of the sortAppend before adding more - fixes issue #115 & #523 6167c.sortList=a.extend([],c.last.sortList),b.isValueInArray(p,c.sortList)>=0) 6168// reverse the sorting direction 6169for(g=0;g<c.sortList.length;g++)k=c.sortList[g],k[0]===p&&(k[1]=q[c.sortVars[p].count],2===k[1]&&(c.sortList.splice(g,1),c.sortVars[p].count=-1));else if(i=q[c.sortVars[p].count],2>i&&(c.sortList.push([p,i]),d.colSpan>1))for(g=1;g<d.colSpan;g++)c.sortList.push([p+g,i]), 6170// update count on columns in colSpan 6171c.sortVars[p+g].count=a.inArray(i,q);if( 6172// save sort before applying sortAppend 6173c.last.sortList=a.extend([],c.sortList),c.sortList.length&&c.sortAppend&&(f=a.isArray(c.sortAppend)?c.sortAppend:c.sortAppend[c.sortList[0][0]],!b.isEmptyObject(f)))for(g=0;g<f.length;g++)if(f[g][0]!==p&&b.isValueInArray(f[g][0],c.sortList)<0){if(i=f[g][1],j=(""+i).match(/^(a|d|s|o|n)/))switch(k=c.sortList[0][1],j[0]){case"d":i=1;break;case"s":i=k;break;case"o":i=0===k?1:0;break;case"n":i=(k+1)%(c.sortReset?3:2);break;default:i=0}c.sortList.push([f[g][0],i])} 6174// sortBegin event triggered immediately before the sort 6175c.$table.trigger("sortBegin",n), 6176// setTimeout needed so the processing icon shows up 6177setTimeout(function(){ 6178// set css for headers 6179b.setHeadersCss(c),b.multisort(c),b.appendCache(c),c.$table.trigger("sortEnd",n)},1)}, 6180// sort multiple columns 6181multisort:function(a){/*jshint loopfunc:true */ 6182var c,d,e,f,g=a.table,h=0,i=a.textSorter||"",j=a.sortList,k=j.length,l=a.$tbodies.length;if(!a.serverSideSorting&&!b.isEmptyObject(a.cache)){for(a.debug&&(d=new Date),c=0;l>c;c++)e=a.cache[c].colMax,f=a.cache[c].normalized,f.sort(function(c,d){var f,l,m,n,o,p,q;for(f=0;k>f;f++){if(m=j[f][0],n=j[f][1],h=0===n,a.sortStable&&c[m]===d[m]&&1===k)return c[a.columns].order-d[a.columns].order;if(l=/n/i.test(b.getSortType(a.parsers,m)),l&&a.strings[m]?(l="boolean"==typeof b.string[a.strings[m]]?(h?1:-1)*(b.string[a.strings[m]]?-1:1):a.strings[m]?b.string[a.strings[m]]||0:0,o=a.numberSorter?a.numberSorter(c[m],d[m],h,e[m],g):b["sortNumeric"+(h?"Asc":"Desc")](c[m],d[m],l,e[m],m,a)):(p=h?c:d,q=h?d:c,o="function"==typeof i?i(p[m],q[m],h,m,g):"object"==typeof i&&i.hasOwnProperty(m)?i[m](p[m],q[m],h,m,g):b["sortNatural"+(h?"Asc":"Desc")](c[m],d[m],m,a)),o)return o}return c[a.columns].order-d[a.columns].order});a.debug&&console.log("Applying sort "+j.toString()+b.benchmark(d))}},resortComplete:function(b,c){b.table.isUpdating&&b.$table.trigger("updateComplete",b.table),a.isFunction(c)&&c(b.table)},checkResort:function(c,d,e){var f=a.isArray(d)?d:c.sortList, 6183// if no resort parameter is passed, fallback to config.resort (true by default) 6184g="undefined"==typeof d?c.resort:d; 6185// don't try to resort if the table is still processing 6186// this will catch spamming of the updateCell method 6187g===!1||c.serverSideSorting||c.table.isProcessing?(b.resortComplete(c,e),b.applyWidget(c.table,!1)):f.length?b.sortOn(c,f,function(){b.resortComplete(c,e)},!0):b.sortReset(c,function(){b.resortComplete(c,e),b.applyWidget(c.table,!1)})},sortOn:function(c,d,e,f){var g=c.table;c.$table.trigger("sortStart",g), 6188// update header count index 6189b.updateHeaderSortCount(c,d), 6190// set css for headers 6191b.setHeadersCss(c), 6192// fixes #346 6193c.delayInit&&b.isEmptyObject(c.cache)&&b.buildCache(c),c.$table.trigger("sortBegin",g), 6194// sort the table and append it to the dom 6195b.multisort(c),b.appendCache(c,f),c.$table.trigger("sortEnd",g),b.applyWidget(g),a.isFunction(e)&&e(g)},sortReset:function(c,d){c.sortList=[],b.setHeadersCss(c),b.multisort(c),b.appendCache(c),a.isFunction(d)&&d(c.table)},getSortType:function(a,b){return a&&a[b]?a[b].type||"":""},formatSortingOrder:function(a){ 6196// look for 'd' in 'desc' order; return true 6197return/^d/i.test(a)||1===a}, 6198// Natural sort - https://github.com/overset/javascript-natural-sort (date sorting removed) 6199// this function will only accept strings, or you'll see 'TypeError: undefined is not a function' 6200// I could add a = a.toString(); b = b.toString(); but it'll slow down the sort overall
6201sortNatural:function(a,c){if(a===c)return 0;var d,e,f,g,h,i,j=b.regex; 6202// first try and sort Hex codes 6203if(j.hex.test(c)){if(d=parseInt(a.match(j.hex),16),e=parseInt(c.match(j.hex),16),e>d)return-1;if(d>e)return 1} 6204// natural sorting through split numeric strings and default strings 6205for(d=a.replace(j.chunk,"\\0$1\\0").replace(j.chunks,"").split("\\0"),e=c.replace(j.chunk,"\\0$1\\0").replace(j.chunks,"").split("\\0"),i=Math.max(d.length,e.length),h=0;i>h;h++){ 6206// handle numeric vs string comparison - number < string - (Kyle Adams) 6207if(f=isNaN(d[h])?d[h]||0:parseFloat(d[h])||0,g=isNaN(e[h])?e[h]||0:parseFloat(e[h])||0,isNaN(f)!==isNaN(g))return isNaN(f)?1:-1;if( 6208// rely on string comparison if different types - i.e. '02' < 2 != '02' < '2' 6209typeof f!=typeof g&&(f+="",g+=""),g>f)return-1;if(f>g)return 1}return 0},sortNaturalAsc:function(a,c,d,e){if(a===c)return 0;var f=b.string[e.empties[d]||e.emptyTo];return""===a&&0!==f?"boolean"==typeof f?f?-1:1:-f||-1:""===c&&0!==f?"boolean"==typeof f?f?1:-1:f||1:b.sortNatural(a,c)},sortNaturalDesc:function(a,c,d,e){if(a===c)return 0;var f=b.string[e.empties[d]||e.emptyTo];return""===a&&0!==f?"boolean"==typeof f?f?-1:1:f||1:""===c&&0!==f?"boolean"==typeof f?f?1:-1:-f||-1:b.sortNatural(c,a)}, 6210// basic alphabetical sort 6211sortText:function(a,b){return a>b?1:b>a?-1:0}, 6212// return text string value by adding up ascii value 6213// so the text is somewhat sorted when using a digital sort 6214// this is NOT an alphanumeric sort 6215getTextValue:function(a,b,c){if(c){ 6216// make sure the text value is greater than the max numerical value (max) 6217var d,e=a?a.length:0,f=c+b;for(d=0;e>d;d++)f+=a.charCodeAt(d);return b*f}return 0},sortNumericAsc:function(a,c,d,e,f,g){if(a===c)return 0;var h=b.string[g.empties[f]||g.emptyTo];return""===a&&0!==h?"boolean"==typeof h?h?-1:1:-h||-1:""===c&&0!==h?"boolean"==typeof h?h?1:-1:h||1:(isNaN(a)&&(a=b.getTextValue(a,d,e)),isNaN(c)&&(c=b.getTextValue(c,d,e)),a-c)},sortNumericDesc:function(a,c,d,e,f,g){if(a===c)return 0;var h=b.string[g.empties[f]||g.emptyTo];return""===a&&0!==h?"boolean"==typeof h?h?-1:1:h||1:""===c&&0!==h?"boolean"==typeof h?h?1:-1:-h||-1:(isNaN(a)&&(a=b.getTextValue(a,d,e)),isNaN(c)&&(c=b.getTextValue(c,d,e)),c-a)},sortNumeric:function(a,b){return a-b},/* 6218 ââ ââ ââ ââ ââââââ ââââââ ââââââ ââââââ ââââââ 6219 ââ ââ ââ ââ ââ ââ ââ âââ ââââ ââ âââ 6220 ââ ââ ââ ââ ââ ââ ââ âââ ââââ ââ âââ 6221 ââââââââ ââ ââââââ ââââââ ââââââ ââ ââââââ 6222 */ 6223addWidget:function(a){b.widgets.push(a)},hasWidget:function(b,c){return b=a(b),b.length&&b[0].config&&b[0].config.widgetInit[c]||!1},getWidgetById:function(a){var c,d,e=b.widgets.length;for(c=0;e>c;c++)if(d=b.widgets[c],d&&d.id&&d.id.toLowerCase()===a.toLowerCase())return d},applyWidgetOptions:function(c){var d,e,f=c.config,g=f.widgets.length;if(g)for(d=0;g>d;d++)e=b.getWidgetById(f.widgets[d]),e&&e.options&&(f.widgetOptions=a.extend(!0,{},e.options,f.widgetOptions))},addWidgetFromClass:function(a){var c,d,e=a.config, 6224// look for widgets to apply from table class 6225// stop using \b otherwise this matches 'ui-widget-content' & adds 'content' widget 6226f="\\s"+e.widgetClass.replace(b.regex.templateName,"([\\w-]+)")+"\\s",g=new RegExp(f,"g"), 6227// extract out the widget id from the table class (widget id's can include dashes) 6228h=(" "+e.table.className+" ").match(g);if(h)for(c=h.length,d=0;c>d;d++)e.widgets.push(h[d].replace(g,"$1"))},applyWidget:function(c,d,e){c=a(c)[0];// in case this is called externally 6229var f,g,h,i,j,k,l,m,n=c.config,o=[]; 6230// prevent numerous consecutive widget applications 6231if(d===!1||!c.hasInitialized||!c.isApplyingWidgets&&!c.isUpdating){if(n.debug&&(l=new Date),b.addWidgetFromClass(c),n.widgets.length){ 6232// build widget array & add priority as needed 6233for(c.isApplyingWidgets=!0, 6234// ensure unique widget ids 6235n.widgets=a.grep(n.widgets,function(b,c){return a.inArray(b,n.widgets)===c}),h=n.widgets||[],g=h.length,f=0;g>f;f++)i=b.getWidgetById(h[f]),i&&i.id&&(i.priority||(i.priority=10),o[f]=i);for( 6236// sort widgets by priority 6237o.sort(function(a,b){return a.priority<b.priority?-1:a.priority===b.priority?0:1}),g=o.length,n.debug&&console[console.group?"group":"log"]("Start "+(d?"initializing":"applying")+" widgets"),f=0;g>f;f++)i=o[f],i&&(j=i.id,k=!1,n.debug&&(m=new Date),(d||!n.widgetInit[j])&&(n.widgetInit[j]=!0,c.hasInitialized&&b.applyWidgetOptions(c),"function"==typeof i.init&&(k=!0,n.debug&&console[console.group?"group":"log"]("Initializing "+j+" widget"),i.init(c,i,c.config,c.config.widgetOptions))),d||"function"!=typeof i.format||(k=!0,n.debug&&console[console.group?"group":"log"]("Updating "+j+" widget"),i.format(c,c.config,c.config.widgetOptions,!1)),n.debug&&k&&(console.log("Completed "+(d?"initializing ":"applying ")+j+" widget"+b.benchmark(m)),console.groupEnd&&console.groupEnd()));n.debug&&console.groupEnd&&console.groupEnd(), 6238// callback executed on init only 6239d||"function"!=typeof e||e(c)}setTimeout(function(){c.isApplyingWidgets=!1,a.data(c,"lastWidgetApplication",new Date),n.$table.trigger("tablesorter-ready")},0),n.debug&&(i=n.widgets.length,console.log("Completed "+(d===!0?"initializing ":"applying ")+i+" widget"+(1!==i?"s":"")+b.benchmark(l)))}},removeWidget:function(c,d,e){c=a(c)[0];var f,g,h,i,j=c.config; 6240// if name === true, add all widgets from $.tablesorter.widgets 6241if(d===!0)for(d=[],i=b.widgets.length,h=0;i>h;h++)g=b.widgets[h],g&&g.id&&d.push(g.id);else 6242// name can be either an array of widgets names, 6243// or a space/comma separated list of widget names 6244d=(a.isArray(d)?d.join(","):d||"").toLowerCase().split(/[\s,]+/);for(i=d.length,f=0;i>f;
6244f++)g=b.getWidgetById(d[f]),h=a.inArray(d[f],j.widgets),g&&g.remove&&(j.debug&&console.log((e?"Refreshing":"Removing")+' "'+d[f]+'" widget'),g.remove(c,j,j.widgetOptions,e),j.widgetInit[d[f]]=!1),h>=0&&e!==!0&&j.widgets.splice(h,1)},refreshWidgets:function(c,d,e){c=a(c)[0];// see issue #243 6245var f,g,h=c.config,i=h.widgets,j=b.widgets,k=j.length,l=[],m=function(b){a(b).trigger("refreshComplete")}; 6246// remove widgets not defined in config.widgets, unless doAll is true 6247for(f=0;k>f;f++)g=j[f],g&&g.id&&(d||a.inArray(g.id,i)<0)&&l.push(g.id);b.removeWidget(c,l.join(","),!0),e!==!0?( 6248// call widget init if 6249b.applyWidget(c,d||!1,m),d&& 6250// apply widget format 6251b.applyWidget(c,!1,m)):m(c)},/* 6252 ââ ââ ââââââ ââ ââ ââ ââââââ ââ ââââââ ââââââ 6253 ââ ââ ââ ââ ââ ââ ââ ââ ââââ âââ 6254 ââ ââ ââ ââ ââ ââ ââ ââ ââââ âââ 6255 ââââââ ââ ââ ââââââ ââ ââ ââ ââââââ ââââââ 6256 */ 6257benchmark:function(a){return" ( "+((new Date).getTime()-a.getTime())+"ms )"}, 6258// deprecated ts.log 6259log:function(){console.log(arguments)}, 6260// $.isEmptyObject from jQuery v1.4 6261isEmptyObject:function(a){/*jshint forin: false */ 6262for(var b in a)return!1;return!0},isValueInArray:function(a,b){var c,d=b&&b.length||0;for(c=0;d>c;c++)if(b[c][0]===a)return c;return-1},formatFloat:function(c,d){if("string"!=typeof c||""===c)return c; 6263// allow using formatFloat without a table; defaults to US number format 6264var e,f=d&&d.config?d.config.usNumberFormat!==!1:"undefined"!=typeof d?d:!0; 6265// return the text instead of zero 6266// US Format - 1,234,567.89 -> 1234567.89 6267// make (#) into a negative number -> (10) = -10 6268return c=f?c.replace(b.regex.comma,""):c.replace(b.regex.digitNonUS,"").replace(b.regex.comma,"."),b.regex.digitNegativeTest.test(c)&&(c=c.replace(b.regex.digitNegativeReplace,"-$1")),e=parseFloat(c),isNaN(e)?a.trim(c):e},isDigit:function(a){ 6269// replace all unwanted chars and match 6270return isNaN(a)?b.regex.digitTest.test(a.toString().replace(b.regex.digitReplace,"")):""!==a}, 6271// computeTableHeaderCellIndexes from: 6272// http://www.javascripttoolbox.com/lib/table/examples.php 6273// http://www.javascripttoolbox.com/temp/table_cellindex.html 6274computeColumnIndex:function(b){var c,d,e,f,g,h,i,j,k,l,m,n,o=[],p=[];for(c=0;c<b.length;c++)for(i=b[c].cells,d=0;d<i.length;d++){ 6275// Find first available column in the first row 6276for(h=i[d],g=a(h),j=h.parentNode.rowIndex,k=j+"-"+g.index(),l=h.rowSpan||1,m=h.colSpan||1,"undefined"==typeof o[j]&&(o[j]=[]),e=0;e<o[j].length+1;e++)if("undefined"==typeof o[j][e]){n=e;break}for( 6277// add data-column (setAttribute = IE8+) 6278h.setAttribute?h.setAttribute("data-column",n):g.attr("data-column",n),e=j;j+l>e;e++)for("undefined"==typeof o[e]&&(o[e]=[]),p=o[e],f=n;n+m>f;f++)p[f]="x"}return p.length}, 6279// automatically add a colgroup with col elements set to a percentage width 6280fixColumnWidth:function(c){c=a(c)[0];var d,e,f,g,h,i=c.config,j=i.$table.children("colgroup");if( 6281// remove plugin-added colgroup, in case we need to refresh the widths 6282j.length&&j.hasClass(b.css.colgroup)&&j.remove(),i.widthFixed&&0===i.$table.children("colgroup").length){for(j=a('<colgroup class="'+b.css.colgroup+'">'),d=i.$table.width(),f=i.$tbodies.find("tr:first").children(":visible"),g=f.length,h=0;g>h;h++)e=parseInt(f.eq(h).width()/d*1e3,10)/10+"%",j.append(a("<col>").css("width",e));i.$table.prepend(j)}}, 6283// get sorter, string, empty, etc options for each column from 6284// jQuery data, metadata, header option or header class name ('sorter-false') 6285// priority = jQuery data > meta > headers option > header class name 6286getData:function(b,c,d){var e,f,g="",h=a(b); 6287// 'data-lockedOrder' is assigned to 'lockedorder'; but 'data-locked-order' is assigned to 'lockedOrder' 6288// 'data-sort-initial-order' is assigned to 'sortInitialOrder' 6289// include sorter class name 'sorter-text', etc; now works with 'sorter-my-custom-parser' 6290return h.length?(e=a.metadata?h.metadata():!1,f=" "+(h.attr("class")||""),"undefined"!=typeof h.data(d)||"undefined"!=typeof h.data(d.toLowerCase())?g+=h.data(d)||h.data(d.toLowerCase()):e&&"undefined"!=typeof e[d]?g+=e[d]:c&&"undefined"!=typeof c[d]?g+=c[d]:" "!==f&&f.match(" "+d+"-")&&(g=f.match(new RegExp("\\s"+d+"-([\\w-]+)"))[1]||""),a.trim(g)):""},getColumnData:function(b,c,d,e,f){if("undefined"!=typeof c&&null!==c){b=a(b)[0];var g,h,i=b.config,j=f||i.$headers, 6291// c.$headerIndexed is not defined initially 6292k=i.$headerIndexed&&i.$headerIndexed[d]||j.filter('[data-column="'+d+'"]:last');
6292if(c[d])return e?c[d]:c[j.index(k)];for(h in c)if("string"==typeof h&&(g=k.filter(h).add(k.find(h)),g.length))return c[h]}}, 6293// *** Process table *** 6294// add processing indicator 6295isProcessing:function(c,d,e){c=a(c);var f=c[0].config, 6296// default to all headers 6297g=e||c.find("."+b.css.header);d?( 6298// don't use sortList if custom $ths used 6299"undefined"!=typeof e&&f.sortList.length>0&&( 6300// get headers from the sortList 6301g=g.filter(function(){ 6302// get data-column from attr to keep compatibility with jQuery 1.2.6 6303return this.sortDisabled?!1:b.isValueInArray(parseFloat(a(this).attr("data-column")),f.sortList)>=0})),c.add(g).addClass(b.css.processing+" "+f.cssProcessing)):c.add(g).removeClass(b.css.processing+" "+f.cssProcessing)}, 6304// detach tbody but save the position 6305// don't use tbody because there are portions that look for a tbody index (updateCell) 6306processTbody:function(b,c,d){if(b=a(b)[0],d)return b.isProcessing=!0,c.before('<colgroup class="tablesorter-savemyplace"/>'),a.fn.detach?c.detach():c.remove();var e=a(b).find("colgroup.tablesorter-savemyplace");c.insertAfter(e),e.remove(),b.isProcessing=!1},clearTableBody:function(b){a(b)[0].config.$tbodies.children().detach()}, 6307// used when replacing accented characters during sorting 6308characterEquivalents:{a:"Ã¡Ã Ã¢Ã£Ã¤Ä Ã¥",// Ã¡Ã Ã¢Ã£Ã¤Ä Ã¥ 6309A:"ÃÃÃÃÃÄà ",// ÃÃÃÃÃÄà 6310c:"çÄÄ",// çÄÄ 6311C:"ÃÄÄ",// ÃÄÄ 6312e:"éèêëÄÄ",// éèêëÄÄ 6313E:"ÃÃÃÃÄÄ",// ÃÃÃÃÄÄ 6314i:"Ãìİîïı",// Ãìİîïı 6315I:"ÃÃİÃÃ",// ÃÃİÃà 6316o:"óòôõöÅ",// óòôõöŠ6317O:"ÃÃÃÃÃÅ",// ÃÃÃÃÃÅ 6318ss:"Ã",// à (s sharp) 6319SS:"áº",// Ạ(Capital sharp s) 6320u:"úùûüů",// úùûüů 6321U:"ÃÃÃÃÅ®"},replaceAccents:function(a){var c,d="[",e=b.characterEquivalents;if(!b.characterRegex){b.characterRegexArray={};for(c in e)"string"==typeof c&&(d+=e[c],b.characterRegexArray[c]=new RegExp("["+e[c]+"]","g"));b.characterRegex=new RegExp(d+"]")}if(b.characterRegex.test(a))for(c in e)"string"==typeof c&&(a=a.replace(b.characterRegexArray[c],c));return a}, 6322// restore headers 6323restoreHeaders:function(c){var d,e,f=a(c)[0].config,g=f.$table.find(f.selectorHeaders),h=g.length; 6324// don't use c.$headers here in case header cells were swapped 6325for(d=0;h>d;d++)e=g.eq(d),e.find("."+b.css.headerIn).length&&e.html(f.headerContent[d])},destroy:function(c,d,e){if(c=a(c)[0],c.hasInitialized){ 6326// remove all widgets 6327b.removeWidget(c,!0,!1);var f,g=a(c),h=c.config,i=h.debug,j=g.find("thead:first"),k=j.find("tr."+b.css.headerRow).removeClass(b.css.headerRow+" "+h.cssHeaderRow),l=g.find("tfoot:first > tr").children("th, td");d===!1&&a.inArray("uitheme",h.widgets)>=0&&( 6328// reapply uitheme classes, in case we want to maintain appearance 6329g.trigger("applyWidgetId",["uitheme"]),g.trigger("applyWidgetId",["zebra"])), 6330// remove widget added rows, just in case 6331j.find("tr").not(k).remove(), 6332// disable tablesorter 6333f="sortReset update updateRows updateAll updateHeaders updateCell addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress "+"sortBegin sortEnd resetToLoadState ".split(" ").join(h.namespace+" "),g.removeData("tablesorter").unbind(f.replace(b.regex.spaces," ")),h.$headers.add(l).removeClass([b.css.header,h.cssHeader,h.cssAsc,h.cssDesc,b.css.sortAsc,b.css.sortDesc,b.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled","true"),k.find(h.selectorSort).unbind("mousedown mouseup keypress ".split(" ").join(h.namespace+" ").replace(b.regex.spaces," ")),b.restoreHeaders(c),g.toggleClass(b.css.table+" "+h.tableClass+" tablesorter-"+h.theme,d===!1), 6334// clear flag in case the plugin is initialized again 6335c.hasInitialized=!1,delete c.config.cache,"function"==typeof e&&e(c),i&&console.log("tablesorter has been removed")}}};a.fn.tablesorter=function(c){return this.each(function(){var d=this, 6336// merge & extend config options 6337e=a.extend(!0,{},b.defaults,c,b.instanceMethods); 6338// save initial settings 6339e.originalSettings=c, 6340// create a table from data (build table widget) 6341!d.hasInitialized&&b.buildTable&&"TABLE"!==this.nodeName? 6342// return the table (in case the original target is the table's container) 6343b.buildTable(d,e):b.setup(d,e)})}, 6344// set up debug logs 6345window.console&&window.console.log||( 6346// access $.tablesorter.logs for browsers that don't have a console... 6347b.logs=[],/*jshint -W020 */ 6348console={},console.log=console.warn=console.error=console.table=function(){var a=arguments.length>1?arguments:arguments[0];b.logs.push({date:Date.now(),log:a})}), 6349// add default parsers 6350b.addParser({id:"no-parser",is:function(){return!1},format:function(){return""},type:"text"}),b.addParser({id:"text",is:function(){return!0},format:function(c,d){var e=d.config;return c&&(c=a.trim(e.ignoreCase?c.toLocaleLowerCase():c),c=e.sortLocaleCompare?b.replaceAcce
6350nts(c):c),c},type:"text"}),b.regex.nondigit=/[^\w,. \-()]/g,b.addParser({id:"digit",is:function(a){return b.isDigit(a)},format:function(c,d){var e=b.formatFloat((c||"").replace(b.regex.nondigit,""),d);return c&&"number"==typeof e?e:c?a.trim(c&&d.config.ignoreCase?c.toLocaleLowerCase():c):c},type:"numeric"}),b.regex.currencyReplace=/[+\-,. ]/g,b.regex.currencyTest=/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/,b.addParser({id:"currency",is:function(a){ 6351// test for £$â¬Â¤Â¥Â¢ 6352return a=(a||"").replace(b.regex.currencyReplace,""),b.regex.currencyTest.test(a)},format:function(c,d){var e=b.formatFloat((c||"").replace(b.regex.nondigit,""),d);return c&&"number"==typeof e?e:c?a.trim(c&&d.config.ignoreCase?c.toLocaleLowerCase():c):c},type:"numeric"}), 6353// too many protocols to add them all https://en.wikipedia.org/wiki/URI_scheme 6354// now, this regex can be updated before initialization 6355b.regex.urlProtocolTest=/^(https?|ftp|file):\/\//,b.regex.urlProtocolReplace=/(https?|ftp|file):\/\//,b.addParser({id:"url",is:function(a){return b.regex.urlProtocolTest.test(a)},format:function(c){return c?a.trim(c.replace(b.regex.urlProtocolReplace,"")):c},parsed:!0,// filter widget flag 6356type:"text"}),b.regex.dash=/-/g,b.regex.isoDate=/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/,b.addParser({id:"isoDate",is:function(a){return b.regex.isoDate.test(a)},format:function(a,c){var d=a?new Date(a.replace(b.regex.dash,"/")):a;return d instanceof Date&&isFinite(d)?d.getTime():a},type:"numeric"}),b.regex.percent=/%/g,b.regex.percentTest=/(\d\s*?%|%\s*?\d)/,b.addParser({id:"percent",is:function(a){return b.regex.percentTest.test(a)&&a.length<15},format:function(a,c){return a?b.formatFloat(a.replace(b.regex.percent,""),c):a},type:"numeric"}), 6357// added image parser to core v2.17.9 6358b.addParser({id:"image",is:function(a,b,c,d){return d.find("img").length>0},format:function(b,c,d){return a(d).find("img").attr(c.config.imgAttr||"alt")||b},parsed:!0,// filter widget flag 6359type:"text"}),b.regex.dateReplace=/(\S)([AP]M)$/i,// used by usLongDate & time parser 6360b.regex.usLongDateTest1=/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i,b.regex.usLongDateTest2=/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i,b.addParser({id:"usLongDate",is:function(a){ 6361// two digit years are not allowed cross-browser 6362// Jan 01, 2013 12:34:56 PM or 01 Jan 2013 6363return b.regex.usLongDateTest1.test(a)||b.regex.usLongDateTest2.test(a)},format:function(a,c){var d=a?new Date(a.replace(b.regex.dateReplace,"$1 $2")):a;return d instanceof Date&&isFinite(d)?d.getTime():a},type:"numeric"}), 6364// testing for ##-##-#### or ####-##-##, so it's not perfect; time can be included 6365b.regex.shortDateTest=/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/, 6366// escaped "-" because JSHint in Firefox was showing it as an error 6367b.regex.shortDateReplace=/[\-.,]/g, 6368// XXY covers MDY & DMY formats 6369b.regex.shortDateXXY=/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,b.regex.shortDateYMD=/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,b.convertFormat=function(a,c){a=(a||"").replace(b.regex.spaces," ").replace(b.regex.shortDateReplace,"/"),"mmddyyyy"===c?a=a.replace(b.regex.shortDateXXY,"$3/$1/$2"):"ddmmyyyy"===c?a=a.replace(b.regex.shortDateXXY,"$3/$2/$1"):"yyyymmdd"===c&&(a=a.replace(b.regex.shortDateYMD,"$1/$2/$3"));var d=new Date(a);return d instanceof Date&&isFinite(d)?d.getTime():""},b.addParser({id:"shortDate",// 'mmddyyyy', 'ddmmyyyy' or 'yyyymmdd' 6370is:function(a){return a=(a||"").replace(b.regex.spaces," ").replace(b.regex.shortDateReplace,"/"),b.regex.shortDateTest.test(a)},format:function(a,c,d,e){if(a){var f=c.config,g=f.$headerIndexed[e],h=g.length&&g.data("dateFormat")||b.getData(g,b.getColumnData(c,f.headers,e),"dateFormat")||f.dateFormat; 6371// save format because getData can be slow... 6372return g.length&&g.data("dateFormat",h),b.convertFormat(a,h)||a}return a},type:"numeric"}), 6373// match 24 hour time & 12 hours time + am/pm - see http://regexr.com/3c3tk 6374b.regex.timeTest=/^([1-9]|1[0-2]):([0-5]\d)(\s[AP]M)|((?:[01]\d|[2][0-4]):[0-5]\d)$/i,b.regex.timeMatch=/([1-9]|1[0-2]):([0-5]\d)(\s[AP]M)|((?:[01]\d|[2][0-4]):[0-5]\d)/i,b.addParser({id:"time",is:function(a){return b.regex.timeTest.test(a)},format:function(a,c){ 6375// isolate time... ignore month, day and year 6376var d,e=(a||"").match(b.regex.timeMatch),f=new Date(a), 6377// no time component? default to 00:00 by leaving it out, but only if str is defined 6378g=a&&(null!==e?e[0]:"00:00 AM"),h=g?new Date("2000/01/01 "+g.replace(b.regex.dateReplace,"$1 $2")):g;return h instanceof Date&&isFinite(h)?(d=f instanceof Date&&isFinite(f)?f.getTime():0,d?parseFloat(h.getTime()+"."+f.getTime()):h.getTime()):a},type:"numeric"}),b.addParser({id:"metadata",is:function(){return!1},format:function(b,c,d){var e=c.config,f=e.parserMetadataName?e.parserMetadataName:"sortValue";return a(d).metadata()[f]},type:"numeric"}),/* 6379 ââââââ ââââââ ââââââ ââââââ ââââââ 6380 âââ ââââ ââââââ ââââââ ââââââ 6381 âââ ââââ ââââââ âââââ ââââââ 6382 ââââââ ââââââ ââââââ ââ ââ ââ ââ 6383 */ 6384// add default widgets 6385b.addWidget({id:"zebra",priority:90,format:function(b,c,d){var e,f,g,h,i,j,k,l=new RegExp(c.cssChildRow,"i"),m=c.$tbodies.add(a(c.namespace+"_extra_table").children("tbody:not(."+c.cssInfoBlock+")"));for(i=0;i<m.length;i++)for(g=0,e=m.eq(i).children("tr:visible").not(c.selectorRemove),k=e.length,j=0;k>j;j++)f=e.eq(j),l.test(f[0].className)||g++,h=g%2===0,f.removeClass(d.zebra[h?1:0]).addClass(d.zebra[h?0:1])},remove:function(a,c,d,e){if(!e){var f,g,h=c.$tbodies,i=(d.zebra||["even","odd"]).join(" ");for(f=0;f<h.length;f++)g=b.processTbody(a,h.eq(f),!0),g.children().removeClass(i),b.processTbody(a,g,!1)}}})}(jQuery),a.tablesorter});// Sticky Plugin v1.0.0 for jQuery 6386// ============= 6387// Author: Anthony Garand 6388// Improvements by German M. Bravo (Kronuz) and Ruud Kamphuis (ruudk) 6389// Improvements by Leonardo C. Daronco (daronco) 6390// Created: 2/14/2011 6391// Date: 2/12/2012 6392// Website: http://labs.anthonygarand.com/sticky 6393// Description: Makes an element on the page stick on the screen as you scroll 6394// It will only set the 'top' and 'position' of your element, you 6395// might need to adjust the width in some cases. 6396 6397(function($) { 6398 var defaults = { 6399 topSpacing: 0, 6400 bottomSpacing: 0, 6401 className: 'is-sticky', 6402 wrapperClassName: 'sticky-wrapper', 6403 center: false, 6404 getWidthFrom: '' 6405 }, 6406 $window = $(window), 6407 $document = $(document), 6408 sticked = [], 6409 windowHeight = $window.height(), 6410 scroller = function() { 6411 var scrollTop = $window.scrollTop(), 6412 documentHeight = $document.height(), 6413 dwh = documentHeight - windowHeight, 6414 extra = (scrollTop > dwh) ? dwh - scrollTop : 0; 6415 6416 for (var i = 0; i < sticked.length; i++) { 6417 var s = sticked[i], 6418 elementTop = s.stickyWrapper.offset().top, 6419 etse = elementTop - s.topSpacing - extra; 6420 6421 if (scrollTop <= etse) { 6422 if (s.currentTop !== null) { 6423 s.stickyElement 6424 .css('position', '') 6425 .css('top', ''); 6426 s.stickyElement.parent().removeClass(s.className); 6427 s.currentTop = null; 6428 } 6429 } 6430 else { 6431 var newTop = documentHeight - s.stickyElement.outerHeight() 6432 - s.topSpacing - s.bottomSpacing - scrollTop - extra; 6433 if (newTop < 0) { 6434 newTop = newTop + s.topSpacing; 6435 } else { 6436 newTop = s.topSpacing; 6437 } 6438 if (s.currentTop != newTop) { 6439 s.stickyElement 6440 .css('position', 'fixed') 6441 .css('top', newTop); 6442 6443 if (typeof s.getWidthFrom !== 'undefined') { 6444 s.stickyElement.css('width', $(s.getWidthFrom).width()); 6445 } 6446 6447 s.stickyElement.parent().addClass(s.className); 6448 s.currentTop = newTop; 6449 } 6450 } 6451 } 6452 }, 6453 resizer = function() { 6454 windowHeight = $window.height(); 6455 }, 6456 methods = { 6457 init: function(options) { 6458 var o = $.extend(defaults, options); 6459 return this.each(function() { 6460 var stickyElement = $(this); 6461 6462 var stickyId = stickyElement.attr('id');
6463 var wrapper = $('<div></div>') 6464 .attr('id', stickyId + '-sticky-wrapper') 6465 .addClass(o.wrapperClassName); 6466 stickyElement.wrapAll(wrapper); 6467 6468 if (o.center) { 6469 stickyElement.parent().css({width:stickyElement.outerWidth(),marginLeft:"auto",marginRight:"auto"}); 6470 } 6471 6472 if (stickyElement.css("float") == "right") { 6473 stickyElement.css({"float":"none"}).parent().css({"float":"right"}); 6474 } 6475 6476 var stickyWrapper = stickyElement.parent(); 6477 stickyWrapper.css('height', stickyElement.outerHeight()); 6478 sticked.push({ 6479 topSpacing: o.topSpacing, 6480 bottomSpacing: o.bottomSpacing, 6481 stickyElement: stickyElement, 6482 currentTop: null, 6483 stickyWrapper: stickyWrapper, 6484 className: o.className, 6485 getWidthFrom: o.getWidthFrom 6486 }); 6487 }); 6488 }, 6489 update: scroller 6490 }; 6491 6492 // should be more efficient than using $window.scroll(scroller) and $window.resize(resizer): 6493 if (window.addEventListener) { 6494 window.addEventListener('scroll', scroller, false); 6495 window.addEventListener('resize', resizer, false); 6496 } else if (window.attachEvent) { 6497 window.attachEvent('onscroll', scroller); 6498 window.attachEvent('onresize', resizer); 6499 } 6500 6501 $.fn.sticky = function(method) { 6502 if (methods[method]) { 6503 return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); 6504 } else if (typeof method === 'object' || !method ) { 6505 return methods.init.apply( this, arguments ); 6506 } else { 6507 $.error('Method ' + method + ' does not exist on jQuery.sticky'); 6508 } 6509 }; 6510 $(function() { 6511 setTimeout(scroller, 0); 6512 }); 6513})(jQuery);; 6514// -------------------------------
6515// js/albums/album-swiper.js 6516// ------------------------------- 6517$(function () { 6518 6519 let swipesOptions = { 6520 slidesPerView: 'auto', 6521 zoom: true, 6522 wrapperClass: 'images-list', 6523 slideClass: 'image-entry', 6524 autoHeight: false, 6525 spaceBetween: 0, 6526 freeMode: false, 6527 mousewheel: false, 6528 pagination: { 6529 el: ".images-pagination", 6530 type: "fraction", 6531 }, 6532 navigation: { 6533 nextEl: ".swiper-button-next", 6534 prevEl: ".swiper-button-prev", 6535 }, 6536 }; 6537 let albumsSwiperList = {}; 6538 6539 $('[data-swiper-id]').each(function (){ 6540 let swiperId = $(this).data('swiper-id'); 6541 albumsSwiperList[swiperId] = new Swiper('[data-swiper-id="'+swiperId+'"]',swipesOptions); 6542 }); 6543 6544 $('[data-type="carousel"]').on('click','[data-slide-target]',function (e){ 6545 e.preventDefault(); 6546 let activeClass = 'active'; 6547 let sliderObject = $(this).closest('[data-type="carousel"]'); 6548 let targetSlide = $(this).data('slide-target'); 6549 let activeSlideObj = $(sliderObject).find( $('[data-carousel-items] .active[data-slide-number]') ); 6550 let activeSlide = $(activeSlideObj).data('slide-number'); 6551 let activeIndicatorObj = $(sliderObject).find( $('[data-carousel-indicators] .active') ); 6552 let lastSlide = $(sliderObject).find( $('[data-carousel-items] [data-slide-number]:last-child') ).data('slide-number'); 6553 let firstSlide = $(sliderObject).find( $('[data-carousel-items] [data-slide-number]:first-child') ).data('slide-number'); 6554 if ( targetSlide === 'prev' ) targetSlide = activeSlide - 1; 6555 if ( targetSlide === 'next' ) targetSlide = activeSlide + 1; 6556 if ( targetSlide > lastSlide ) targetSlide = firstSlide; 6557 if ( targetSlide < firstSlide ) targetSlide = lastSlide; 6558 6559 let targetSlideObject = $(sliderObject).find( $('[data-carousel-items] [data-slide-number="'+targetSlide+'"]') ); 6560 let targetIndicatorObject = $(sliderObject).find( $('[data-carousel-indicators] [data-slide-target="'+targetSlide+'"]') ); 6561 if ( $(targetSlideObject).length > 0 ) { 6562 $(activeSlideObj).removeClass(activeClass); 6563 $(targetSlideObject).addClass(activeClass); 6564 } 6565 if ( $(targetIndicatorObject).length > 0 ) { 6566 $(activeIndicatorObj).removeClass(activeClass); 6567 $(targetIndicatorObject).addClass(activeClass); 6568 } 6569 }); 6570 6571});/** 6572 * Swiper 11.1.12 6573 * Most modern mobile touch slider and framework with hardware accelerated transitions 6574 * https://swiperjs.com 6575 * 6576 * Copyright 2014-2024 Vladimir Kharlampidi 6577 * 6578 * Released under the MIT License 6579 * 6580 * Released on: September 1, 2024 6581 */ 6582 6583var Swiper = (function () { 6584 'use strict'; 6585 6586 /** 6587 * SSR Window 4.0.2 6588 * Better handling for window object in SSR environment 6589 * https://github.com/nolimits4web/ssr-window 6590 * 6591 * Copyright 2021, Vladimir Kharlampidi 6592 * 6593 * Licensed under MIT 6594 * 6595 * Released on: December 13, 2021 6596 */ 6597 /* eslint-disable no-param-reassign */ 6598 function isObject$1(obj) { 6599 return obj !== null && typeof obj === 'object' && 'constructor' in obj && obj.constructor === Object; 6600 } 6601 function extend$1(target, src) { 6602 if (target === void 0) { 6603 target = {}; 6604 } 6605 if (src === void 0) { 6606 src = {}; 6607 } 6608 Object.keys(src).forEach(key => { 6609 if (typeof target[key] === 'undefined') target[key] = src[key];else if (isObject$1(src[key]) && isObject$1(target[key]) && Object.keys(src[key]).length > 0) { 6610 extend$1(target[key], src[key]); 6611 } 6612 }); 6613 } 6614 const ssrDocument = { 6615 body: {}, 6616 addEventListener() {}, 6617 removeEventListener() {}, 6618 activeElement: { 6619 blur() {}, 6620 nodeName: '' 6621 }, 6622 querySelector() { 6623 return null; 6624 }, 6625 querySelectorAll() { 6626 return []; 6627 }, 6628 getElementById() { 6629 return null; 6630 }, 6631 createEvent() { 6632 return { 6633 initEvent() {} 6634 }; 6635 }, 6636 createElement() { 6637 return { 6638 children: [], 6639 childNodes: [], 6640 style: {}, 6641 setAttribute() {}, 6642 getElementsByTagName() { 6643 return []; 6644 } 6645 }; 6646 }, 6647 createElementNS() { 6648 return {}; 6649 }, 6650 importNode() { 6651 return null; 6652 }, 6653 location: { 6654 hash: '', 6655 host: '', 6656 hostname: '', 6657 href: '', 6658 origin: '', 6659 pathname: '', 6660 protocol: '', 6661 search: '' 6662 } 6663 }; 6664 function getDocument() { 6665 const doc = typeof document !== 'undefined' ? document : {}; 6666 extend$1(doc, ssrDocument); 6667 return doc; 6668 } 6669 const ssrWindow = { 6670 document: ssrDocument, 6671 navigator: { 6672 userAgent: '' 6673 }, 6674 location: { 6675 hash: '', 6676 host: '', 6677 hostname: '', 6678 href: '', 6679 origin: '', 6680 pathname: '', 6681 protocol: '', 6682 search: '' 6683 }, 6684 history: { 6685 replaceState() {}, 6686 pushState() {}, 6687 go() {}, 6688 back() {} 6689 }, 6690 CustomEvent: function CustomEvent() { 6691 return this; 6692 }, 6693 addEventListener() {}, 6694 removeEventListener() {}, 6695 getComputedStyle() { 6696 return { 6697 getPropertyValue() { 6698 return ''; 6699 } 6700 }; 6701 }, 6702 Image() {}, 6703 Date() {}, 6704 screen: {}, 6705 setTimeout() {}, 6706 clearTimeout() {}, 6707 matchMedia() { 6708 return {}; 6709 }, 6710 requestAnimationFrame(callback) { 6711 if (typeof setTimeout === 'undefined') { 6712 callback(); 6713 return null; 6714 } 6715 return setTimeout(callback, 0); 6716 }, 6717 cancelAnimationFrame(id) { 6718 if (typeof setTimeout === 'undefined') { 6719 return; 6720 } 6721 clearTimeout(id); 6722 } 6723 }; 6724 function getWindow() { 6725 const win = typeof window !== 'undefined' ? window : {}; 6726 extend$1(win, ssrWindow); 6727 return win; 6728 } 6729
vendor: 7,364 bytes, lines 6730-6943
6730 function classesToTokens(classes) { 6731 if (classes === void 0) { 6732 classes = ''; 6733 } 6734 return classes.trim().split(' ').filter(c => !!c.trim()); 6735 } 6736 6737 function deleteProps(obj) { 6738 const object = obj; 6739 Object.keys(object).forEach(key => { 6740 try { 6741 object[key] = null; 6742 } catch (e) { 6743 // no getter for object 6744 } 6745 try { 6746 delete object[key]; 6747 } catch (e) { 6748 // something got wrong 6749 } 6750 }); 6751 } 6752 function nextTick(callback, delay) { 6753 if (delay === void 0) { 6754 delay = 0; 6755 } 6756 return setTimeout(callback, delay); 6757 } 6758 function now() { 6759 return Date.now(); 6760 } 6761 function getComputedStyle$1(el) { 6762 const window = getWindow(); 6763 let style; 6764 if (window.getComputedStyle) { 6765 style = window.getComputedStyle(el, null); 6766 } 6767 if (!style && el.currentStyle) { 6768 style = el.currentStyle; 6769 } 6770 if (!style) { 6771 style = el.style; 6772 } 6773 return style; 6774 } 6775 function getTranslate(el, axis) { 6776 if (axis === void 0) { 6777 axis = 'x'; 6778 } 6779 const window = getWindow(); 6780 let matrix; 6781 let curTransform; 6782 let transformMatrix; 6783 const curStyle = getComputedStyle$1(el); 6784 if (window.WebKitCSSMatrix) { 6785 curTransform = curStyle.transform || curStyle.webkitTransform; 6786 if (curTransform.split(',').length > 6) { 6787 curTransform = curTransform.split(', ').map(a => a.replace(',', '.')).join(', '); 6788 } 6789 // Some old versions of Webkit choke when 'none' is passed; pass 6790 // empty string instead in this case 6791 transformMatrix = new window.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform); 6792 } else { 6793 transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,'); 6794 matrix = transformMatrix.toString().split(','); 6795 } 6796 if (axis === 'x') { 6797 // Latest Chrome and webkits Fix 6798 if (window.WebKitCSSMatrix) curTransform = transformMatrix.m41; 6799 // Crazy IE10 Matrix 6800 else if (matrix.length === 16) curTransform = parseFloat(matrix[12]); 6801 // Normal Browsers 6802 else curTransform = parseFloat(matrix[4]); 6803 } 6804 if (axis === 'y') { 6805 // Latest Chrome and webkits Fix 6806 if (window.WebKitCSSMatrix) curTransform = transformMatrix.m42; 6807 // Crazy IE10 Matrix 6808 else if (matrix.length === 16) curTransform = parseFloat(matrix[13]); 6809 // Normal Browsers 6810 else curTransform = parseFloat(matrix[5]); 6811 } 6812 return curTransform || 0; 6813 } 6814 function isObject(o) { 6815 return typeof o === 'object' && o !== null && o.constructor && Object.prototype.toString.call(o).slice(8, -1) === 'Object'; 6816 } 6817 function isNode(node) { 6818 // eslint-disable-next-line 6819 if (typeof window !== 'undefined' && typeof window.HTMLElement !== 'undefined') { 6820 return node instanceof HTMLElement; 6821 } 6822 return node && (node.nodeType === 1 || node.nodeType === 11); 6823 } 6824 function extend() { 6825 const to = Object(arguments.length <= 0 ? undefined : arguments[0]); 6826 const noExtend = ['__proto__', 'constructor', 'prototype']; 6827 for (let i = 1; i < arguments.length; i += 1) { 6828 const nextSource = i < 0 || arguments.length <= i ? undefined : arguments[i]; 6829 if (nextSource !== undefined && nextSource !== null && !isNode(nextSource)) { 6830 const keysArray = Object.keys(Object(nextSource)).filter(key => noExtend.indexOf(key) < 0); 6831 for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) { 6832 const nextKey = keysArray[nextIndex]; 6833 const desc = Object.getOwnPropertyDescriptor(nextSource, nextKey); 6834 if (desc !== undefined && desc.enumerable) { 6835 if (isObject(to[nextKey]) && isObject(nextSource[nextKey])) { 6836 if (nextSource[nextKey].__swiper__) { 6837 to[nextKey] = nextSource[nextKey]; 6838 } else { 6839 extend(to[nextKey], nextSource[nextKey]); 6840 } 6841 } else if (!isObject(to[nextKey]) && isObject(nextSource[nextKey])) { 6842 to[nextKey] = {}; 6843 if (nextSource[nextKey].__swiper__) { 6844 to[nextKey] = nextSource[nextKey]; 6845 } else { 6846 extend(to[nextKey], nextSource[nextKey]); 6847 } 6848 } else { 6849 to[nextKey] = nextSource[nextKey]; 6850 } 6851 } 6852 } 6853 } 6854 } 6855 return to; 6856 } 6857 function setCSSProperty(el, varName, varValue) { 6858 el.style.setProperty(varName, varValue); 6859 } 6860 function animateCSSModeScroll(_ref) { 6861 let { 6862 swiper, 6863 targetPosition, 6864 side 6865 } = _ref; 6866 const window = getWindow(); 6867 const startPosition = -swiper.translate; 6868 let startTime = null; 6869 let time; 6870 const duration = swiper.params.speed; 6871 swiper.wrapperEl.style.scrollSnapType = 'none'; 6872 window.cancelAnimationFrame(swiper.cssModeFrameID); 6873 const dir = targetPosition > startPosition ? 'next' : 'prev'; 6874 const isOutOfBound = (current, target) => { 6875 return dir === 'next' && current >= target || dir === 'prev' && current <= target; 6876 }; 6877 const animate = () => { 6878 time = new Date().getTime(); 6879 if (startTime === null) { 6880 startTime = time; 6881 } 6882 const progress = Math.max(Math.min((time - startTime) / duration, 1), 0); 6883 const easeProgress = 0.5 - Math.cos(progress * Math.PI) / 2; 6884 let currentPosition = startPosition + easeProgress * (targetPosition - startPosition); 6885 if (isOutOfBound(currentPosition, targetPosition)) { 6886 currentPosition = targetPosition; 6887 } 6888 swiper.wrapperEl.scrollTo({ 6889 [side]: currentPosition 6890 }); 6891 if (isOutOfBound(currentPosition, targetPosition)) { 6892 swiper.wrapperEl.style.overflow = 'hidden'; 6893 swiper.wrapperEl.style.scrollSnapType = ''; 6894 setTimeout(() => { 6895 swiper.wrapperEl.style.overflow = ''; 6896 swiper.wrapperEl.scrollTo({ 6897 [side]: currentPosition 6898 }); 6899 }); 6900 window.cancelAnimationFrame(swiper.cssModeFrameID); 6901 return; 6902 } 6903 swiper.cssModeFrameID = window.requestAnimationFrame(animate); 6904 }; 6905 animate(); 6906 } 6907 function getSlideTransformEl(slideEl) { 6908 return slideEl.querySelector('.swiper-slide-transform') || slideEl.shadowRoot && slideEl.shadowRoot.querySelector('.swiper-slide-transform') || slideEl; 6909 } 6910 function elementChildren(element, selector) { 6911 if (selector === void 0) { 6912 selector = ''; 6913 } 6914 const children = [...element.children]; 6915 if (element instanceof HTMLSlotElement) { 6916 children.push(...element.assignedElements()); 6917 } 6918 if (!selector) { 6919 return children; 6920 } 6921 return children.filter(el => el.matches(selector)); 6922 } 6923 function elementIsChildOf(el, parent) { 6924 const isChild = parent.contains(el); 6925 if (!isChild && parent instanceof HTMLSlotElement) { 6926 const children = [...parent.assignedElements()]; 6927 return children.includes(el); 6928 } 6929 return isChild; 6930 } 6931 function showWarning(text) { 6932 try { 6933 console.warn(text); 6934 return; 6935 } catch (err) { 6936 // err 6937 } 6938 } 6939 function createElement(tag, classes) { 6940 if (classes === void 0) { 6941 classes = []; 6942 } 6943 const el = document.createElement(tag);
vendor: 3,772 bytes, lines 6944-7062
6944 el.classList.add(...(Array.isArray(classes) ? classes : classesToTokens(classes))); 6945 return el; 6946 } 6947 function elementOffset(el) { 6948 const window = getWindow(); 6949 const document = getDocument(); 6950 const box = el.getBoundingClientRect(); 6951 const body = document.body; 6952 const clientTop = el.clientTop || body.clientTop || 0; 6953 const clientLeft = el.clientLeft || body.clientLeft || 0; 6954 const scrollTop = el === window ? window.scrollY : el.scrollTop; 6955 const scrollLeft = el === window ? window.scrollX : el.scrollLeft; 6956 return { 6957 top: box.top + scrollTop - clientTop, 6958 left: box.left + scrollLeft - clientLeft 6959 }; 6960 } 6961 function elementPrevAll(el, selector) { 6962 const prevEls = []; 6963 while (el.previousElementSibling) { 6964 const prev = el.previousElementSibling; // eslint-disable-line 6965 if (selector) { 6966 if (prev.matches(selector)) prevEls.push(prev); 6967 } else prevEls.push(prev); 6968 el = prev; 6969 } 6970 return prevEls; 6971 } 6972 function elementNextAll(el, selector) { 6973 const nextEls = []; 6974 while (el.nextElementSibling) { 6975 const next = el.nextElementSibling; // eslint-disable-line 6976 if (selector) { 6977 if (next.matches(selector)) nextEls.push(next); 6978 } else nextEls.push(next); 6979 el = next; 6980 } 6981 return nextEls; 6982 } 6983 function elementStyle(el, prop) { 6984 const window = getWindow(); 6985 return window.getComputedStyle(el, null).getPropertyValue(prop); 6986 } 6987 function elementIndex(el) { 6988 let child = el; 6989 let i; 6990 if (child) { 6991 i = 0; 6992 // eslint-disable-next-line 6993 while ((child = child.previousSibling) !== null) { 6994 if (child.nodeType === 1) i += 1; 6995 } 6996 return i; 6997 } 6998 return undefined; 6999 } 7000 function elementParents(el, selector) { 7001 const parents = []; // eslint-disable-line 7002 let parent = el.parentElement; // eslint-disable-line 7003 while (parent) { 7004 if (selector) { 7005 if (parent.matches(selector)) parents.push(parent); 7006 } else { 7007 parents.push(parent); 7008 } 7009 parent = parent.parentElement; 7010 } 7011 return parents; 7012 } 7013 function elementTransitionEnd(el, callback) { 7014 function fireCallBack(e) { 7015 if (e.target !== el) return; 7016 callback.call(el, e); 7017 el.removeEventListener('transitionend', fireCallBack); 7018 } 7019 if (callback) { 7020 el.addEventListener('transitionend', fireCallBack); 7021 } 7022 } 7023 function elementOuterSize(el, size, includeMargins) { 7024 const window = getWindow(); 7025 if (includeMargins) { 7026 return el[size === 'width' ? 'offsetWidth' : 'offsetHeight'] + parseFloat(window.getComputedStyle(el, null).getPropertyValue(size === 'width' ? 'margin-right' : 'margin-top')) + parseFloat(window.getComputedStyle(el, null).getPropertyValue(size === 'width' ? 'margin-left' : 'margin-bottom')); 7027 } 7028 return el.offsetWidth; 7029 } 7030 function makeElementsArray(el) { 7031 return (Array.isArray(el) ? el : [el]).filter(e => !!e); 7032 } 7033 function getRotateFix(swiper) { 7034 return v => { 7035 if (Math.abs(v) > 0 && swiper.browser && swiper.browser.need3dFix && Math.abs(v) % 90 === 0) { 7036 return v + 0.001; 7037 } 7038 return v; 7039 }; 7040 } 7041 7042 let support; 7043 function calcSupport() { 7044 const window = getWindow(); 7045 const document = getDocument(); 7046 return { 7047 smoothScroll: document.documentElement && document.documentElement.style && 'scrollBehavior' in document.documentElement.style, 7048 touch: !!('ontouchstart' in window || window.DocumentTouch && document instanceof window.DocumentTouch) 7049 }; 7050 } 7051 function getSupport() { 7052 if (!support) { 7053 support = calcSupport(); 7054 } 7055 return support; 7056 } 7057 7058 let deviceCached; 7059 function calcDevice(_temp) { 7060 let { 7061 userAgent 7062 } = _temp === void 0 ? {} : _temp;
vendor: 6,818 bytes, lines 7063-7270
7063 const support = getSupport(); 7064 const window = getWindow(); 7065 const platform = window.navigator.platform; 7066 const ua = userAgent || window.navigator.userAgent; 7067 const device = { 7068 ios: false, 7069 android: false 7070 }; 7071 const screenWidth = window.screen.width; 7072 const screenHeight = window.screen.height; 7073 const android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); // eslint-disable-line 7074 let ipad = ua.match(/(iPad).*OS\s([\d_]+)/); 7075 const ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/); 7076 const iphone = !ipad && ua.match(/(iPhone\sOS|iOS)\s([\d_]+)/); 7077 const windows = platform === 'Win32'; 7078 let macos = platform === 'MacIntel'; 7079 7080 // iPadOs 13 fix 7081 const iPadScreens = ['1024x1366', '1366x1024', '834x1194', '1194x834', '834x1112', '1112x834', '768x1024', '1024x768', '820x1180', '1180x820', '810x1080', '1080x810']; 7082 if (!ipad && macos && support.touch && iPadScreens.indexOf(`${screenWidth}x${screenHeight}`) >= 0) { 7083 ipad = ua.match(/(Version)\/([\d.]+)/); 7084 if (!ipad) ipad = [0, 1, '13_0_0']; 7085 macos = false; 7086 } 7087 7088 // Android 7089 if (android && !windows) { 7090 device.os = 'android'; 7091 device.android = true; 7092 } 7093 if (ipad || iphone || ipod) { 7094 device.os = 'ios'; 7095 device.ios = true; 7096 } 7097 7098 // Export object 7099 return device; 7100 } 7101 function getDevice(overrides) { 7102 if (overrides === void 0) { 7103 overrides = {}; 7104 } 7105 if (!deviceCached) { 7106 deviceCached = calcDevice(overrides); 7107 } 7108 return deviceCached; 7109 } 7110 7111 let browser; 7112 function calcBrowser() { 7113 const window = getWindow(); 7114 const device = getDevice(); 7115 let needPerspectiveFix = false; 7116 function isSafari() { 7117 const ua = window.navigator.userAgent.toLowerCase(); 7118 return ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0 && ua.indexOf('android') < 0; 7119 } 7120 if (isSafari()) { 7121 const ua = String(window.navigator.userAgent); 7122 if (ua.includes('Version/')) { 7123 const [major, minor] = ua.split('Version/')[1].split(' ')[0].split('.').map(num => Number(num)); 7124 needPerspectiveFix = major < 16 || major === 16 && minor < 2; 7125 } 7126 } 7127 const isWebView = /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent); 7128 const isSafariBrowser = isSafari(); 7129 const need3dFix = isSafariBrowser || isWebView && device.ios; 7130 return { 7131 isSafari: needPerspectiveFix || isSafariBrowser, 7132 needPerspectiveFix, 7133 need3dFix, 7134 isWebView 7135 }; 7136 } 7137 function getBrowser() { 7138 if (!browser) { 7139 browser = calcBrowser(); 7140 } 7141 return browser; 7142 } 7143 7144 function Resize(_ref) { 7145 let { 7146 swiper, 7147 on, 7148 emit 7149 } = _ref; 7150 const window = getWindow(); 7151 let observer = null; 7152 let animationFrame = null; 7153 const resizeHandler = () => { 7154 if (!swiper || swiper.destroyed || !swiper.initialized) return; 7155 emit('beforeResize'); 7156 emit('resize'); 7157 }; 7158 const createObserver = () => { 7159 if (!swiper || swiper.destroyed || !swiper.initialized) return; 7160 observer = new ResizeObserver(entries => { 7161 animationFrame = window.requestAnimationFrame(() => { 7162 const { 7163 width, 7164 height 7165 } = swiper; 7166 let newWidth = width; 7167 let newHeight = height; 7168 entries.forEach(_ref2 => { 7169 let { 7170 contentBoxSize, 7171 contentRect, 7172 target 7173 } = _ref2; 7174 if (target && target !== swiper.el) return; 7175 newWidth = contentRect ? contentRect.width : (contentBoxSize[0] || contentBoxSize).inlineSize; 7176 newHeight = contentRect ? contentRect.height : (contentBoxSize[0] || contentBoxSize).blockSize; 7177 }); 7178 if (newWidth !== width || newHeight !== height) { 7179 resizeHandler(); 7180 } 7181 }); 7182 }); 7183 observer.observe(swiper.el); 7184 }; 7185 const removeObserver = () => { 7186 if (animationFrame) { 7187 window.cancelAnimationFrame(animationFrame); 7188 } 7189 if (observer && observer.unobserve && swiper.el) { 7190 observer.unobserve(swiper.el); 7191 observer = null; 7192 } 7193 }; 7194 const orientationChangeHandler = () => { 7195 if (!swiper || swiper.destroyed || !swiper.initialized) return; 7196 emit('orientationchange'); 7197 }; 7198 on('init', () => { 7199 if (swiper.params.resizeObserver && typeof window.ResizeObserver !== 'undefined') { 7200 createObserver(); 7201 return; 7202 } 7203 window.addEventListener('resize', resizeHandler); 7204 window.addEventListener('orientationchange', orientationChangeHandler); 7205 }); 7206 on('destroy', () => { 7207 removeObserver(); 7208 window.removeEventListener('resize', resizeHandler); 7209 window.removeEventListener('orientationchange', orientationChangeHandler); 7210 }); 7211 } 7212 7213 function Observer(_ref) { 7214 let { 7215 swiper, 7216 extendParams, 7217 on, 7218 emit 7219 } = _ref; 7220 const observers = []; 7221 const window = getWindow(); 7222 const attach = function (target, options) { 7223 if (options === void 0) { 7224 options = {}; 7225 } 7226 const ObserverFunc = window.MutationObserver || window.WebkitMutationObserver; 7227 const observer = new ObserverFunc(mutations => { 7228 // The observerUpdate event should only be triggered 7229 // once despite the number of mutations. Additional 7230 // triggers are redundant and are very costly 7231 if (swiper.__preventObserver__) return; 7232 if (mutations.length === 1) { 7233 emit('observerUpdate', mutations[0]); 7234 return; 7235 } 7236 const observerUpdate = function observerUpdate() { 7237 emit('observerUpdate', mutations[0]); 7238 }; 7239 if (window.requestAnimationFrame) { 7240 window.requestAnimationFrame(observerUpdate); 7241 } else { 7242 window.setTimeout(observerUpdate, 0); 7243 } 7244 }); 7245 observer.observe(target, { 7246 attributes: typeof options.attributes === 'undefined' ? true : options.attributes, 7247 childList: swiper.isElement || (typeof options.childList === 'undefined' ? true : options).childList, 7248 characterData: typeof options.characterData === 'undefined' ? true : options.characterData 7249 }); 7250 observers.push(observer); 7251 }; 7252 const init = () => { 7253 if (!swiper.params.observer) return; 7254 if (swiper.params.observeParents) { 7255 const containerParents = elementParents(swiper.hostEl); 7256 for (let i = 0; i < containerParents.length; i += 1) { 7257 attach(containerParents[i]); 7258 } 7259 } 7260 // Observe container 7261 attach(swiper.hostEl, { 7262 childList: swiper.params.observeSlideChildren 7263 }); 7264 7265 // Observe wrapper 7266 attach(swiper.wrapperEl, { 7267 attributes: false 7268 }); 7269 }; 7270 const destroy = () => {
vendor: 4,990 bytes, lines 7271-7413
7271 observers.forEach(observer => { 7272 observer.disconnect(); 7273 }); 7274 observers.splice(0, observers.length); 7275 }; 7276 extendParams({ 7277 observer: false, 7278 observeParents: false, 7279 observeSlideChildren: false 7280 }); 7281 on('init', init); 7282 on('destroy', destroy); 7283 } 7284 7285 /* eslint-disable no-underscore-dangle */ 7286 7287 var eventsEmitter = { 7288 on(events, handler, priority) { 7289 const self = this; 7290 if (!self.eventsListeners || self.destroyed) return self; 7291 if (typeof handler !== 'function') return self; 7292 const method = priority ? 'unshift' : 'push'; 7293 events.split(' ').forEach(event => { 7294 if (!self.eventsListeners[event]) self.eventsListeners[event] = []; 7295 self.eventsListeners[event][method](handler); 7296 }); 7297 return self; 7298 }, 7299 once(events, handler, priority) { 7300 const self = this; 7301 if (!self.eventsListeners || self.destroyed) return self; 7302 if (typeof handler !== 'function') return self; 7303 function onceHandler() { 7304 self.off(events, onceHandler); 7305 if (onceHandler.__emitterProxy) { 7306 delete onceHandler.__emitterProxy; 7307 } 7308 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 7309 args[_key] = arguments[_key]; 7310 } 7311 handler.apply(self, args); 7312 } 7313 onceHandler.__emitterProxy = handler; 7314 return self.on(events, onceHandler, priority); 7315 }, 7316 onAny(handler, priority) { 7317 const self = this; 7318 if (!self.eventsListeners || self.destroyed) return self; 7319 if (typeof handler !== 'function') return self; 7320 const method = priority ? 'unshift' : 'push'; 7321 if (self.eventsAnyListeners.indexOf(handler) < 0) { 7322 self.eventsAnyListeners[method](handler); 7323 } 7324 return self; 7325 }, 7326 offAny(handler) { 7327 const self = this; 7328 if (!self.eventsListeners || self.destroyed) return self; 7329 if (!self.eventsAnyListeners) return self; 7330 const index = self.eventsAnyListeners.indexOf(handler); 7331 if (index >= 0) { 7332 self.eventsAnyListeners.splice(index, 1); 7333 } 7334 return self; 7335 }, 7336 off(events, handler) { 7337 const self = this; 7338 if (!self.eventsListeners || self.destroyed) return self; 7339 if (!self.eventsListeners) return self; 7340 events.split(' ').forEach(event => { 7341 if (typeof handler === 'undefined') { 7342 self.eventsListeners[event] = []; 7343 } else if (self.eventsListeners[event]) { 7344 self.eventsListeners[event].forEach((eventHandler, index) => { 7345 if (eventHandler === handler || eventHandler.__emitterProxy && eventHandler.__emitterProxy === handler) { 7346 self.eventsListeners[event].splice(index, 1); 7347 } 7348 }); 7349 } 7350 }); 7351 return self; 7352 }, 7353 emit() { 7354 const self = this; 7355 if (!self.eventsListeners || self.destroyed) return self; 7356 if (!self.eventsListeners) return self; 7357 let events; 7358 let data; 7359 let context; 7360 for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { 7361 args[_key2] = arguments[_key2]; 7362 } 7363 if (typeof args[0] === 'string' || Array.isArray(args[0])) { 7364 events = args[0]; 7365 data = args.slice(1, args.length); 7366 context = self; 7367 } else { 7368 events = args[0].events; 7369 data = args[0].data; 7370 context = args[0].context || self; 7371 } 7372 data.unshift(context); 7373 const eventsArray = Array.isArray(events) ? events : events.split(' '); 7374 eventsArray.forEach(event => { 7375 if (self.eventsAnyListeners && self.eventsAnyListeners.length) { 7376 self.eventsAnyListeners.forEach(eventHandler => { 7377 eventHandler.apply(context, [event, ...data]); 7378 }); 7379 } 7380 if (self.eventsListeners && self.eventsListeners[event]) { 7381 self.eventsListeners[event].forEach(eventHandler => { 7382 eventHandler.apply(context, data); 7383 }); 7384 } 7385 }); 7386 return self; 7387 } 7388 }; 7389 7390 function updateSize() { 7391 const swiper = this; 7392 let width; 7393 let height; 7394 const el = swiper.el; 7395 if (typeof swiper.params.width !== 'undefined' && swiper.params.width !== null) { 7396 width = swiper.params.width; 7397 } else { 7398 width = el.clientWidth; 7399 } 7400 if (typeof swiper.params.height !== 'undefined' && swiper.params.height !== null) { 7401 height = swiper.params.height; 7402 } else { 7403 height = el.clientHeight; 7404 } 7405 if (width === 0 && swiper.isHorizontal() || height === 0 && swiper.isVertical()) { 7406 return; 7407 } 7408 7409 // Subtract paddings 7410 width = width - parseInt(elementStyle(el, 'padding-left') || 0, 10) - parseInt(elementStyle(el, 'padding-right') || 0, 10); 7411 height = height - parseInt(elementStyle(el, 'padding-top') || 0, 10) - parseInt(elementStyle(el, 'padding-bottom') || 0, 10); 7412 if (Number.isNaN(width)) width = 0; 7413 if (Number.isNaN(height)) height = 0;
vendor: 8,689 bytes, lines 7414-7623
7414 Object.assign(swiper, { 7415 width, 7416 height, 7417 size: swiper.isHorizontal() ? width : height 7418 }); 7419 } 7420 7421 function updateSlides() { 7422 const swiper = this; 7423 function getDirectionPropertyValue(node, label) { 7424 return parseFloat(node.getPropertyValue(swiper.getDirectionLabel(label)) || 0); 7425 } 7426 const params = swiper.params; 7427 const { 7428 wrapperEl, 7429 slidesEl, 7430 size: swiperSize, 7431 rtlTranslate: rtl, 7432 wrongRTL 7433 } = swiper; 7434 const isVirtual = swiper.virtual && params.virtual.enabled; 7435 const previousSlidesLength = isVirtual ? swiper.virtual.slides.length : swiper.slides.length; 7436 const slides = elementChildren(slidesEl, `.${swiper.params.slideClass}, swiper-slide`); 7437 const slidesLength = isVirtual ? swiper.virtual.slides.length : slides.length; 7438 let snapGrid = []; 7439 const slidesGrid = []; 7440 const slidesSizesGrid = []; 7441 let offsetBefore = params.slidesOffsetBefore; 7442 if (typeof offsetBefore === 'function') { 7443 offsetBefore = params.slidesOffsetBefore.call(swiper); 7444 } 7445 let offsetAfter = params.slidesOffsetAfter; 7446 if (typeof offsetAfter === 'function') { 7447 offsetAfter = params.slidesOffsetAfter.call(swiper); 7448 } 7449 const previousSnapGridLength = swiper.snapGrid.length; 7450 const previousSlidesGridLength = swiper.slidesGrid.length; 7451 let spaceBetween = params.spaceBetween; 7452 let slidePosition = -offsetBefore; 7453 let prevSlideSize = 0; 7454 let index = 0; 7455 if (typeof swiperSize === 'undefined') { 7456 return; 7457 } 7458 if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) { 7459 spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * swiperSize; 7460 } else if (typeof spaceBetween === 'string') { 7461 spaceBetween = parseFloat(spaceBetween); 7462 } 7463 swiper.virtualSize = -spaceBetween; 7464 7465 // reset margins 7466 slides.forEach(slideEl => { 7467 if (rtl) { 7468 slideEl.style.marginLeft = ''; 7469 } else { 7470 slideEl.style.marginRight = ''; 7471 } 7472 slideEl.style.marginBottom = ''; 7473 slideEl.style.marginTop = ''; 7474 }); 7475 7476 // reset cssMode offsets 7477 if (params.centeredSlides && params.cssMode) { 7478 setCSSProperty(wrapperEl, '--swiper-centered-offset-before', ''); 7479 setCSSProperty(wrapperEl, '--swiper-centered-offset-after', ''); 7480 } 7481 const gridEnabled = params.grid && params.grid.rows > 1 && swiper.grid; 7482 if (gridEnabled) { 7483 swiper.grid.initSlides(slides); 7484 } else if (swiper.grid) { 7485 swiper.grid.unsetSlides(); 7486 } 7487 7488 // Calc slides 7489 let slideSize; 7490 const shouldResetSlideSize = params.slidesPerView === 'auto' && params.breakpoints && Object.keys(params.breakpoints).filter(key => { 7491 return typeof params.breakpoints[key].slidesPerView !== 'undefined'; 7492 }).length > 0; 7493 for (let i = 0; i < slidesLength; i += 1) { 7494 slideSize = 0; 7495 let slide; 7496 if (slides[i]) slide = slides[i]; 7497 if (gridEnabled) { 7498 swiper.grid.updateSlide(i, slide, slides); 7499 } 7500 if (slides[i] && elementStyle(slide, 'display') === 'none') continue; // eslint-disable-line 7501 7502 if (params.slidesPerView === 'auto') { 7503 if (shouldResetSlideSize) { 7504 slides[i].style[swiper.getDirectionLabel('width')] = ``; 7505 } 7506 const slideStyles = getComputedStyle(slide); 7507 const currentTransform = slide.style.transform; 7508 const currentWebKitTransform = slide.style.webkitTransform; 7509 if (currentTransform) { 7510 slide.style.transform = 'none'; 7511 } 7512 if (currentWebKitTransform) { 7513 slide.style.webkitTransform = 'none'; 7514 } 7515 if (params.roundLengths) { 7516 slideSize = swiper.isHorizontal() ? elementOuterSize(slide, 'width', true) : elementOuterSize(slide, 'height', true); 7517 } else { 7518 // eslint-disable-next-line 7519 const width = getDirectionPropertyValue(slideStyles, 'width'); 7520 const paddingLeft = getDirectionPropertyValue(slideStyles, 'padding-left'); 7521 const paddingRight = getDirectionPropertyValue(slideStyles, 'padding-right'); 7522 const marginLeft = getDirectionPropertyValue(slideStyles, 'margin-left'); 7523 const marginRight = getDirectionPropertyValue(slideStyles, 'margin-right'); 7524 const boxSizing = slideStyles.getPropertyValue('box-sizing'); 7525 if (boxSizing && boxSizing === 'border-box') { 7526 slideSize = width + marginLeft + marginRight; 7527 } else { 7528 const { 7529 clientWidth, 7530 offsetWidth 7531 } = slide; 7532 slideSize = width + paddingLeft + paddingRight + marginLeft + marginRight + (offsetWidth - clientWidth); 7533 } 7534 } 7535 if (currentTransform) { 7536 slide.style.transform = currentTransform; 7537 } 7538 if (currentWebKitTransform) { 7539 slide.style.webkitTransform = currentWebKitTransform; 7540 } 7541 if (params.roundLengths) slideSize = Math.floor(slideSize); 7542 } else { 7543 slideSize = (swiperSize - (params.slidesPerView - 1) * spaceBetween) / params.slidesPerView; 7544 if (params.roundLengths) slideSize = Math.floor(slideSize); 7545 if (slides[i]) { 7546 slides[i].style[swiper.getDirectionLabel('width')] = `${slideSize}px`; 7547 } 7548 } 7549 if (slides[i]) { 7550 slides[i].swiperSlideSize = slideSize; 7551 } 7552 slidesSizesGrid.push(slideSize); 7553 if (params.centeredSlides) { 7554 slidePosition = slidePosition + slideSize / 2 + prevSlideSize / 2 + spaceBetween; 7555 if (prevSlideSize === 0 && i !== 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween; 7556 if (i === 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween; 7557 if (Math.abs(slidePosition) < 1 / 1000) slidePosition = 0; 7558 if (params.roundLengths) slidePosition = Math.floor(slidePosition); 7559 if (index % params.slidesPerGroup === 0) snapGrid.push(slidePosition); 7560 slidesGrid.push(slidePosition); 7561 } else { 7562 if (params.roundLengths) slidePosition = Math.floor(slidePosition); 7563 if ((index - Math.min(swiper.params.slidesPerGroupSkip, index)) % swiper.params.slidesPerGroup === 0) snapGrid.push(slidePosition); 7564 slidesGrid.push(slidePosition); 7565 slidePosition = slidePosition + slideSize + spaceBetween; 7566 } 7567 swiper.virtualSize += slideSize + spaceBetween; 7568 prevSlideSize = slideSize; 7569 index += 1; 7570 } 7571 swiper.virtualSize = Math.max(swiper.virtualSize, swiperSize) + offsetAfter; 7572 if (rtl && wrongRTL && (params.effect === 'slide' || params.effect === 'coverflow')) { 7573 wrapperEl.style.width = `${swiper.virtualSize + spaceBetween}px`; 7574 } 7575 if (params.setWrapperSize) { 7576 wrapperEl.style[swiper.getDirectionLabel('width')] = `${swiper.virtualSize + spaceBetween}px`; 7577 } 7578 if (gridEnabled) { 7579 swiper.grid.updateWrapperSize(slideSize, snapGrid); 7580 } 7581 7582 // Remove last grid elements depending on width 7583 if (!params.centeredSlides) { 7584 const newSlidesGrid = []; 7585 for (let i = 0; i < snapGrid.length; i += 1) { 7586 let slidesGridItem = snapGrid[i]; 7587 if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem); 7588 if (snapGrid[i] <= swiper.virtualSize - swiperSize) { 7589 newSlidesGrid.push(slidesGridItem); 7590 } 7591 } 7592 snapGrid = newSlidesGrid; 7593 if (Math.floor(swiper.virtualSize - swiperSize) - Math.floor(snapGrid[snapGrid.length - 1]) > 1) { 7594 snapGrid.push(swiper.virtualSize - swiperSize); 7595 } 7596 } 7597 if (isVirtual && params.loop) { 7598 const size = slidesSizesGrid[0] + spaceBetween; 7599 if (params.slidesPerGroup > 1) { 7600 const groups = Math.ceil((swiper.virtual.slidesBefore + swiper.virtual.slidesAfter) / params.slidesPerGroup); 7601 const groupSize = size * params.slidesPerGroup; 7602 for (let i = 0; i < groups; i += 1) { 7603 snapGrid.push(snapGrid[snapGrid.length - 1] + groupSize); 7604 } 7605 } 7606 for (let i = 0; i < swiper.virtual.slidesBefore + swiper.virtual.slidesAfter; i += 1) { 7607 if (params.slidesPerGroup === 1) { 7608 snapGrid.push(snapGrid[snapGrid.length - 1] + size); 7609 } 7610 slidesGrid.push(slidesGrid[slidesGrid.length - 1] + size); 7611 swiper.virtualSize += size; 7612 } 7613 } 7614 if (snapGrid.length === 0) snapGrid = [0]; 7615 if (spaceBetween !== 0) { 7616 const key = swiper.isHorizontal() && rtl ? 'marginLeft' : swiper.getDirectionLabel('marginRight'); 7617 slides.filter((_, slideIndex) => { 7618 if (!params.cssMode || params.loop) return true; 7619 if (slideIndex === slides.length - 1) { 7620 return false; 7621 } 7622 return true; 7623 }
vendor: 3,711 bytes, lines 7623-7715
7623).forEach(slideEl => { 7624 slideEl.style[key] = `${spaceBetween}px`; 7625 }); 7626 } 7627 if (params.centeredSlides && params.centeredSlidesBounds) { 7628 let allSlidesSize = 0; 7629 slidesSizesGrid.forEach(slideSizeValue => { 7630 allSlidesSize += slideSizeValue + (spaceBetween || 0); 7631 }); 7632 allSlidesSize -= spaceBetween; 7633 const maxSnap = allSlidesSize > swiperSize ? allSlidesSize - swiperSize : 0; 7634 snapGrid = snapGrid.map(snap => { 7635 if (snap <= 0) return -offsetBefore; 7636 if (snap > maxSnap) return maxSnap + offsetAfter; 7637 return snap; 7638 }); 7639 } 7640 if (params.centerInsufficientSlides) { 7641 let allSlidesSize = 0; 7642 slidesSizesGrid.forEach(slideSizeValue => { 7643 allSlidesSize += slideSizeValue + (spaceBetween || 0); 7644 }); 7645 allSlidesSize -= spaceBetween; 7646 const offsetSize = (params.slidesOffsetBefore || 0) + (params.slidesOffsetAfter || 0); 7647 if (allSlidesSize + offsetSize < swiperSize) { 7648 const allSlidesOffset = (swiperSize - allSlidesSize - offsetSize) / 2; 7649 snapGrid.forEach((snap, snapIndex) => { 7650 snapGrid[snapIndex] = snap - allSlidesOffset; 7651 }); 7652 slidesGrid.forEach((snap, snapIndex) => { 7653 slidesGrid[snapIndex] = snap + allSlidesOffset; 7654 }); 7655 } 7656 } 7657 Object.assign(swiper, { 7658 slides, 7659 snapGrid, 7660 slidesGrid, 7661 slidesSizesGrid 7662 }); 7663 if (params.centeredSlides && params.cssMode && !params.centeredSlidesBounds) { 7664 setCSSProperty(wrapperEl, '--swiper-centered-offset-before', `${-snapGrid[0]}px`); 7665 setCSSProperty(wrapperEl, '--swiper-centered-offset-after', `${swiper.size / 2 - slidesSizesGrid[slidesSizesGrid.length - 1] / 2}px`); 7666 const addToSnapGrid = -swiper.snapGrid[0]; 7667 const addToSlidesGrid = -swiper.slidesGrid[0]; 7668 swiper.snapGrid = swiper.snapGrid.map(v => v + addToSnapGrid); 7669 swiper.slidesGrid = swiper.slidesGrid.map(v => v + addToSlidesGrid); 7670 } 7671 if (slidesLength !== previousSlidesLength) { 7672 swiper.emit('slidesLengthChange'); 7673 } 7674 if (snapGrid.length !== previousSnapGridLength) { 7675 if (swiper.params.watchOverflow) swiper.checkOverflow(); 7676 swiper.emit('snapGridLengthChange'); 7677 } 7678 if (slidesGrid.length !== previousSlidesGridLength) { 7679 swiper.emit('slidesGridLengthChange'); 7680 } 7681 if (params.watchSlidesProgress) { 7682 swiper.updateSlidesOffset(); 7683 } 7684 swiper.emit('slidesUpdated'); 7685 if (!isVirtual && !params.cssMode && (params.effect === 'slide' || params.effect === 'fade')) { 7686 const backFaceHiddenClass = `${params.containerModifierClass}backface-hidden`; 7687 const hasClassBackfaceClassAdded = swiper.el.classList.contains(backFaceHiddenClass); 7688 if (slidesLength <= params.maxBackfaceHiddenSlides) { 7689 if (!hasClassBackfaceClassAdded) swiper.el.classList.add(backFaceHiddenClass); 7690 } else if (hasClassBackfaceClassAdded) { 7691 swiper.el.classList.remove(backFaceHiddenClass); 7692 } 7693 } 7694 } 7695 7696 function updateAutoHeight(speed) { 7697 const swiper = this; 7698 const activeSlides = []; 7699 const isVirtual = swiper.virtual && swiper.params.virtual.enabled; 7700 let newHeight = 0; 7701 let i; 7702 if (typeof speed === 'number') { 7703 swiper.setTransition(speed); 7704 } else if (speed === true) { 7705 swiper.setTransition(swiper.params.speed); 7706 } 7707 const getSlideByIndex = index => { 7708 if (isVirtual) { 7709 return swiper.slides[swiper.getSlideIndexByData(index)]; 7710 } 7711 return swiper.slides[index]; 7712 }; 7713 // Find slides currently in view 7714 if (swiper.params.slidesPerView !== 'auto' && swiper.params.slidesPerView > 1) { 7715 if (swiper.params.centeredSlides) {
vendor: 3,554 bytes, lines 7716-7797
7716 (swiper.visibleSlides || []).forEach(slide => { 7717 activeSlides.push(slide); 7718 }); 7719 } else { 7720 for (i = 0; i < Math.ceil(swiper.params.slidesPerView); i += 1) { 7721 const index = swiper.activeIndex + i; 7722 if (index > swiper.slides.length && !isVirtual) break; 7723 activeSlides.push(getSlideByIndex(index)); 7724 } 7725 } 7726 } else { 7727 activeSlides.push(getSlideByIndex(swiper.activeIndex)); 7728 } 7729 7730 // Find new height from highest slide in view 7731 for (i = 0; i < activeSlides.length; i += 1) { 7732 if (typeof activeSlides[i] !== 'undefined') { 7733 const height = activeSlides[i].offsetHeight; 7734 newHeight = height > newHeight ? height : newHeight; 7735 } 7736 } 7737 7738 // Update Height 7739 if (newHeight || newHeight === 0) swiper.wrapperEl.style.height = `${newHeight}px`; 7740 } 7741 7742 function updateSlidesOffset() { 7743 const swiper = this; 7744 const slides = swiper.slides; 7745 // eslint-disable-next-line 7746 const minusOffset = swiper.isElement ? swiper.isHorizontal() ? swiper.wrapperEl.offsetLeft : swiper.wrapperEl.offsetTop : 0; 7747 for (let i = 0; i < slides.length; i += 1) { 7748 slides[i].swiperSlideOffset = (swiper.isHorizontal() ? slides[i].offsetLeft : slides[i].offsetTop) - minusOffset - swiper.cssOverflowAdjustment(); 7749 } 7750 } 7751 7752 const toggleSlideClasses$1 = (slideEl, condition, className) => { 7753 if (condition && !slideEl.classList.contains(className)) { 7754 slideEl.classList.add(className); 7755 } else if (!condition && slideEl.classList.contains(className)) { 7756 slideEl.classList.remove(className); 7757 } 7758 }; 7759 function updateSlidesProgress(translate) { 7760 if (translate === void 0) { 7761 translate = this && this.translate || 0; 7762 } 7763 const swiper = this; 7764 const params = swiper.params; 7765 const { 7766 slides, 7767 rtlTranslate: rtl, 7768 snapGrid 7769 } = swiper; 7770 if (slides.length === 0) return; 7771 if (typeof slides[0].swiperSlideOffset === 'undefined') swiper.updateSlidesOffset(); 7772 let offsetCenter = -translate; 7773 if (rtl) offsetCenter = translate; 7774 swiper.visibleSlidesIndexes = []; 7775 swiper.visibleSlides = []; 7776 let spaceBetween = params.spaceBetween; 7777 if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) { 7778 spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * swiper.size; 7779 } else if (typeof spaceBetween === 'string') { 7780 spaceBetween = parseFloat(spaceBetween); 7781 } 7782 for (let i = 0; i < slides.length; i += 1) { 7783 const slide = slides[i]; 7784 let slideOffset = slide.swiperSlideOffset; 7785 if (params.cssMode && params.centeredSlides) { 7786 slideOffset -= slides[0].swiperSlideOffset; 7787 } 7788 const slideProgress = (offsetCenter + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide.swiperSlideSize + spaceBetween); 7789 const originalSlideProgress = (offsetCenter - snapGrid[0] + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide.swiperSlideSize + spaceBetween); 7790 const slideBefore = -(offsetCenter - slideOffset); 7791 const slideAfter = slideBefore + swiper.slidesSizesGrid[i]; 7792 const isFullyVisible = slideBefore >= 0 && slideBefore <= swiper.size - swiper.slidesSizesGrid[i]; 7793 const isVisible = slideBefore >= 0 && slideBefore < swiper.size - 1 || slideAfter > 1 && slideAfter <= swiper.size || slideBefore <= 0 && slideAfter >= swiper.size; 7794 if (isVisible) { 7795 swiper.visibleSlides.push(slide); 7796 swiper.visibleSlidesIndexes.push(i); 7797 }
vendor: 11,893 bytes, lines 7798-8110
7798 toggleSlideClasses$1(slide, isVisible, params.slideVisibleClass); 7799 toggleSlideClasses$1(slide, isFullyVisible, params.slideFullyVisibleClass); 7800 slide.progress = rtl ? -slideProgress : slideProgress; 7801 slide.originalProgress = rtl ? -originalSlideProgress : originalSlideProgress; 7802 } 7803 } 7804 7805 function updateProgress(translate) { 7806 const swiper = this; 7807 if (typeof translate === 'undefined') { 7808 const multiplier = swiper.rtlTranslate ? -1 : 1; 7809 // eslint-disable-next-line 7810 translate = swiper && swiper.translate && swiper.translate * multiplier || 0; 7811 } 7812 const params = swiper.params; 7813 const translatesDiff = swiper.maxTranslate() - swiper.minTranslate(); 7814 let { 7815 progress, 7816 isBeginning, 7817 isEnd, 7818 progressLoop 7819 } = swiper; 7820 const wasBeginning = isBeginning; 7821 const wasEnd = isEnd; 7822 if (translatesDiff === 0) { 7823 progress = 0; 7824 isBeginning = true; 7825 isEnd = true; 7826 } else { 7827 progress = (translate - swiper.minTranslate()) / translatesDiff; 7828 const isBeginningRounded = Math.abs(translate - swiper.minTranslate()) < 1; 7829 const isEndRounded = Math.abs(translate - swiper.maxTranslate()) < 1; 7830 isBeginning = isBeginningRounded || progress <= 0; 7831 isEnd = isEndRounded || progress >= 1; 7832 if (isBeginningRounded) progress = 0; 7833 if (isEndRounded) progress = 1; 7834 } 7835 if (params.loop) { 7836 const firstSlideIndex = swiper.getSlideIndexByData(0); 7837 const lastSlideIndex = swiper.getSlideIndexByData(swiper.slides.length - 1); 7838 const firstSlideTranslate = swiper.slidesGrid[firstSlideIndex]; 7839 const lastSlideTranslate = swiper.slidesGrid[lastSlideIndex]; 7840 const translateMax = swiper.slidesGrid[swiper.slidesGrid.length - 1]; 7841 const translateAbs = Math.abs(translate); 7842 if (translateAbs >= firstSlideTranslate) { 7843 progressLoop = (translateAbs - firstSlideTranslate) / translateMax; 7844 } else { 7845 progressLoop = (translateAbs + translateMax - lastSlideTranslate) / translateMax; 7846 } 7847 if (progressLoop > 1) progressLoop -= 1; 7848 } 7849 Object.assign(swiper, { 7850 progress, 7851 progressLoop, 7852 isBeginning, 7853 isEnd 7854 }); 7855 if (params.watchSlidesProgress || params.centeredSlides && params.autoHeight) swiper.updateSlidesProgress(translate); 7856 if (isBeginning && !wasBeginning) { 7857 swiper.emit('reachBeginning toEdge'); 7858 } 7859 if (isEnd && !wasEnd) { 7860 swiper.emit('reachEnd toEdge'); 7861 } 7862 if (wasBeginning && !isBeginning || wasEnd && !isEnd) { 7863 swiper.emit('fromEdge'); 7864 } 7865 swiper.emit('progress', progress); 7866 } 7867 7868 const toggleSlideClasses = (slideEl, condition, className) => { 7869 if (condition && !slideEl.classList.contains(className)) { 7870 slideEl.classList.add(className); 7871 } else if (!condition && slideEl.classList.contains(className)) { 7872 slideEl.classList.remove(className); 7873 } 7874 }; 7875 function updateSlidesClasses() { 7876 const swiper = this; 7877 const { 7878 slides, 7879 params, 7880 slidesEl, 7881 activeIndex 7882 } = swiper; 7883 const isVirtual = swiper.virtual && params.virtual.enabled; 7884 const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1; 7885 const getFilteredSlide = selector => { 7886 return elementChildren(slidesEl, `.${params.slideClass}${selector}, swiper-slide${selector}`)[0]; 7887 }; 7888 let activeSlide; 7889 let prevSlide; 7890 let nextSlide; 7891 if (isVirtual) { 7892 if (params.loop) { 7893 let slideIndex = activeIndex - swiper.virtual.slidesBefore; 7894 if (slideIndex < 0) slideIndex = swiper.virtual.slides.length + slideIndex; 7895 if (slideIndex >= swiper.virtual.slides.length) slideIndex -= swiper.virtual.slides.length; 7896 activeSlide = getFilteredSlide(`[data-swiper-slide-index="${slideIndex}"]`); 7897 } else { 7898 activeSlide = getFilteredSlide(`[data-swiper-slide-index="${activeIndex}"]`); 7899 } 7900 } else { 7901 if (gridEnabled) { 7902 activeSlide = slides.filter(slideEl => slideEl.column === activeIndex)[0]; 7903 nextSlide = slides.filter(slideEl => slideEl.column === activeIndex + 1)[0]; 7904 prevSlide = slides.filter(slideEl => slideEl.column === activeIndex - 1)[0]; 7905 } else { 7906 activeSlide = slides[activeIndex]; 7907 } 7908 } 7909 if (activeSlide) { 7910 if (!gridEnabled) { 7911 // Next Slide 7912 nextSlide = elementNextAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0]; 7913 if (params.loop && !nextSlide) { 7914 nextSlide = slides[0]; 7915 } 7916 7917 // Prev Slide 7918 prevSlide = elementPrevAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0]; 7919 if (params.loop && !prevSlide === 0) { 7920 prevSlide = slides[slides.length - 1]; 7921 } 7922 } 7923 } 7924 slides.forEach(slideEl => { 7925 toggleSlideClasses(slideEl, slideEl === activeSlide, params.slideActiveClass); 7926 toggleSlideClasses(slideEl, slideEl === nextSlide, params.slideNextClass); 7927 toggleSlideClasses(slideEl, slideEl === prevSlide, params.slidePrevClass); 7928 }); 7929 swiper.emitSlidesClasses(); 7930 } 7931 7932 const processLazyPreloader = (swiper, imageEl) => { 7933 if (!swiper || swiper.destroyed || !swiper.params) return; 7934 const slideSelector = () => swiper.isElement ? `swiper-slide` : `.${swiper.params.slideClass}`; 7935 const slideEl = imageEl.closest(slideSelector()); 7936 if (slideEl) { 7937 let lazyEl = slideEl.querySelector(`.${swiper.params.lazyPreloaderClass}`); 7938 if (!lazyEl && swiper.isElement) { 7939 if (slideEl.shadowRoot) { 7940 lazyEl = slideEl.shadowRoot.querySelector(`.${swiper.params.lazyPreloaderClass}`); 7941 } else { 7942 // init later 7943 requestAnimationFrame(() => { 7944 if (slideEl.shadowRoot) { 7945 lazyEl = slideEl.shadowRoot.querySelector(`.${swiper.params.lazyPreloaderClass}`); 7946 if (lazyEl) lazyEl.remove(); 7947 } 7948 }); 7949 } 7950 } 7951 if (lazyEl) lazyEl.remove(); 7952 } 7953 }; 7954 const unlazy = (swiper, index) => { 7955 if (!swiper.slides[index]) return; 7956 const imageEl = swiper.slides[index].querySelector('[loading="lazy"]'); 7957 if (imageEl) imageEl.removeAttribute('loading'); 7958 }; 7959 const preload = swiper => { 7960 if (!swiper || swiper.destroyed || !swiper.params) return; 7961 let amount = swiper.params.lazyPreloadPrevNext; 7962 const len = swiper.slides.length; 7963 if (!len || !amount || amount < 0) return; 7964 amount = Math.min(amount, len); 7965 const slidesPerView = swiper.params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : Math.ceil(swiper.params.slidesPerView); 7966 const activeIndex = swiper.activeIndex; 7967 if (swiper.params.grid && swiper.params.grid.rows > 1) { 7968 const activeColumn = activeIndex; 7969 const preloadColumns = [activeColumn - amount]; 7970 preloadColumns.push(...Array.from({ 7971 length: amount 7972 }).map((_, i) => { 7973 return activeColumn + slidesPerView + i; 7974 })); 7975 swiper.slides.forEach((slideEl, i) => { 7976 if (preloadColumns.includes(slideEl.column)) unlazy(swiper, i); 7977 }); 7978 return; 7979 } 7980 const slideIndexLastInView = activeIndex + slidesPerView - 1; 7981 if (swiper.params.rewind || swiper.params.loop) { 7982 for (let i = activeIndex - amount; i <= slideIndexLastInView + amount; i += 1) { 7983 const realIndex = (i % len + len) % len; 7984 if (realIndex < activeIndex || realIndex > slideIndexLastInView) unlazy(swiper, realIndex); 7985 } 7986 } else { 7987 for (let i = Math.max(activeIndex - amount, 0); i <= Math.min(slideIndexLastInView + amount, len - 1); i += 1) { 7988 if (i !== activeIndex && (i > slideIndexLastInView || i < activeIndex)) { 7989 unlazy(swiper, i); 7990 } 7991 } 7992 } 7993 }; 7994 7995 function getActiveIndexByTranslate(swiper) { 7996 const { 7997 slidesGrid, 7998 params 7999 } = swiper; 8000 const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate; 8001 let activeIndex; 8002 for (let i = 0; i < slidesGrid.length; i += 1) { 8003 if (typeof slidesGrid[i + 1] !== 'undefined') { 8004 if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1] - (slidesGrid[i + 1] - slidesGrid[i]) / 2) { 8005 activeIndex = i; 8006 } else if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1]) { 8007 activeIndex = i + 1; 8008 } 8009 } else if (translate >= slidesGrid[i]) { 8010 activeIndex = i; 8011 } 8012 } 8013 // Normalize slideIndex 8014 if (params.normalizeSlideIndex) { 8015 if (activeIndex < 0 || typeof activeIndex === 'undefined') activeIndex = 0; 8016 } 8017 return activeIndex; 8018 } 8019 function updateActiveIndex(newActiveIndex) { 8020 const swiper = this; 8021 const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate; 8022 const { 8023 snapGrid, 8024 params, 8025 activeIndex: previousIndex, 8026 realIndex: previousRealIndex, 8027 snapIndex: previousSnapIndex 8028 } = swiper; 8029 let activeIndex = newActiveIndex; 8030 let snapIndex; 8031 const getVirtualRealIndex = aIndex => { 8032 let realIndex = aIndex - swiper.virtual.slidesBefore; 8033 if (realIndex < 0) { 8034 realIndex = swiper.virtual.slides.length + realIndex; 8035 } 8036 if (realIndex >= swiper.virtual.slides.length) { 8037 realIndex -= swiper.virtual.slides.length; 8038 } 8039 return realIndex; 8040 }; 8041 if (typeof activeIndex === 'undefined') { 8042 activeIndex = getActiveIndexByTranslate(swiper); 8043 } 8044 if (snapGrid.indexOf(translate) >= 0) { 8045 snapIndex = snapGrid.indexOf(translate); 8046 } else { 8047 const skip = Math.min(params.slidesPerGroupSkip, activeIndex); 8048 snapIndex = skip + Math.floor((activeIndex - skip) / params.slidesPerGroup); 8049 } 8050 if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1; 8051 if (activeIndex === previousIndex && !swiper.params.loop) { 8052 if (snapIndex !== previousSnapIndex) { 8053 swiper.snapIndex = snapIndex; 8054 swiper.emit('snapIndexChange'); 8055 } 8056 return; 8057 } 8058 if (activeIndex === previousIndex && swiper.params.loop && swiper.virtual && swiper.params.virtual.enabled) { 8059 swiper.realIndex = getVirtualRealIndex(activeIndex); 8060 return; 8061 } 8062 const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1; 8063 8064 // Get real index 8065 let realIndex; 8066 if (swiper.virtual && params.virtual.enabled && params.loop) { 8067 realIndex = getVirtualRealIndex(activeIndex); 8068 } else if (gridEnabled) { 8069 const firstSlideInColumn = swiper.slides.filter(slideEl => slideEl.column === activeIndex)[0]; 8070 let activeSlideIndex = parseInt(firstSlideInColumn.getAttribute('data-swiper-slide-index'), 10); 8071 if (Number.isNaN(activeSlideIndex)) { 8072 activeSlideIndex = Math.max(swiper.slides.indexOf(firstSlideInColumn), 0); 8073 } 8074 realIndex = Math.floor(activeSlideIndex / params.grid.rows); 8075 } else if (swiper.slides[activeIndex]) { 8076 const slideIndex = swiper.slides[activeIndex].getAttribute('data-swiper-slide-index'); 8077 if (slideIndex) { 8078 realIndex = parseInt(slideIndex, 10); 8079 } else { 8080 realIndex = activeIndex; 8081 } 8082 } else { 8083 realIndex = activeIndex; 8084 } 8085 Object.assign(swiper, { 8086 previousSnapIndex, 8087 snapIndex, 8088 previousRealIndex, 8089 realIndex, 8090 previousIndex, 8091 activeIndex 8092 }); 8093 if (swiper.initialized) { 8094 preload(swiper); 8095 } 8096 swiper.emit('activeIndexChange'); 8097 swiper.emit('snapIndexChange'); 8098 if (swiper.initialized || swiper.params.runCallbacksOnInit) { 8099 if (previousRealIndex !== realIndex) { 8100 swiper.emit('realIndexChange'); 8101 } 8102 swiper.emit('slideChange'); 8103 } 8104 } 8105 8106 function updateClickedSlide(el, path) { 8107 const swiper = this; 8108 const params = swiper.params; 8109 let slide = el.closest(`.${params.slideClass}, swiper-slide`); 8110 if (!slide && swiper.isElement && path && path.length > 1 && path.includes(el)) {
vendor: 14,988 bytes, lines 8111-8593
8111 [...path.slice(path.indexOf(el) + 1, path.length)].forEach(pathEl => { 8112 if (!slide && pathEl.matches && pathEl.matches(`.${params.slideClass}, swiper-slide`)) { 8113 slide = pathEl; 8114 } 8115 }); 8116 } 8117 let slideFound = false; 8118 let slideIndex; 8119 if (slide) { 8120 for (let i = 0; i < swiper.slides.length; i += 1) { 8121 if (swiper.slides[i] === slide) { 8122 slideFound = true; 8123 slideIndex = i; 8124 break; 8125 } 8126 } 8127 } 8128 if (slide && slideFound) { 8129 swiper.clickedSlide = slide; 8130 if (swiper.virtual && swiper.params.virtual.enabled) { 8131 swiper.clickedIndex = parseInt(slide.getAttribute('data-swiper-slide-index'), 10); 8132 } else { 8133 swiper.clickedIndex = slideIndex; 8134 } 8135 } else { 8136 swiper.clickedSlide = undefined; 8137 swiper.clickedIndex = undefined; 8138 return; 8139 } 8140 if (params.slideToClickedSlide && swiper.clickedIndex !== undefined && swiper.clickedIndex !== swiper.activeIndex) { 8141 swiper.slideToClickedSlide(); 8142 } 8143 } 8144 8145 var update = { 8146 updateSize, 8147 updateSlides, 8148 updateAutoHeight, 8149 updateSlidesOffset, 8150 updateSlidesProgress, 8151 updateProgress, 8152 updateSlidesClasses, 8153 updateActiveIndex, 8154 updateClickedSlide 8155 }; 8156 8157 function getSwiperTranslate(axis) { 8158 if (axis === void 0) { 8159 axis = this.isHorizontal() ? 'x' : 'y'; 8160 } 8161 const swiper = this; 8162 const { 8163 params, 8164 rtlTranslate: rtl, 8165 translate, 8166 wrapperEl 8167 } = swiper; 8168 if (params.virtualTranslate) { 8169 return rtl ? -translate : translate; 8170 } 8171 if (params.cssMode) { 8172 return translate; 8173 } 8174 let currentTranslate = getTranslate(wrapperEl, axis); 8175 currentTranslate += swiper.cssOverflowAdjustment(); 8176 if (rtl) currentTranslate = -currentTranslate; 8177 return currentTranslate || 0; 8178 } 8179 8180 function setTranslate(translate, byController) { 8181 const swiper = this; 8182 const { 8183 rtlTranslate: rtl, 8184 params, 8185 wrapperEl, 8186 progress 8187 } = swiper; 8188 let x = 0; 8189 let y = 0; 8190 const z = 0; 8191 if (swiper.isHorizontal()) { 8192 x = rtl ? -translate : translate; 8193 } else { 8194 y = translate; 8195 } 8196 if (params.roundLengths) { 8197 x = Math.floor(x); 8198 y = Math.floor(y); 8199 } 8200 swiper.previousTranslate = swiper.translate; 8201 swiper.translate = swiper.isHorizontal() ? x : y; 8202 if (params.cssMode) { 8203 wrapperEl[swiper.isHorizontal() ? 'scrollLeft' : 'scrollTop'] = swiper.isHorizontal() ? -x : -y; 8204 } else if (!params.virtualTranslate) { 8205 if (swiper.isHorizontal()) { 8206 x -= swiper.cssOverflowAdjustment(); 8207 } else { 8208 y -= swiper.cssOverflowAdjustment(); 8209 } 8210 wrapperEl.style.transform = `translate3d(${x}px, ${y}px, ${z}px)`; 8211 } 8212 8213 // Check if we need to update progress 8214 let newProgress; 8215 const translatesDiff = swiper.maxTranslate() - swiper.minTranslate(); 8216 if (translatesDiff === 0) { 8217 newProgress = 0; 8218 } else { 8219 newProgress = (translate - swiper.minTranslate()) / translatesDiff; 8220 } 8221 if (newProgress !== progress) { 8222 swiper.updateProgress(translate); 8223 } 8224 swiper.emit('setTranslate', swiper.translate, byController); 8225 } 8226 8227 function minTranslate() { 8228 return -this.snapGrid[0]; 8229 } 8230 8231 function maxTranslate() { 8232 return -this.snapGrid[this.snapGrid.length - 1]; 8233 } 8234 8235 function translateTo(translate, speed, runCallbacks, translateBounds, internal) { 8236 if (translate === void 0) { 8237 translate = 0; 8238 } 8239 if (speed === void 0) { 8240 speed = this.params.speed; 8241 } 8242 if (runCallbacks === void 0) { 8243 runCallbacks = true; 8244 } 8245 if (translateBounds === void 0) { 8246 translateBounds = true; 8247 } 8248 const swiper = this; 8249 const { 8250 params, 8251 wrapperEl 8252 } = swiper; 8253 if (swiper.animating && params.preventInteractionOnTransition) { 8254 return false; 8255 } 8256 const minTranslate = swiper.minTranslate(); 8257 const maxTranslate = swiper.maxTranslate(); 8258 let newTranslate; 8259 if (translateBounds && translate > minTranslate) newTranslate = minTranslate;else if (translateBounds && translate < maxTranslate) newTranslate = maxTranslate;else newTranslate = translate; 8260 8261 // Update progress 8262 swiper.updateProgress(newTranslate); 8263 if (params.cssMode) { 8264 const isH = swiper.isHorizontal(); 8265 if (speed === 0) { 8266 wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -newTranslate; 8267 } else { 8268 if (!swiper.support.smoothScroll) { 8269 animateCSSModeScroll({ 8270 swiper, 8271 targetPosition: -newTranslate, 8272 side: isH ? 'left' : 'top' 8273 }); 8274 return true; 8275 } 8276 wrapperEl.scrollTo({ 8277 [isH ? 'left' : 'top']: -newTranslate, 8278 behavior: 'smooth' 8279 }); 8280 } 8281 return true; 8282 } 8283 if (speed === 0) { 8284 swiper.setTransition(0); 8285 swiper.setTranslate(newTranslate); 8286 if (runCallbacks) { 8287 swiper.emit('beforeTransitionStart', speed, internal); 8288 swiper.emit('transitionEnd'); 8289 } 8290 } else { 8291 swiper.setTransition(speed); 8292 swiper.setTranslate(newTranslate); 8293 if (runCallbacks) { 8294 swiper.emit('beforeTransitionStart', speed, internal); 8295 swiper.emit('transitionStart'); 8296 } 8297 if (!swiper.animating) { 8298 swiper.animating = true; 8299 if (!swiper.onTranslateToWrapperTransitionEnd) { 8300 swiper.onTranslateToWrapperTransitionEnd = function transitionEnd(e) { 8301 if (!swiper || swiper.destroyed) return; 8302 if (e.target !== this) return; 8303 swiper.wrapperEl.removeEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd); 8304 swiper.onTranslateToWrapperTransitionEnd = null; 8305 delete swiper.onTranslateToWrapperTransitionEnd; 8306 swiper.animating = false; 8307 if (runCallbacks) { 8308 swiper.emit('transitionEnd'); 8309 } 8310 }; 8311 } 8312 swiper.wrapperEl.addEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd); 8313 } 8314 } 8315 return true; 8316 } 8317 8318 var translate = { 8319 getTranslate: getSwiperTranslate, 8320 setTranslate, 8321 minTranslate, 8322 maxTranslate, 8323 translateTo 8324 }; 8325 8326 function setTransition(duration, byController) { 8327 const swiper = this; 8328 if (!swiper.params.cssMode) { 8329 swiper.wrapperEl.style.transitionDuration = `${duration}ms`; 8330 swiper.wrapperEl.style.transitionDelay = duration === 0 ? `0ms` : ''; 8331 } 8332 swiper.emit('setTransition', duration, byController); 8333 } 8334 8335 function transitionEmit(_ref) { 8336 let { 8337 swiper, 8338 runCallbacks, 8339 direction, 8340 step 8341 } = _ref; 8342 const { 8343 activeIndex, 8344 previousIndex 8345 } = swiper; 8346 let dir = direction; 8347 if (!dir) { 8348 if (activeIndex > previousIndex) dir = 'next';else if (activeIndex < previousIndex) dir = 'prev';else dir = 'reset'; 8349 } 8350 swiper.emit(`transition${step}`); 8351 if (runCallbacks && activeIndex !== previousIndex) { 8352 if (dir === 'reset') { 8353 swiper.emit(`slideResetTransition${step}`); 8354 return; 8355 } 8356 swiper.emit(`slideChangeTransition${step}`); 8357 if (dir === 'next') { 8358 swiper.emit(`slideNextTransition${step}`); 8359 } else { 8360 swiper.emit(`slidePrevTransition${step}`); 8361 } 8362 } 8363 } 8364 8365 function transitionStart(runCallbacks, direction) { 8366 if (runCallbacks === void 0) { 8367 runCallbacks = true; 8368 } 8369 const swiper = this; 8370 const { 8371 params 8372 } = swiper; 8373 if (params.cssMode) return; 8374 if (params.autoHeight) { 8375 swiper.updateAutoHeight(); 8376 } 8377 transitionEmit({ 8378 swiper, 8379 runCallbacks, 8380 direction, 8381 step: 'Start' 8382 }); 8383 } 8384 8385 function transitionEnd(runCallbacks, direction) { 8386 if (runCallbacks === void 0) { 8387 runCallbacks = true; 8388 } 8389 const swiper = this; 8390 const { 8391 params 8392 } = swiper; 8393 swiper.animating = false; 8394 if (params.cssMode) return; 8395 swiper.setTransition(0); 8396 transitionEmit({ 8397 swiper, 8398 runCallbacks, 8399 direction, 8400 step: 'End' 8401 }); 8402 } 8403 8404 var transition = { 8405 setTransition, 8406 transitionStart, 8407 transitionEnd 8408 }; 8409 8410 function slideTo(index, speed, runCallbacks, internal, initial) { 8411 if (index === void 0) { 8412 index = 0; 8413 } 8414 if (runCallbacks === void 0) { 8415 runCallbacks = true; 8416 } 8417 if (typeof index === 'string') { 8418 index = parseInt(index, 10); 8419 } 8420 const swiper = this; 8421 let slideIndex = index; 8422 if (slideIndex < 0) slideIndex = 0; 8423 const { 8424 params, 8425 snapGrid, 8426 slidesGrid, 8427 previousIndex, 8428 activeIndex, 8429 rtlTranslate: rtl, 8430 wrapperEl, 8431 enabled 8432 } = swiper; 8433 if (!enabled && !internal && !initial || swiper.destroyed || swiper.animating && params.preventInteractionOnTransition) { 8434 return false; 8435 } 8436 if (typeof speed === 'undefined') { 8437 speed = swiper.params.speed; 8438 } 8439 const skip = Math.min(swiper.params.slidesPerGroupSkip, slideIndex); 8440 let snapIndex = skip + Math.floor((slideIndex - skip) / swiper.params.slidesPerGroup); 8441 if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1; 8442 const translate = -snapGrid[snapIndex]; 8443 // Normalize slideIndex 8444 if (params.normalizeSlideIndex) { 8445 for (let i = 0; i < slidesGrid.length; i += 1) { 8446 const normalizedTranslate = -Math.floor(translate * 100); 8447 const normalizedGrid = Math.floor(slidesGrid[i] * 100); 8448 const normalizedGridNext = Math.floor(slidesGrid[i + 1] * 100); 8449 if (typeof slidesGrid[i + 1] !== 'undefined') { 8450 if (normalizedTranslate >= normalizedGrid && normalizedTranslate < normalizedGridNext - (normalizedGridNext - normalizedGrid) / 2) { 8451 slideIndex = i; 8452 } else if (normalizedTranslate >= normalizedGrid && normalizedTranslate < normalizedGridNext) { 8453 slideIndex = i + 1; 8454 } 8455 } else if (normalizedTranslate >= normalizedGrid) { 8456 slideIndex = i; 8457 } 8458 } 8459 } 8460 // Directions locks 8461 if (swiper.initialized && slideIndex !== activeIndex) { 8462 if (!swiper.allowSlideNext && (rtl ? translate > swiper.translate && translate > swiper.minTranslate() : translate < swiper.translate && translate < swiper.minTranslate())) { 8463 return false; 8464 } 8465 if (!swiper.allowSlidePrev && translate > swiper.translate && translate > swiper.maxTranslate()) { 8466 if ((activeIndex || 0) !== slideIndex) { 8467 return false; 8468 } 8469 } 8470 } 8471 if (slideIndex !== (previousIndex || 0) && runCallbacks) { 8472 swiper.emit('beforeSlideChangeStart'); 8473 } 8474 8475 // Update progress 8476 swiper.updateProgress(translate); 8477 let direction; 8478 if (slideIndex > activeIndex) direction = 'next';else if (slideIndex < activeIndex) direction = 'prev';else direction = 'reset'; 8479 8480 // initial virtual 8481 const isVirtual = swiper.virtual && swiper.params.virtual.enabled; 8482 const isInitialVirtual = isVirtual && initial; 8483 // Update Index 8484 if (!isInitialVirtual && (rtl && -translate === swiper.translate || !rtl && translate === swiper.translate)) { 8485 swiper.updateActiveIndex(slideIndex); 8486 // Update Height 8487 if (params.autoHeight) { 8488 swiper.updateAutoHeight(); 8489 } 8490 swiper.updateSlidesClasses(); 8491 if (params.effect !== 'slide') { 8492 swiper.setTranslate(translate); 8493 } 8494 if (direction !== 'reset') { 8495 swiper.transitionStart(runCallbacks, direction); 8496 swiper.transitionEnd(runCallbacks, direction); 8497 } 8498 return false; 8499 } 8500 if (params.cssMode) { 8501 const isH = swiper.isHorizontal(); 8502 const t = rtl ? translate : -translate; 8503 if (speed === 0) { 8504 if (isVirtual) { 8505 swiper.wrapperEl.style.scrollSnapType = 'none'; 8506 swiper._immediateVirtual = true; 8507 } 8508 if (isVirtual && !swiper._cssModeVirtualInitialSet && swiper.params.initialSlide > 0) { 8509 swiper._cssModeVirtualInitialSet = true; 8510 requestAnimationFrame(() => { 8511 wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = t; 8512 }); 8513 } else { 8514 wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = t; 8515 } 8516 if (isVirtual) { 8517 requestAnimationFrame(() => { 8518 swiper.wrapperEl.style.scrollSnapType = ''; 8519 swiper._immediateVirtual = false; 8520 }); 8521 } 8522 } else { 8523 if (!swiper.support.smoothScroll) { 8524 animateCSSModeScroll({ 8525 swiper, 8526 targetPosition: t, 8527 side: isH ? 'left' : 'top' 8528 }); 8529 return true; 8530 } 8531 wrapperEl.scrollTo({ 8532 [isH ? 'left' : 'top']: t, 8533 behavior: 'smooth' 8534 }); 8535 } 8536 return true; 8537 } 8538 swiper.setTransition(speed); 8539 swiper.setTranslate(translate); 8540 swiper.updateActiveIndex(slideIndex); 8541 swiper.updateSlidesClasses(); 8542 swiper.emit('beforeTransitionStart', speed, internal); 8543 swiper.transitionStart(runCallbacks, direction); 8544 if (speed === 0) { 8545 swiper.transitionEnd(runCallbacks, direction); 8546 } else if (!swiper.animating) { 8547 swiper.animating = true; 8548 if (!swiper.onSlideToWrapperTransitionEnd) { 8549 swiper.onSlideToWrapperTransitionEnd = function transitionEnd(e) { 8550 if (!swiper || swiper.destroyed) return; 8551 if (e.target !== this) return; 8552 swiper.wrapperEl.removeEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd); 8553 swiper.onSlideToWrapperTransitionEnd = null; 8554 delete swiper.onSlideToWrapperTransitionEnd; 8555 swiper.transitionEnd(runCallbacks, direction); 8556 }; 8557 } 8558 swiper.wrapperEl.addEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd); 8559 } 8560 return true; 8561 } 8562 8563 function slideToLoop(index, speed, runCallbacks, internal) { 8564 if (index === void 0) { 8565 index = 0; 8566 } 8567 if (runCallbacks === void 0) { 8568 runCallbacks = true; 8569 } 8570 if (typeof index === 'string') { 8571 const indexAsNumber = parseInt(index, 10); 8572 index = indexAsNumber; 8573 } 8574 const swiper = this; 8575 if (swiper.destroyed) return; 8576 if (typeof speed === 'undefined') { 8577 speed = swiper.params.speed; 8578 } 8579 const gridEnabled = swiper.grid && swiper.params.grid && swiper.params.grid.rows > 1; 8580 let newIndex = index; 8581 if (swiper.params.loop) { 8582 if (swiper.virtual && swiper.params.virtual.enabled) { 8583 // eslint-disable-next-line 8584 newIndex = newIndex + swiper.virtual.slidesBefore; 8585 } else { 8586 let targetSlideIndex; 8587 if (gridEnabled) { 8588 const slideIndex = newIndex * swiper.params.grid.rows; 8589 targetSlideIndex = swiper.slides.filter(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === slideIndex)[0].column; 8590 } else { 8591 targetSlideIndex = swiper.getSlideIndexByData(newIndex); 8592 } 8593 const cols = gridEnabled ? Math.ceil(swiper.slides.length /
vendor: 4,036 bytes, lines 8593-8703
8593swiper.params.grid.rows) : swiper.slides.length; 8594 const { 8595 centeredSlides 8596 } = swiper.params; 8597 let slidesPerView = swiper.params.slidesPerView; 8598 if (slidesPerView === 'auto') { 8599 slidesPerView = swiper.slidesPerViewDynamic(); 8600 } else { 8601 slidesPerView = Math.ceil(parseFloat(swiper.params.slidesPerView, 10)); 8602 if (centeredSlides && slidesPerView % 2 === 0) { 8603 slidesPerView = slidesPerView + 1; 8604 } 8605 } 8606 let needLoopFix = cols - targetSlideIndex < slidesPerView; 8607 if (centeredSlides) { 8608 needLoopFix = needLoopFix || targetSlideIndex < Math.ceil(slidesPerView / 2); 8609 } 8610 if (internal && centeredSlides && swiper.params.slidesPerView !== 'auto' && !gridEnabled) { 8611 needLoopFix = false; 8612 } 8613 if (needLoopFix) { 8614 const direction = centeredSlides ? targetSlideIndex < swiper.activeIndex ? 'prev' : 'next' : targetSlideIndex - swiper.activeIndex - 1 < swiper.params.slidesPerView ? 'next' : 'prev'; 8615 swiper.loopFix({ 8616 direction, 8617 slideTo: true, 8618 activeSlideIndex: direction === 'next' ? targetSlideIndex + 1 : targetSlideIndex - cols + 1, 8619 slideRealIndex: direction === 'next' ? swiper.realIndex : undefined 8620 }); 8621 } 8622 if (gridEnabled) { 8623 const slideIndex = newIndex * swiper.params.grid.rows; 8624 newIndex = swiper.slides.filter(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === slideIndex)[0].column; 8625 } else { 8626 newIndex = swiper.getSlideIndexByData(newIndex); 8627 } 8628 } 8629 } 8630 requestAnimationFrame(() => { 8631 swiper.slideTo(newIndex, speed, runCallbacks, internal); 8632 }); 8633 return swiper; 8634 } 8635 8636 /* eslint no-unused-vars: "off" */ 8637 function slideNext(speed, runCallbacks, internal) { 8638 if (runCallbacks === void 0) { 8639 runCallbacks = true; 8640 } 8641 const swiper = this; 8642 const { 8643 enabled, 8644 params, 8645 animating 8646 } = swiper; 8647 if (!enabled || swiper.destroyed) return swiper; 8648 if (typeof speed === 'undefined') { 8649 speed = swiper.params.speed; 8650 } 8651 let perGroup = params.slidesPerGroup; 8652 if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) { 8653 perGroup = Math.max(swiper.slidesPerViewDynamic('current', true), 1); 8654 } 8655 const increment = swiper.activeIndex < params.slidesPerGroupSkip ? 1 : perGroup; 8656 const isVirtual = swiper.virtual && params.virtual.enabled; 8657 if (params.loop) { 8658 if (animating && !isVirtual && params.loopPreventsSliding) return false; 8659 swiper.loopFix({ 8660 direction: 'next' 8661 }); 8662 // eslint-disable-next-line 8663 swiper._clientLeft = swiper.wrapperEl.clientLeft; 8664 if (swiper.activeIndex === swiper.slides.length - 1 && params.cssMode) { 8665 requestAnimationFrame(() => { 8666 swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal); 8667 }); 8668 return true; 8669 } 8670 } 8671 if (params.rewind && swiper.isEnd) { 8672 return swiper.slideTo(0, speed, runCallbacks, internal); 8673 } 8674 return swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal); 8675 } 8676 8677 /* eslint no-unused-vars: "off" */ 8678 function slidePrev(speed, runCallbacks, internal) { 8679 if (runCallbacks === void 0) { 8680 runCallbacks = true; 8681 } 8682 const swiper = this; 8683 const { 8684 params, 8685 snapGrid, 8686 slidesGrid, 8687 rtlTranslate, 8688 enabled, 8689 animating 8690 } = swiper; 8691 if (!enabled || swiper.destroyed) return swiper; 8692 if (typeof speed === 'undefined') { 8693 speed = swiper.params.speed; 8694 } 8695 const isVirtual = swiper.virtual && params.virtual.enabled; 8696 if (params.loop) { 8697 if (animating && !isVirtual && params.loopPreventsSliding) return false; 8698 swiper.loopFix({ 8699 direction: 'prev' 8700 }); 8701 // eslint-disable-next-line 8702 swiper._clientLeft = swiper.wrapperEl.clientLeft; 8703 }
vendor: 11,243 bytes, lines 8704-8977
8704 const translate = rtlTranslate ? swiper.translate : -swiper.translate; 8705 function normalize(val) { 8706 if (val < 0) return -Math.floor(Math.abs(val)); 8707 return Math.floor(val); 8708 } 8709 const normalizedTranslate = normalize(translate); 8710 const normalizedSnapGrid = snapGrid.map(val => normalize(val)); 8711 let prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1]; 8712 if (typeof prevSnap === 'undefined' && params.cssMode) { 8713 let prevSnapIndex; 8714 snapGrid.forEach((snap, snapIndex) => { 8715 if (normalizedTranslate >= snap) { 8716 // prevSnap = snap; 8717 prevSnapIndex = snapIndex; 8718 } 8719 }); 8720 if (typeof prevSnapIndex !== 'undefined') { 8721 prevSnap = snapGrid[prevSnapIndex > 0 ? prevSnapIndex - 1 : prevSnapIndex]; 8722 } 8723 } 8724 let prevIndex = 0; 8725 if (typeof prevSnap !== 'undefined') { 8726 prevIndex = slidesGrid.indexOf(prevSnap); 8727 if (prevIndex < 0) prevIndex = swiper.activeIndex - 1; 8728 if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) { 8729 prevIndex = prevIndex - swiper.slidesPerViewDynamic('previous', true) + 1; 8730 prevIndex = Math.max(prevIndex, 0); 8731 } 8732 } 8733 if (params.rewind && swiper.isBeginning) { 8734 const lastIndex = swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual ? swiper.virtual.slides.length - 1 : swiper.slides.length - 1; 8735 return swiper.slideTo(lastIndex, speed, runCallbacks, internal); 8736 } else if (params.loop && swiper.activeIndex === 0 && params.cssMode) { 8737 requestAnimationFrame(() => { 8738 swiper.slideTo(prevIndex, speed, runCallbacks, internal); 8739 }); 8740 return true; 8741 } 8742 return swiper.slideTo(prevIndex, speed, runCallbacks, internal); 8743 } 8744 8745 /* eslint no-unused-vars: "off" */ 8746 function slideReset(speed, runCallbacks, internal) { 8747 if (runCallbacks === void 0) { 8748 runCallbacks = true; 8749 } 8750 const swiper = this; 8751 if (swiper.destroyed) return; 8752 if (typeof speed === 'undefined') { 8753 speed = swiper.params.speed; 8754 } 8755 return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal); 8756 } 8757 8758 /* eslint no-unused-vars: "off" */ 8759 function slideToClosest(speed, runCallbacks, internal, threshold) { 8760 if (runCallbacks === void 0) { 8761 runCallbacks = true; 8762 } 8763 if (threshold === void 0) { 8764 threshold = 0.5; 8765 } 8766 const swiper = this; 8767 if (swiper.destroyed) return; 8768 if (typeof speed === 'undefined') { 8769 speed = swiper.params.speed; 8770 } 8771 let index = swiper.activeIndex; 8772 const skip = Math.min(swiper.params.slidesPerGroupSkip, index); 8773 const snapIndex = skip + Math.floor((index - skip) / swiper.params.slidesPerGroup); 8774 const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate; 8775 if (translate >= swiper.snapGrid[snapIndex]) { 8776 // The current translate is on or after the current snap index, so the choice 8777 // is between the current index and the one after it. 8778 const currentSnap = swiper.snapGrid[snapIndex]; 8779 const nextSnap = swiper.snapGrid[snapIndex + 1]; 8780 if (translate - currentSnap > (nextSnap - currentSnap) * threshold) { 8781 index += swiper.params.slidesPerGroup; 8782 } 8783 } else { 8784 // The current translate is before the current snap index, so the choice 8785 // is between the current index and the one before it. 8786 const prevSnap = swiper.snapGrid[snapIndex - 1]; 8787 const currentSnap = swiper.snapGrid[snapIndex]; 8788 if (translate - prevSnap <= (currentSnap - prevSnap) * threshold) { 8789 index -= swiper.params.slidesPerGroup; 8790 } 8791 } 8792 index = Math.max(index, 0); 8793 index = Math.min(index, swiper.slidesGrid.length - 1); 8794 return swiper.slideTo(index, speed, runCallbacks, internal); 8795 } 8796 8797 function slideToClickedSlide() { 8798 const swiper = this; 8799 if (swiper.destroyed) return; 8800 const { 8801 params, 8802 slidesEl 8803 } = swiper; 8804 const slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : params.slidesPerView; 8805 let slideToIndex = swiper.clickedIndex; 8806 let realIndex; 8807 const slideSelector = swiper.isElement ? `swiper-slide` : `.${params.slideClass}`; 8808 if (params.loop) { 8809 if (swiper.animating) return; 8810 realIndex = parseInt(swiper.clickedSlide.getAttribute('data-swiper-slide-index'), 10); 8811 if (params.centeredSlides) { 8812 if (slideToIndex < swiper.loopedSlides - slidesPerView / 2 || slideToIndex > swiper.slides.length - swiper.loopedSlides + slidesPerView / 2) { 8813 swiper.loopFix(); 8814 slideToIndex = swiper.getSlideIndex(elementChildren(slidesEl, `${slideSelector}[data-swiper-slide-index="${realIndex}"]`)[0]); 8815 nextTick(() => { 8816 swiper.slideTo(slideToIndex); 8817 }); 8818 } else { 8819 swiper.slideTo(slideToIndex); 8820 } 8821 } else if (slideToIndex > swiper.slides.length - slidesPerView) { 8822 swiper.loopFix(); 8823 slideToIndex = swiper.getSlideIndex(elementChildren(slidesEl, `${slideSelector}[data-swiper-slide-index="${realIndex}"]`)[0]); 8824 nextTick(() => { 8825 swiper.slideTo(slideToIndex); 8826 }); 8827 } else { 8828 swiper.slideTo(slideToIndex); 8829 } 8830 } else { 8831 swiper.slideTo(slideToIndex); 8832 } 8833 } 8834 8835 var slide = { 8836 slideTo, 8837 slideToLoop, 8838 slideNext, 8839 slidePrev, 8840 slideReset, 8841 slideToClosest, 8842 slideToClickedSlide 8843 }; 8844 8845 function loopCreate(slideRealIndex) { 8846 const swiper = this; 8847 const { 8848 params, 8849 slidesEl 8850 } = swiper; 8851 if (!params.loop || swiper.virtual && swiper.params.virtual.enabled) return; 8852 const initSlides = () => { 8853 const slides = elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`); 8854 slides.forEach((el, index) => { 8855 el.setAttribute('data-swiper-slide-index', index); 8856 }); 8857 }; 8858 const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1; 8859 const slidesPerGroup = params.slidesPerGroup * (gridEnabled ? params.grid.rows : 1); 8860 const shouldFillGroup = swiper.slides.length % slidesPerGroup !== 0; 8861 const shouldFillGrid = gridEnabled && swiper.slides.length % params.grid.rows !== 0; 8862 const addBlankSlides = amountOfSlides => { 8863 for (let i = 0; i < amountOfSlides; i += 1) { 8864 const slideEl = swiper.isElement ? createElement('swiper-slide', [params.slideBlankClass]) : createElement('div', [params.slideClass, params.slideBlankClass]); 8865 swiper.slidesEl.append(slideEl); 8866 } 8867 }; 8868 if (shouldFillGroup) { 8869 if (params.loopAddBlankSlides) { 8870 const slidesToAdd = slidesPerGroup - swiper.slides.length % slidesPerGroup; 8871 addBlankSlides(slidesToAdd); 8872 swiper.recalcSlides(); 8873 swiper.updateSlides(); 8874 } else { 8875 showWarning('Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)'); 8876 } 8877 initSlides(); 8878 } else if (shouldFillGrid) { 8879 if (params.loopAddBlankSlides) { 8880 const slidesToAdd = params.grid.rows - swiper.slides.length % params.grid.rows; 8881 addBlankSlides(slidesToAdd); 8882 swiper.recalcSlides(); 8883 swiper.updateSlides(); 8884 } else { 8885 showWarning('Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)'); 8886 } 8887 initSlides(); 8888 } else { 8889 initSlides(); 8890 } 8891 swiper.loopFix({ 8892 slideRealIndex, 8893 direction: params.centeredSlides ? undefined : 'next' 8894 }); 8895 } 8896 8897 function loopFix(_temp) { 8898 let { 8899 slideRealIndex, 8900 slideTo = true, 8901 direction, 8902 setTranslate, 8903 activeSlideIndex, 8904 byController, 8905 byMousewheel 8906 } = _temp === void 0 ? {} : _temp; 8907 const swiper = this; 8908 if (!swiper.params.loop) return; 8909 swiper.emit('beforeLoopFix'); 8910 const { 8911 slides, 8912 allowSlidePrev, 8913 allowSlideNext, 8914 slidesEl, 8915 params 8916 } = swiper; 8917 const { 8918 centeredSlides 8919 } = params; 8920 swiper.allowSlidePrev = true; 8921 swiper.allowSlideNext = true; 8922 if (swiper.virtual && params.virtual.enabled) { 8923 if (slideTo) { 8924 if (!params.centeredSlides && swiper.snapIndex === 0) { 8925 swiper.slideTo(swiper.virtual.slides.length, 0, false, true); 8926 } else if (params.centeredSlides && swiper.snapIndex < params.slidesPerView) { 8927 swiper.slideTo(swiper.virtual.slides.length + swiper.snapIndex, 0, false, true); 8928 } else if (swiper.snapIndex === swiper.snapGrid.length - 1) { 8929 swiper.slideTo(swiper.virtual.slidesBefore, 0, false, true); 8930 } 8931 } 8932 swiper.allowSlidePrev = allowSlidePrev; 8933 swiper.allowSlideNext = allowSlideNext; 8934 swiper.emit('loopFix'); 8935 return; 8936 } 8937 let slidesPerView = params.slidesPerView; 8938 if (slidesPerView === 'auto') { 8939 slidesPerView = swiper.slidesPerViewDynamic(); 8940 } else { 8941 slidesPerView = Math.ceil(parseFloat(params.slidesPerView, 10)); 8942 if (centeredSlides && slidesPerView % 2 === 0) { 8943 slidesPerView = slidesPerView + 1; 8944 } 8945 } 8946 const slidesPerGroup = params.slidesPerGroupAuto ? slidesPerView : params.slidesPerGroup; 8947 let loopedSlides = slidesPerGroup; 8948 if (loopedSlides % slidesPerGroup !== 0) { 8949 loopedSlides += slidesPerGroup - loopedSlides % slidesPerGroup; 8950 } 8951 loopedSlides += params.loopAdditionalSlides; 8952 swiper.loopedSlides = loopedSlides; 8953 const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1; 8954 if (slides.length < slidesPerView + loopedSlides) { 8955 showWarning('Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled and not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters'); 8956 } else if (gridEnabled && params.grid.fill === 'row') { 8957 showWarning('Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`'); 8958 } 8959 const prependSlidesIndexes = []; 8960 const appendSlidesIndexes = []; 8961 let activeIndex = swiper.activeIndex; 8962 if (typeof activeSlideIndex === 'undefined') { 8963 activeSlideIndex = swiper.getSlideIndex(slides.filter(el => el.classList.contains(params.slideActiveClass))[0]); 8964 } else { 8965 activeIndex = activeSlideIndex; 8966 } 8967 const isNext = direction === 'next' || !direction; 8968 const isPrev = direction === 'prev' || !direction; 8969 let slidesPrepended = 0; 8970 let slidesAppended = 0; 8971 const cols = gridEnabled ? Math.ceil(slides.length / params.grid.rows) : slides.length; 8972 const activeColIndex = gridEnabled ? slides[activeSlideIndex].column : activeSlideIndex; 8973 const activeColIndexWithShift = activeColIndex + (centeredSlides && typeof setTranslate === 'undefined' ? -slidesPerView / 2 + 0.5 : 0); 8974 // prepend last slides before start 8975 if (activeColIndexWithShift < loopedSlides) { 8976 slidesPrepended = Math.max(loopedSlides - activeColIndexWithShift, slidesPerGroup); 8977 for (let i = 0; i < loopedSlides - activeColIndexWithShift; i += 1) {
vendor: 15,687 bytes, lines 8978-9406
8978 const index = i - Math.floor(i / cols) * cols; 8979 if (gridEnabled) { 8980 const colIndexToPrepend = cols - index - 1; 8981 for (let i = slides.length - 1; i >= 0; i -= 1) { 8982 if (slides[i].column === colIndexToPrepend) prependSlidesIndexes.push(i); 8983 } 8984 // slides.forEach((slide, slideIndex) => { 8985 // if (slide.column === colIndexToPrepend) prependSlidesIndexes.push(slideIndex); 8986 // }); 8987 } else { 8988 prependSlidesIndexes.push(cols - index - 1); 8989 } 8990 } 8991 } else if (activeColIndexWithShift + slidesPerView > cols - loopedSlides) { 8992 slidesAppended = Math.max(activeColIndexWithShift - (cols - loopedSlides * 2), slidesPerGroup); 8993 for (let i = 0; i < slidesAppended; i += 1) { 8994 const index = i - Math.floor(i / cols) * cols; 8995 if (gridEnabled) { 8996 slides.forEach((slide, slideIndex) => { 8997 if (slide.column === index) appendSlidesIndexes.push(slideIndex); 8998 }); 8999 } else { 9000 appendSlidesIndexes.push(index); 9001 } 9002 } 9003 } 9004 swiper.__preventObserver__ = true; 9005 requestAnimationFrame(() => { 9006 swiper.__preventObserver__ = false; 9007 }); 9008 if (isPrev) { 9009 prependSlidesIndexes.forEach(index => { 9010 slides[index].swiperLoopMoveDOM = true; 9011 slidesEl.prepend(slides[index]); 9012 slides[index].swiperLoopMoveDOM = false; 9013 }); 9014 } 9015 if (isNext) { 9016 appendSlidesIndexes.forEach(index => { 9017 slides[index].swiperLoopMoveDOM = true; 9018 slidesEl.append(slides[index]); 9019 slides[index].swiperLoopMoveDOM = false; 9020 }); 9021 } 9022 swiper.recalcSlides(); 9023 if (params.slidesPerView === 'auto') { 9024 swiper.updateSlides(); 9025 } else if (gridEnabled && (prependSlidesIndexes.length > 0 && isPrev || appendSlidesIndexes.length > 0 && isNext)) { 9026 swiper.slides.forEach((slide, slideIndex) => { 9027 swiper.grid.updateSlide(slideIndex, slide, swiper.slides); 9028 }); 9029 } 9030 if (params.watchSlidesProgress) { 9031 swiper.updateSlidesOffset(); 9032 } 9033 if (slideTo) { 9034 if (prependSlidesIndexes.length > 0 && isPrev) { 9035 if (typeof slideRealIndex === 'undefined') { 9036 const currentSlideTranslate = swiper.slidesGrid[activeIndex]; 9037 const newSlideTranslate = swiper.slidesGrid[activeIndex + slidesPrepended]; 9038 const diff = newSlideTranslate - currentSlideTranslate; 9039 if (byMousewheel) { 9040 swiper.setTranslate(swiper.translate - diff); 9041 } else { 9042 swiper.slideTo(activeIndex + Math.ceil(slidesPrepended), 0, false, true); 9043 if (setTranslate) { 9044 swiper.touchEventsData.startTranslate = swiper.touchEventsData.startTranslate - diff; 9045 swiper.touchEventsData.currentTranslate = swiper.touchEventsData.currentTranslate - diff; 9046 } 9047 } 9048 } else { 9049 if (setTranslate) { 9050 const shift = gridEnabled ? prependSlidesIndexes.length / params.grid.rows : prependSlidesIndexes.length; 9051 swiper.slideTo(swiper.activeIndex + shift, 0, false, true); 9052 swiper.touchEventsData.currentTranslate = swiper.translate; 9053 } 9054 } 9055 } else if (appendSlidesIndexes.length > 0 && isNext) { 9056 if (typeof slideRealIndex === 'undefined') { 9057 const currentSlideTranslate = swiper.slidesGrid[activeIndex]; 9058 const newSlideTranslate = swiper.slidesGrid[activeIndex - slidesAppended]; 9059 const diff = newSlideTranslate - currentSlideTranslate; 9060 if (byMousewheel) { 9061 swiper.setTranslate(swiper.translate - diff); 9062 } else { 9063 swiper.slideTo(activeIndex - slidesAppended, 0, false, true); 9064 if (setTranslate) { 9065 swiper.touchEventsData.startTranslate = swiper.touchEventsData.startTranslate - diff; 9066 swiper.touchEventsData.currentTranslate = swiper.touchEventsData.currentTranslate - diff; 9067 } 9068 } 9069 } else { 9070 const shift = gridEnabled ? appendSlidesIndexes.length / params.grid.rows : appendSlidesIndexes.length; 9071 swiper.slideTo(swiper.activeIndex - shift, 0, false, true); 9072 } 9073 } 9074 } 9075 swiper.allowSlidePrev = allowSlidePrev; 9076 swiper.allowSlideNext = allowSlideNext; 9077 if (swiper.controller && swiper.controller.control && !byController) { 9078 const loopParams = { 9079 slideRealIndex, 9080 direction, 9081 setTranslate, 9082 activeSlideIndex, 9083 byController: true 9084 }; 9085 if (Array.isArray(swiper.controller.control)) { 9086 swiper.controller.control.forEach(c => { 9087 if (!c.destroyed && c.params.loop) c.loopFix({ 9088 ...loopParams, 9089 slideTo: c.params.slidesPerView === params.slidesPerView ? slideTo : false 9090 }); 9091 }); 9092 } else if (swiper.controller.control instanceof swiper.constructor && swiper.controller.control.params.loop) { 9093 swiper.controller.control.loopFix({ 9094 ...loopParams, 9095 slideTo: swiper.controller.control.params.slidesPerView === params.slidesPerView ? slideTo : false 9096 }); 9097 } 9098 } 9099 swiper.emit('loopFix'); 9100 } 9101 9102 function loopDestroy() { 9103 const swiper = this; 9104 const { 9105 params, 9106 slidesEl 9107 } = swiper; 9108 if (!params.loop || swiper.virtual && swiper.params.virtual.enabled) return; 9109 swiper.recalcSlides(); 9110 const newSlidesOrder = []; 9111 swiper.slides.forEach(slideEl => { 9112 const index = typeof slideEl.swiperSlideIndex === 'undefined' ? slideEl.getAttribute('data-swiper-slide-index') * 1 : slideEl.swiperSlideIndex; 9113 newSlidesOrder[index] = slideEl; 9114 }); 9115 swiper.slides.forEach(slideEl => { 9116 slideEl.removeAttribute('data-swiper-slide-index'); 9117 }); 9118 newSlidesOrder.forEach(slideEl => { 9119 slidesEl.append(slideEl); 9120 }); 9121 swiper.recalcSlides(); 9122 swiper.slideTo(swiper.realIndex, 0); 9123 } 9124 9125 var loop = { 9126 loopCreate, 9127 loopFix, 9128 loopDestroy 9129 }; 9130 9131 function setGrabCursor(moving) { 9132 const swiper = this; 9133 if (!swiper.params.simulateTouch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) return; 9134 const el = swiper.params.touchEventsTarget === 'container' ? swiper.el : swiper.wrapperEl; 9135 if (swiper.isElement) { 9136 swiper.__preventObserver__ = true; 9137 } 9138 el.style.cursor = 'move'; 9139 el.style.cursor = moving ? 'grabbing' : 'grab'; 9140 if (swiper.isElement) { 9141 requestAnimationFrame(() => { 9142 swiper.__preventObserver__ = false; 9143 }); 9144 } 9145 } 9146 9147 function unsetGrabCursor() { 9148 const swiper = this; 9149 if (swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) { 9150 return; 9151 } 9152 if (swiper.isElement) { 9153 swiper.__preventObserver__ = true; 9154 } 9155 swiper[swiper.params.touchEventsTarget === 'container' ? 'el' : 'wrapperEl'].style.cursor = ''; 9156 if (swiper.isElement) { 9157 requestAnimationFrame(() => { 9158 swiper.__preventObserver__ = false; 9159 }); 9160 } 9161 } 9162 9163 var grabCursor = { 9164 setGrabCursor, 9165 unsetGrabCursor 9166 }; 9167 9168 // Modified from https://stackoverflow.com/questions/54520554/custom-element-getrootnode-closest-function-crossing-multiple-parent-shadowd 9169 function closestElement(selector, base) { 9170 if (base === void 0) { 9171 base = this; 9172 } 9173 function __closestFrom(el) { 9174 if (!el || el === getDocument() || el === getWindow()) return null; 9175 if (el.assignedSlot) el = el.assignedSlot; 9176 const found = el.closest(selector); 9177 if (!found && !el.getRootNode) { 9178 return null; 9179 } 9180 return found || __closestFrom(el.getRootNode().host); 9181 } 9182 return __closestFrom(base); 9183 } 9184 function preventEdgeSwipe(swiper, event, startX) { 9185 const window = getWindow(); 9186 const { 9187 params 9188 } = swiper; 9189 const edgeSwipeDetection = params.edgeSwipeDetection; 9190 const edgeSwipeThreshold = params.edgeSwipeThreshold; 9191 if (edgeSwipeDetection && (startX <= edgeSwipeThreshold || startX >= window.innerWidth - edgeSwipeThreshold)) { 9192 if (edgeSwipeDetection === 'prevent') { 9193 event.preventDefault(); 9194 return true; 9195 } 9196 return false; 9197 } 9198 return true; 9199 } 9200 function onTouchStart(event) { 9201 const swiper = this; 9202 const document = getDocument(); 9203 let e = event; 9204 if (e.originalEvent) e = e.originalEvent; 9205 const data = swiper.touchEventsData; 9206 if (e.type === 'pointerdown') { 9207 if (data.pointerId !== null && data.pointerId !== e.pointerId) { 9208 return; 9209 } 9210 data.pointerId = e.pointerId; 9211 } else if (e.type === 'touchstart' && e.targetTouches.length === 1) { 9212 data.touchId = e.targetTouches[0].identifier; 9213 } 9214 if (e.type === 'touchstart') { 9215 // don't proceed touch event 9216 preventEdgeSwipe(swiper, e, e.targetTouches[0].pageX); 9217 return; 9218 } 9219 const { 9220 params, 9221 touches, 9222 enabled 9223 } = swiper; 9224 if (!enabled) return; 9225 if (!params.simulateTouch && e.pointerType === 'mouse') return; 9226 if (swiper.animating && params.preventInteractionOnTransition) { 9227 return; 9228 } 9229 if (!swiper.animating && params.cssMode && params.loop) { 9230 swiper.loopFix(); 9231 } 9232 let targetEl = e.target; 9233 if (params.touchEventsTarget === 'wrapper') { 9234 if (!elementIsChildOf(targetEl, swiper.wrapperEl)) return; 9235 } 9236 if ('which' in e && e.which === 3) return; 9237 if ('button' in e && e.button > 0) return; 9238 if (data.isTouched && data.isMoved) return; 9239 9240 // change target el for shadow root component 9241 const swipingClassHasValue = !!params.noSwipingClass && params.noSwipingClass !== ''; 9242 // eslint-disable-next-line 9243 const eventPath = e.composedPath ? e.composedPath() : e.path; 9244 if (swipingClassHasValue && e.target && e.target.shadowRoot && eventPath) { 9245 targetEl = eventPath[0]; 9246 } 9247 const noSwipingSelector = params.noSwipingSelector ? params.noSwipingSelector : `.${params.noSwipingClass}`; 9248 const isTargetShadow = !!(e.target && e.target.shadowRoot); 9249 9250 // use closestElement for shadow root element to get the actual closest for nested shadow root element 9251 if (params.noSwiping && (isTargetShadow ? closestElement(noSwipingSelector, targetEl) : targetEl.closest(noSwipingSelector))) { 9252 swiper.allowClick = true; 9253 return; 9254 } 9255 if (params.swipeHandler) { 9256 if (!targetEl.closest(params.swipeHandler)) return; 9257 } 9258 touches.currentX = e.pageX; 9259 touches.currentY = e.pageY; 9260 const startX = touches.currentX; 9261 const startY = touches.currentY; 9262 9263 // Do NOT start if iOS edge swipe is detected. Otherwise iOS app cannot swipe-to-go-back anymore 9264 9265 if (!preventEdgeSwipe(swiper, e, startX)) { 9266 return; 9267 } 9268 Object.assign(data, { 9269 isTouched: true, 9270 isMoved: false, 9271 allowTouchCallbacks: true, 9272 isScrolling: undefined, 9273 startMoving: undefined 9274 }); 9275 touches.startX = startX; 9276 touches.startY = startY; 9277 data.touchStartTime = now(); 9278 swiper.allowClick = true; 9279 swiper.updateSize(); 9280 swiper.swipeDirection = undefined; 9281 if (params.threshold > 0) data.allowThresholdMove = false; 9282 let preventDefault = true; 9283 if (targetEl.matches(data.focusableElements)) { 9284 preventDefault = false; 9285 if (targetEl.nodeName === 'SELECT') { 9286 data.isTouched = false; 9287 } 9288 } 9289 if (document.activeElement && document.activeElement.matches(data.focusableElements) && document.activeElement !== targetEl) { 9290 document.activeElement.blur(); 9291 } 9292 const shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault; 9293 if ((params.touchStartForcePreventDefault || shouldPreventDefault) && !targetEl.isContentEditable) { 9294 e.preventDefault(); 9295 } 9296 if (params.freeMode && params.freeMode.enabled && swiper.freeMode && swiper.animating && !params.cssMode) { 9297 swiper.freeMode.onTouchStart(); 9298 } 9299 swiper.emit('touchStart', e); 9300 } 9301 9302 function onTouchMove(event) { 9303 const document = getDocument(); 9304 const swiper = this; 9305 const data = swiper.touchEventsData; 9306 const { 9307 params, 9308 touches, 9309 rtlTranslate: rtl, 9310 enabled 9311 } = swiper; 9312 if (!enabled) return; 9313 if (!params.simulateTouch && event.pointerType === 'mouse') return; 9314 let e = event; 9315 if (e.originalEvent) e = e.originalEvent; 9316 if (e.type === 'pointermove') { 9317 if (data.touchId !== null) return; // return from pointer if we use touch 9318 const id = e.pointerId; 9319 if (id !== data.pointerId) return; 9320 } 9321 let targetTouch; 9322 if (e.type === 'touchmove') { 9323 targetTouch = [...e.changedTouches].filter(t => t.identifier === data.touchId)[0]; 9324 if (!targetTouch || targetTouch.identifier !== data.touchId) return; 9325 } else { 9326 targetTouch = e; 9327 } 9328 if (!data.isTouched) { 9329 if (data.startMoving && data.isScrolling) { 9330 swiper.emit('touchMoveOpposite', e); 9331 } 9332 return; 9333 } 9334 const pageX = targetTouch.pageX; 9335 const pageY = targetTouch.pageY; 9336 if (e.preventedByNestedSwiper) { 9337 touches.startX = pageX; 9338 touches.startY = pageY; 9339 return; 9340 } 9341 if (!swiper.allowTouchMove) { 9342 if (!e.target.matches(data.focusableElements)) { 9343 swiper.allowClick = false; 9344 } 9345 if (data.isTouched) { 9346 Object.assign(touches, { 9347 startX: pageX, 9348 startY: pageY, 9349 currentX: pageX, 9350 currentY: pageY 9351 }); 9352 data.touchStartTime = now(); 9353 } 9354 return; 9355 } 9356 if (params.touchReleaseOnEdges && !params.loop) { 9357 if (swiper.isVertical()) { 9358 // Vertical 9359 if (pageY < touches.startY && swiper.translate <= swiper.maxTranslate() || pageY > touches.startY && swiper.translate >= swiper.minTranslate()) { 9360 data.isTouched = false; 9361 data.isMoved = false; 9362 return; 9363 } 9364 } else if (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate()) { 9365 return; 9366 } 9367 } 9368 if (document.activeElement) { 9369 if (e.target === document.activeElement && e.target.matches(data.focusableElements)) { 9370 data.isMoved = true; 9371 swiper.allowClick = false; 9372 return; 9373 } 9374 } 9375 if (data.allowTouchCallbacks) { 9376 swiper.emit('touchMove', e); 9377 } 9378 touches.previousX = touches.currentX; 9379 touches.previousY = touches.currentY; 9380 touches.currentX = pageX; 9381 touches.currentY = pageY; 9382 const diffX = touches.currentX - touches.startX; 9383 const diffY = touches.currentY - touches.startY; 9384 if (swiper.params.threshold && Math.sqrt(diffX ** 2 + diffY ** 2) < swiper.params.threshold) return; 9385 if (typeof data.isScrolling === 'undefined') { 9386 let touchAngle; 9387 if (swiper.isHorizontal() && touches.currentY === touches.startY || swiper.isVertical() && touches.currentX === touches.startX) { 9388 data.isScrolling = false; 9389 } else { 9390 // eslint-disable-next-line 9391 if (diffX * diffX + diffY * diffY >= 25) { 9392 touchAngle = Math.atan2(Math.abs(diffY), Math.abs(diffX)) * 180 / Math.PI; 9393 data.isScrolling = swiper.isHorizontal() ? touchAngle > params.touchAngle : 90 - touchAngle > params.touchAngle; 9394 } 9395 } 9396 } 9397 if (data.isScrolling) { 9398 swiper.emit('touchMoveOpposite', e); 9399 } 9400 if (typeof data.startMoving === 'undefined') { 9401 if (touches.currentX !== touches.startX || touches.currentY !== touches.startY) { 9402 data.startMoving = true; 9403 } 9404 } 9405 if (data.isScrolling || e.type === 'touchmove' && data.preventTouchMoveFromPointerMove) { 9406 data.isTouched = false;
vendor: 7,492 bytes, lines 9407-9594
9407 return; 9408 } 9409 if (!data.startMoving) { 9410 return; 9411 } 9412 swiper.allowClick = false; 9413 if (!params.cssMode && e.cancelable) { 9414 e.preventDefault(); 9415 } 9416 if (params.touchMoveStopPropagation && !params.nested) { 9417 e.stopPropagation(); 9418 } 9419 let diff = swiper.isHorizontal() ? diffX : diffY; 9420 let touchesDiff = swiper.isHorizontal() ? touches.currentX - touches.previousX : touches.currentY - touches.previousY; 9421 if (params.oneWayMovement) { 9422 diff = Math.abs(diff) * (rtl ? 1 : -1); 9423 touchesDiff = Math.abs(touchesDiff) * (rtl ? 1 : -1); 9424 } 9425 touches.diff = diff; 9426 diff *= params.touchRatio; 9427 if (rtl) { 9428 diff = -diff; 9429 touchesDiff = -touchesDiff; 9430 } 9431 const prevTouchesDirection = swiper.touchesDirection; 9432 swiper.swipeDirection = diff > 0 ? 'prev' : 'next'; 9433 swiper.touchesDirection = touchesDiff > 0 ? 'prev' : 'next'; 9434 const isLoop = swiper.params.loop && !params.cssMode; 9435 const allowLoopFix = swiper.touchesDirection === 'next' && swiper.allowSlideNext || swiper.touchesDirection === 'prev' && swiper.allowSlidePrev; 9436 if (!data.isMoved) { 9437 if (isLoop && allowLoopFix) { 9438 swiper.loopFix({ 9439 direction: swiper.swipeDirection 9440 }); 9441 } 9442 data.startTranslate = swiper.getTranslate(); 9443 swiper.setTransition(0); 9444 if (swiper.animating) { 9445 const evt = new window.CustomEvent('transitionend', { 9446 bubbles: true, 9447 cancelable: true, 9448 detail: { 9449 bySwiperTouchMove: true 9450 } 9451 }); 9452 swiper.wrapperEl.dispatchEvent(evt); 9453 } 9454 data.allowMomentumBounce = false; 9455 // Grab Cursor 9456 if (params.grabCursor && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) { 9457 swiper.setGrabCursor(true); 9458 } 9459 swiper.emit('sliderFirstMove', e); 9460 } 9461 let loopFixed; 9462 new Date().getTime(); 9463 if (data.isMoved && data.allowThresholdMove && prevTouchesDirection !== swiper.touchesDirection && isLoop && allowLoopFix && Math.abs(diff) >= 1) { 9464 Object.assign(touches, { 9465 startX: pageX, 9466 startY: pageY, 9467 currentX: pageX, 9468 currentY: pageY, 9469 startTranslate: data.currentTranslate 9470 }); 9471 data.loopSwapReset = true; 9472 data.startTranslate = data.currentTranslate; 9473 return; 9474 } 9475 swiper.emit('sliderMove', e); 9476 data.isMoved = true; 9477 data.currentTranslate = diff + data.startTranslate; 9478 let disableParentSwiper = true; 9479 let resistanceRatio = params.resistanceRatio; 9480 if (params.touchReleaseOnEdges) { 9481 resistanceRatio = 0; 9482 } 9483 if (diff > 0) { 9484 if (isLoop && allowLoopFix && !loopFixed && data.allowThresholdMove && data.currentTranslate > (params.centeredSlides ? swiper.minTranslate() - swiper.slidesSizesGrid[swiper.activeIndex + 1] - (params.slidesPerView !== 'auto' && swiper.slides.length - params.slidesPerView >= 2 ? swiper.slidesSizesGrid[swiper.activeIndex + 1] + swiper.params.spaceBetween : 0) - swiper.params.spaceBetween : swiper.minTranslate())) { 9485 swiper.loopFix({ 9486 direction: 'prev', 9487 setTranslate: true, 9488 activeSlideIndex: 0 9489 }); 9490 } 9491 if (data.currentTranslate > swiper.minTranslate()) { 9492 disableParentSwiper = false; 9493 if (params.resistance) { 9494 data.currentTranslate = swiper.minTranslate() - 1 + (-swiper.minTranslate() + data.startTranslate + diff) ** resistanceRatio; 9495 } 9496 } 9497 } else if (diff < 0) { 9498 if (isLoop && allowLoopFix && !loopFixed && data.allowThresholdMove && data.currentTranslate < (params.centeredSlides ? swiper.maxTranslate() + swiper.slidesSizesGrid[swiper.slidesSizesGrid.length - 1] + swiper.params.spaceBetween + (params.slidesPerView !== 'auto' && swiper.slides.length - params.slidesPerView >= 2 ? swiper.slidesSizesGrid[swiper.slidesSizesGrid.length - 1] + swiper.params.spaceBetween : 0) : swiper.maxTranslate())) { 9499 swiper.loopFix({ 9500 direction: 'next', 9501 setTranslate: true, 9502 activeSlideIndex: swiper.slides.length - (params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : Math.ceil(parseFloat(params.slidesPerView, 10))) 9503 }); 9504 } 9505 if (data.currentTranslate < swiper.maxTranslate()) { 9506 disableParentSwiper = false; 9507 if (params.resistance) { 9508 data.currentTranslate = swiper.maxTranslate() + 1 - (swiper.maxTranslate() - data.startTranslate - diff) ** resistanceRatio; 9509 } 9510 } 9511 } 9512 if (disableParentSwiper) { 9513 e.preventedByNestedSwiper = true; 9514 } 9515 9516 // Directions locks 9517 if (!swiper.allowSlideNext && swiper.swipeDirection === 'next' && data.currentTranslate < data.startTranslate) { 9518 data.currentTranslate = data.startTranslate; 9519 } 9520 if (!swiper.allowSlidePrev && swiper.swipeDirection === 'prev' && data.currentTranslate > data.startTranslate) { 9521 data.currentTranslate = data.startTranslate; 9522 } 9523 if (!swiper.allowSlidePrev && !swiper.allowSlideNext) { 9524 data.currentTranslate = data.startTranslate; 9525 } 9526 9527 // Threshold 9528 if (params.threshold > 0) { 9529 if (Math.abs(diff) > params.threshold || data.allowThresholdMove) { 9530 if (!data.allowThresholdMove) { 9531 data.allowThresholdMove = true; 9532 touches.startX = touches.currentX; 9533 touches.startY = touches.currentY; 9534 data.currentTranslate = data.startTranslate; 9535 touches.diff = swiper.isHorizontal() ? touches.currentX - touches.startX : touches.currentY - touches.startY; 9536 return; 9537 } 9538 } else { 9539 data.currentTranslate = data.startTranslate; 9540 return; 9541 } 9542 } 9543 if (!params.followFinger || params.cssMode) return; 9544 9545 // Update active index in free mode 9546 if (params.freeMode && params.freeMode.enabled && swiper.freeMode || params.watchSlidesProgress) { 9547 swiper.updateActiveIndex(); 9548 swiper.updateSlidesClasses(); 9549 } 9550 if (params.freeMode && params.freeMode.enabled && swiper.freeMode) { 9551 swiper.freeMode.onTouchMove(); 9552 } 9553 // Update progress 9554 swiper.updateProgress(data.currentTranslate); 9555 // Update translate 9556 swiper.setTranslate(data.currentTranslate); 9557 } 9558 9559 function onTouchEnd(event) { 9560 const swiper = this; 9561 const data = swiper.touchEventsData; 9562 let e = event; 9563 if (e.originalEvent) e = e.originalEvent; 9564 let targetTouch; 9565 const isTouchEvent = e.type === 'touchend' || e.type === 'touchcancel'; 9566 if (!isTouchEvent) { 9567 if (data.touchId !== null) return; // return from pointer if we use touch 9568 if (e.pointerId !== data.pointerId) return; 9569 targetTouch = e; 9570 } else { 9571 targetTouch = [...e.changedTouches].filter(t => t.identifier === data.touchId)[0]; 9572 if (!targetTouch || targetTouch.identifier !== data.touchId) return; 9573 } 9574 if (['pointercancel', 'pointerout', 'pointerleave', 'contextmenu'].includes(e.type)) { 9575 const proceed = ['pointercancel', 'contextmenu'].includes(e.type) && (swiper.browser.isSafari || swiper.browser.isWebView); 9576 if (!proceed) { 9577 return; 9578 } 9579 } 9580 data.pointerId = null; 9581 data.touchId = null; 9582 const { 9583 params, 9584 touches, 9585 rtlTranslate: rtl, 9586 slidesGrid, 9587 enabled 9588 } = swiper; 9589 if (!enabled) return; 9590 if (!params.simulateTouch && e.pointerType === 'mouse') return; 9591 if (data.allowTouchCallbacks) { 9592 swiper.emit('touchEnd', e); 9593 } 9594 data.allowTouchCallbacks = false;
vendor: 4,775 bytes, lines 9595-9726
9595 if (!data.isTouched) { 9596 if (data.isMoved && params.grabCursor) { 9597 swiper.setGrabCursor(false); 9598 } 9599 data.isMoved = false; 9600 data.startMoving = false; 9601 return; 9602 } 9603 9604 // Return Grab Cursor 9605 if (params.grabCursor && data.isMoved && data.isTouched && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) { 9606 swiper.setGrabCursor(false); 9607 } 9608 9609 // Time diff 9610 const touchEndTime = now(); 9611 const timeDiff = touchEndTime - data.touchStartTime; 9612 9613 // Tap, doubleTap, Click 9614 if (swiper.allowClick) { 9615 const pathTree = e.path || e.composedPath && e.composedPath(); 9616 swiper.updateClickedSlide(pathTree && pathTree[0] || e.target, pathTree); 9617 swiper.emit('tap click', e); 9618 if (timeDiff < 300 && touchEndTime - data.lastClickTime < 300) { 9619 swiper.emit('doubleTap doubleClick', e); 9620 } 9621 } 9622 data.lastClickTime = now(); 9623 nextTick(() => { 9624 if (!swiper.destroyed) swiper.allowClick = true; 9625 }); 9626 if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0 && !data.loopSwapReset || data.currentTranslate === data.startTranslate && !data.loopSwapReset) { 9627 data.isTouched = false; 9628 data.isMoved = false; 9629 data.startMoving = false; 9630 return; 9631 } 9632 data.isTouched = false; 9633 data.isMoved = false; 9634 data.startMoving = false; 9635 let currentPos; 9636 if (params.followFinger) { 9637 currentPos = rtl ? swiper.translate : -swiper.translate; 9638 } else { 9639 currentPos = -data.currentTranslate; 9640 } 9641 if (params.cssMode) { 9642 return; 9643 } 9644 if (params.freeMode && params.freeMode.enabled) { 9645 swiper.freeMode.onTouchEnd({ 9646 currentPos 9647 }); 9648 return; 9649 } 9650 9651 // Find current slide 9652 const swipeToLast = currentPos >= -swiper.maxTranslate() && !swiper.params.loop; 9653 let stopIndex = 0; 9654 let groupSize = swiper.slidesSizesGrid[0]; 9655 for (let i = 0; i < slidesGrid.length; i += i < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup) { 9656 const increment = i < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup; 9657 if (typeof slidesGrid[i + increment] !== 'undefined') { 9658 if (swipeToLast || currentPos >= slidesGrid[i] && currentPos < slidesGrid[i + increment]) { 9659 stopIndex = i; 9660 groupSize = slidesGrid[i + increment] - slidesGrid[i]; 9661 } 9662 } else if (swipeToLast || currentPos >= slidesGrid[i]) { 9663 stopIndex = i; 9664 groupSize = slidesGrid[slidesGrid.length - 1] - slidesGrid[slidesGrid.length - 2]; 9665 } 9666 } 9667 let rewindFirstIndex = null; 9668 let rewindLastIndex = null; 9669 if (params.rewind) { 9670 if (swiper.isBeginning) { 9671 rewindLastIndex = params.virtual && params.virtual.enabled && swiper.virtual ? swiper.virtual.slides.length - 1 : swiper.slides.length - 1; 9672 } else if (swiper.isEnd) { 9673 rewindFirstIndex = 0; 9674 } 9675 } 9676 // Find current slide size 9677 const ratio = (currentPos - slidesGrid[stopIndex]) / groupSize; 9678 const increment = stopIndex < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup; 9679 if (timeDiff > params.longSwipesMs) { 9680 // Long touches 9681 if (!params.longSwipes) { 9682 swiper.slideTo(swiper.activeIndex); 9683 return; 9684 } 9685 if (swiper.swipeDirection === 'next') { 9686 if (ratio >= params.longSwipesRatio) swiper.slideTo(params.rewind && swiper.isEnd ? rewindFirstIndex : stopIndex + increment);else swiper.slideTo(stopIndex); 9687 } 9688 if (swiper.swipeDirection === 'prev') { 9689 if (ratio > 1 - params.longSwipesRatio) { 9690 swiper.slideTo(stopIndex + increment); 9691 } else if (rewindLastIndex !== null && ratio < 0 && Math.abs(ratio) > params.longSwipesRatio) { 9692 swiper.slideTo(rewindLastIndex); 9693 } else { 9694 swiper.slideTo(stopIndex); 9695 } 9696 } 9697 } else { 9698 // Short swipes 9699 if (!params.shortSwipes) { 9700 swiper.slideTo(swiper.activeIndex); 9701 return; 9702 } 9703 const isNavButtonTarget = swiper.navigation && (e.target === swiper.navigation.nextEl || e.target === swiper.navigation.prevEl); 9704 if (!isNavButtonTarget) { 9705 if (swiper.swipeDirection === 'next') { 9706 swiper.slideTo(rewindFirstIndex !== null ? rewindFirstIndex : stopIndex + increment); 9707 } 9708 if (swiper.swipeDirection === 'prev') { 9709 swiper.slideTo(rewindLastIndex !== null ? rewindLastIndex : stopIndex); 9710 } 9711 } else if (e.target === swiper.navigation.nextEl) { 9712 swiper.slideTo(stopIndex + increment); 9713 } else { 9714 swiper.slideTo(stopIndex); 9715 } 9716 } 9717 } 9718 9719 function onResize() { 9720 const swiper = this; 9721 const { 9722 params, 9723 el 9724 } = swiper; 9725 if (el && el.offsetWidth === 0) return; 9726
vendor: 6,498 bytes, lines 9727-9946
9727 // Breakpoints 9728 if (params.breakpoints) { 9729 swiper.setBreakpoint(); 9730 } 9731 9732 // Save locks 9733 const { 9734 allowSlideNext, 9735 allowSlidePrev, 9736 snapGrid 9737 } = swiper; 9738 const isVirtual = swiper.virtual && swiper.params.virtual.enabled; 9739 9740 // Disable locks on resize 9741 swiper.allowSlideNext = true; 9742 swiper.allowSlidePrev = true; 9743 swiper.updateSize(); 9744 swiper.updateSlides(); 9745 swiper.updateSlidesClasses(); 9746 const isVirtualLoop = isVirtual && params.loop; 9747 if ((params.slidesPerView === 'auto' || params.slidesPerView > 1) && swiper.isEnd && !swiper.isBeginning && !swiper.params.centeredSlides && !isVirtualLoop) { 9748 swiper.slideTo(swiper.slides.length - 1, 0, false, true); 9749 } else { 9750 if (swiper.params.loop && !isVirtual) { 9751 swiper.slideToLoop(swiper.realIndex, 0, false, true); 9752 } else { 9753 swiper.slideTo(swiper.activeIndex, 0, false, true); 9754 } 9755 } 9756 if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) { 9757 clearTimeout(swiper.autoplay.resizeTimeout); 9758 swiper.autoplay.resizeTimeout = setTimeout(() => { 9759 if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) { 9760 swiper.autoplay.resume(); 9761 } 9762 }, 500); 9763 } 9764 // Return locks after resize 9765 swiper.allowSlidePrev = allowSlidePrev; 9766 swiper.allowSlideNext = allowSlideNext; 9767 if (swiper.params.watchOverflow && snapGrid !== swiper.snapGrid) { 9768 swiper.checkOverflow(); 9769 } 9770 } 9771 9772 function onClick(e) { 9773 const swiper = this; 9774 if (!swiper.enabled) return; 9775 if (!swiper.allowClick) { 9776 if (swiper.params.preventClicks) e.preventDefault(); 9777 if (swiper.params.preventClicksPropagation && swiper.animating) { 9778 e.stopPropagation(); 9779 e.stopImmediatePropagation(); 9780 } 9781 } 9782 } 9783 9784 function onScroll() { 9785 const swiper = this; 9786 const { 9787 wrapperEl, 9788 rtlTranslate, 9789 enabled 9790 } = swiper; 9791 if (!enabled) return; 9792 swiper.previousTranslate = swiper.translate; 9793 if (swiper.isHorizontal()) { 9794 swiper.translate = -wrapperEl.scrollLeft; 9795 } else { 9796 swiper.translate = -wrapperEl.scrollTop; 9797 } 9798 // eslint-disable-next-line 9799 if (swiper.translate === 0) swiper.translate = 0; 9800 swiper.updateActiveIndex(); 9801 swiper.updateSlidesClasses(); 9802 let newProgress; 9803 const translatesDiff = swiper.maxTranslate() - swiper.minTranslate(); 9804 if (translatesDiff === 0) { 9805 newProgress = 0; 9806 } else { 9807 newProgress = (swiper.translate - swiper.minTranslate()) / translatesDiff; 9808 } 9809 if (newProgress !== swiper.progress) { 9810 swiper.updateProgress(rtlTranslate ? -swiper.translate : swiper.translate); 9811 } 9812 swiper.emit('setTranslate', swiper.translate, false); 9813 } 9814 9815 function onLoad(e) { 9816 const swiper = this; 9817 processLazyPreloader(swiper, e.target); 9818 if (swiper.params.cssMode || swiper.params.slidesPerView !== 'auto' && !swiper.params.autoHeight) { 9819 return; 9820 } 9821 swiper.update(); 9822 } 9823 9824 function onDocumentTouchStart() { 9825 const swiper = this; 9826 if (swiper.documentTouchHandlerProceeded) return; 9827 swiper.documentTouchHandlerProceeded = true; 9828 if (swiper.params.touchReleaseOnEdges) { 9829 swiper.el.style.touchAction = 'auto'; 9830 } 9831 } 9832 9833 const events = (swiper, method) => { 9834 const document = getDocument(); 9835 const { 9836 params, 9837 el, 9838 wrapperEl, 9839 device 9840 } = swiper; 9841 const capture = !!params.nested; 9842 const domMethod = method === 'on' ? 'addEventListener' : 'removeEventListener'; 9843 const swiperMethod = method; 9844 if (!el || typeof el === 'string') return; 9845 9846 // Touch Events 9847 document[domMethod]('touchstart', swiper.onDocumentTouchStart, { 9848 passive: false, 9849 capture 9850 }); 9851 el[domMethod]('touchstart', swiper.onTouchStart, { 9852 passive: false 9853 }); 9854 el[domMethod]('pointerdown', swiper.onTouchStart, { 9855 passive: false 9856 }); 9857 document[domMethod]('touchmove', swiper.onTouchMove, { 9858 passive: false, 9859 capture 9860 }); 9861 document[domMethod]('pointermove', swiper.onTouchMove, { 9862 passive: false, 9863 capture 9864 }); 9865 document[domMethod]('touchend', swiper.onTouchEnd, { 9866 passive: true 9867 }); 9868 document[domMethod]('pointerup', swiper.onTouchEnd, { 9869 passive: true 9870 }); 9871 document[domMethod]('pointercancel', swiper.onTouchEnd, { 9872 passive: true 9873 }); 9874 document[domMethod]('touchcancel', swiper.onTouchEnd, { 9875 passive: true 9876 }); 9877 document[domMethod]('pointerout', swiper.onTouchEnd, { 9878 passive: true 9879 }); 9880 document[domMethod]('pointerleave', swiper.onTouchEnd, { 9881 passive: true 9882 }); 9883 document[domMethod]('contextmenu', swiper.onTouchEnd, { 9884 passive: true 9885 }); 9886 9887 // Prevent Links Clicks 9888 if (params.preventClicks || params.preventClicksPropagation) { 9889 el[domMethod]('click', swiper.onClick, true); 9890 } 9891 if (params.cssMode) { 9892 wrapperEl[domMethod]('scroll', swiper.onScroll); 9893 } 9894 9895 // Resize handler 9896 if (params.updateOnWindowResize) { 9897 swiper[swiperMethod](device.ios || device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate', onResize, true); 9898 } else { 9899 swiper[swiperMethod]('observerUpdate', onResize, true); 9900 } 9901 9902 // Images loader 9903 el[domMethod]('load', swiper.onLoad, { 9904 capture: true 9905 }); 9906 }; 9907 function attachEvents() { 9908 const swiper = this; 9909 const { 9910 params 9911 } = swiper; 9912 swiper.onTouchStart = onTouchStart.bind(swiper); 9913 swiper.onTouchMove = onTouchMove.bind(swiper); 9914 swiper.onTouchEnd = onTouchEnd.bind(swiper); 9915 swiper.onDocumentTouchStart = onDocumentTouchStart.bind(swiper); 9916 if (params.cssMode) { 9917 swiper.onScroll = onScroll.bind(swiper); 9918 } 9919 swiper.onClick = onClick.bind(swiper); 9920 swiper.onLoad = onLoad.bind(swiper); 9921 events(swiper, 'on'); 9922 } 9923 function detachEvents() { 9924 const swiper = this; 9925 events(swiper, 'off'); 9926 } 9927 var events$1 = { 9928 attachEvents, 9929 detachEvents 9930 }; 9931 9932 const isGridEnabled = (swiper, params) => { 9933 return swiper.grid && params.grid && params.grid.rows > 1; 9934 }; 9935 function setBreakpoint() { 9936 const swiper = this; 9937 const { 9938 realIndex, 9939 initialized, 9940 params, 9941 el 9942 } = swiper; 9943 const breakpoints = params.breakpoints; 9944 if (!breakpoints || breakpoints && Object.keys(breakpoints).length === 0) return; 9945 9946 // Get breakpoint for window width and update parameters
vendor: 7,997 bytes, lines 9947-10200
9947 const breakpoint = swiper.getBreakpoint(breakpoints, swiper.params.breakpointsBase, swiper.el); 9948 if (!breakpoint || swiper.currentBreakpoint === breakpoint) return; 9949 const breakpointOnlyParams = breakpoint in breakpoints ? breakpoints[breakpoint] : undefined; 9950 const breakpointParams = breakpointOnlyParams || swiper.originalParams; 9951 const wasMultiRow = isGridEnabled(swiper, params); 9952 const isMultiRow = isGridEnabled(swiper, breakpointParams); 9953 const wasGrabCursor = swiper.params.grabCursor; 9954 const isGrabCursor = breakpointParams.grabCursor; 9955 const wasEnabled = params.enabled; 9956 if (wasMultiRow && !isMultiRow) { 9957 el.classList.remove(`${params.containerModifierClass}grid`, `${params.containerModifierClass}grid-column`); 9958 swiper.emitContainerClasses(); 9959 } else if (!wasMultiRow && isMultiRow) { 9960 el.classList.add(`${params.containerModifierClass}grid`); 9961 if (breakpointParams.grid.fill && breakpointParams.grid.fill === 'column' || !breakpointParams.grid.fill && params.grid.fill === 'column') { 9962 el.classList.add(`${params.containerModifierClass}grid-column`); 9963 } 9964 swiper.emitContainerClasses(); 9965 } 9966 if (wasGrabCursor && !isGrabCursor) { 9967 swiper.unsetGrabCursor(); 9968 } else if (!wasGrabCursor && isGrabCursor) { 9969 swiper.setGrabCursor(); 9970 } 9971 9972 // Toggle navigation, pagination, scrollbar 9973 ['navigation', 'pagination', 'scrollbar'].forEach(prop => { 9974 if (typeof breakpointParams[prop] === 'undefined') return; 9975 const wasModuleEnabled = params[prop] && params[prop].enabled; 9976 const isModuleEnabled = breakpointParams[prop] && breakpointParams[prop].enabled; 9977 if (wasModuleEnabled && !isModuleEnabled) { 9978 swiper[prop].disable(); 9979 } 9980 if (!wasModuleEnabled && isModuleEnabled) { 9981 swiper[prop].enable(); 9982 } 9983 }); 9984 const directionChanged = breakpointParams.direction && breakpointParams.direction !== params.direction; 9985 const needsReLoop = params.loop && (breakpointParams.slidesPerView !== params.slidesPerView || directionChanged); 9986 const wasLoop = params.loop; 9987 if (directionChanged && initialized) { 9988 swiper.changeDirection(); 9989 } 9990 extend(swiper.params, breakpointParams); 9991 const isEnabled = swiper.params.enabled; 9992 const hasLoop = swiper.params.loop; 9993 Object.assign(swiper, { 9994 allowTouchMove: swiper.params.allowTouchMove, 9995 allowSlideNext: swiper.params.allowSlideNext, 9996 allowSlidePrev: swiper.params.allowSlidePrev 9997 }); 9998 if (wasEnabled && !isEnabled) { 9999 swiper.disable(); 10000 } else if (!wasEnabled && isEnabled) { 10001 swiper.enable(); 10002 } 10003 swiper.currentBreakpoint = breakpoint; 10004 swiper.emit('_beforeBreakpoint', breakpointParams); 10005 if (initialized) { 10006 if (needsReLoop) { 10007 swiper.loopDestroy(); 10008 swiper.loopCreate(realIndex); 10009 swiper.updateSlides(); 10010 } else if (!wasLoop && hasLoop) { 10011 swiper.loopCreate(realIndex); 10012 swiper.updateSlides(); 10013 } else if (wasLoop && !hasLoop) { 10014 swiper.loopDestroy(); 10015 } 10016 } 10017 swiper.emit('breakpoint', breakpointParams); 10018 } 10019 10020 function getBreakpoint(breakpoints, base, containerEl) { 10021 if (base === void 0) { 10022 base = 'window'; 10023 } 10024 if (!breakpoints || base === 'container' && !containerEl) return undefined; 10025 let breakpoint = false; 10026 const window = getWindow(); 10027 const currentHeight = base === 'window' ? window.innerHeight : containerEl.clientHeight; 10028 const points = Object.keys(breakpoints).map(point => { 10029 if (typeof point === 'string' && point.indexOf('@') === 0) { 10030 const minRatio = parseFloat(point.substr(1)); 10031 const value = currentHeight * minRatio; 10032 return { 10033 value, 10034 point 10035 }; 10036 } 10037 return { 10038 value: point, 10039 point 10040 }; 10041 }); 10042 points.sort((a, b) => parseInt(a.value, 10) - parseInt(b.value, 10)); 10043 for (let i = 0; i < points.length; i += 1) { 10044 const { 10045 point, 10046 value 10047 } = points[i]; 10048 if (base === 'window') { 10049 if (window.matchMedia(`(min-width: ${value}px)`).matches) { 10050 breakpoint = point; 10051 } 10052 } else if (value <= containerEl.clientWidth) { 10053 breakpoint = point; 10054 } 10055 } 10056 return breakpoint || 'max'; 10057 } 10058 10059 var breakpoints = { 10060 setBreakpoint, 10061 getBreakpoint 10062 }; 10063 10064 function prepareClasses(entries, prefix) { 10065 const resultClasses = []; 10066 entries.forEach(item => { 10067 if (typeof item === 'object') { 10068 Object.keys(item).forEach(classNames => { 10069 if (item[classNames]) { 10070 resultClasses.push(prefix + classNames); 10071 } 10072 }); 10073 } else if (typeof item === 'string') { 10074 resultClasses.push(prefix + item); 10075 } 10076 }); 10077 return resultClasses; 10078 } 10079 function addClasses() { 10080 const swiper = this; 10081 const { 10082 classNames, 10083 params, 10084 rtl, 10085 el, 10086 device 10087 } = swiper; 10088 // prettier-ignore 10089 const suffixes = prepareClasses(['initialized', params.direction, { 10090 'free-mode': swiper.params.freeMode && params.freeMode.enabled 10091 }, { 10092 'autoheight': params.autoHeight 10093 }, { 10094 'rtl': rtl 10095 }, { 10096 'grid': params.grid && params.grid.rows > 1 10097 }, { 10098 'grid-column': params.grid && params.grid.rows > 1 && params.grid.fill === 'column' 10099 }, { 10100 'android': device.android 10101 }, { 10102 'ios': device.ios 10103 }, { 10104 'css-mode': params.cssMode 10105 }, { 10106 'centered': params.cssMode && params.centeredSlides 10107 }, { 10108 'watch-progress': params.watchSlidesProgress 10109 }], params.containerModifierClass); 10110 classNames.push(...suffixes); 10111 el.classList.add(...classNames); 10112 swiper.emitContainerClasses(); 10113 } 10114 10115 function removeClasses() { 10116 const swiper = this; 10117 const { 10118 el, 10119 classNames 10120 } = swiper; 10121 if (!el || typeof el === 'string') return; 10122 el.classList.remove(...classNames); 10123 swiper.emitContainerClasses(); 10124 } 10125 10126 var classes = { 10127 addClasses, 10128 removeClasses 10129 }; 10130 10131 function checkOverflow() { 10132 const swiper = this; 10133 const { 10134 isLocked: wasLocked, 10135 params 10136 } = swiper; 10137 const { 10138 slidesOffsetBefore 10139 } = params; 10140 if (slidesOffsetBefore) { 10141 const lastSlideIndex = swiper.slides.length - 1; 10142 const lastSlideRightEdge = swiper.slidesGrid[lastSlideIndex] + swiper.slidesSizesGrid[lastSlideIndex] + slidesOffsetBefore * 2; 10143 swiper.isLocked = swiper.size > lastSlideRightEdge; 10144 } else { 10145 swiper.isLocked = swiper.snapGrid.length === 1; 10146 } 10147 if (params.allowSlideNext === true) { 10148 swiper.allowSlideNext = !swiper.isLocked; 10149 } 10150 if (params.allowSlidePrev === true) { 10151 swiper.allowSlidePrev = !swiper.isLocked; 10152 } 10153 if (wasLocked && wasLocked !== swiper.isLocked) { 10154 swiper.isEnd = false; 10155 } 10156 if (wasLocked !== swiper.isLocked) { 10157 swiper.emit(swiper.isLocked ? 'lock' : 'unlock'); 10158 } 10159 } 10160 var checkOverflow$1 = { 10161 checkOverflow 10162 }; 10163 10164 var defaults = { 10165 init: true, 10166 direction: 'horizontal', 10167 oneWayMovement: false, 10168 swiperElementNodeName: 'SWIPER-CONTAINER', 10169 touchEventsTarget: 'wrapper', 10170 initialSlide: 0, 10171 speed: 300, 10172 cssMode: false, 10173 updateOnWindowResize: true, 10174 resizeObserver: true, 10175 nested: false, 10176 createElements: false, 10177 eventsPrefix: 'swiper', 10178 enabled: true, 10179 focusableElements: 'input, select, option, textarea, button, video, label', 10180 // Overrides 10181 width: null, 10182 height: null, 10183 // 10184 preventInteractionOnTransition: false, 10185 // ssr 10186 userAgent: null, 10187 url: null, 10188 // To support iOS's swipe-to-go-back gesture (when being used in-app). 10189 edgeSwipeDetection: false, 10190 edgeSwipeThreshold: 20, 10191 // Autoheight 10192 autoHeight: false, 10193 // Set wrapper width 10194 setWrapperSize: false, 10195 // Virtual Translate 10196 virtualTranslate: false, 10197 // Effects 10198 effect: 'slide', 10199 // 'slide' or 'fade' or 'cube' or 'coverflow' or 'flip' 10200
vendor: 4,199 bytes, lines 10201-10344
10201 // Breakpoints 10202 breakpoints: undefined, 10203 breakpointsBase: 'window', 10204 // Slides grid 10205 spaceBetween: 0, 10206 slidesPerView: 1, 10207 slidesPerGroup: 1, 10208 slidesPerGroupSkip: 0, 10209 slidesPerGroupAuto: false, 10210 centeredSlides: false, 10211 centeredSlidesBounds: false, 10212 slidesOffsetBefore: 0, 10213 // in px 10214 slidesOffsetAfter: 0, 10215 // in px 10216 normalizeSlideIndex: true, 10217 centerInsufficientSlides: false, 10218 // Disable swiper and hide navigation when container not overflow 10219 watchOverflow: true, 10220 // Round length 10221 roundLengths: false, 10222 // Touches 10223 touchRatio: 1, 10224 touchAngle: 45, 10225 simulateTouch: true, 10226 shortSwipes: true, 10227 longSwipes: true, 10228 longSwipesRatio: 0.5, 10229 longSwipesMs: 300, 10230 followFinger: true, 10231 allowTouchMove: true, 10232 threshold: 5, 10233 touchMoveStopPropagation: false, 10234 touchStartPreventDefault: true, 10235 touchStartForcePreventDefault: false, 10236 touchReleaseOnEdges: false, 10237 // Unique Navigation Elements 10238 uniqueNavElements: true, 10239 // Resistance 10240 resistance: true, 10241 resistanceRatio: 0.85, 10242 // Progress 10243 watchSlidesProgress: false, 10244 // Cursor 10245 grabCursor: false, 10246 // Clicks 10247 preventClicks: true, 10248 preventClicksPropagation: true, 10249 slideToClickedSlide: false, 10250 // loop 10251 loop: false, 10252 loopAddBlankSlides: true, 10253 loopAdditionalSlides: 0, 10254 loopPreventsSliding: true, 10255 // rewind 10256 rewind: false, 10257 // Swiping/no swiping 10258 allowSlidePrev: true, 10259 allowSlideNext: true, 10260 swipeHandler: null, 10261 // '.swipe-handler', 10262 noSwiping: true, 10263 noSwipingClass: 'swiper-no-swiping', 10264 noSwipingSelector: null, 10265 // Passive Listeners 10266 passiveListeners: true, 10267 maxBackfaceHiddenSlides: 10, 10268 // NS 10269 containerModifierClass: 'swiper-', 10270 // NEW 10271 slideClass: 'swiper-slide', 10272 slideBlankClass: 'swiper-slide-blank', 10273 slideActiveClass: 'swiper-slide-active', 10274 slideVisibleClass: 'swiper-slide-visible', 10275 slideFullyVisibleClass: 'swiper-slide-fully-visible', 10276 slideNextClass: 'swiper-slide-next', 10277 slidePrevClass: 'swiper-slide-prev', 10278 wrapperClass: 'swiper-wrapper', 10279 lazyPreloaderClass: 'swiper-lazy-preloader', 10280 lazyPreloadPrevNext: 0, 10281 // Callbacks 10282 runCallbacksOnInit: true, 10283 // Internals 10284 _emitClasses: false 10285 }; 10286 10287 function moduleExtendParams(params, allModulesParams) { 10288 return function extendParams(obj) { 10289 if (obj === void 0) { 10290 obj = {}; 10291 } 10292 const moduleParamName = Object.keys(obj)[0]; 10293 const moduleParams = obj[moduleParamName]; 10294 if (typeof moduleParams !== 'object' || moduleParams === null) { 10295 extend(allModulesParams, obj); 10296 return; 10297 } 10298 if (params[moduleParamName] === true) { 10299 params[moduleParamName] = { 10300 enabled: true 10301 }; 10302 } 10303 if (moduleParamName === 'navigation' && params[moduleParamName] && params[moduleParamName].enabled && !params[moduleParamName].prevEl && !params[moduleParamName].nextEl) { 10304 params[moduleParamName].auto = true; 10305 } 10306 if (['pagination', 'scrollbar'].indexOf(moduleParamName) >= 0 && params[moduleParamName] && params[moduleParamName].enabled && !params[moduleParamName].el) { 10307 params[moduleParamName].auto = true; 10308 } 10309 if (!(moduleParamName in params && 'enabled' in moduleParams)) { 10310 extend(allModulesParams, obj); 10311 return; 10312 } 10313 if (typeof params[moduleParamName] === 'object' && !('enabled' in params[moduleParamName])) { 10314 params[moduleParamName].enabled = true; 10315 } 10316 if (!params[moduleParamName]) params[moduleParamName] = { 10317 enabled: false 10318 }; 10319 extend(allModulesParams, obj); 10320 }; 10321 } 10322 10323 /* eslint no-param-reassign: "off" */ 10324 const prototypes = { 10325 eventsEmitter, 10326 update, 10327 translate, 10328 transition, 10329 slide, 10330 loop, 10331 grabCursor, 10332 events: events$1, 10333 breakpoints, 10334 checkOverflow: checkOverflow$1, 10335 classes 10336 }; 10337 const extendedDefaults = {}; 10338 class Swiper { 10339 constructor() { 10340 let el; 10341 let params; 10342 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 10343 args[_key] = arguments[_key]; 10344 }
vendor: 7,462 bytes, lines 10345-10579
10345 if (args.length === 1 && args[0].constructor && Object.prototype.toString.call(args[0]).slice(8, -1) === 'Object') { 10346 params = args[0]; 10347 } else { 10348 [el, params] = args; 10349 } 10350 if (!params) params = {}; 10351 params = extend({}, params); 10352 if (el && !params.el) params.el = el; 10353 const document = getDocument(); 10354 if (params.el && typeof params.el === 'string' && document.querySelectorAll(params.el).length > 1) { 10355 const swipers = []; 10356 document.querySelectorAll(params.el).forEach(containerEl => { 10357 const newParams = extend({}, params, { 10358 el: containerEl 10359 }); 10360 swipers.push(new Swiper(newParams)); 10361 }); 10362 // eslint-disable-next-line no-constructor-return 10363 return swipers; 10364 } 10365 10366 // Swiper Instance 10367 const swiper = this; 10368 swiper.__swiper__ = true; 10369 swiper.support = getSupport(); 10370 swiper.device = getDevice({ 10371 userAgent: params.userAgent 10372 }); 10373 swiper.browser = getBrowser(); 10374 swiper.eventsListeners = {}; 10375 swiper.eventsAnyListeners = []; 10376 swiper.modules = [...swiper.__modules__]; 10377 if (params.modules && Array.isArray(params.modules)) { 10378 swiper.modules.push(...params.modules); 10379 } 10380 const allModulesParams = {}; 10381 swiper.modules.forEach(mod => { 10382 mod({ 10383 params, 10384 swiper, 10385 extendParams: moduleExtendParams(params, allModulesParams), 10386 on: swiper.on.bind(swiper), 10387 once: swiper.once.bind(swiper), 10388 off: swiper.off.bind(swiper), 10389 emit: swiper.emit.bind(swiper) 10390 }); 10391 }); 10392 10393 // Extend defaults with modules params 10394 const swiperParams = extend({}, defaults, allModulesParams); 10395 10396 // Extend defaults with passed params 10397 swiper.params = extend({}, swiperParams, extendedDefaults, params); 10398 swiper.originalParams = extend({}, swiper.params); 10399 swiper.passedParams = extend({}, params); 10400 10401 // add event listeners 10402 if (swiper.params && swiper.params.on) { 10403 Object.keys(swiper.params.on).forEach(eventName => { 10404 swiper.on(eventName, swiper.params.on[eventName]); 10405 }); 10406 } 10407 if (swiper.params && swiper.params.onAny) { 10408 swiper.onAny(swiper.params.onAny); 10409 } 10410 10411 // Extend Swiper 10412 Object.assign(swiper, { 10413 enabled: swiper.params.enabled, 10414 el, 10415 // Classes 10416 classNames: [], 10417 // Slides 10418 slides: [], 10419 slidesGrid: [], 10420 snapGrid: [], 10421 slidesSizesGrid: [], 10422 // isDirection 10423 isHorizontal() { 10424 return swiper.params.direction === 'horizontal'; 10425 }, 10426 isVertical() { 10427 return swiper.params.direction === 'vertical'; 10428 }, 10429 // Indexes 10430 activeIndex: 0, 10431 realIndex: 0, 10432 // 10433 isBeginning: true, 10434 isEnd: false, 10435 // Props 10436 translate: 0, 10437 previousTranslate: 0, 10438 progress: 0, 10439 velocity: 0, 10440 animating: false, 10441 cssOverflowAdjustment() { 10442 // Returns 0 unless `translate` is > 2**23 10443 // Should be subtracted from css values to prevent overflow 10444 return Math.trunc(this.translate / 2 ** 23) * 2 ** 23; 10445 }, 10446 // Locks 10447 allowSlideNext: swiper.params.allowSlideNext, 10448 allowSlidePrev: swiper.params.allowSlidePrev, 10449 // Touch Events 10450 touchEventsData: { 10451 isTouched: undefined, 10452 isMoved: undefined, 10453 allowTouchCallbacks: undefined, 10454 touchStartTime: undefined, 10455 isScrolling: undefined, 10456 currentTranslate: undefined, 10457 startTranslate: undefined, 10458 allowThresholdMove: undefined, 10459 // Form elements to match 10460 focusableElements: swiper.params.focusableElements, 10461 // Last click time 10462 lastClickTime: 0, 10463 clickTimeout: undefined, 10464 // Velocities 10465 velocities: [], 10466 allowMomentumBounce: undefined, 10467 startMoving: undefined, 10468 pointerId: null, 10469 touchId: null 10470 }, 10471 // Clicks 10472 allowClick: true, 10473 // Touches 10474 allowTouchMove: swiper.params.allowTouchMove, 10475 touches: { 10476 startX: 0, 10477 startY: 0, 10478 currentX: 0, 10479 currentY: 0, 10480 diff: 0 10481 }, 10482 // Images 10483 imagesToLoad: [], 10484 imagesLoaded: 0 10485 }); 10486 swiper.emit('_swiper'); 10487 10488 // Init 10489 if (swiper.params.init) { 10490 swiper.init(); 10491 } 10492 10493 // Return app instance 10494 // eslint-disable-next-line no-constructor-return 10495 return swiper; 10496 } 10497 getDirectionLabel(property) { 10498 if (this.isHorizontal()) { 10499 return property; 10500 } 10501 // prettier-ignore 10502 return { 10503 'width': 'height', 10504 'margin-top': 'margin-left', 10505 'margin-bottom ': 'margin-right', 10506 'margin-left': 'margin-top', 10507 'margin-right': 'margin-bottom', 10508 'padding-left': 'padding-top', 10509 'padding-right': 'padding-bottom', 10510 'marginRight': 'marginBottom' 10511 }[property]; 10512 } 10513 getSlideIndex(slideEl) { 10514 const { 10515 slidesEl, 10516 params 10517 } = this; 10518 const slides = elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`); 10519 const firstSlideIndex = elementIndex(slides[0]); 10520 return elementIndex(slideEl) - firstSlideIndex; 10521 } 10522 getSlideIndexByData(index) { 10523 return this.getSlideIndex(this.slides.filter(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === index)[0]); 10524 } 10525 recalcSlides() { 10526 const swiper = this; 10527 const { 10528 slidesEl, 10529 params 10530 } = swiper; 10531 swiper.slides = elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`); 10532 } 10533 enable() { 10534 const swiper = this; 10535 if (swiper.enabled) return; 10536 swiper.enabled = true; 10537 if (swiper.params.grabCursor) { 10538 swiper.setGrabCursor(); 10539 } 10540 swiper.emit('enable'); 10541 } 10542 disable() { 10543 const swiper = this; 10544 if (!swiper.enabled) return; 10545 swiper.enabled = false; 10546 if (swiper.params.grabCursor) { 10547 swiper.unsetGrabCursor(); 10548 } 10549 swiper.emit('disable'); 10550 } 10551 setProgress(progress, speed) { 10552 const swiper = this; 10553 progress = Math.min(Math.max(progress, 0), 1); 10554 const min = swiper.minTranslate(); 10555 const max = swiper.maxTranslate(); 10556 const current = (max - min) * progress + min; 10557 swiper.translateTo(current, typeof speed === 'undefined' ? 0 : speed); 10558 swiper.updateActiveIndex(); 10559 swiper.updateSlidesClasses(); 10560 } 10561 emitContainerClasses() { 10562 const swiper = this; 10563 if (!swiper.params._emitClasses || !swiper.el) return; 10564 const cls = swiper.el.className.split(' ').filter(className => { 10565 return className.indexOf('swiper') === 0 || className.indexOf(swiper.params.containerModifierClass) === 0; 10566 }); 10567 swiper.emit('_containerClasses', cls.join(' ')); 10568 } 10569 getSlideClasses(slideEl) { 10570 const swiper = this; 10571 if (swiper.destroyed) return ''; 10572 return slideEl.className.split(' ').filter(className => { 10573 return className.indexOf('swiper-slide') === 0 || className.indexOf(swiper.params.slideClass) === 0; 10574 }).join(' '); 10575 } 10576 emitSlidesClasses() { 10577 const swiper = this; 10578 if (!swiper.params._emitClasses || !swiper.el) return; 10579 const updates = [];
vendor: 4,642 bytes, lines 10580-10711
10580 swiper.slides.forEach(slideEl => { 10581 const classNames = swiper.getSlideClasses(slideEl); 10582 updates.push({ 10583 slideEl, 10584 classNames 10585 }); 10586 swiper.emit('_slideClass', slideEl, classNames); 10587 }); 10588 swiper.emit('_slideClasses', updates); 10589 } 10590 slidesPerViewDynamic(view, exact) { 10591 if (view === void 0) { 10592 view = 'current'; 10593 } 10594 if (exact === void 0) { 10595 exact = false; 10596 } 10597 const swiper = this; 10598 const { 10599 params, 10600 slides, 10601 slidesGrid, 10602 slidesSizesGrid, 10603 size: swiperSize, 10604 activeIndex 10605 } = swiper; 10606 let spv = 1; 10607 if (typeof params.slidesPerView === 'number') return params.slidesPerView; 10608 if (params.centeredSlides) { 10609 let slideSize = slides[activeIndex] ? Math.ceil(slides[activeIndex].swiperSlideSize) : 0; 10610 let breakLoop; 10611 for (let i = activeIndex + 1; i < slides.length; i += 1) { 10612 if (slides[i] && !breakLoop) { 10613 slideSize += Math.ceil(slides[i].swiperSlideSize); 10614 spv += 1; 10615 if (slideSize > swiperSize) breakLoop = true; 10616 } 10617 } 10618 for (let i = activeIndex - 1; i >= 0; i -= 1) { 10619 if (slides[i] && !breakLoop) { 10620 slideSize += slides[i].swiperSlideSize; 10621 spv += 1; 10622 if (slideSize > swiperSize) breakLoop = true; 10623 } 10624 } 10625 } else { 10626 // eslint-disable-next-line 10627 if (view === 'current') { 10628 for (let i = activeIndex + 1; i < slides.length; i += 1) { 10629 const slideInView = exact ? slidesGrid[i] + slidesSizesGrid[i] - slidesGrid[activeIndex] < swiperSize : slidesGrid[i] - slidesGrid[activeIndex] < swiperSize; 10630 if (slideInView) { 10631 spv += 1; 10632 } 10633 } 10634 } else { 10635 // previous 10636 for (let i = activeIndex - 1; i >= 0; i -= 1) { 10637 const slideInView = slidesGrid[activeIndex] - slidesGrid[i] < swiperSize; 10638 if (slideInView) { 10639 spv += 1; 10640 } 10641 } 10642 } 10643 } 10644 return spv; 10645 } 10646 update() { 10647 const swiper = this; 10648 if (!swiper || swiper.destroyed) return; 10649 const { 10650 snapGrid, 10651 params 10652 } = swiper; 10653 // Breakpoints 10654 if (params.breakpoints) { 10655 swiper.setBreakpoint(); 10656 } 10657 [...swiper.el.querySelectorAll('[loading="lazy"]')].forEach(imageEl => { 10658 if (imageEl.complete) { 10659 processLazyPreloader(swiper, imageEl); 10660 } 10661 }); 10662 swiper.updateSize(); 10663 swiper.updateSlides(); 10664 swiper.updateProgress(); 10665 swiper.updateSlidesClasses(); 10666 function setTranslate() { 10667 const translateValue = swiper.rtlTranslate ? swiper.translate * -1 : swiper.translate; 10668 const newTranslate = Math.min(Math.max(translateValue, swiper.maxTranslate()), swiper.minTranslate()); 10669 swiper.setTranslate(newTranslate); 10670 swiper.updateActiveIndex(); 10671 swiper.updateSlidesClasses(); 10672 } 10673 let translated; 10674 if (params.freeMode && params.freeMode.enabled && !params.cssMode) { 10675 setTranslate(); 10676 if (params.autoHeight) { 10677 swiper.updateAutoHeight(); 10678 } 10679 } else { 10680 if ((params.slidesPerView === 'auto' || params.slidesPerView > 1) && swiper.isEnd && !params.centeredSlides) { 10681 const slides = swiper.virtual && params.virtual.enabled ? swiper.virtual.slides : swiper.slides; 10682 translated = swiper.slideTo(slides.length - 1, 0, false, true); 10683 } else { 10684 translated = swiper.slideTo(swiper.activeIndex, 0, false, true); 10685 } 10686 if (!translated) { 10687 setTranslate(); 10688 } 10689 } 10690 if (params.watchOverflow && snapGrid !== swiper.snapGrid) { 10691 swiper.checkOverflow(); 10692 } 10693 swiper.emit('update'); 10694 } 10695 changeDirection(newDirection, needUpdate) { 10696 if (needUpdate === void 0) { 10697 needUpdate = true; 10698 } 10699 const swiper = this; 10700 const currentDirection = swiper.params.direction; 10701 if (!newDirection) { 10702 // eslint-disable-next-line 10703 newDirection = currentDirection === 'horizontal' ? 'vertical' : 'horizontal'; 10704 } 10705 if (newDirection === currentDirection || newDirection !== 'horizontal' && newDirection !== 'vertical') { 10706 return swiper; 10707 } 10708 swiper.el.classList.remove(`${swiper.params.containerModifierClass}${currentDirection}`); 10709 swiper.el.classList.add(`${swiper.params.containerModifierClass}${newDirection}`); 10710 swiper.emitContainerClasses(); 10711 swiper.params.direction = newDirection;
vendor: 2,091 bytes, lines 10712-10769
10712 swiper.slides.forEach(slideEl => { 10713 if (newDirection === 'vertical') { 10714 slideEl.style.width = ''; 10715 } else { 10716 slideEl.style.height = ''; 10717 } 10718 }); 10719 swiper.emit('changeDirection'); 10720 if (needUpdate) swiper.update(); 10721 return swiper; 10722 } 10723 changeLanguageDirection(direction) { 10724 const swiper = this; 10725 if (swiper.rtl && direction === 'rtl' || !swiper.rtl && direction === 'ltr') return; 10726 swiper.rtl = direction === 'rtl'; 10727 swiper.rtlTranslate = swiper.params.direction === 'horizontal' && swiper.rtl; 10728 if (swiper.rtl) { 10729 swiper.el.classList.add(`${swiper.params.containerModifierClass}rtl`); 10730 swiper.el.dir = 'rtl'; 10731 } else { 10732 swiper.el.classList.remove(`${swiper.params.containerModifierClass}rtl`); 10733 swiper.el.dir = 'ltr'; 10734 } 10735 swiper.update(); 10736 } 10737 mount(element) { 10738 const swiper = this; 10739 if (swiper.mounted) return true; 10740 10741 // Find el 10742 let el = element || swiper.params.el; 10743 if (typeof el === 'string') { 10744 el = document.querySelector(el); 10745 } 10746 if (!el) { 10747 return false; 10748 } 10749 el.swiper = swiper; 10750 if (el.parentNode && el.parentNode.host && el.parentNode.host.nodeName === swiper.params.swiperElementNodeName.toUpperCase()) { 10751 swiper.isElement = true; 10752 } 10753 const getWrapperSelector = () => { 10754 return `.${(swiper.params.wrapperClass || '').trim().split(' ').join('.')}`; 10755 }; 10756 const getWrapper = () => { 10757 if (el && el.shadowRoot && el.shadowRoot.querySelector) { 10758 const res = el.shadowRoot.querySelector(getWrapperSelector()); 10759 // Children needs to return slot items 10760 return res; 10761 } 10762 return elementChildren(el, getWrapperSelector())[0]; 10763 }; 10764 // Find Wrapper 10765 let wrapperEl = getWrapper(); 10766 if (!wrapperEl && swiper.params.createElements) { 10767 wrapperEl = createElement('div', swiper.params.wrapperClass); 10768 el.append(wrapperEl); 10769 elementChildren(el, `.${swiper.params.slideClass}
10769`).forEach(slideEl => { 10770 wrapperEl.append(slideEl); 10771 }); 10772 } 10773 Object.assign(swiper, { 10774 el, 10775 wrapperEl, 10776 slidesEl: swiper.isElement && !el.parentNode.host.slideSlots ? el.parentNode.host : wrapperEl, 10777 hostEl: swiper.isElement ? el.parentNode.host : el, 10778 mounted: true, 10779 // RTL 10780 rtl: el.dir.toLowerCase() === 'rtl' || elementStyle(el, 'direction') === 'rtl', 10781 rtlTranslate: swiper.params.direction === 'horizontal' && (el.dir.toLowerCase() === 'rtl' || elementStyle(el, 'direction') === 'rtl'), 10782 wrongRTL: elementStyle(wrapperEl, 'display') === '-webkit-box' 10783 }); 10784 return true; 10785 } 10786 init(el) { 10787 const swiper = this; 10788 if (swiper.initialized) return swiper; 10789 const mounted = swiper.mount(el); 10790 if (mounted === false) return swiper; 10791 swiper.emit('beforeInit'); 10792 10793 // Set breakpoint 10794 if (swiper.params.breakpoints) { 10795 swiper.setBreakpoint(); 10796 } 10797 10798 // Add Classes 10799 swiper.addClasses(); 10800 10801 // Update size 10802 swiper.updateSize(); 10803 10804 // Update slides 10805 swiper.updateSlides(); 10806 if (swiper.params.watchOverflow) { 10807 swiper.checkOverflow(); 10808 } 10809 10810 // Set Grab Cursor 10811 if (swiper.params.grabCursor && swiper.enabled) { 10812 swiper.setGrabCursor(); 10813 } 10814 10815 // Slide To Initial Slide 10816 if (swiper.params.loop && swiper.virtual && swiper.params.virtual.enabled) { 10817 swiper.slideTo(swiper.params.initialSlide + swiper.virtual.slidesBefore, 0, swiper.params.runCallbacksOnInit, false, true); 10818 } else { 10819 swiper.slideTo(swiper.params.initialSlide, 0, swiper.params.runCallbacksOnInit, false, true); 10820 } 10821 10822 // Create loop 10823 if (swiper.params.loop) { 10824 swiper.loopCreate(); 10825 } 10826 10827 // Attach events 10828 swiper.attachEvents(); 10829 const lazyElements = [...swiper.el.querySelectorAll('[loading="lazy"]')]; 10830 if (swiper.isElement) { 10831 lazyElements.push(...swiper.hostEl.querySelectorAll('[loading="lazy"]')); 10832 } 10833 lazyElements.forEach(imageEl => { 10834 if (imageEl.complete) { 10835 processLazyPreloader(swiper, imageEl); 10836 } else { 10837 imageEl.addEventListener('load', e => { 10838 processLazyPreloader(swiper, e.target); 10839 }); 10840 } 10841 }); 10842 preload(swiper); 10843 10844 // Init Flag 10845 swiper.initialized = true; 10846 preload(swiper); 10847 10848 // Emit 10849 swiper.emit('init'); 10850 swiper.emit('afterInit'); 10851 return swiper; 10852 } 10853 destroy(deleteInstance, cleanStyles) { 10854 if (deleteInstance === void 0) { 10855 deleteInstance = true; 10856 } 10857 if (cleanStyles === void 0) { 10858 cleanStyles = true; 10859 } 10860 const swiper = this; 10861 const { 10862 params, 10863 el, 10864 wrapperEl, 10865 slides 10866 } = swiper; 10867 if (typeof swiper.params === 'undefined' || swiper.destroyed) { 10868 return null; 10869 } 10870 swiper.emit('beforeDestroy'); 10871 10872 // Init Flag 10873 swiper.initialized = false; 10874 10875 // Detach events 10876 swiper.detachEvents(); 10877 10878 // Destroy loop 10879 if (params.loop) { 10880 swiper.loopDestroy(); 10881 } 10882 10883 // Cleanup styles 10884 if (cleanStyles) { 10885 swiper.removeClasses(); 10886 if (el && typeof el !== 'string') { 10887 el.removeAttribute('style'); 10888 } 10889 if (wrapperEl) { 10890 wrapperEl.removeAttribute('style'); 10891 } 10892 if (slides && slides.length) {
vendor: 6,856 bytes, lines 10893-11112
10893 slides.forEach(slideEl => { 10894 slideEl.classList.remove(params.slideVisibleClass, params.slideFullyVisibleClass, params.slideActiveClass, params.slideNextClass, params.slidePrevClass); 10895 slideEl.removeAttribute('style'); 10896 slideEl.removeAttribute('data-swiper-slide-index'); 10897 }); 10898 } 10899 } 10900 swiper.emit('destroy'); 10901 10902 // Detach emitter events 10903 Object.keys(swiper.eventsListeners).forEach(eventName => { 10904 swiper.off(eventName); 10905 }); 10906 if (deleteInstance !== false) { 10907 if (swiper.el && typeof swiper.el !== 'string') { 10908 swiper.el.swiper = null; 10909 } 10910 deleteProps(swiper); 10911 } 10912 swiper.destroyed = true; 10913 return null; 10914 } 10915 static extendDefaults(newDefaults) { 10916 extend(extendedDefaults, newDefaults); 10917 } 10918 static get extendedDefaults() { 10919 return extendedDefaults; 10920 } 10921 static get defaults() { 10922 return defaults; 10923 } 10924 static installModule(mod) { 10925 if (!Swiper.prototype.__modules__) Swiper.prototype.__modules__ = []; 10926 const modules = Swiper.prototype.__modules__; 10927 if (typeof mod === 'function' && modules.indexOf(mod) < 0) { 10928 modules.push(mod); 10929 } 10930 } 10931 static use(module) { 10932 if (Array.isArray(module)) { 10933 module.forEach(m => Swiper.installModule(m)); 10934 return Swiper; 10935 } 10936 Swiper.installModule(module); 10937 return Swiper; 10938 } 10939 } 10940 Object.keys(prototypes).forEach(prototypeGroup => { 10941 Object.keys(prototypes[prototypeGroup]).forEach(protoMethod => { 10942 Swiper.prototype[protoMethod] = prototypes[prototypeGroup][protoMethod]; 10943 }); 10944 }); 10945 Swiper.use([Resize, Observer]); 10946 10947 function Virtual(_ref) { 10948 let { 10949 swiper, 10950 extendParams, 10951 on, 10952 emit 10953 } = _ref; 10954 extendParams({ 10955 virtual: { 10956 enabled: false, 10957 slides: [], 10958 cache: true, 10959 renderSlide: null, 10960 renderExternal: null, 10961 renderExternalUpdate: true, 10962 addSlidesBefore: 0, 10963 addSlidesAfter: 0 10964 } 10965 }); 10966 let cssModeTimeout; 10967 const document = getDocument(); 10968 swiper.virtual = { 10969 cache: {}, 10970 from: undefined, 10971 to: undefined, 10972 slides: [], 10973 offset: 0, 10974 slidesGrid: [] 10975 }; 10976 const tempDOM = document.createElement('div'); 10977 function renderSlide(slide, index) { 10978 const params = swiper.params.virtual; 10979 if (params.cache && swiper.virtual.cache[index]) { 10980 return swiper.virtual.cache[index]; 10981 } 10982 // eslint-disable-next-line 10983 let slideEl; 10984 if (params.renderSlide) { 10985 slideEl = params.renderSlide.call(swiper, slide, index); 10986 if (typeof slideEl === 'string') { 10987 tempDOM.innerHTML = slideEl; 10988 slideEl = tempDOM.children[0]; 10989 } 10990 } else if (swiper.isElement) { 10991 slideEl = createElement('swiper-slide'); 10992 } else { 10993 slideEl = createElement('div', swiper.params.slideClass); 10994 } 10995 slideEl.setAttribute('data-swiper-slide-index', index); 10996 if (!params.renderSlide) { 10997 slideEl.innerHTML = slide; 10998 } 10999 if (params.cache) { 11000 swiper.virtual.cache[index] = slideEl; 11001 } 11002 return slideEl; 11003 } 11004 function update(force, beforeInit) { 11005 const { 11006 slidesPerView, 11007 slidesPerGroup, 11008 centeredSlides, 11009 loop: isLoop, 11010 initialSlide 11011 } = swiper.params; 11012 if (beforeInit && !isLoop && initialSlide > 0) { 11013 return; 11014 } 11015 const { 11016 addSlidesBefore, 11017 addSlidesAfter 11018 } = swiper.params.virtual; 11019 const { 11020 from: previousFrom, 11021 to: previousTo, 11022 slides, 11023 slidesGrid: previousSlidesGrid, 11024 offset: previousOffset 11025 } = swiper.virtual; 11026 if (!swiper.params.cssMode) { 11027 swiper.updateActiveIndex(); 11028 } 11029 const activeIndex = swiper.activeIndex || 0; 11030 let offsetProp; 11031 if (swiper.rtlTranslate) offsetProp = 'right';else offsetProp = swiper.isHorizontal() ? 'left' : 'top'; 11032 let slidesAfter; 11033 let slidesBefore; 11034 if (centeredSlides) { 11035 slidesAfter = Math.floor(slidesPerView / 2) + slidesPerGroup + addSlidesAfter; 11036 slidesBefore = Math.floor(slidesPerView / 2) + slidesPerGroup + addSlidesBefore; 11037 } else { 11038 slidesAfter = slidesPerView + (slidesPerGroup - 1) + addSlidesAfter; 11039 slidesBefore = (isLoop ? slidesPerView : slidesPerGroup) + addSlidesBefore; 11040 } 11041 let from = activeIndex - slidesBefore; 11042 let to = activeIndex + slidesAfter; 11043 if (!isLoop) { 11044 from = Math.max(from, 0); 11045 to = Math.min(to, slides.length - 1); 11046 } 11047 let offset = (swiper.slidesGrid[from] || 0) - (swiper.slidesGrid[0] || 0); 11048 if (isLoop && activeIndex >= slidesBefore) { 11049 from -= slidesBefore; 11050 if (!centeredSlides) offset += swiper.slidesGrid[0]; 11051 } else if (isLoop && activeIndex < slidesBefore) { 11052 from = -slidesBefore; 11053 if (centeredSlides) offset += swiper.slidesGrid[0]; 11054 } 11055 Object.assign(swiper.virtual, { 11056 from, 11057 to, 11058 offset, 11059 slidesGrid: swiper.slidesGrid, 11060 slidesBefore, 11061 slidesAfter 11062 }); 11063 function onRendered() { 11064 swiper.updateSlides(); 11065 swiper.updateProgress(); 11066 swiper.updateSlidesClasses(); 11067 emit('virtualUpdate'); 11068 } 11069 if (previousFrom === from && previousTo === to && !force) { 11070 if (swiper.slidesGrid !== previousSlidesGrid && offset !== previousOffset) { 11071 swiper.slides.forEach(slideEl => { 11072 slideEl.style[offsetProp] = `${offset - Math.abs(swiper.cssOverflowAdjustment())}px`; 11073 }); 11074 } 11075 swiper.updateProgress(); 11076 emit('virtualUpdate'); 11077 return; 11078 } 11079 if (swiper.params.virtual.renderExternal) { 11080 swiper.params.virtual.renderExternal.call(swiper, { 11081 offset, 11082 from, 11083 to, 11084 slides: function getSlides() { 11085 const slidesToRender = []; 11086 for (let i = from; i <= to; i += 1) { 11087 slidesToRender.push(slides[i]); 11088 } 11089 return slidesToRender; 11090 }() 11091 }); 11092 if (swiper.params.virtual.renderExternalUpdate) { 11093 onRendered(); 11094 } else { 11095 emit('virtualUpdate'); 11096 } 11097 return; 11098 } 11099 const prependIndexes = []; 11100 const appendIndexes = []; 11101 const getSlideIndex = index => { 11102 let slideIndex = index; 11103 if (index < 0) { 11104 slideIndex = slides.length + index; 11105 } else if (slideIndex >= slides.length) { 11106 // eslint-disable-next-line 11107 slideIndex = slideIndex - slides.length; 11108 } 11109 return slideIndex; 11110 }; 11111 if (force) { 11112 swiper.slides.filter(el => el.matches(`.${swiper.params.slideClass}
11112, swiper-slide`)).forEach(slideEl => { 11113 slideEl.remove(); 11114 }); 11115 } else { 11116 for (let i = previousFrom; i <= previousTo; i += 1) { 11117 if (i < from || i > to) { 11118 const slideIndex = getSlideIndex(i); 11119 swiper.slides.filter(el => el.matches(`.${swiper.params.slideClass}[data-swiper-slide-index="${slideIndex}"], swiper-slide[data-swiper-slide-index="${slideIndex}"]`)).forEach(slideEl => { 11120 slideEl.remove(); 11121 }); 11122 } 11123 } 11124 } 11125 const loopFrom = isLoop ? -slides.length : 0; 11126 const loopTo = isLoop ? slides.length * 2 : slides.length; 11127 for (let i = loopFrom; i < loopTo; i += 1) { 11128 if (i >= from && i <= to) { 11129 const slideIndex = getSlideIndex(i); 11130 if (typeof previousTo === 'undefined' || force) { 11131 appendIndexes.push(slideIndex); 11132 } else { 11133 if (i > previousTo) appendIndexes.push(slideIndex); 11134 if (i < previousFrom) prependIndexes.push(slideIndex); 11135 } 11136 } 11137 } 11138 appendIndexes.forEach(index => { 11139 swiper.slidesEl.append(renderSlide(slides[index], index)); 11140 }); 11141 if (isLoop) { 11142 for (let i = prependIndexes.length - 1; i >= 0; i -= 1) { 11143 const index = prependIndexes[i]; 11144 swiper.slidesEl.prepend(renderSlide(slides[index], index)); 11145 } 11146 } else { 11147 prependIndexes.sort((a, b) => b - a); 11148 prependIndexes.forEach(index => { 11149 swiper.slidesEl.prepend(renderSlide(slides[index], index)); 11150 }); 11151 } 11152 elementChildren(swiper.slidesEl, '.swiper-slide, swiper-slide').forEach(sli
vendor: 5,044 bytes, lines 11152-11282
11152deEl => { 11153 slideEl.style[offsetProp] = `${offset - Math.abs(swiper.cssOverflowAdjustment())}px`; 11154 }); 11155 onRendered(); 11156 } 11157 function appendSlide(slides) { 11158 if (typeof slides === 'object' && 'length' in slides) { 11159 for (let i = 0; i < slides.length; i += 1) { 11160 if (slides[i]) swiper.virtual.slides.push(slides[i]); 11161 } 11162 } else { 11163 swiper.virtual.slides.push(slides); 11164 } 11165 update(true); 11166 } 11167 function prependSlide(slides) { 11168 const activeIndex = swiper.activeIndex; 11169 let newActiveIndex = activeIndex + 1; 11170 let numberOfNewSlides = 1; 11171 if (Array.isArray(slides)) { 11172 for (let i = 0; i < slides.length; i += 1) { 11173 if (slides[i]) swiper.virtual.slides.unshift(slides[i]); 11174 } 11175 newActiveIndex = activeIndex + slides.length; 11176 numberOfNewSlides = slides.length; 11177 } else { 11178 swiper.virtual.slides.unshift(slides); 11179 } 11180 if (swiper.params.virtual.cache) { 11181 const cache = swiper.virtual.cache; 11182 const newCache = {}; 11183 Object.keys(cache).forEach(cachedIndex => { 11184 const cachedEl = cache[cachedIndex]; 11185 const cachedElIndex = cachedEl.getAttribute('data-swiper-slide-index'); 11186 if (cachedElIndex) { 11187 cachedEl.setAttribute('data-swiper-slide-index', parseInt(cachedElIndex, 10) + numberOfNewSlides); 11188 } 11189 newCache[parseInt(cachedIndex, 10) + numberOfNewSlides] = cachedEl; 11190 }); 11191 swiper.virtual.cache = newCache; 11192 } 11193 update(true); 11194 swiper.slideTo(newActiveIndex, 0); 11195 } 11196 function removeSlide(slidesIndexes) { 11197 if (typeof slidesIndexes === 'undefined' || slidesIndexes === null) return; 11198 let activeIndex = swiper.activeIndex; 11199 if (Array.isArray(slidesIndexes)) { 11200 for (let i = slidesIndexes.length - 1; i >= 0; i -= 1) { 11201 if (swiper.params.virtual.cache) { 11202 delete swiper.virtual.cache[slidesIndexes[i]]; 11203 // shift cache indexes 11204 Object.keys(swiper.virtual.cache).forEach(key => { 11205 if (key > slidesIndexes) { 11206 swiper.virtual.cache[key - 1] = swiper.virtual.cache[key]; 11207 swiper.virtual.cache[key - 1].setAttribute('data-swiper-slide-index', key - 1); 11208 delete swiper.virtual.cache[key]; 11209 } 11210 }); 11211 } 11212 swiper.virtual.slides.splice(slidesIndexes[i], 1); 11213 if (slidesIndexes[i] < activeIndex) activeIndex -= 1; 11214 activeIndex = Math.max(activeIndex, 0); 11215 } 11216 } else { 11217 if (swiper.params.virtual.cache) { 11218 delete swiper.virtual.cache[slidesIndexes]; 11219 // shift cache indexes 11220 Object.keys(swiper.virtual.cache).forEach(key => { 11221 if (key > slidesIndexes) { 11222 swiper.virtual.cache[key - 1] = swiper.virtual.cache[key]; 11223 swiper.virtual.cache[key - 1].setAttribute('data-swiper-slide-index', key - 1); 11224 delete swiper.virtual.cache[key]; 11225 } 11226 }); 11227 } 11228 swiper.virtual.slides.splice(slidesIndexes, 1); 11229 if (slidesIndexes < activeIndex) activeIndex -= 1; 11230 activeIndex = Math.max(activeIndex, 0); 11231 } 11232 update(true); 11233 swiper.slideTo(activeIndex, 0); 11234 } 11235 function removeAllSlides() { 11236 swiper.virtual.slides = []; 11237 if (swiper.params.virtual.cache) { 11238 swiper.virtual.cache = {}; 11239 } 11240 update(true); 11241 swiper.slideTo(0, 0); 11242 } 11243 on('beforeInit', () => { 11244 if (!swiper.params.virtual.enabled) return; 11245 let domSlidesAssigned; 11246 if (typeof swiper.passedParams.virtual.slides === 'undefined') { 11247 const slides = [...swiper.slidesEl.children].filter(el => el.matches(`.${swiper.params.slideClass}, swiper-slide`)); 11248 if (slides && slides.length) { 11249 swiper.virtual.slides = [...slides]; 11250 domSlidesAssigned = true; 11251 slides.forEach((slideEl, slideIndex) => { 11252 slideEl.setAttribute('data-swiper-slide-index', slideIndex); 11253 swiper.virtual.cache[slideIndex] = slideEl; 11254 slideEl.remove(); 11255 }); 11256 } 11257 } 11258 if (!domSlidesAssigned) { 11259 swiper.virtual.slides = swiper.params.virtual.slides; 11260 } 11261 swiper.classNames.push(`${swiper.params.containerModifierClass}virtual`); 11262 swiper.params.watchSlidesProgress = true; 11263 swiper.originalParams.watchSlidesProgress = true; 11264 update(false, true); 11265 }); 11266 on('setTranslate', () => { 11267 if (!swiper.params.virtual.enabled) return; 11268 if (swiper.params.cssMode && !swiper._immediateVirtual) { 11269 clearTimeout(cssModeTimeout); 11270 cssModeTimeout = setTimeout(() => { 11271 update(); 11272 }, 100); 11273 } else { 11274 update(); 11275 } 11276 }); 11277 on('init update resize', () => { 11278 if (!swiper.params.virtual.enabled) return; 11279 if (swiper.params.cssMode) { 11280 setCSSProperty(swiper.wrapperEl, '--swiper-virtual-size', `${swiper.virtualSize}px`); 11281 } 11282 });
vendor: 4,242 bytes, lines 11283-11387
11283 Object.assign(swiper.virtual, { 11284 appendSlide, 11285 prependSlide, 11286 removeSlide, 11287 removeAllSlides, 11288 update 11289 }); 11290 } 11291 11292 /* eslint-disable consistent-return */ 11293 function Keyboard(_ref) { 11294 let { 11295 swiper, 11296 extendParams, 11297 on, 11298 emit 11299 } = _ref; 11300 const document = getDocument(); 11301 const window = getWindow(); 11302 swiper.keyboard = { 11303 enabled: false 11304 }; 11305 extendParams({ 11306 keyboard: { 11307 enabled: false, 11308 onlyInViewport: true, 11309 pageUpDown: true 11310 } 11311 }); 11312 function handle(event) { 11313 if (!swiper.enabled) return; 11314 const { 11315 rtlTranslate: rtl 11316 } = swiper; 11317 let e = event; 11318 if (e.originalEvent) e = e.originalEvent; // jquery fix 11319 const kc = e.keyCode || e.charCode; 11320 const pageUpDown = swiper.params.keyboard.pageUpDown; 11321 const isPageUp = pageUpDown && kc === 33; 11322 const isPageDown = pageUpDown && kc === 34; 11323 const isArrowLeft = kc === 37; 11324 const isArrowRight = kc === 39; 11325 const isArrowUp = kc === 38; 11326 const isArrowDown = kc === 40; 11327 // Directions locks 11328 if (!swiper.allowSlideNext && (swiper.isHorizontal() && isArrowRight || swiper.isVertical() && isArrowDown || isPageDown)) { 11329 return false; 11330 } 11331 if (!swiper.allowSlidePrev && (swiper.isHorizontal() && isArrowLeft || swiper.isVertical() && isArrowUp || isPageUp)) { 11332 return false; 11333 } 11334 if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) { 11335 return undefined; 11336 } 11337 if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) { 11338 return undefined; 11339 } 11340 if (swiper.params.keyboard.onlyInViewport && (isPageUp || isPageDown || isArrowLeft || isArrowRight || isArrowUp || isArrowDown)) { 11341 let inView = false; 11342 // Check that swiper should be inside of visible area of window 11343 if (elementParents(swiper.el, `.${swiper.params.slideClass}, swiper-slide`).length > 0 && elementParents(swiper.el, `.${swiper.params.slideActiveClass}`).length === 0) { 11344 return undefined; 11345 } 11346 const el = swiper.el; 11347 const swiperWidth = el.clientWidth; 11348 const swiperHeight = el.clientHeight; 11349 const windowWidth = window.innerWidth; 11350 const windowHeight = window.innerHeight; 11351 const swiperOffset = elementOffset(el); 11352 if (rtl) swiperOffset.left -= el.scrollLeft; 11353 const swiperCoord = [[swiperOffset.left, swiperOffset.top], [swiperOffset.left + swiperWidth, swiperOffset.top], [swiperOffset.left, swiperOffset.top + swiperHeight], [swiperOffset.left + swiperWidth, swiperOffset.top + swiperHeight]]; 11354 for (let i = 0; i < swiperCoord.length; i += 1) { 11355 const point = swiperCoord[i]; 11356 if (point[0] >= 0 && point[0] <= windowWidth && point[1] >= 0 && point[1] <= windowHeight) { 11357 if (point[0] === 0 && point[1] === 0) continue; // eslint-disable-line 11358 inView = true; 11359 } 11360 } 11361 if (!inView) return undefined; 11362 } 11363 if (swiper.isHorizontal()) { 11364 if (isPageUp || isPageDown || isArrowLeft || isArrowRight) { 11365 if (e.preventDefault) e.preventDefault();else e.returnValue = false; 11366 } 11367 if ((isPageDown || isArrowRight) && !rtl || (isPageUp || isArrowLeft) && rtl) swiper.slideNext(); 11368 if ((isPageUp || isArrowLeft) && !rtl || (isPageDown || isArrowRight) && rtl) swiper.slidePrev(); 11369 } else { 11370 if (isPageUp || isPageDown || isArrowUp || isArrowDown) { 11371 if (e.preventDefault) e.preventDefault();else e.returnValue = false; 11372 } 11373 if (isPageDown || isArrowDown) swiper.slideNext(); 11374 if (isPageUp || isArrowUp) swiper.slidePrev(); 11375 } 11376 emit('keyPress', kc); 11377 return undefined; 11378 } 11379 function enable() { 11380 if (swiper.keyboard.enabled) return; 11381 document.addEventListener('keydown', handle); 11382 swiper.keyboard.enabled = true; 11383 } 11384 function disable() { 11385 if (!swiper.keyboard.enabled) return; 11386 document.removeEventListener('keydown', handle); 11387 swiper.keyboard.enabled = false;
vendor: 22,694 bytes, lines 11388-12000
11388 } 11389 on('init', () => { 11390 if (swiper.params.keyboard.enabled) { 11391 enable(); 11392 } 11393 }); 11394 on('destroy', () => { 11395 if (swiper.keyboard.enabled) { 11396 disable(); 11397 } 11398 }); 11399 Object.assign(swiper.keyboard, { 11400 enable, 11401 disable 11402 }); 11403 } 11404 11405 /* eslint-disable consistent-return */ 11406 function Mousewheel(_ref) { 11407 let { 11408 swiper, 11409 extendParams, 11410 on, 11411 emit 11412 } = _ref; 11413 const window = getWindow(); 11414 extendParams({ 11415 mousewheel: { 11416 enabled: false, 11417 releaseOnEdges: false, 11418 invert: false, 11419 forceToAxis: false, 11420 sensitivity: 1, 11421 eventsTarget: 'container', 11422 thresholdDelta: null, 11423 thresholdTime: null, 11424 noMousewheelClass: 'swiper-no-mousewheel' 11425 } 11426 }); 11427 swiper.mousewheel = { 11428 enabled: false 11429 }; 11430 let timeout; 11431 let lastScrollTime = now(); 11432 let lastEventBeforeSnap; 11433 const recentWheelEvents = []; 11434 function normalize(e) { 11435 // Reasonable defaults 11436 const PIXEL_STEP = 10; 11437 const LINE_HEIGHT = 40; 11438 const PAGE_HEIGHT = 800; 11439 let sX = 0; 11440 let sY = 0; // spinX, spinY 11441 let pX = 0; 11442 let pY = 0; // pixelX, pixelY 11443 11444 // Legacy 11445 if ('detail' in e) { 11446 sY = e.detail; 11447 } 11448 if ('wheelDelta' in e) { 11449 sY = -e.wheelDelta / 120; 11450 } 11451 if ('wheelDeltaY' in e) { 11452 sY = -e.wheelDeltaY / 120; 11453 } 11454 if ('wheelDeltaX' in e) { 11455 sX = -e.wheelDeltaX / 120; 11456 } 11457 11458 // side scrolling on FF with DOMMouseScroll 11459 if ('axis' in e && e.axis === e.HORIZONTAL_AXIS) { 11460 sX = sY; 11461 sY = 0; 11462 } 11463 pX = sX * PIXEL_STEP; 11464 pY = sY * PIXEL_STEP; 11465 if ('deltaY' in e) { 11466 pY = e.deltaY; 11467 } 11468 if ('deltaX' in e) { 11469 pX = e.deltaX; 11470 } 11471 if (e.shiftKey && !pX) { 11472 // if user scrolls with shift he wants horizontal scroll 11473 pX = pY; 11474 pY = 0; 11475 } 11476 if ((pX || pY) && e.deltaMode) { 11477 if (e.deltaMode === 1) { 11478 // delta in LINE units 11479 pX *= LINE_HEIGHT; 11480 pY *= LINE_HEIGHT; 11481 } else { 11482 // delta in PAGE units 11483 pX *= PAGE_HEIGHT; 11484 pY *= PAGE_HEIGHT; 11485 } 11486 } 11487 11488 // Fall-back if spin cannot be determined 11489 if (pX && !sX) { 11490 sX = pX < 1 ? -1 : 1; 11491 } 11492 if (pY && !sY) { 11493 sY = pY < 1 ? -1 : 1; 11494 } 11495 return { 11496 spinX: sX, 11497 spinY: sY, 11498 pixelX: pX, 11499 pixelY: pY 11500 }; 11501 } 11502 function handleMouseEnter() { 11503 if (!swiper.enabled) return; 11504 swiper.mouseEntered = true; 11505 } 11506 function handleMouseLeave() { 11507 if (!swiper.enabled) return; 11508 swiper.mouseEntered = false; 11509 } 11510 function animateSlider(newEvent) { 11511 if (swiper.params.mousewheel.thresholdDelta && newEvent.delta < swiper.params.mousewheel.thresholdDelta) { 11512 // Prevent if delta of wheel scroll delta is below configured threshold 11513 return false; 11514 } 11515 if (swiper.params.mousewheel.thresholdTime && now() - lastScrollTime < swiper.params.mousewheel.thresholdTime) { 11516 // Prevent if time between scrolls is below configured threshold 11517 return false; 11518 } 11519 11520 // If the movement is NOT big enough and 11521 // if the last time the user scrolled was too close to the current one (avoid continuously triggering the slider): 11522 // Don't go any further (avoid insignificant scroll movement). 11523 if (newEvent.delta >= 6 && now() - lastScrollTime < 60) { 11524 // Return false as a default 11525 return true; 11526 } 11527 // If user is scrolling towards the end: 11528 // If the slider hasn't hit the latest slide or 11529 // if the slider is a loop and 11530 // if the slider isn't moving right now: 11531 // Go to next slide and 11532 // emit a scroll event. 11533 // Else (the user is scrolling towards the beginning) and 11534 // if the slider hasn't hit the first slide or 11535 // if the slider is a loop and 11536 // if the slider isn't moving right now: 11537 // Go to prev slide and 11538 // emit a scroll event. 11539 if (newEvent.direction < 0) { 11540 if ((!swiper.isEnd || swiper.params.loop) && !swiper.animating) { 11541 swiper.slideNext(); 11542 emit('scroll', newEvent.raw); 11543 } 11544 } else if ((!swiper.isBeginning || swiper.params.loop) && !swiper.animating) { 11545 swiper.slidePrev(); 11546 emit('scroll', newEvent.raw); 11547 } 11548 // If you got here is because an animation has been triggered so store the current time 11549 lastScrollTime = new window.Date().getTime(); 11550 // Return false as a default 11551 return false; 11552 } 11553 function releaseScroll(newEvent) { 11554 const params = swiper.params.mousewheel; 11555 if (newEvent.direction < 0) { 11556 if (swiper.isEnd && !swiper.params.loop && params.releaseOnEdges) { 11557 // Return true to animate scroll on edges 11558 return true; 11559 } 11560 } else if (swiper.isBeginning && !swiper.params.loop && params.releaseOnEdges) { 11561 // Return true to animate scroll on edges 11562 return true; 11563 } 11564 return false; 11565 } 11566 function handle(event) { 11567 let e = event; 11568 let disableParentSwiper = true; 11569 if (!swiper.enabled) return; 11570 11571 // Ignore event if the target or its parents have the swiper-no-mousewheel class 11572 if (event.target.closest(`.${swiper.params.mousewheel.noMousewheelClass}`)) return; 11573 const params = swiper.params.mousewheel; 11574 if (swiper.params.cssMode) { 11575 e.preventDefault(); 11576 } 11577 let targetEl = swiper.el; 11578 if (swiper.params.mousewheel.eventsTarget !== 'container') { 11579 targetEl = document.querySelector(swiper.params.mousewheel.eventsTarget); 11580 } 11581 const targetElContainsTarget = targetEl && targetEl.contains(e.target); 11582 if (!swiper.mouseEntered && !targetElContainsTarget && !params.releaseOnEdges) return true; 11583 if (e.originalEvent) e = e.originalEvent; // jquery fix 11584 let delta = 0; 11585 const rtlFactor = swiper.rtlTranslate ? -1 : 1; 11586 const data = normalize(e); 11587 if (params.forceToAxis) { 11588 if (swiper.isHorizontal()) { 11589 if (Math.abs(data.pixelX) > Math.abs(data.pixelY)) delta = -data.pixelX * rtlFactor;else return true; 11590 } else if (Math.abs(data.pixelY) > Math.abs(data.pixelX)) delta = -data.pixelY;else return true; 11591 } else { 11592 delta = Math.abs(data.pixelX) > Math.abs(data.pixelY) ? -data.pixelX * rtlFactor : -data.pixelY; 11593 } 11594 if (delta === 0) return true; 11595 if (params.invert) delta = -delta; 11596 11597 // Get the scroll positions 11598 let positions = swiper.getTranslate() + delta * params.sensitivity; 11599 if (positions >= swiper.minTranslate()) positions = swiper.minTranslate(); 11600 if (positions <= swiper.maxTranslate()) positions = swiper.maxTranslate(); 11601 11602 // When loop is true: 11603 // the disableParentSwiper will be true. 11604 // When loop is false: 11605 // if the scroll positions is not on edge, 11606 // then the disableParentSwiper will be true. 11607 // if the scroll on edge positions, 11608 // then the disableParentSwiper will be false. 11609 disableParentSwiper = swiper.params.loop ? true : !(positions === swiper.minTranslate() || positions === swiper.maxTranslate()); 11610 if (disableParentSwiper && swiper.params.nested) e.stopPropagation(); 11611 if (!swiper.params.freeMode || !swiper.params.freeMode.enabled) { 11612 // Register the new event in a variable which stores the relevant data 11613 const newEvent = { 11614 time: now(), 11615 delta: Math.abs(delta), 11616 direction: Math.sign(delta), 11617 raw: event 11618 }; 11619 11620 // Keep the most recent events 11621 if (recentWheelEvents.length >= 2) { 11622 recentWheelEvents.shift(); // only store the last N events 11623 } 11624 11625 const prevEvent = recentWheelEvents.length ? recentWheelEvents[recentWheelEvents.length - 1] : undefined; 11626 recentWheelEvents.push(newEvent); 11627 11628 // If there is at least one previous recorded event: 11629 // If direction has changed or 11630 // if the scroll is quicker than the previous one: 11631 // Animate the slider. 11632 // Else (this is the first time the wheel is moved): 11633 // Animate the slider. 11634 if (prevEvent) { 11635 if (newEvent.direction !== prevEvent.direction || newEvent.delta > prevEvent.delta || newEvent.time > prevEvent.time + 150) { 11636 animateSlider(newEvent); 11637 } 11638 } else { 11639 animateSlider(newEvent); 11640 } 11641 11642 // If it's time to release the scroll: 11643 // Return now so you don't hit the preventDefault. 11644 if (releaseScroll(newEvent)) { 11645 return true; 11646 } 11647 } else { 11648 // Freemode or scrollContainer: 11649 11650 // If we recently snapped after a momentum scroll, then ignore wheel events 11651 // to give time for the deceleration to finish. Stop ignoring after 500 msecs 11652 // or if it's a new scroll (larger delta or inverse sign as last event before 11653 // an end-of-momentum snap). 11654 const newEvent = { 11655 time: now(), 11656 delta: Math.abs(delta), 11657 direction: Math.sign(delta) 11658 }; 11659 const ignoreWheelEvents = lastEventBeforeSnap && newEvent.time < lastEventBeforeSnap.time + 500 && newEvent.delta <= lastEventBeforeSnap.delta && newEvent.direction === lastEventBeforeSnap.direction; 11660 if (!ignoreWheelEvents) { 11661 lastEventBeforeSnap = undefined; 11662 let position = swiper.getTranslate() + delta * params.sensitivity; 11663 const wasBeginning = swiper.isBeginning; 11664 const wasEnd = swiper.isEnd; 11665 if (position >= swiper.minTranslate()) position = swiper.minTranslate(); 11666 if (position <= swiper.maxTranslate()) position = swiper.maxTranslate(); 11667 swiper.setTransition(0); 11668 swiper.setTranslate(position); 11669 swiper.updateProgress(); 11670 swiper.updateActiveIndex(); 11671 swiper.updateSlidesClasses(); 11672 if (!wasBeginning && swiper.isBeginning || !wasEnd && swiper.isEnd) { 11673 swiper.updateSlidesClasses(); 11674 } 11675 if (swiper.params.loop) { 11676 swiper.loopFix({ 11677 direction: newEvent.direction < 0 ? 'next' : 'prev', 11678 byMousewheel: true 11679 }); 11680 } 11681 if (swiper.params.freeMode.sticky) { 11682 // When wheel scrolling starts with sticky (aka snap) enabled, then detect 11683 // the end of a momentum scroll by storing recent (N=15?) wheel events. 11684 // 1. do all N events have decreasing or same (absolute value) delta? 11685 // 2. did all N events arrive in the last M (M=500?) msecs? 11686 // 3. does the earliest event have an (absolute value) delta that's 11687 // at least P (P=1?) larger than the most recent event's delta? 11688 // 4. does the latest event have a delta that's smaller than Q (Q=6?) pixels? 11689 // If 1-4 are "yes" then we're near the end of a momentum scroll deceleration. 11690 // Snap immediately and ignore remaining wheel events in this scroll. 11691 // See comment above for "remaining wheel events in this scroll" determination. 11692 // If 1-4 aren't satisfied, then wait to snap until 500ms after the last event. 11693 clearTimeout(timeout); 11694 timeout = undefined; 11695 if (recentWheelEvents.length >= 15) { 11696 recentWheelEvents.shift(); // only store the last N events 11697 } 11698 11699 const prevEvent = recentWheelEvents.length ? recentWheelEvents[recentWheelEvents.length - 1] : undefined; 11700 const firstEvent = recentWheelEvents[0]; 11701 recentWheelEvents.push(newEvent); 11702 if (prevEvent && (newEvent.delta > prevEvent.delta || newEvent.direction !== prevEvent.direction)) { 11703 // Increasing or reverse-sign delta means the user started scrolling again. Clear the wheel event log. 11704 recentWheelEvents.splice(0); 11705 } else if (recentWheelEvents.length >= 15 && newEvent.time - firstEvent.time < 500 && firstEvent.delta - newEvent.delta >= 1 && newEvent.delta <= 6) { 11706 // We're at the end of the deceleration of a momentum scroll, so there's no need 11707 // to wait for more events. Snap ASAP on the next tick. 11708 // Also, because there's some remaining momentum we'll bias the snap in the 11709 // direction of the ongoing scroll because it's better UX for the scroll to snap 11710 // in the same direction as the scroll instead of reversing to snap. Therefore, 11711 // if it's already scrolled more than 20% in the current direction, keep going. 11712 const snapToThreshold = delta > 0 ? 0.8 : 0.2; 11713 lastEventBeforeSnap = newEvent; 11714 recentWheelEvents.splice(0); 11715 timeout = nextTick(() => { 11716 if (swiper.destroyed || !swiper.params) return; 11717 swiper.slideToClosest(swiper.params.speed, true, undefined, snapToThreshold); 11718 }, 0); // no delay; move on next tick 11719 } 11720 11721 if (!timeout) { 11722 // if we get here, then we haven't detected the end of a momentum scroll, so 11723 // we'll consider a scroll "complete" when there haven't been any wheel events 11724 // for 500ms. 11725 timeout = nextTick(() => { 11726 if (swiper.destroyed || !swiper.params) return; 11727 const snapToThreshold = 0.5; 11728 lastEventBeforeSnap = newEvent; 11729 recentWheelEvents.splice(0); 11730 swiper.slideToClosest(swiper.params.speed, true, undefined, snapToThreshold); 11731 }, 500); 11732 } 11733 } 11734 11735 // Emit event 11736 if (!ignoreWheelEvents) emit('scroll', e); 11737 11738 // Stop autoplay 11739 if (swiper.params.autoplay && swiper.params.autoplayDisableOnInteraction) swiper.autoplay.stop(); 11740 // Return page scroll on edge positions 11741 if (params.releaseOnEdges && (position === swiper.minTranslate() || position === swiper.maxTranslate())) { 11742 return true; 11743 } 11744 } 11745 } 11746 if (e.preventDefault) e.preventDefault();else e.returnValue = false; 11747 return false; 11748 } 11749 function events(method) { 11750 let targetEl = swiper.el; 11751 if (swiper.params.mousewheel.eventsTarget !== 'container') { 11752 targetEl = document.querySelector(swiper.params.mousewheel.eventsTarget); 11753 } 11754 targetEl[method]('mouseenter', handleMouseEnter); 11755 targetEl[method]('mouseleave', handleMouseLeave); 11756 targetEl[method]('wheel', handle); 11757 } 11758 function enable() { 11759 if (swiper.params.cssMode) { 11760 swiper.wrapperEl.removeEventListener('wheel', handle); 11761 return true; 11762 } 11763 if (swiper.mousewheel.enabled) return false; 11764 events('addEventListener'); 11765 swiper.mousewheel.enabled = true; 11766 return true; 11767 } 11768 function disable() { 11769 if (swiper.params.cssMode) { 11770 swiper.wrapperEl.addEventListener(event, handle); 11771 return true; 11772 } 11773 if (!swiper.mousewheel.enabled) return false; 11774 events('removeEventListener'); 11775 swiper.mousewheel.enabled = false; 11776 return true; 11777 } 11778 on('init', () => { 11779 if (!swiper.params.mousewheel.enabled && swiper.params.cssMode) { 11780 disable(); 11781 } 11782 if (swiper.params.mousewheel.enabled) enable(); 11783 }); 11784 on('destroy', () => { 11785 if (swiper.params.cssMode) { 11786 enable(); 11787 } 11788 if (swiper.mousewheel.enabled) disable(); 11789 }); 11790 Object.assign(swiper.mousewheel, { 11791 enable, 11792 disable 11793 }); 11794 } 11795 11796 function createElementIfNotDefined(swiper, originalParams, params, checkProps) { 11797 if (swiper.params.createElements) { 11798 Object.keys(checkProps).forEach(key => { 11799 if (!params[key] && params.auto === true) { 11800 let element = elementChildren(swiper.el, `.${checkProps[key]}`)[0]; 11801 if (!element) { 11802 element = createElement('div', checkProps[key]); 11803 element.className = checkProps[key]; 11804 swiper.el.append(element); 11805 } 11806 params[key] = element; 11807 originalParams[key] = element; 11808 } 11809 }); 11810 } 11811 return params; 11812 } 11813 11814 function Navigation(_ref) { 11815 let { 11816 swiper, 11817 extendParams, 11818 on, 11819 emit 11820 } = _ref; 11821 extendParams({ 11822 navigation: { 11823 nextEl: null, 11824 prevEl: null, 11825 hideOnClick: false, 11826 disabledClass: 'swiper-button-disabled', 11827 hiddenClass: 'swiper-button-hidden', 11828 lockClass: 'swiper-button-lock', 11829 navigationDisabledClass: 'swiper-navigation-disabled' 11830 } 11831 }); 11832 swiper.navigation = { 11833 nextEl: null, 11834 prevEl: null 11835 }; 11836 function getEl(el) { 11837 let res; 11838 if (el && typeof el === 'string' && swiper.isElement) { 11839 res = swiper.el.querySelector(el); 11840 if (res) return res; 11841 } 11842 if (el) { 11843 if (typeof el === 'string') res = [...document.querySelectorAll(el)]; 11844 if (swiper.params.uniqueNavElements && typeof el === 'string' && res && res.length > 1 && swiper.el.querySelectorAll(el).length === 1) { 11845 res = swiper.el.querySelector(el); 11846 } else if (res && res.length === 1) { 11847 res = res[0]; 11848 } 11849 } 11850 if (el && !res) return el; 11851 // if (Array.isArray(res) && res.length === 1) res = res[0]; 11852 return res; 11853 } 11854 function toggleEl(el, disabled) { 11855 const params = swiper.params.navigation; 11856 el = makeElementsArray(el); 11857 el.forEach(subEl => { 11858 if (subEl) { 11859 subEl.classList[disabled ? 'add' : 'remove'](...params.disabledClass.split(' ')); 11860 if (subEl.tagName === 'BUTTON') subEl.disabled = disabled; 11861 if (swiper.params.watchOverflow && swiper.enabled) { 11862 subEl.classList[swiper.isLocked ? 'add' : 'remove'](params.lockClass); 11863 } 11864 } 11865 }); 11866 } 11867 function update() { 11868 // Update Navigation Buttons 11869 const { 11870 nextEl, 11871 prevEl 11872 } = swiper.navigation; 11873 if (swiper.params.loop) { 11874 toggleEl(prevEl, false); 11875 toggleEl(nextEl, false); 11876 return; 11877 } 11878 toggleEl(prevEl, swiper.isBeginning && !swiper.params.rewind); 11879 toggleEl(nextEl, swiper.isEnd && !swiper.params.rewind); 11880 } 11881 function onPrevClick(e) { 11882 e.preventDefault(); 11883 if (swiper.isBeginning && !swiper.params.loop && !swiper.params.rewind) return; 11884 swiper.slidePrev(); 11885 emit('navigationPrev'); 11886 } 11887 function onNextClick(e) { 11888 e.preventDefault(); 11889 if (swiper.isEnd && !swiper.params.loop && !swiper.params.rewind) return; 11890 swiper.slideNext(); 11891 emit('navigationNext'); 11892 } 11893 function init() { 11894 const params = swiper.params.navigation; 11895 swiper.params.navigation = createElementIfNotDefined(swiper, swiper.originalParams.navigation, swiper.params.navigation, { 11896 nextEl: 'swiper-button-next', 11897 prevEl: 'swiper-button-prev' 11898 }); 11899 if (!(params.nextEl || params.prevEl)) return; 11900 let nextEl = getEl(params.nextEl); 11901 let prevEl = getEl(params.prevEl); 11902 Object.assign(swiper.navigation, { 11903 nextEl, 11904 prevEl 11905 }); 11906 nextEl = makeElementsArray(nextEl); 11907 prevEl = makeElementsArray(prevEl); 11908 const initButton = (el, dir) => { 11909 if (el) { 11910 el.addEventListener('click', dir === 'next' ? onNextClick : onPrevClick); 11911 } 11912 if (!swiper.enabled && el) { 11913 el.classList.add(...params.lockClass.split(' ')); 11914 } 11915 }; 11916 nextEl.forEach(el => initButton(el, 'next')); 11917 prevEl.forEach(el => initButton(el, 'prev')); 11918 } 11919 function destroy() { 11920 let { 11921 nextEl, 11922 prevEl 11923 } = swiper.navigation; 11924 nextEl = makeElementsArray(nextEl); 11925 prevEl = makeElementsArray(prevEl); 11926 const destroyButton = (el, dir) => { 11927 el.removeEventListener('click', dir === 'next' ? onNextClick : onPrevClick); 11928 el.classList.remove(...swiper.params.navigation.disabledClass.split(' ')); 11929 }; 11930 nextEl.forEach(el => destroyButton(el, 'next')); 11931 prevEl.forEach(el => destroyButton(el, 'prev')); 11932 } 11933 on('init', () => { 11934 if (swiper.params.navigation.enabled === false) { 11935 // eslint-disable-next-line 11936 disable(); 11937 } else { 11938 init(); 11939 update(); 11940 } 11941 }); 11942 on('toEdge fromEdge lock unlock', () => { 11943 update(); 11944 }); 11945 on('destroy', () => { 11946 destroy(); 11947 }); 11948 on('enable disable', () => { 11949 let { 11950 nextEl, 11951 prevEl 11952 } = swiper.navigation; 11953 nextEl = makeElementsArray(nextEl); 11954 prevEl = makeElementsArray(prevEl); 11955 if (swiper.enabled) { 11956 update(); 11957 return; 11958 } 11959 [...nextEl, ...prevEl].filter(el => !!el).forEach(el => el.classList.add(swiper.params.navigation.lockClass)); 11960 }); 11961 on('click', (_s, e) => { 11962 let { 11963 nextEl, 11964 prevEl 11965 } = swiper.navigation; 11966 nextEl = makeElementsArray(nextEl); 11967 prevEl = makeElementsArray(prevEl); 11968 const targetEl = e.target; 11969 let targetIsButton = prevEl.includes(targetEl) || nextEl.includes(targetEl); 11970 if (swiper.isElement && !targetIsButton) { 11971 const path = e.path || e.composedPath && e.composedPath(); 11972 if (path) { 11973 targetIsButton = path.find(pathEl => nextEl.includes(pathEl) || prevEl.includes(pathEl)); 11974 } 11975 } 11976 if (swiper.params.navigation.hideOnClick && !targetIsButton) { 11977 if (swiper.pagination && swiper.params.pagination && swiper.params.pagination.clickable && (swiper.pagination.el === targetEl || swiper.pagination.el.contains(targetEl))) return; 11978 let isHidden; 11979 if (nextEl.length) { 11980 isHidden = nextEl[0].classList.contains(swiper.params.navigation.hiddenClass); 11981 } else if (prevEl.length) { 11982 isHidden = prevEl[0].classList.contains(swiper.params.navigation.hiddenClass); 11983 } 11984 if (isHidden === true) { 11985 emit('navigationShow'); 11986 } else { 11987 emit('navigationHide'); 11988 } 11989 [...nextEl, ...prevEl].filter(el => !!el).forEach(el => el.classList.toggle(swiper.params.navigation.hiddenClass)); 11990 } 11991 }); 11992 const enable = () => { 11993 swiper.el.classList.remove(...swiper.params.navigation.navigationDisabledClass.split(' ')); 11994 init(); 11995 update(); 11996 }; 11997 const disable = () => { 11998 swiper.el.classList.add(...swiper.params.navigation.navigationDisabledClass.split(' ')); 11999 destroy(); 12000 };
vendor: 5,742 bytes, lines 12001-12156
12001 Object.assign(swiper.navigation, { 12002 enable, 12003 disable, 12004 update, 12005 init, 12006 destroy 12007 }); 12008 } 12009 12010 function classesToSelector(classes) { 12011 if (classes === void 0) { 12012 classes = ''; 12013 } 12014 return `.${classes.trim().replace(/([\.:!+\/])/g, '\\$1') // eslint-disable-line 12015 .replace(/ /g, '.')}`; 12016 } 12017 12018 function Pagination(_ref) { 12019 let { 12020 swiper, 12021 extendParams, 12022 on, 12023 emit 12024 } = _ref; 12025 const pfx = 'swiper-pagination'; 12026 extendParams({ 12027 pagination: { 12028 el: null, 12029 bulletElement: 'span', 12030 clickable: false, 12031 hideOnClick: false, 12032 renderBullet: null, 12033 renderProgressbar: null, 12034 renderFraction: null, 12035 renderCustom: null, 12036 progressbarOpposite: false, 12037 type: 'bullets', 12038 // 'bullets' or 'progressbar' or 'fraction' or 'custom' 12039 dynamicBullets: false, 12040 dynamicMainBullets: 1, 12041 formatFractionCurrent: number => number, 12042 formatFractionTotal: number => number, 12043 bulletClass: `${pfx}-bullet`, 12044 bulletActiveClass: `${pfx}-bullet-active`, 12045 modifierClass: `${pfx}-`, 12046 currentClass: `${pfx}-current`, 12047 totalClass: `${pfx}-total`, 12048 hiddenClass: `${pfx}-hidden`, 12049 progressbarFillClass: `${pfx}-progressbar-fill`, 12050 progressbarOppositeClass: `${pfx}-progressbar-opposite`, 12051 clickableClass: `${pfx}-clickable`, 12052 lockClass: `${pfx}-lock`, 12053 horizontalClass: `${pfx}-horizontal`, 12054 verticalClass: `${pfx}-vertical`, 12055 paginationDisabledClass: `${pfx}-disabled` 12056 } 12057 }); 12058 swiper.pagination = { 12059 el: null, 12060 bullets: [] 12061 }; 12062 let bulletSize; 12063 let dynamicBulletIndex = 0; 12064 function isPaginationDisabled() { 12065 return !swiper.params.pagination.el || !swiper.pagination.el || Array.isArray(swiper.pagination.el) && swiper.pagination.el.length === 0; 12066 } 12067 function setSideBullets(bulletEl, position) { 12068 const { 12069 bulletActiveClass 12070 } = swiper.params.pagination; 12071 if (!bulletEl) return; 12072 bulletEl = bulletEl[`${position === 'prev' ? 'previous' : 'next'}ElementSibling`]; 12073 if (bulletEl) { 12074 bulletEl.classList.add(`${bulletActiveClass}-${position}`); 12075 bulletEl = bulletEl[`${position === 'prev' ? 'previous' : 'next'}ElementSibling`]; 12076 if (bulletEl) { 12077 bulletEl.classList.add(`${bulletActiveClass}-${position}-${position}`); 12078 } 12079 } 12080 } 12081 function getMoveDirection(prevIndex, nextIndex, length) { 12082 prevIndex = prevIndex % length; 12083 nextIndex = nextIndex % length; 12084 if (nextIndex === prevIndex + 1) { 12085 return 'next'; 12086 } else if (nextIndex === prevIndex - 1) { 12087 return 'previous'; 12088 } 12089 return; 12090 } 12091 function onBulletClick(e) { 12092 const bulletEl = e.target.closest(classesToSelector(swiper.params.pagination.bulletClass)); 12093 if (!bulletEl) { 12094 return; 12095 } 12096 e.preventDefault(); 12097 const index = elementIndex(bulletEl) * swiper.params.slidesPerGroup; 12098 if (swiper.params.loop) { 12099 if (swiper.realIndex === index) return; 12100 const moveDirection = getMoveDirection(swiper.realIndex, index, swiper.slides.length); 12101 if (moveDirection === 'next') { 12102 swiper.slideNext(); 12103 } else if (moveDirection === 'previous') { 12104 swiper.slidePrev(); 12105 } else { 12106 swiper.slideToLoop(index); 12107 } 12108 } else { 12109 swiper.slideTo(index); 12110 } 12111 } 12112 function update() { 12113 // Render || Update Pagination bullets/items 12114 const rtl = swiper.rtl; 12115 const params = swiper.params.pagination; 12116 if (isPaginationDisabled()) return; 12117 let el = swiper.pagination.el; 12118 el = makeElementsArray(el); 12119 // Current/Total 12120 let current; 12121 let previousIndex; 12122 const slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length; 12123 const total = swiper.params.loop ? Math.ceil(slidesLength / swiper.params.slidesPerGroup) : swiper.snapGrid.length; 12124 if (swiper.params.loop) { 12125 previousIndex = swiper.previousRealIndex || 0; 12126 current = swiper.params.slidesPerGroup > 1 ? Math.floor(swiper.realIndex / swiper.params.slidesPerGroup) : swiper.realIndex; 12127 } else if (typeof swiper.snapIndex !== 'undefined') { 12128 current = swiper.snapIndex; 12129 previousIndex = swiper.previousSnapIndex; 12130 } else { 12131 previousIndex = swiper.previousIndex || 0; 12132 current = swiper.activeIndex || 0; 12133 } 12134 // Types 12135 if (params.type === 'bullets' && swiper.pagination.bullets && swiper.pagination.bullets.length > 0) { 12136 const bullets = swiper.pagination.bullets; 12137 let firstIndex; 12138 let lastIndex; 12139 let midIndex; 12140 if (params.dynamicBullets) { 12141 bulletSize = elementOuterSize(bullets[0], swiper.isHorizontal() ? 'width' : 'height', true); 12142 el.forEach(subEl => { 12143 subEl.style[swiper.isHorizontal() ? 'width' : 'height'] = `${bulletSize * (params.dynamicMainBullets + 4)}px`; 12144 }); 12145 if (params.dynamicMainBullets > 1 && previousIndex !== undefined) { 12146 dynamicBulletIndex += current - (previousIndex || 0); 12147 if (dynamicBulletIndex > params.dynamicMainBullets - 1) { 12148 dynamicBulletIndex = params.dynamicMainBullets - 1; 12149 } else if (dynamicBulletIndex < 0) { 12150 dynamicBulletIndex = 0; 12151 } 12152 } 12153 firstIndex = Math.max(current - dynamicBulletIndex, 0); 12154 lastIndex = firstIndex + (Math.min(bullets.length, params.dynamicMainBullets) - 1); 12155 midIndex = (lastIndex + firstIndex) / 2; 12156 }
vendor: 9,583 bytes, lines 12157-12374
12157 bullets.forEach(bulletEl => { 12158 const classesToRemove = [...['', '-next', '-next-next', '-prev', '-prev-prev', '-main'].map(suffix => `${params.bulletActiveClass}${suffix}`)].map(s => typeof s === 'string' && s.includes(' ') ? s.split(' ') : s).flat(); 12159 bulletEl.classList.remove(...classesToRemove); 12160 }); 12161 if (el.length > 1) { 12162 bullets.forEach(bullet => { 12163 const bulletIndex = elementIndex(bullet); 12164 if (bulletIndex === current) { 12165 bullet.classList.add(...params.bulletActiveClass.split(' ')); 12166 } else if (swiper.isElement) { 12167 bullet.setAttribute('part', 'bullet'); 12168 } 12169 if (params.dynamicBullets) { 12170 if (bulletIndex >= firstIndex && bulletIndex <= lastIndex) { 12171 bullet.classList.add(...`${params.bulletActiveClass}-main`.split(' ')); 12172 } 12173 if (bulletIndex === firstIndex) { 12174 setSideBullets(bullet, 'prev'); 12175 } 12176 if (bulletIndex === lastIndex) { 12177 setSideBullets(bullet, 'next'); 12178 } 12179 } 12180 }); 12181 } else { 12182 const bullet = bullets[current]; 12183 if (bullet) { 12184 bullet.classList.add(...params.bulletActiveClass.split(' ')); 12185 } 12186 if (swiper.isElement) { 12187 bullets.forEach((bulletEl, bulletIndex) => { 12188 bulletEl.setAttribute('part', bulletIndex === current ? 'bullet-active' : 'bullet'); 12189 }); 12190 } 12191 if (params.dynamicBullets) { 12192 const firstDisplayedBullet = bullets[firstIndex]; 12193 const lastDisplayedBullet = bullets[lastIndex]; 12194 for (let i = firstIndex; i <= lastIndex; i += 1) { 12195 if (bullets[i]) { 12196 bullets[i].classList.add(...`${params.bulletActiveClass}-main`.split(' ')); 12197 } 12198 } 12199 setSideBullets(firstDisplayedBullet, 'prev'); 12200 setSideBullets(lastDisplayedBullet, 'next'); 12201 } 12202 } 12203 if (params.dynamicBullets) { 12204 const dynamicBulletsLength = Math.min(bullets.length, params.dynamicMainBullets + 4); 12205 const bulletsOffset = (bulletSize * dynamicBulletsLength - bulletSize) / 2 - midIndex * bulletSize; 12206 const offsetProp = rtl ? 'right' : 'left'; 12207 bullets.forEach(bullet => { 12208 bullet.style[swiper.isHorizontal() ? offsetProp : 'top'] = `${bulletsOffset}px`; 12209 }); 12210 } 12211 } 12212 el.forEach((subEl, subElIndex) => { 12213 if (params.type === 'fraction') { 12214 subEl.querySelectorAll(classesToSelector(params.currentClass)).forEach(fractionEl => { 12215 fractionEl.textContent = params.formatFractionCurrent(current + 1); 12216 }); 12217 subEl.querySelectorAll(classesToSelector(params.totalClass)).forEach(totalEl => { 12218 totalEl.textContent = params.formatFractionTotal(total); 12219 }); 12220 } 12221 if (params.type === 'progressbar') { 12222 let progressbarDirection; 12223 if (params.progressbarOpposite) { 12224 progressbarDirection = swiper.isHorizontal() ? 'vertical' : 'horizontal'; 12225 } else { 12226 progressbarDirection = swiper.isHorizontal() ? 'horizontal' : 'vertical'; 12227 } 12228 const scale = (current + 1) / total; 12229 let scaleX = 1; 12230 let scaleY = 1; 12231 if (progressbarDirection === 'horizontal') { 12232 scaleX = scale; 12233 } else { 12234 scaleY = scale; 12235 } 12236 subEl.querySelectorAll(classesToSelector(params.progressbarFillClass)).forEach(progressEl => { 12237 progressEl.style.transform = `translate3d(0,0,0) scaleX(${scaleX}) scaleY(${scaleY})`; 12238 progressEl.style.transitionDuration = `${swiper.params.speed}ms`; 12239 }); 12240 } 12241 if (params.type === 'custom' && params.renderCustom) { 12242 subEl.innerHTML = params.renderCustom(swiper, current + 1, total); 12243 if (subElIndex === 0) emit('paginationRender', subEl); 12244 } else { 12245 if (subElIndex === 0) emit('paginationRender', subEl); 12246 emit('paginationUpdate', subEl); 12247 } 12248 if (swiper.params.watchOverflow && swiper.enabled) { 12249 subEl.classList[swiper.isLocked ? 'add' : 'remove'](params.lockClass); 12250 } 12251 }); 12252 } 12253 function render() { 12254 // Render Container 12255 const params = swiper.params.pagination; 12256 if (isPaginationDisabled()) return; 12257 const slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.grid && swiper.params.grid.rows > 1 ? swiper.slides.length / Math.ceil(swiper.params.grid.rows) : swiper.slides.length; 12258 let el = swiper.pagination.el; 12259 el = makeElementsArray(el); 12260 let paginationHTML = ''; 12261 if (params.type === 'bullets') { 12262 let numberOfBullets = swiper.params.loop ? Math.ceil(slidesLength / swiper.params.slidesPerGroup) : swiper.snapGrid.length; 12263 if (swiper.params.freeMode && swiper.params.freeMode.enabled && numberOfBullets > slidesLength) { 12264 numberOfBullets = slidesLength; 12265 } 12266 for (let i = 0; i < numberOfBullets; i += 1) { 12267 if (params.renderBullet) { 12268 paginationHTML += params.renderBullet.call(swiper, i, params.bulletClass); 12269 } else { 12270 // prettier-ignore 12271 paginationHTML += `<${params.bulletElement} ${swiper.isElement ? 'part="bullet"' : ''} class="${params.bulletClass}"></${params.bulletElement}>`; 12272 } 12273 } 12274 } 12275 if (params.type === 'fraction') { 12276 if (params.renderFraction) { 12277 paginationHTML = params.renderFraction.call(swiper, params.currentClass, params.totalClass); 12278 } else { 12279 paginationHTML = `<span class="${params.currentClass}"></span>` + ' / ' + `<span class="${params.totalClass}"></span>`; 12280 } 12281 } 12282 if (params.type === 'progressbar') { 12283 if (params.renderProgressbar) { 12284 paginationHTML = params.renderProgressbar.call(swiper, params.progressbarFillClass); 12285 } else { 12286 paginationHTML = `<span class="${params.progressbarFillClass}"></span>`; 12287 } 12288 } 12289 swiper.pagination.bullets = []; 12290 el.forEach(subEl => { 12291 if (params.type !== 'custom') { 12292 subEl.innerHTML = paginationHTML || ''; 12293 } 12294 if (params.type === 'bullets') { 12295 swiper.pagination.bullets.push(...subEl.querySelectorAll(classesToSelector(params.bulletClass))); 12296 } 12297 }); 12298 if (params.type !== 'custom') { 12299 emit('paginationRender', el[0]); 12300 } 12301 } 12302 function init() { 12303 swiper.params.pagination = createElementIfNotDefined(swiper, swiper.originalParams.pagination, swiper.params.pagination, { 12304 el: 'swiper-pagination' 12305 }); 12306 const params = swiper.params.pagination; 12307 if (!params.el) return; 12308 let el; 12309 if (typeof params.el === 'string' && swiper.isElement) { 12310 el = swiper.el.querySelector(params.el); 12311 } 12312 if (!el && typeof params.el === 'string') { 12313 el = [...document.querySelectorAll(params.el)]; 12314 } 12315 if (!el) { 12316 el = params.el; 12317 } 12318 if (!el || el.length === 0) return; 12319 if (swiper.params.uniqueNavElements && typeof params.el === 'string' && Array.isArray(el) && el.length > 1) { 12320 el = [...swiper.el.querySelectorAll(params.el)]; 12321 // check if it belongs to another nested Swiper 12322 if (el.length > 1) { 12323 el = el.filter(subEl => { 12324 if (elementParents(subEl, '.swiper')[0] !== swiper.el) return false; 12325 return true; 12326 })[0]; 12327 } 12328 } 12329 if (Array.isArray(el) && el.length === 1) el = el[0]; 12330 Object.assign(swiper.pagination, { 12331 el 12332 }); 12333 el = makeElementsArray(el); 12334 el.forEach(subEl => { 12335 if (params.type === 'bullets' && params.clickable) { 12336 subEl.classList.add(...(params.clickableClass || '').split(' ')); 12337 } 12338 subEl.classList.add(params.modifierClass + params.type); 12339 subEl.classList.add(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass); 12340 if (params.type === 'bullets' && params.dynamicBullets) { 12341 subEl.classList.add(`${params.modifierClass}${params.type}-dynamic`); 12342 dynamicBulletIndex = 0; 12343 if (params.dynamicMainBullets < 1) { 12344 params.dynamicMainBullets = 1; 12345 } 12346 } 12347 if (params.type === 'progressbar' && params.progressbarOpposite) { 12348 subEl.classList.add(params.progressbarOppositeClass); 12349 } 12350 if (params.clickable) { 12351 subEl.addEventListener('click', onBulletClick); 12352 } 12353 if (!swiper.enabled) { 12354 subEl.classList.add(params.lockClass); 12355 } 12356 }); 12357 } 12358 function destroy() { 12359 const params = swiper.params.pagination; 12360 if (isPaginationDisabled()) return; 12361 let el = swiper.pagination.el; 12362 if (el) { 12363 el = makeElementsArray(el); 12364 el.forEach(subEl => { 12365 subEl.classList.remove(params.hiddenClass); 12366 subEl.classList.remove(params.modifierClass + params.type); 12367 subEl.classList.remove(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass); 12368 if (params.clickable) { 12369 subEl.classList.remove(...(params.clickableClass || '').split(' ')); 12370 subEl.removeEventListener('click', onBulletClick); 12371 } 12372 }); 12373 } 12374 if (swiper.pagination.bullets) swiper.pagination.bullets.forEac
vendor: 8,226 bytes, lines 12374-12634
12374h(subEl => subEl.classList.remove(...params.bulletActiveClass.split(' '))); 12375 } 12376 on('changeDirection', () => { 12377 if (!swiper.pagination || !swiper.pagination.el) return; 12378 const params = swiper.params.pagination; 12379 let { 12380 el 12381 } = swiper.pagination; 12382 el = makeElementsArray(el); 12383 el.forEach(subEl => { 12384 subEl.classList.remove(params.horizontalClass, params.verticalClass); 12385 subEl.classList.add(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass); 12386 }); 12387 }); 12388 on('init', () => { 12389 if (swiper.params.pagination.enabled === false) { 12390 // eslint-disable-next-line 12391 disable(); 12392 } else { 12393 init(); 12394 render(); 12395 update(); 12396 } 12397 }); 12398 on('activeIndexChange', () => { 12399 if (typeof swiper.snapIndex === 'undefined') { 12400 update(); 12401 } 12402 }); 12403 on('snapIndexChange', () => { 12404 update(); 12405 }); 12406 on('snapGridLengthChange', () => { 12407 render(); 12408 update(); 12409 }); 12410 on('destroy', () => { 12411 destroy(); 12412 }); 12413 on('enable disable', () => { 12414 let { 12415 el 12416 } = swiper.pagination; 12417 if (el) { 12418 el = makeElementsArray(el); 12419 el.forEach(subEl => subEl.classList[swiper.enabled ? 'remove' : 'add'](swiper.params.pagination.lockClass)); 12420 } 12421 }); 12422 on('lock unlock', () => { 12423 update(); 12424 }); 12425 on('click', (_s, e) => { 12426 const targetEl = e.target; 12427 const el = makeElementsArray(swiper.pagination.el); 12428 if (swiper.params.pagination.el && swiper.params.pagination.hideOnClick && el && el.length > 0 && !targetEl.classList.contains(swiper.params.pagination.bulletClass)) { 12429 if (swiper.navigation && (swiper.navigation.nextEl && targetEl === swiper.navigation.nextEl || swiper.navigation.prevEl && targetEl === swiper.navigation.prevEl)) return; 12430 const isHidden = el[0].classList.contains(swiper.params.pagination.hiddenClass); 12431 if (isHidden === true) { 12432 emit('paginationShow'); 12433 } else { 12434 emit('paginationHide'); 12435 } 12436 el.forEach(subEl => subEl.classList.toggle(swiper.params.pagination.hiddenClass)); 12437 } 12438 }); 12439 const enable = () => { 12440 swiper.el.classList.remove(swiper.params.pagination.paginationDisabledClass); 12441 let { 12442 el 12443 } = swiper.pagination; 12444 if (el) { 12445 el = makeElementsArray(el); 12446 el.forEach(subEl => subEl.classList.remove(swiper.params.pagination.paginationDisabledClass)); 12447 } 12448 init(); 12449 render(); 12450 update(); 12451 }; 12452 const disable = () => { 12453 swiper.el.classList.add(swiper.params.pagination.paginationDisabledClass); 12454 let { 12455 el 12456 } = swiper.pagination; 12457 if (el) { 12458 el = makeElementsArray(el); 12459 el.forEach(subEl => subEl.classList.add(swiper.params.pagination.paginationDisabledClass)); 12460 } 12461 destroy(); 12462 }; 12463 Object.assign(swiper.pagination, { 12464 enable, 12465 disable, 12466 render, 12467 update, 12468 init, 12469 destroy 12470 }); 12471 } 12472 12473 function Scrollbar(_ref) { 12474 let { 12475 swiper, 12476 extendParams, 12477 on, 12478 emit 12479 } = _ref; 12480 const document = getDocument(); 12481 let isTouched = false; 12482 let timeout = null; 12483 let dragTimeout = null; 12484 let dragStartPos; 12485 let dragSize; 12486 let trackSize; 12487 let divider; 12488 extendParams({ 12489 scrollbar: { 12490 el: null, 12491 dragSize: 'auto', 12492 hide: false, 12493 draggable: false, 12494 snapOnRelease: true, 12495 lockClass: 'swiper-scrollbar-lock', 12496 dragClass: 'swiper-scrollbar-drag', 12497 scrollbarDisabledClass: 'swiper-scrollbar-disabled', 12498 horizontalClass: `swiper-scrollbar-horizontal`, 12499 verticalClass: `swiper-scrollbar-vertical` 12500 } 12501 }); 12502 swiper.scrollbar = { 12503 el: null, 12504 dragEl: null 12505 }; 12506 function setTranslate() { 12507 if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return; 12508 const { 12509 scrollbar, 12510 rtlTranslate: rtl 12511 } = swiper; 12512 const { 12513 dragEl, 12514 el 12515 } = scrollbar; 12516 const params = swiper.params.scrollbar; 12517 const progress = swiper.params.loop ? swiper.progressLoop : swiper.progress; 12518 let newSize = dragSize; 12519 let newPos = (trackSize - dragSize) * progress; 12520 if (rtl) { 12521 newPos = -newPos; 12522 if (newPos > 0) { 12523 newSize = dragSize - newPos; 12524 newPos = 0; 12525 } else if (-newPos + dragSize > trackSize) { 12526 newSize = trackSize + newPos; 12527 } 12528 } else if (newPos < 0) { 12529 newSize = dragSize + newPos; 12530 newPos = 0; 12531 } else if (newPos + dragSize > trackSize) { 12532 newSize = trackSize - newPos; 12533 } 12534 if (swiper.isHorizontal()) { 12535 dragEl.style.transform = `translate3d(${newPos}px, 0, 0)`; 12536 dragEl.style.width = `${newSize}px`; 12537 } else { 12538 dragEl.style.transform = `translate3d(0px, ${newPos}px, 0)`; 12539 dragEl.style.height = `${newSize}px`; 12540 } 12541 if (params.hide) { 12542 clearTimeout(timeout); 12543 el.style.opacity = 1; 12544 timeout = setTimeout(() => { 12545 el.style.opacity = 0; 12546 el.style.transitionDuration = '400ms'; 12547 }, 1000); 12548 } 12549 } 12550 function setTransition(duration) { 12551 if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return; 12552 swiper.scrollbar.dragEl.style.transitionDuration = `${duration}ms`; 12553 } 12554 function updateSize() { 12555 if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return; 12556 const { 12557 scrollbar 12558 } = swiper; 12559 const { 12560 dragEl, 12561 el 12562 } = scrollbar; 12563 dragEl.style.width = ''; 12564 dragEl.style.height = ''; 12565 trackSize = swiper.isHorizontal() ? el.offsetWidth : el.offsetHeight; 12566 divider = swiper.size / (swiper.virtualSize + swiper.params.slidesOffsetBefore - (swiper.params.centeredSlides ? swiper.snapGrid[0] : 0)); 12567 if (swiper.params.scrollbar.dragSize === 'auto') { 12568 dragSize = trackSize * divider; 12569 } else { 12570 dragSize = parseInt(swiper.params.scrollbar.dragSize, 10); 12571 } 12572 if (swiper.isHorizontal()) { 12573 dragEl.style.width = `${dragSize}px`; 12574 } else { 12575 dragEl.style.height = `${dragSize}px`; 12576 } 12577 if (divider >= 1) { 12578 el.style.display = 'none'; 12579 } else { 12580 el.style.display = ''; 12581 } 12582 if (swiper.params.scrollbar.hide) { 12583 el.style.opacity = 0; 12584 } 12585 if (swiper.params.watchOverflow && swiper.enabled) { 12586 scrollbar.el.classList[swiper.isLocked ? 'add' : 'remove'](swiper.params.scrollbar.lockClass); 12587 } 12588 } 12589 function getPointerPosition(e) { 12590 return swiper.isHorizontal() ? e.clientX : e.clientY; 12591 } 12592 function setDragPosition(e) { 12593 const { 12594 scrollbar, 12595 rtlTranslate: rtl 12596 } = swiper; 12597 const { 12598 el 12599 } = scrollbar; 12600 let positionRatio; 12601 positionRatio = (getPointerPosition(e) - elementOffset(el)[swiper.isHorizontal() ? 'left' : 'top'] - (dragStartPos !== null ? dragStartPos : dragSize / 2)) / (trackSize - dragSize); 12602 positionRatio = Math.max(Math.min(positionRatio, 1), 0); 12603 if (rtl) { 12604 positionRatio = 1 - positionRatio; 12605 } 12606 const position = swiper.minTranslate() + (swiper.maxTranslate() - swiper.minTranslate()) * positionRatio; 12607 swiper.updateProgress(position); 12608 swiper.setTranslate(position); 12609 swiper.updateActiveIndex(); 12610 swiper.updateSlidesClasses(); 12611 } 12612 function onDragStart(e) { 12613 const params = swiper.params.scrollbar; 12614 const { 12615 scrollbar, 12616 wrapperEl 12617 } = swiper; 12618 const { 12619 el, 12620 dragEl 12621 } = scrollbar; 12622 isTouched = true; 12623 dragStartPos = e.target === dragEl ? getPointerPosition(e) - e.target.getBoundingClientRect()[swiper.isHorizontal() ? 'left' : 'top'] : null; 12624 e.preventDefault(); 12625 e.stopPropagation(); 12626 wrapperEl.style.transitionDuration = '100ms'; 12627 dragEl.style.transitionDuration = '100ms'; 12628 setDragPosition(e); 12629 clearTimeout(dragTimeout); 12630 el.style.transitionDuration = '0ms'; 12631 if (params.hide) { 12632 el.style.opacity = 1; 12633 } 12634 if (swiper.params.cssMode) {
vendor: 6,010 bytes, lines 12635-12822
12635 swiper.wrapperEl.style['scroll-snap-type'] = 'none'; 12636 } 12637 emit('scrollbarDragStart', e); 12638 } 12639 function onDragMove(e) { 12640 const { 12641 scrollbar, 12642 wrapperEl 12643 } = swiper; 12644 const { 12645 el, 12646 dragEl 12647 } = scrollbar; 12648 if (!isTouched) return; 12649 if (e.preventDefault && e.cancelable) e.preventDefault();else e.returnValue = false; 12650 setDragPosition(e); 12651 wrapperEl.style.transitionDuration = '0ms'; 12652 el.style.transitionDuration = '0ms'; 12653 dragEl.style.transitionDuration = '0ms'; 12654 emit('scrollbarDragMove', e); 12655 } 12656 function onDragEnd(e) { 12657 const params = swiper.params.scrollbar; 12658 const { 12659 scrollbar, 12660 wrapperEl 12661 } = swiper; 12662 const { 12663 el 12664 } = scrollbar; 12665 if (!isTouched) return; 12666 isTouched = false; 12667 if (swiper.params.cssMode) { 12668 swiper.wrapperEl.style['scroll-snap-type'] = ''; 12669 wrapperEl.style.transitionDuration = ''; 12670 } 12671 if (params.hide) { 12672 clearTimeout(dragTimeout); 12673 dragTimeout = nextTick(() => { 12674 el.style.opacity = 0; 12675 el.style.transitionDuration = '400ms'; 12676 }, 1000); 12677 } 12678 emit('scrollbarDragEnd', e); 12679 if (params.snapOnRelease) { 12680 swiper.slideToClosest(); 12681 } 12682 } 12683 function events(method) { 12684 const { 12685 scrollbar, 12686 params 12687 } = swiper; 12688 const el = scrollbar.el; 12689 if (!el) return; 12690 const target = el; 12691 const activeListener = params.passiveListeners ? { 12692 passive: false, 12693 capture: false 12694 } : false; 12695 const passiveListener = params.passiveListeners ? { 12696 passive: true, 12697 capture: false 12698 } : false; 12699 if (!target) return; 12700 const eventMethod = method === 'on' ? 'addEventListener' : 'removeEventListener'; 12701 target[eventMethod]('pointerdown', onDragStart, activeListener); 12702 document[eventMethod]('pointermove', onDragMove, activeListener); 12703 document[eventMethod]('pointerup', onDragEnd, passiveListener); 12704 } 12705 function enableDraggable() { 12706 if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return; 12707 events('on'); 12708 } 12709 function disableDraggable() { 12710 if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return; 12711 events('off'); 12712 } 12713 function init() { 12714 const { 12715 scrollbar, 12716 el: swiperEl 12717 } = swiper; 12718 swiper.params.scrollbar = createElementIfNotDefined(swiper, swiper.originalParams.scrollbar, swiper.params.scrollbar, { 12719 el: 'swiper-scrollbar' 12720 }); 12721 const params = swiper.params.scrollbar; 12722 if (!params.el) return; 12723 let el; 12724 if (typeof params.el === 'string' && swiper.isElement) { 12725 el = swiper.el.querySelector(params.el); 12726 } 12727 if (!el && typeof params.el === 'string') { 12728 el = document.querySelectorAll(params.el); 12729 if (!el.length) return; 12730 } else if (!el) { 12731 el = params.el; 12732 } 12733 if (swiper.params.uniqueNavElements && typeof params.el === 'string' && el.length > 1 && swiperEl.querySelectorAll(params.el).length === 1) { 12734 el = swiperEl.querySelector(params.el); 12735 } 12736 if (el.length > 0) el = el[0]; 12737 el.classList.add(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass); 12738 let dragEl; 12739 if (el) { 12740 dragEl = el.querySelector(classesToSelector(swiper.params.scrollbar.dragClass)); 12741 if (!dragEl) { 12742 dragEl = createElement('div', swiper.params.scrollbar.dragClass); 12743 el.append(dragEl); 12744 } 12745 } 12746 Object.assign(scrollbar, { 12747 el, 12748 dragEl 12749 }); 12750 if (params.draggable) { 12751 enableDraggable(); 12752 } 12753 if (el) { 12754 el.classList[swiper.enabled ? 'remove' : 'add'](...classesToTokens(swiper.params.scrollbar.lockClass)); 12755 } 12756 } 12757 function destroy() { 12758 const params = swiper.params.scrollbar; 12759 const el = swiper.scrollbar.el; 12760 if (el) { 12761 el.classList.remove(...classesToTokens(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass)); 12762 } 12763 disableDraggable(); 12764 } 12765 on('changeDirection', () => { 12766 if (!swiper.scrollbar || !swiper.scrollbar.el) return; 12767 const params = swiper.params.scrollbar; 12768 let { 12769 el 12770 } = swiper.scrollbar; 12771 el = makeElementsArray(el); 12772 el.forEach(subEl => { 12773 subEl.classList.remove(params.horizontalClass, params.verticalClass); 12774 subEl.classList.add(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass); 12775 }); 12776 }); 12777 on('init', () => { 12778 if (swiper.params.scrollbar.enabled === false) { 12779 // eslint-disable-next-line 12780 disable(); 12781 } else { 12782 init(); 12783 updateSize(); 12784 setTranslate(); 12785 } 12786 }); 12787 on('update resize observerUpdate lock unlock changeDirection', () => { 12788 updateSize(); 12789 }); 12790 on('setTranslate', () => { 12791 setTranslate(); 12792 }); 12793 on('setTransition', (_s, duration) => { 12794 setTransition(duration); 12795 }); 12796 on('enable disable', () => { 12797 const { 12798 el 12799 } = swiper.scrollbar; 12800 if (el) { 12801 el.classList[swiper.enabled ? 'remove' : 'add'](...classesToTokens(swiper.params.scrollbar.lockClass)); 12802 } 12803 }); 12804 on('destroy', () => { 12805 destroy(); 12806 }); 12807 const enable = () => { 12808 swiper.el.classList.remove(...classesToTokens(swiper.params.scrollbar.scrollbarDisabledClass)); 12809 if (swiper.scrollbar.el) { 12810 swiper.scrollbar.el.classList.remove(...classesToTokens(swiper.params.scrollbar.scrollbarDisabledClass)); 12811 } 12812 init(); 12813 updateSize(); 12814 setTranslate(); 12815 }; 12816 const disable = () => { 12817 swiper.el.classList.add(...classesToTokens(swiper.params.scrollbar.scrollbarDisabledClass)); 12818 if (swiper.scrollbar.el) { 12819 swiper.scrollbar.el.classList.add(...classesToTokens(swiper.params.scrollbar.scrollbarDisabledClass)); 12820 } 12821 destroy(); 12822 };
vendor: 40,257 bytes, lines 12823-13936
12823 Object.assign(swiper.scrollbar, { 12824 enable, 12825 disable, 12826 updateSize, 12827 setTranslate, 12828 init, 12829 destroy 12830 }); 12831 } 12832 12833 function Parallax(_ref) { 12834 let { 12835 swiper, 12836 extendParams, 12837 on 12838 } = _ref; 12839 extendParams({ 12840 parallax: { 12841 enabled: false 12842 } 12843 }); 12844 const elementsSelector = '[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]'; 12845 const setTransform = (el, progress) => { 12846 const { 12847 rtl 12848 } = swiper; 12849 const rtlFactor = rtl ? -1 : 1; 12850 const p = el.getAttribute('data-swiper-parallax') || '0'; 12851 let x = el.getAttribute('data-swiper-parallax-x'); 12852 let y = el.getAttribute('data-swiper-parallax-y'); 12853 const scale = el.getAttribute('data-swiper-parallax-scale'); 12854 const opacity = el.getAttribute('data-swiper-parallax-opacity'); 12855 const rotate = el.getAttribute('data-swiper-parallax-rotate'); 12856 if (x || y) { 12857 x = x || '0'; 12858 y = y || '0'; 12859 } else if (swiper.isHorizontal()) { 12860 x = p; 12861 y = '0'; 12862 } else { 12863 y = p; 12864 x = '0'; 12865 } 12866 if (x.indexOf('%') >= 0) { 12867 x = `${parseInt(x, 10) * progress * rtlFactor}%`; 12868 } else { 12869 x = `${x * progress * rtlFactor}px`; 12870 } 12871 if (y.indexOf('%') >= 0) { 12872 y = `${parseInt(y, 10) * progress}%`; 12873 } else { 12874 y = `${y * progress}px`; 12875 } 12876 if (typeof opacity !== 'undefined' && opacity !== null) { 12877 const currentOpacity = opacity - (opacity - 1) * (1 - Math.abs(progress)); 12878 el.style.opacity = currentOpacity; 12879 } 12880 let transform = `translate3d(${x}, ${y}, 0px)`; 12881 if (typeof scale !== 'undefined' && scale !== null) { 12882 const currentScale = scale - (scale - 1) * (1 - Math.abs(progress)); 12883 transform += ` scale(${currentScale})`; 12884 } 12885 if (rotate && typeof rotate !== 'undefined' && rotate !== null) { 12886 const currentRotate = rotate * progress * -1; 12887 transform += ` rotate(${currentRotate}deg)`; 12888 } 12889 el.style.transform = transform; 12890 }; 12891 const setTranslate = () => { 12892 const { 12893 el, 12894 slides, 12895 progress, 12896 snapGrid, 12897 isElement 12898 } = swiper; 12899 const elements = elementChildren(el, elementsSelector); 12900 if (swiper.isElement) { 12901 elements.push(...elementChildren(swiper.hostEl, elementsSelector)); 12902 } 12903 elements.forEach(subEl => { 12904 setTransform(subEl, progress); 12905 }); 12906 slides.forEach((slideEl, slideIndex) => { 12907 let slideProgress = slideEl.progress; 12908 if (swiper.params.slidesPerGroup > 1 && swiper.params.slidesPerView !== 'auto') { 12909 slideProgress += Math.ceil(slideIndex / 2) - progress * (snapGrid.length - 1); 12910 } 12911 slideProgress = Math.min(Math.max(slideProgress, -1), 1); 12912 slideEl.querySelectorAll(`${elementsSelector}, [data-swiper-parallax-rotate]`).forEach(subEl => { 12913 setTransform(subEl, slideProgress); 12914 }); 12915 }); 12916 }; 12917 const setTransition = function (duration) { 12918 if (duration === void 0) { 12919 duration = swiper.params.speed; 12920 } 12921 const { 12922 el, 12923 hostEl 12924 } = swiper; 12925 const elements = [...el.querySelectorAll(elementsSelector)]; 12926 if (swiper.isElement) { 12927 elements.push(...hostEl.querySelectorAll(elementsSelector)); 12928 } 12929 elements.forEach(parallaxEl => { 12930 let parallaxDuration = parseInt(parallaxEl.getAttribute('data-swiper-parallax-duration'), 10) || duration; 12931 if (duration === 0) parallaxDuration = 0; 12932 parallaxEl.style.transitionDuration = `${parallaxDuration}ms`; 12933 }); 12934 }; 12935 on('beforeInit', () => { 12936 if (!swiper.params.parallax.enabled) return; 12937 swiper.params.watchSlidesProgress = true; 12938 swiper.originalParams.watchSlidesProgress = true; 12939 }); 12940 on('init', () => { 12941 if (!swiper.params.parallax.enabled) return; 12942 setTranslate(); 12943 }); 12944 on('setTranslate', () => { 12945 if (!swiper.params.parallax.enabled) return; 12946 setTranslate(); 12947 }); 12948 on('setTransition', (_swiper, duration) => { 12949 if (!swiper.params.parallax.enabled) return; 12950 setTransition(duration); 12951 }); 12952 } 12953 12954 function Zoom(_ref) { 12955 let { 12956 swiper, 12957 extendParams, 12958 on, 12959 emit 12960 } = _ref; 12961 const window = getWindow(); 12962 extendParams({ 12963 zoom: { 12964 enabled: false, 12965 limitToOriginalSize: false, 12966 maxRatio: 3, 12967 minRatio: 1, 12968 toggle: true, 12969 containerClass: 'swiper-zoom-container', 12970 zoomedSlideClass: 'swiper-slide-zoomed' 12971 } 12972 }); 12973 swiper.zoom = { 12974 enabled: false 12975 }; 12976 let currentScale = 1; 12977 let isScaling = false; 12978 let fakeGestureTouched; 12979 let fakeGestureMoved; 12980 const evCache = []; 12981 const gesture = { 12982 originX: 0, 12983 originY: 0, 12984 slideEl: undefined, 12985 slideWidth: undefined, 12986 slideHeight: undefined, 12987 imageEl: undefined, 12988 imageWrapEl: undefined, 12989 maxRatio: 3 12990 }; 12991 const image = { 12992 isTouched: undefined, 12993 isMoved: undefined, 12994 currentX: undefined, 12995 currentY: undefined, 12996 minX: undefined, 12997 minY: undefined, 12998 maxX: undefined, 12999 maxY: undefined, 13000 width: undefined, 13001 height: undefined, 13002 startX: undefined, 13003 startY: undefined, 13004 touchesStart: {}, 13005 touchesCurrent: {} 13006 }; 13007 const velocity = { 13008 x: undefined, 13009 y: undefined, 13010 prevPositionX: undefined, 13011 prevPositionY: undefined, 13012 prevTime: undefined 13013 }; 13014 let scale = 1; 13015 Object.defineProperty(swiper.zoom, 'scale', { 13016 get() { 13017 return scale; 13018 }, 13019 set(value) { 13020 if (scale !== value) { 13021 const imageEl = gesture.imageEl; 13022 const slideEl = gesture.slideEl; 13023 emit('zoomChange', value, imageEl, slideEl); 13024 } 13025 scale = value; 13026 } 13027 }); 13028 function getDistanceBetweenTouches() { 13029 if (evCache.length < 2) return 1; 13030 const x1 = evCache[0].pageX; 13031 const y1 = evCache[0].pageY; 13032 const x2 = evCache[1].pageX; 13033 const y2 = evCache[1].pageY; 13034 const distance = Math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2); 13035 return distance; 13036 } 13037 function getMaxRatio() { 13038 const params = swiper.params.zoom; 13039 const maxRatio = gesture.imageWrapEl.getAttribute('data-swiper-zoom') || params.maxRatio; 13040 if (params.limitToOriginalSize && gesture.imageEl && gesture.imageEl.naturalWidth) { 13041 const imageMaxRatio = gesture.imageEl.naturalWidth / gesture.imageEl.offsetWidth; 13042 return Math.min(imageMaxRatio, maxRatio); 13043 } 13044 return maxRatio; 13045 } 13046 function getScaleOrigin() { 13047 if (evCache.length < 2) return { 13048 x: null, 13049 y: null 13050 }; 13051 const box = gesture.imageEl.getBoundingClientRect(); 13052 return [(evCache[0].pageX + (evCache[1].pageX - evCache[0].pageX) / 2 - box.x - window.scrollX) / currentScale, (evCache[0].pageY + (evCache[1].pageY - evCache[0].pageY) / 2 - box.y - window.scrollY) / currentScale]; 13053 } 13054 function getSlideSelector() { 13055 return swiper.isElement ? `swiper-slide` : `.${swiper.params.slideClass}`; 13056 } 13057 function eventWithinSlide(e) { 13058 const slideSelector = getSlideSelector(); 13059 if (e.target.matches(slideSelector)) return true; 13060 if (swiper.slides.filter(slideEl => slideEl.contains(e.target)).length > 0) return true; 13061 return false; 13062 } 13063 function eventWithinZoomContainer(e) { 13064 const selector = `.${swiper.params.zoom.containerClass}`; 13065 if (e.target.matches(selector)) return true; 13066 if ([...swiper.hostEl.querySelectorAll(selector)].filter(containerEl => containerEl.contains(e.target)).length > 0) return true; 13067 return false; 13068 } 13069 13070 // Events 13071 function onGestureStart(e) { 13072 if (e.pointerType === 'mouse') { 13073 evCache.splice(0, evCache.length); 13074 } 13075 if (!eventWithinSlide(e)) return; 13076 const params = swiper.params.zoom; 13077 fakeGestureTouched = false; 13078 fakeGestureMoved = false; 13079 evCache.push(e); 13080 if (evCache.length < 2) { 13081 return; 13082 } 13083 fakeGestureTouched = true; 13084 gesture.scaleStart = getDistanceBetweenTouches(); 13085 if (!gesture.slideEl) { 13086 gesture.slideEl = e.target.closest(`.${swiper.params.slideClass}, swiper-slide`); 13087 if (!gesture.slideEl) gesture.slideEl = swiper.slides[swiper.activeIndex]; 13088 let imageEl = gesture.slideEl.querySelector(`.${params.containerClass}`); 13089 if (imageEl) { 13090 imageEl = imageEl.querySelectorAll('picture, img, svg, canvas, .swiper-zoom-target')[0]; 13091 } 13092 gesture.imageEl = imageEl; 13093 if (imageEl) { 13094 gesture.imageWrapEl = elementParents(gesture.imageEl, `.${params.containerClass}`)[0]; 13095 } else { 13096 gesture.imageWrapEl = undefined; 13097 } 13098 if (!gesture.imageWrapEl) { 13099 gesture.imageEl = undefined; 13100 return; 13101 } 13102 gesture.maxRatio = getMaxRatio(); 13103 } 13104 if (gesture.imageEl) { 13105 const [originX, originY] = getScaleOrigin(); 13106 gesture.originX = originX; 13107 gesture.originY = originY; 13108 gesture.imageEl.style.transitionDuration = '0ms'; 13109 } 13110 isScaling = true; 13111 } 13112 function onGestureChange(e) { 13113 if (!eventWithinSlide(e)) return; 13114 const params = swiper.params.zoom; 13115 const zoom = swiper.zoom; 13116 const pointerIndex = evCache.findIndex(cachedEv => cachedEv.pointerId === e.pointerId); 13117 if (pointerIndex >= 0) evCache[pointerIndex] = e; 13118 if (evCache.length < 2) { 13119 return; 13120 } 13121 fakeGestureMoved = true; 13122 gesture.scaleMove = getDistanceBetweenTouches(); 13123 if (!gesture.imageEl) { 13124 return; 13125 } 13126 zoom.scale = gesture.scaleMove / gesture.scaleStart * currentScale; 13127 if (zoom.scale > gesture.maxRatio) { 13128 zoom.scale = gesture.maxRatio - 1 + (zoom.scale - gesture.maxRatio + 1) ** 0.5; 13129 } 13130 if (zoom.scale < params.minRatio) { 13131 zoom.scale = params.minRatio + 1 - (params.minRatio - zoom.scale + 1) ** 0.5; 13132 } 13133 gesture.imageEl.style.transform = `translate3d(0,0,0) scale(${zoom.scale})`; 13134 } 13135 function onGestureEnd(e) { 13136 if (!eventWithinSlide(e)) return; 13137 if (e.pointerType === 'mouse' && e.type === 'pointerout') return; 13138 const params = swiper.params.zoom; 13139 const zoom = swiper.zoom; 13140 const pointerIndex = evCache.findIndex(cachedEv => cachedEv.pointerId === e.pointerId); 13141 if (pointerIndex >= 0) evCache.splice(pointerIndex, 1); 13142 if (!fakeGestureTouched || !fakeGestureMoved) { 13143 return; 13144 } 13145 fakeGestureTouched = false; 13146 fakeGestureMoved = false; 13147 if (!gesture.imageEl) return; 13148 zoom.scale = Math.max(Math.min(zoom.scale, gesture.maxRatio), params.minRatio); 13149 gesture.imageEl.style.transitionDuration = `${swiper.params.speed}ms`; 13150 gesture.imageEl.style.transform = `translate3d(0,0,0) scale(${zoom.scale})`; 13151 currentScale = zoom.scale; 13152 isScaling = false; 13153 if (zoom.scale > 1 && gesture.slideEl) { 13154 gesture.slideEl.classList.add(`${params.zoomedSlideClass}`); 13155 } else if (zoom.scale <= 1 && gesture.slideEl) { 13156 gesture.slideEl.classList.remove(`${params.zoomedSlideClass}`); 13157 } 13158 if (zoom.scale === 1) { 13159 gesture.originX = 0; 13160 gesture.originY = 0; 13161 gesture.slideEl = undefined; 13162 } 13163 } 13164 let allowTouchMoveTimeout; 13165 function allowTouchMove() { 13166 swiper.touchEventsData.preventTouchMoveFromPointerMove = false; 13167 } 13168 function preventTouchMove() { 13169 clearTimeout(allowTouchMoveTimeout); 13170 swiper.touchEventsData.preventTouchMoveFromPointerMove = true; 13171 allowTouchMoveTimeout = setTimeout(() => { 13172 allowTouchMove(); 13173 }); 13174 } 13175 function onTouchStart(e) { 13176 const device = swiper.device; 13177 if (!gesture.imageEl) return; 13178 if (image.isTouched) return; 13179 if (device.android && e.cancelable) e.preventDefault(); 13180 image.isTouched = true; 13181 const event = evCache.length > 0 ? evCache[0] : e; 13182 image.touchesStart.x = event.pageX; 13183 image.touchesStart.y = event.pageY; 13184 } 13185 function onTouchMove(e) { 13186 if (!eventWithinSlide(e) || !eventWithinZoomContainer(e)) { 13187 return; 13188 } 13189 const zoom = swiper.zoom; 13190 if (!gesture.imageEl) { 13191 return; 13192 } 13193 if (!image.isTouched || !gesture.slideEl) { 13194 return; 13195 } 13196 if (!image.isMoved) { 13197 image.width = gesture.imageEl.offsetWidth || gesture.imageEl.clientWidth; 13198 image.height = gesture.imageEl.offsetHeight || gesture.imageEl.clientHeight; 13199 image.startX = getTranslate(gesture.imageWrapEl, 'x') || 0; 13200 image.startY = getTranslate(gesture.imageWrapEl, 'y') || 0; 13201 gesture.slideWidth = gesture.slideEl.offsetWidth; 13202 gesture.slideHeight = gesture.slideEl.offsetHeight; 13203 gesture.imageWrapEl.style.transitionDuration = '0ms'; 13204 } 13205 // Define if we need image drag 13206 const scaledWidth = image.width * zoom.scale; 13207 const scaledHeight = image.height * zoom.scale; 13208 image.minX = Math.min(gesture.slideWidth / 2 - scaledWidth / 2, 0); 13209 image.maxX = -image.minX; 13210 image.minY = Math.min(gesture.slideHeight / 2 - scaledHeight / 2, 0); 13211 image.maxY = -image.minY; 13212 image.touchesCurrent.x = evCache.length > 0 ? evCache[0].pageX : e.pageX; 13213 image.touchesCurrent.y = evCache.length > 0 ? evCache[0].pageY : e.pageY; 13214 const touchesDiff = Math.max(Math.abs(image.touchesCurrent.x - image.touchesStart.x), Math.abs(image.touchesCurrent.y - image.touchesStart.y)); 13215 if (touchesDiff > 5) { 13216 swiper.allowClick = false; 13217 } 13218 if (!image.isMoved && !isScaling) { 13219 if (swiper.isHorizontal() && (Math.floor(image.minX) === Math.floor(image.startX) && image.touchesCurrent.x < image.touchesStart.x || Math.floor(image.maxX) === Math.floor(image.startX) && image.touchesCurrent.x > image.touchesStart.x)) { 13220 image.isTouched = false; 13221 allowTouchMove(); 13222 return; 13223 } 13224 if (!swiper.isHorizontal() && (Math.floor(image.minY) === Math.floor(image.startY) && image.touchesCurrent.y < image.touchesStart.y || Math.floor(image.maxY) === Math.floor(image.startY) && image.touchesCurrent.y > image.touchesStart.y)) { 13225 image.isTouched = false; 13226 allowTouchMove(); 13227 return; 13228 } 13229 } 13230 if (e.cancelable) { 13231 e.preventDefault(); 13232 } 13233 e.stopPropagation(); 13234 preventTouchMove(); 13235 image.isMoved = true; 13236 const scaleRatio = (zoom.scale - currentScale) / (gesture.maxRatio - swiper.params.zoom.minRatio); 13237 const { 13238 originX, 13239 originY 13240 } = gesture; 13241 image.currentX = image.touchesCurrent.x - image.touchesStart.x + image.startX + scaleRatio * (image.width - originX * 2); 13242 image.currentY = image.touchesCurrent.y - image.touchesStart.y + image.startY + scaleRatio * (image.height - originY * 2); 13243 if (image.currentX < image.minX) { 13244 image.currentX = image.minX + 1 - (image.minX - image.currentX + 1) ** 0.8; 13245 } 13246 if (image.currentX > image.maxX) { 13247 image.currentX = image.maxX - 1 + (image.currentX - image.maxX + 1) ** 0.8; 13248 } 13249 if (image.currentY < image.minY) { 13250 image.currentY = image.minY + 1 - (image.minY - image.currentY + 1) ** 0.8; 13251 } 13252 if (image.currentY > image.maxY) { 13253 image.currentY = image.maxY - 1 + (image.currentY - image.maxY + 1) ** 0.8; 13254 } 13255 13256 // Velocity 13257 if (!velocity.prevPositionX) velocity.prevPositionX = image.touchesCurrent.x; 13258 if (!velocity.prevPositionY) velocity.prevPositionY = image.touchesCurrent.y; 13259 if (!velocity.prevTime) velocity.prevTime = Date.now(); 13260 velocity.x = (image.touchesCurrent.x - velocity.prevPositionX) / (Date.now() - velocity.prevTime) / 2; 13261 velocity.y = (image.touchesCurrent.y - velocity.prevPositionY) / (Date.now() - velocity.prevTime) / 2; 13262 if (Math.abs(image.touchesCurrent.x - velocity.prevPositionX) < 2) velocity.x = 0; 13263 if (Math.abs(image.touchesCurrent.y - velocity.prevPositionY) < 2) velocity.y = 0; 13264 velocity.prevPositionX = image.touchesCurrent.x; 13265 velocity.prevPositionY = image.touchesCurrent.y; 13266 velocity.prevTime = Date.now(); 13267 gesture.imageWrapEl.style.transform = `translate3d(${image.currentX}px, ${image.currentY}px,0)`; 13268 } 13269 function onTouchEnd() { 13270 const zoom = swiper.zoom; 13271 if (!gesture.imageEl) return; 13272 if (!image.isTouched || !image.isMoved) { 13273 image.isTouched = false; 13274 image.isMoved = false; 13275 return; 13276 } 13277 image.isTouched = false; 13278 image.isMoved = false; 13279 let momentumDurationX = 300; 13280 let momentumDurationY = 300; 13281 const momentumDistanceX = velocity.x * momentumDurationX; 13282 const newPositionX = image.currentX + momentumDistanceX; 13283 const momentumDistanceY = velocity.y * momentumDurationY; 13284 const newPositionY = image.currentY + momentumDistanceY; 13285 13286 // Fix duration 13287 if (velocity.x !== 0) momentumDurationX = Math.abs((newPositionX - image.currentX) / velocity.x); 13288 if (velocity.y !== 0) momentumDurationY = Math.abs((newPositionY - image.currentY) / velocity.y); 13289 const momentumDuration = Math.max(momentumDurationX, momentumDurationY); 13290 image.currentX = newPositionX; 13291 image.currentY = newPositionY; 13292 // Define if we need image drag 13293 const scaledWidth = image.width * zoom.scale; 13294 const scaledHeight = image.height * zoom.scale; 13295 image.minX = Math.min(gesture.slideWidth / 2 - scaledWidth / 2, 0); 13296 image.maxX = -image.minX; 13297 image.minY = Math.min(gesture.slideHeight / 2 - scaledHeight / 2, 0); 13298 image.maxY = -image.minY; 13299 image.currentX = Math.max(Math.min(image.currentX, image.maxX), image.minX); 13300 image.currentY = Math.max(Math.min(image.currentY, image.maxY), image.minY); 13301 gesture.imageWrapEl.style.transitionDuration = `${momentumDuration}ms`; 13302 gesture.imageWrapEl.style.transform = `translate3d(${image.currentX}px, ${image.currentY}px,0)`; 13303 } 13304 function onTransitionEnd() { 13305 const zoom = swiper.zoom; 13306 if (gesture.slideEl && swiper.activeIndex !== swiper.slides.indexOf(gesture.slideEl)) { 13307 if (gesture.imageEl) { 13308 gesture.imageEl.style.transform = 'translate3d(0,0,0) scale(1)'; 13309 } 13310 if (gesture.imageWrapEl) { 13311 gesture.imageWrapEl.style.transform = 'translate3d(0,0,0)'; 13312 } 13313 gesture.slideEl.classList.remove(`${swiper.params.zoom.zoomedSlideClass}`); 13314 zoom.scale = 1; 13315 currentScale = 1; 13316 gesture.slideEl = undefined; 13317 gesture.imageEl = undefined; 13318 gesture.imageWrapEl = undefined; 13319 gesture.originX = 0; 13320 gesture.originY = 0; 13321 } 13322 } 13323 function zoomIn(e) { 13324 const zoom = swiper.zoom; 13325 const params = swiper.params.zoom; 13326 if (!gesture.slideEl) { 13327 if (e && e.target) { 13328 gesture.slideEl = e.target.closest(`.${swiper.params.slideClass}, swiper-slide`); 13329 } 13330 if (!gesture.slideEl) { 13331 if (swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual) { 13332 gesture.slideEl = elementChildren(swiper.slidesEl, `.${swiper.params.slideActiveClass}`)[0]; 13333 } else { 13334 gesture.slideEl = swiper.slides[swiper.activeIndex]; 13335 } 13336 } 13337 let imageEl = gesture.slideEl.querySelector(`.${params.containerClass}`); 13338 if (imageEl) { 13339 imageEl = imageEl.querySelectorAll('picture, img, svg, canvas, .swiper-zoom-target')[0]; 13340 } 13341 gesture.imageEl = imageEl; 13342 if (imageEl) { 13343 gesture.imageWrapEl = elementParents(gesture.imageEl, `.${params.containerClass}`)[0]; 13344 } else { 13345 gesture.imageWrapEl = undefined; 13346 } 13347 } 13348 if (!gesture.imageEl || !gesture.imageWrapEl) return; 13349 if (swiper.params.cssMode) { 13350 swiper.wrapperEl.style.overflow = 'hidden'; 13351 swiper.wrapperEl.style.touchAction = 'none'; 13352 } 13353 gesture.slideEl.classList.add(`${params.zoomedSlideClass}`); 13354 let touchX; 13355 let touchY; 13356 let offsetX; 13357 let offsetY; 13358 let diffX; 13359 let diffY; 13360 let translateX; 13361 let translateY; 13362 let imageWidth; 13363 let imageHeight; 13364 let scaledWidth; 13365 let scaledHeight; 13366 let translateMinX; 13367 let translateMinY; 13368 let translateMaxX; 13369 let translateMaxY; 13370 let slideWidth; 13371 let slideHeight; 13372 if (typeof image.touchesStart.x === 'undefined' && e) { 13373 touchX = e.pageX; 13374 touchY = e.pageY; 13375 } else { 13376 touchX = image.touchesStart.x; 13377 touchY = image.touchesStart.y; 13378 } 13379 const forceZoomRatio = typeof e === 'number' ? e : null; 13380 if (currentScale === 1 && forceZoomRatio) { 13381 touchX = undefined; 13382 touchY = undefined; 13383 image.touchesStart.x = undefined; 13384 image.touchesStart.y = undefined; 13385 } 13386 const maxRatio = getMaxRatio(); 13387 zoom.scale = forceZoomRatio || maxRatio; 13388 currentScale = forceZoomRatio || maxRatio; 13389 if (e && !(currentScale === 1 && forceZoomRatio)) { 13390 slideWidth = gesture.slideEl.offsetWidth; 13391 slideHeight = gesture.slideEl.offsetHeight; 13392 offsetX = elementOffset(gesture.slideEl).left + window.scrollX; 13393 offsetY = elementOffset(gesture.slideEl).top + window.scrollY; 13394 diffX = offsetX + slideWidth / 2 - touchX; 13395 diffY = offsetY + slideHeight / 2 - touchY; 13396 imageWidth = gesture.imageEl.offsetWidth || gesture.imageEl.clientWidth; 13397 imageHeight = gesture.imageEl.offsetHeight || gesture.imageEl.clientHeight; 13398 scaledWidth = imageWidth * zoom.scale; 13399 scaledHeight = imageHeight * zoom.scale; 13400 translateMinX = Math.min(slideWidth / 2 - scaledWidth / 2, 0); 13401 translateMinY = Math.min(slideHeight / 2 - scaledHeight / 2, 0); 13402 translateMaxX = -translateMinX; 13403 translateMaxY = -translateMinY; 13404 translateX = diffX * zoom.scale; 13405 translateY = diffY * zoom.scale; 13406 if (translateX < translateMinX) { 13407 translateX = translateMinX; 13408 } 13409 if (translateX > translateMaxX) { 13410 translateX = translateMaxX; 13411 } 13412 if (translateY < translateMinY) { 13413 translateY = translateMinY; 13414 } 13415 if (translateY > translateMaxY) { 13416 translateY = translateMaxY; 13417 } 13418 } else { 13419 translateX = 0; 13420 translateY = 0; 13421 } 13422 if (forceZoomRatio && zoom.scale === 1) { 13423 gesture.originX = 0; 13424 gesture.originY = 0; 13425 } 13426 gesture.imageWrapEl.style.transitionDuration = '300ms'; 13427 gesture.imageWrapEl.style.transform = `translate3d(${translateX}px, ${translateY}px,0)`; 13428 gesture.imageEl.style.transitionDuration = '300ms'; 13429 gesture.imageEl.style.transform = `translate3d(0,0,0) scale(${zoom.scale})`; 13430 } 13431 function zoomOut() { 13432 const zoom = swiper.zoom; 13433 const params = swiper.params.zoom; 13434 if (!gesture.slideEl) { 13435 if (swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual) { 13436 gesture.slideEl = elementChildren(swiper.slidesEl, `.${swiper.params.slideActiveClass}`)[0]; 13437 } else { 13438 gesture.slideEl = swiper.slides[swiper.activeIndex]; 13439 } 13440 let imageEl = gesture.slideEl.querySelector(`.${params.containerClass}`); 13441 if (imageEl) { 13442 imageEl = imageEl.querySelectorAll('picture, img, svg, canvas, .swiper-zoom-target')[0]; 13443 } 13444 gesture.imageEl = imageEl; 13445 if (imageEl) { 13446 gesture.imageWrapEl = elementParents(gesture.imageEl, `.${params.containerClass}`)[0]; 13447 } else { 13448 gesture.imageWrapEl = undefined; 13449 } 13450 } 13451 if (!gesture.imageEl || !gesture.imageWrapEl) return; 13452 if (swiper.params.cssMode) { 13453 swiper.wrapperEl.style.overflow = ''; 13454 swiper.wrapperEl.style.touchAction = ''; 13455 } 13456 zoom.scale = 1; 13457 currentScale = 1; 13458 image.touchesStart.x = undefined; 13459 image.touchesStart.y = undefined; 13460 gesture.imageWrapEl.style.transitionDuration = '300ms'; 13461 gesture.imageWrapEl.style.transform = 'translate3d(0,0,0)'; 13462 gesture.imageEl.style.transitionDuration = '300ms'; 13463 gesture.imageEl.style.transform = 'translate3d(0,0,0) scale(1)'; 13464 gesture.slideEl.classList.remove(`${params.zoomedSlideClass}`); 13465 gesture.slideEl = undefined; 13466 gesture.originX = 0; 13467 gesture.originY = 0; 13468 } 13469 13470 // Toggle Zoom 13471 function zoomToggle(e) { 13472 const zoom = swiper.zoom; 13473 if (zoom.scale && zoom.scale !== 1) { 13474 // Zoom Out 13475 zoomOut(); 13476 } else { 13477 // Zoom In 13478 zoomIn(e); 13479 } 13480 } 13481 function getListeners() { 13482 const passiveListener = swiper.params.passiveListeners ? { 13483 passive: true, 13484 capture: false 13485 } : false; 13486 const activeListenerWithCapture = swiper.params.passiveListeners ? { 13487 passive: false, 13488 capture: true 13489 } : true; 13490 return { 13491 passiveListener, 13492 activeListenerWithCapture 13493 }; 13494 } 13495 13496 // Attach/Detach Events 13497 function enable() { 13498 const zoom = swiper.zoom; 13499 if (zoom.enabled) return; 13500 zoom.enabled = true; 13501 const { 13502 passiveListener, 13503 activeListenerWithCapture 13504 } = getListeners(); 13505 13506 // Scale image 13507 swiper.wrapperEl.addEventListener('pointerdown', onGestureStart, passiveListener); 13508 swiper.wrapperEl.addEventListener('pointermove', onGestureChange, activeListenerWithCapture); 13509 ['pointerup', 'pointercancel', 'pointerout'].forEach(eventName => { 13510 swiper.wrapperEl.addEventListener(eventName, onGestureEnd, passiveListener); 13511 }); 13512 13513 // Move image 13514 swiper.wrapperEl.addEventListener('pointermove', onTouchMove, activeListenerWithCapture); 13515 } 13516 function disable() { 13517 const zoom = swiper.zoom; 13518 if (!zoom.enabled) return; 13519 zoom.enabled = false; 13520 const { 13521 passiveListener, 13522 activeListenerWithCapture 13523 } = getListeners(); 13524 13525 // Scale image 13526 swiper.wrapperEl.removeEventListener('pointerdown', onGestureStart, passiveListener); 13527 swiper.wrapperEl.removeEventListener('pointermove', onGestureChange, activeListenerWithCapture); 13528 ['pointerup', 'pointercancel', 'pointerout'].forEach(eventName => { 13529 swiper.wrapperEl.removeEventListener(eventName, onGestureEnd, passiveListener); 13530 }); 13531 13532 // Move image 13533 swiper.wrapperEl.removeEventListener('pointermove', onTouchMove, activeListenerWithCapture); 13534 } 13535 on('init', () => { 13536 if (swiper.params.zoom.enabled) { 13537 enable(); 13538 } 13539 }); 13540 on('destroy', () => { 13541 disable(); 13542 }); 13543 on('touchStart', (_s, e) => { 13544 if (!swiper.zoom.enabled) return; 13545 onTouchStart(e); 13546 }); 13547 on('touchEnd', (_s, e) => { 13548 if (!swiper.zoom.enabled) return; 13549 onTouchEnd(); 13550 }); 13551 on('doubleTap', (_s, e) => { 13552 if (!swiper.animating && swiper.params.zoom.enabled && swiper.zoom.enabled && swiper.params.zoom.toggle) { 13553 zoomToggle(e); 13554 } 13555 }); 13556 on('transitionEnd', () => { 13557 if (swiper.zoom.enabled && swiper.params.zoom.enabled) { 13558 onTransitionEnd(); 13559 } 13560 }); 13561 on('slideChange', () => { 13562 if (swiper.zoom.enabled && swiper.params.zoom.enabled && swiper.params.cssMode) { 13563 onTransitionEnd(); 13564 } 13565 }); 13566 Object.assign(swiper.zoom, { 13567 enable, 13568 disable, 13569 in: zoomIn, 13570 out: zoomOut, 13571 toggle: zoomToggle 13572 }); 13573 } 13574 13575 /* eslint no-bitwise: ["error", { "allow": [">>"] }] */ 13576 function Controller(_ref) { 13577 let { 13578 swiper, 13579 extendParams, 13580 on 13581 } = _ref; 13582 extendParams({ 13583 controller: { 13584 control: undefined, 13585 inverse: false, 13586 by: 'slide' // or 'container' 13587 } 13588 }); 13589 13590 swiper.controller = { 13591 control: undefined 13592 }; 13593 function LinearSpline(x, y) { 13594 const binarySearch = function search() { 13595 let maxIndex; 13596 let minIndex; 13597 let guess; 13598 return (array, val) => { 13599 minIndex = -1; 13600 maxIndex = array.length; 13601 while (maxIndex - minIndex > 1) { 13602 guess = maxIndex + minIndex >> 1; 13603 if (array[guess] <= val) { 13604 minIndex = guess; 13605 } else { 13606 maxIndex = guess; 13607 } 13608 } 13609 return maxIndex; 13610 }; 13611 }(); 13612 this.x = x; 13613 this.y = y; 13614 this.lastIndex = x.length - 1; 13615 // Given an x value (x2), return the expected y2 value: 13616 // (x1,y1) is the known point before given value, 13617 // (x3,y3) is the known point after given value. 13618 let i1; 13619 let i3; 13620 this.interpolate = function interpolate(x2) { 13621 if (!x2) return 0; 13622 13623 // Get the indexes of x1 and x3 (the array indexes before and after given x2): 13624 i3 = binarySearch(this.x, x2); 13625 i1 = i3 - 1; 13626 13627 // We have our indexes i1 & i3, so we can calculate already: 13628 // y2 := ((x2âx1) à (y3ây1)) ÷ (x3âx1) + y1 13629 return (x2 - this.x[i1]) * (this.y[i3] - this.y[i1]) / (this.x[i3] - this.x[i1]) + this.y[i1]; 13630 }; 13631 return this; 13632 } 13633 function getInterpolateFunction(c) { 13634 swiper.controller.spline = swiper.params.loop ? new LinearSpline(swiper.slidesGrid, c.slidesGrid) : new LinearSpline(swiper.snapGrid, c.snapGrid); 13635 } 13636 function setTranslate(_t, byController) { 13637 const controlled = swiper.controller.control; 13638 let multiplier; 13639 let controlledTranslate; 13640 const Swiper = swiper.constructor; 13641 function setControlledTranslate(c) { 13642 if (c.destroyed) return; 13643 13644 // this will create an Interpolate function based on the snapGrids 13645 // x is the Grid of the scrolled scroller and y will be the controlled scroller 13646 // it makes sense to create this only once and recall it for the interpolation 13647 // the function does a lot of value caching for performance 13648 const translate = swiper.rtlTranslate ? -swiper.translate : swiper.translate; 13649 if (swiper.params.controller.by === 'slide') { 13650 getInterpolateFunction(c); 13651 // i am not sure why the values have to be multiplicated this way, tried to invert the snapGrid 13652 // but it did not work out 13653 controlledTranslate = -swiper.controller.spline.interpolate(-translate); 13654 } 13655 if (!controlledTranslate || swiper.params.controller.by === 'container') { 13656 multiplier = (c.maxTranslate() - c.minTranslate()) / (swiper.maxTranslate() - swiper.minTranslate()); 13657 if (Number.isNaN(multiplier) || !Number.isFinite(multiplier)) { 13658 multiplier = 1; 13659 } 13660 controlledTranslate = (translate - swiper.minTranslate()) * multiplier + c.minTranslate(); 13661 } 13662 if (swiper.params.controller.inverse) { 13663 controlledTranslate = c.maxTranslate() - controlledTranslate; 13664 } 13665 c.updateProgress(controlledTranslate); 13666 c.setTranslate(controlledTranslate, swiper); 13667 c.updateActiveIndex(); 13668 c.updateSlidesClasses(); 13669 } 13670 if (Array.isArray(controlled)) { 13671 for (let i = 0; i < controlled.length; i += 1) { 13672 if (controlled[i] !== byController && controlled[i] instanceof Swiper) { 13673 setControlledTranslate(controlled[i]); 13674 } 13675 } 13676 } else if (controlled instanceof Swiper && byController !== controlled) { 13677 setControlledTranslate(controlled); 13678 } 13679 } 13680 function setTransition(duration, byController) { 13681 const Swiper = swiper.constructor; 13682 const controlled = swiper.controller.control; 13683 let i; 13684 function setControlledTransition(c) { 13685 if (c.destroyed) return; 13686 c.setTransition(duration, swiper); 13687 if (duration !== 0) { 13688 c.transitionStart(); 13689 if (c.params.autoHeight) { 13690 nextTick(() => { 13691 c.updateAutoHeight(); 13692 }); 13693 } 13694 elementTransitionEnd(c.wrapperEl, () => { 13695 if (!controlled) return; 13696 c.transitionEnd(); 13697 }); 13698 } 13699 } 13700 if (Array.isArray(controlled)) { 13701 for (i = 0; i < controlled.length; i += 1) { 13702 if (controlled[i] !== byController && controlled[i] instanceof Swiper) { 13703 setControlledTransition(controlled[i]); 13704 } 13705 } 13706 } else if (controlled instanceof Swiper && byController !== controlled) { 13707 setControlledTransition(controlled); 13708 } 13709 } 13710 function removeSpline() { 13711 if (!swiper.controller.control) return; 13712 if (swiper.controller.spline) { 13713 swiper.controller.spline = undefined; 13714 delete swiper.controller.spline; 13715 } 13716 } 13717 on('beforeInit', () => { 13718 if (typeof window !== 'undefined' && ( 13719 // eslint-disable-line 13720 typeof swiper.params.controller.control === 'string' || swiper.params.controller.control instanceof HTMLElement)) { 13721 const controlElements = typeof swiper.params.controller.control === 'string' ? [...document.querySelectorAll(swiper.params.controller.control)] : [swiper.params.controller.control]; 13722 controlElements.forEach(controlElement => { 13723 if (!swiper.controller.control) swiper.controller.control = []; 13724 if (controlElement && controlElement.swiper) { 13725 swiper.controller.control.push(controlElement.swiper); 13726 } else if (controlElement) { 13727 const eventName = `${swiper.params.eventsPrefix}init`; 13728 const onControllerSwiper = e => { 13729 swiper.controller.control.push(e.detail[0]); 13730 swiper.update(); 13731 controlElement.removeEventListener(eventName, onControllerSwiper); 13732 }; 13733 controlElement.addEventListener(eventName, onControllerSwiper); 13734 } 13735 }); 13736 return; 13737 } 13738 swiper.controller.control = swiper.params.controller.control; 13739 }); 13740 on('update', () => { 13741 removeSpline(); 13742 }); 13743 on('resize', () => { 13744 removeSpline(); 13745 }); 13746 on('observerUpdate', () => { 13747 removeSpline(); 13748 }); 13749 on('setTranslate', (_s, translate, byController) => { 13750 if (!swiper.controller.control || swiper.controller.control.destroyed) return; 13751 swiper.controller.setTranslate(translate, byController); 13752 }); 13753 on('setTransition', (_s, duration, byController) => { 13754 if (!swiper.controller.control || swiper.controller.control.destroyed) return; 13755 swiper.controller.setTransition(duration, byController); 13756 }); 13757 Object.assign(swiper.controller, { 13758 setTranslate, 13759 setTransition 13760 }); 13761 } 13762 13763 function A11y(_ref) { 13764 let { 13765 swiper, 13766 extendParams, 13767 on 13768 } = _ref; 13769 extendParams({ 13770 a11y: { 13771 enabled: true, 13772 notificationClass: 'swiper-notification', 13773 prevSlideMessage: 'Previous slide', 13774 nextSlideMessage: 'Next slide', 13775 firstSlideMessage: 'This is the first slide', 13776 lastSlideMessage: 'This is the last slide', 13777 paginationBulletMessage: 'Go to slide {{index}}', 13778 slideLabelMessage: '{{index}} / {{slidesLength}}', 13779 containerMessage: null, 13780 containerRoleDescriptionMessage: null, 13781 containerRole: null, 13782 itemRoleDescriptionMessage: null, 13783 slideRole: 'group', 13784 id: null, 13785 scrollOnFocus: true 13786 } 13787 }); 13788 swiper.a11y = { 13789 clicked: false 13790 }; 13791 let liveRegion = null; 13792 let preventFocusHandler; 13793 let focusTargetSlideEl; 13794 let visibilityChangedTimestamp = new Date().getTime(); 13795 function notify(message) { 13796 const notification = liveRegion; 13797 if (notification.length === 0) return; 13798 notification.innerHTML = ''; 13799 notification.innerHTML = message; 13800 } 13801 function getRandomNumber(size) { 13802 if (size === void 0) { 13803 size = 16; 13804 } 13805 const randomChar = () => Math.round(16 * Math.random()).toString(16); 13806 return 'x'.repeat(size).replace(/x/g, randomChar); 13807 } 13808 function makeElFocusable(el) { 13809 el = makeElementsArray(el); 13810 el.forEach(subEl => { 13811 subEl.setAttribute('tabIndex', '0'); 13812 }); 13813 } 13814 function makeElNotFocusable(el) { 13815 el = makeElementsArray(el); 13816 el.forEach(subEl => { 13817 subEl.setAttribute('tabIndex', '-1'); 13818 }); 13819 } 13820 function addElRole(el, role) { 13821 el = makeElementsArray(el); 13822 el.forEach(subEl => { 13823 subEl.setAttribute('role', role); 13824 }); 13825 } 13826 function addElRoleDescription(el, description) { 13827 el = makeElementsArray(el); 13828 el.forEach(subEl => { 13829 subEl.setAttribute('aria-roledescription', description); 13830 }); 13831 } 13832 function addElControls(el, controls) { 13833 el = makeElementsArray(el); 13834 el.forEach(subEl => { 13835 subEl.setAttribute('aria-controls', controls); 13836 }); 13837 } 13838 function addElLabel(el, label) { 13839 el = makeElementsArray(el); 13840 el.forEach(subEl => { 13841 subEl.setAttribute('aria-label', label); 13842 }); 13843 } 13844 function addElId(el, id) { 13845 el = makeElementsArray(el); 13846 el.forEach(subEl => { 13847 subEl.setAttribute('id', id); 13848 }); 13849 } 13850 function addElLive(el, live) { 13851 el = makeElementsArray(el); 13852 el.forEach(subEl => { 13853 subEl.setAttribute('aria-live', live); 13854 }); 13855 } 13856 function disableEl(el) { 13857 el = makeElementsArray(el); 13858 el.forEach(subEl => { 13859 subEl.setAttribute('aria-disabled', true); 13860 }); 13861 } 13862 function enableEl(el) { 13863 el = makeElementsArray(el); 13864 el.forEach(subEl => { 13865 subEl.setAttribute('aria-disabled', false); 13866 }); 13867 } 13868 function onEnterOrSpaceKey(e) { 13869 if (e.keyCode !== 13 && e.keyCode !== 32) return; 13870 const params = swiper.params.a11y; 13871 const targetEl = e.target; 13872 if (swiper.pagination && swiper.pagination.el && (targetEl === swiper.pagination.el || swiper.pagination.el.contains(e.target))) { 13873 if (!e.target.matches(classesToSelector(swiper.params.pagination.bulletClass))) return; 13874 } 13875 if (swiper.navigation && swiper.navigation.prevEl && swiper.navigation.nextEl) { 13876 const prevEls = makeElementsArray(swiper.navigation.prevEl); 13877 const nextEls = makeElementsArray(swiper.navigation.nextEl); 13878 if (nextEls.includes(targetEl)) { 13879 if (!(swiper.isEnd && !swiper.params.loop)) { 13880 swiper.slideNext(); 13881 } 13882 if (swiper.isEnd) { 13883 notify(params.lastSlideMessage); 13884 } else { 13885 notify(params.nextSlideMessage); 13886 } 13887 } 13888 if (prevEls.includes(targetEl)) { 13889 if (!(swiper.isBeginning && !swiper.params.loop)) { 13890 swiper.slidePrev(); 13891 } 13892 if (swiper.isBeginning) { 13893 notify(params.firstSlideMessage); 13894 } else { 13895 notify(params.prevSlideMessage); 13896 } 13897 } 13898 } 13899 if (swiper.pagination && targetEl.matches(classesToSelector(swiper.params.pagination.bulletClass))) { 13900 targetEl.click(); 13901 } 13902 } 13903 function updateNavigation() { 13904 if (swiper.params.loop || swiper.params.rewind || !swiper.navigation) return; 13905 const { 13906 nextEl, 13907 prevEl 13908 } = swiper.navigation; 13909 if (prevEl) { 13910 if (swiper.isBeginning) { 13911 disableEl(prevEl); 13912 makeElNotFocusable(prevEl); 13913 } else { 13914 enableEl(prevEl); 13915 makeElFocusable(prevEl); 13916 } 13917 } 13918 if (nextEl) { 13919 if (swiper.isEnd) { 13920 disableEl(nextEl); 13921 makeElNotFocusable(nextEl); 13922 } else { 13923 enableEl(nextEl); 13924 makeElFocusable(nextEl); 13925 } 13926 } 13927 } 13928 function hasPagination() { 13929 return swiper.pagination && swiper.pagination.bullets && swiper.pagination.bullets.length; 13930 } 13931 function hasClickablePagination() { 13932 return hasPagination() && swiper.params.pagination.clickable; 13933 } 13934 function updatePagination() { 13935 const params = swiper.params.a11y; 13936 if (!hasPagination()) return;
vendor: 7,682 bytes, lines 13937-14151
13937 swiper.pagination.bullets.forEach(bulletEl => { 13938 if (swiper.params.pagination.clickable) { 13939 makeElFocusable(bulletEl); 13940 if (!swiper.params.pagination.renderBullet) { 13941 addElRole(bulletEl, 'button'); 13942 addElLabel(bulletEl, params.paginationBulletMessage.replace(/\{\{index\}\}/, elementIndex(bulletEl) + 1)); 13943 } 13944 } 13945 if (bulletEl.matches(classesToSelector(swiper.params.pagination.bulletActiveClass))) { 13946 bulletEl.setAttribute('aria-current', 'true'); 13947 } else { 13948 bulletEl.removeAttribute('aria-current'); 13949 } 13950 }); 13951 } 13952 const initNavEl = (el, wrapperId, message) => { 13953 makeElFocusable(el); 13954 if (el.tagName !== 'BUTTON') { 13955 addElRole(el, 'button'); 13956 el.addEventListener('keydown', onEnterOrSpaceKey); 13957 } 13958 addElLabel(el, message); 13959 addElControls(el, wrapperId); 13960 }; 13961 const handlePointerDown = e => { 13962 if (focusTargetSlideEl && focusTargetSlideEl !== e.target && !focusTargetSlideEl.contains(e.target)) { 13963 preventFocusHandler = true; 13964 } 13965 swiper.a11y.clicked = true; 13966 }; 13967 const handlePointerUp = () => { 13968 preventFocusHandler = false; 13969 requestAnimationFrame(() => { 13970 requestAnimationFrame(() => { 13971 if (!swiper.destroyed) { 13972 swiper.a11y.clicked = false; 13973 } 13974 }); 13975 }); 13976 }; 13977 const onVisibilityChange = e => { 13978 visibilityChangedTimestamp = new Date().getTime(); 13979 }; 13980 const handleFocus = e => { 13981 if (swiper.a11y.clicked || !swiper.params.a11y.scrollOnFocus) return; 13982 if (new Date().getTime() - visibilityChangedTimestamp < 100) return; 13983 const slideEl = e.target.closest(`.${swiper.params.slideClass}, swiper-slide`); 13984 if (!slideEl || !swiper.slides.includes(slideEl)) return; 13985 focusTargetSlideEl = slideEl; 13986 const isActive = swiper.slides.indexOf(slideEl) === swiper.activeIndex; 13987 const isVisible = swiper.params.watchSlidesProgress && swiper.visibleSlides && swiper.visibleSlides.includes(slideEl); 13988 if (isActive || isVisible) return; 13989 if (e.sourceCapabilities && e.sourceCapabilities.firesTouchEvents) return; 13990 if (swiper.isHorizontal()) { 13991 swiper.el.scrollLeft = 0; 13992 } else { 13993 swiper.el.scrollTop = 0; 13994 } 13995 requestAnimationFrame(() => { 13996 if (preventFocusHandler) return; 13997 if (swiper.params.loop) { 13998 swiper.slideToLoop(parseInt(slideEl.getAttribute('data-swiper-slide-index')), 0); 13999 } else { 14000 swiper.slideTo(swiper.slides.indexOf(slideEl), 0); 14001 } 14002 preventFocusHandler = false; 14003 }); 14004 }; 14005 const initSlides = () => { 14006 const params = swiper.params.a11y; 14007 if (params.itemRoleDescriptionMessage) { 14008 addElRoleDescription(swiper.slides, params.itemRoleDescriptionMessage); 14009 } 14010 if (params.slideRole) { 14011 addElRole(swiper.slides, params.slideRole); 14012 } 14013 const slidesLength = swiper.slides.length; 14014 if (params.slideLabelMessage) { 14015 swiper.slides.forEach((slideEl, index) => { 14016 const slideIndex = swiper.params.loop ? parseInt(slideEl.getAttribute('data-swiper-slide-index'), 10) : index; 14017 const ariaLabelMessage = params.slideLabelMessage.replace(/\{\{index\}\}/, slideIndex + 1).replace(/\{\{slidesLength\}\}/, slidesLength); 14018 addElLabel(slideEl, ariaLabelMessage); 14019 }); 14020 } 14021 }; 14022 const init = () => { 14023 const params = swiper.params.a11y; 14024 swiper.el.append(liveRegion); 14025 14026 // Container 14027 const containerEl = swiper.el; 14028 if (params.containerRoleDescriptionMessage) { 14029 addElRoleDescription(containerEl, params.containerRoleDescriptionMessage); 14030 } 14031 if (params.containerMessage) { 14032 addElLabel(containerEl, params.containerMessage); 14033 } 14034 if (params.containerRole) { 14035 addElRole(containerEl, params.containerRole); 14036 } 14037 14038 // Wrapper 14039 const wrapperEl = swiper.wrapperEl; 14040 const wrapperId = params.id || wrapperEl.getAttribute('id') || `swiper-wrapper-${getRandomNumber(16)}`; 14041 const live = swiper.params.autoplay && swiper.params.autoplay.enabled ? 'off' : 'polite'; 14042 addElId(wrapperEl, wrapperId); 14043 addElLive(wrapperEl, live); 14044 14045 // Slide 14046 initSlides(); 14047 14048 // Navigation 14049 let { 14050 nextEl, 14051 prevEl 14052 } = swiper.navigation ? swiper.navigation : {}; 14053 nextEl = makeElementsArray(nextEl); 14054 prevEl = makeElementsArray(prevEl); 14055 if (nextEl) { 14056 nextEl.forEach(el => initNavEl(el, wrapperId, params.nextSlideMessage)); 14057 } 14058 if (prevEl) { 14059 prevEl.forEach(el => initNavEl(el, wrapperId, params.prevSlideMessage)); 14060 } 14061 14062 // Pagination 14063 if (hasClickablePagination()) { 14064 const paginationEl = makeElementsArray(swiper.pagination.el); 14065 paginationEl.forEach(el => { 14066 el.addEventListener('keydown', onEnterOrSpaceKey); 14067 }); 14068 } 14069 14070 // Tab focus 14071 const document = getDocument(); 14072 document.addEventListener('visibilitychange', onVisibilityChange); 14073 swiper.el.addEventListener('focus', handleFocus, true); 14074 swiper.el.addEventListener('focus', handleFocus, true); 14075 swiper.el.addEventListener('pointerdown', handlePointerDown, true); 14076 swiper.el.addEventListener('pointerup', handlePointerUp, true); 14077 }; 14078 function destroy() { 14079 if (liveRegion) liveRegion.remove(); 14080 let { 14081 nextEl, 14082 prevEl 14083 } = swiper.navigation ? swiper.navigation : {}; 14084 nextEl = makeElementsArray(nextEl); 14085 prevEl = makeElementsArray(prevEl); 14086 if (nextEl) { 14087 nextEl.forEach(el => el.removeEventListener('keydown', onEnterOrSpaceKey)); 14088 } 14089 if (prevEl) { 14090 prevEl.forEach(el => el.removeEventListener('keydown', onEnterOrSpaceKey)); 14091 } 14092 14093 // Pagination 14094 if (hasClickablePagination()) { 14095 const paginationEl = makeElementsArray(swiper.pagination.el); 14096 paginationEl.forEach(el => { 14097 el.removeEventListener('keydown', onEnterOrSpaceKey); 14098 }); 14099 } 14100 const document = getDocument(); 14101 document.removeEventListener('visibilitychange', onVisibilityChange); 14102 // Tab focus 14103 if (swiper.el && typeof swiper.el !== 'string') { 14104 swiper.el.removeEventListener('focus', handleFocus, true); 14105 swiper.el.removeEventListener('pointerdown', handlePointerDown, true); 14106 swiper.el.removeEventListener('pointerup', handlePointerUp, true); 14107 } 14108 } 14109 on('beforeInit', () => { 14110 liveRegion = createElement('span', swiper.params.a11y.notificationClass); 14111 liveRegion.setAttribute('aria-live', 'assertive'); 14112 liveRegion.setAttribute('aria-atomic', 'true'); 14113 }); 14114 on('afterInit', () => { 14115 if (!swiper.params.a11y.enabled) return; 14116 init(); 14117 }); 14118 on('slidesLengthChange snapGridLengthChange slidesGridLengthChange', () => { 14119 if (!swiper.params.a11y.enabled) return; 14120 initSlides(); 14121 }); 14122 on('fromEdge toEdge afterInit lock unlock', () => { 14123 if (!swiper.params.a11y.enabled) return; 14124 updateNavigation(); 14125 }); 14126 on('paginationUpdate', () => { 14127 if (!swiper.params.a11y.enabled) return; 14128 updatePagination(); 14129 }); 14130 on('destroy', () => { 14131 if (!swiper.params.a11y.enabled) return; 14132 destroy(); 14133 }); 14134 } 14135 14136 function History(_ref) { 14137 let { 14138 swiper, 14139 extendParams, 14140 on 14141 } = _ref; 14142 extendParams({ 14143 history: { 14144 enabled: false, 14145 root: '', 14146 replaceState: false, 14147 key: 'slides', 14148 keepQuery: false 14149 } 14150 }); 14151 let initialized = false;
vendor: 24,830 bytes, lines 14152-14847
14152 let paths = {}; 14153 const slugify = text => { 14154 return text.toString().replace(/\s+/g, '-').replace(/[^\w-]+/g, '').replace(/--+/g, '-').replace(/^-+/, '').replace(/-+$/, ''); 14155 }; 14156 const getPathValues = urlOverride => { 14157 const window = getWindow(); 14158 let location; 14159 if (urlOverride) { 14160 location = new URL(urlOverride); 14161 } else { 14162 location = window.location; 14163 } 14164 const pathArray = location.pathname.slice(1).split('/').filter(part => part !== ''); 14165 const total = pathArray.length; 14166 const key = pathArray[total - 2]; 14167 const value = pathArray[total - 1]; 14168 return { 14169 key, 14170 value 14171 }; 14172 }; 14173 const setHistory = (key, index) => { 14174 const window = getWindow(); 14175 if (!initialized || !swiper.params.history.enabled) return; 14176 let location; 14177 if (swiper.params.url) { 14178 location = new URL(swiper.params.url); 14179 } else { 14180 location = window.location; 14181 } 14182 const slide = swiper.virtual && swiper.params.virtual.enabled ? swiper.slidesEl.querySelector(`[data-swiper-slide-index="${index}"]`) : swiper.slides[index]; 14183 let value = slugify(slide.getAttribute('data-history')); 14184 if (swiper.params.history.root.length > 0) { 14185 let root = swiper.params.history.root; 14186 if (root[root.length - 1] === '/') root = root.slice(0, root.length - 1); 14187 value = `${root}/${key ? `${key}/` : ''}${value}`; 14188 } else if (!location.pathname.includes(key)) { 14189 value = `${key ? `${key}/` : ''}${value}`; 14190 } 14191 if (swiper.params.history.keepQuery) { 14192 value += location.search; 14193 } 14194 const currentState = window.history.state; 14195 if (currentState && currentState.value === value) { 14196 return; 14197 } 14198 if (swiper.params.history.replaceState) { 14199 window.history.replaceState({ 14200 value 14201 }, null, value); 14202 } else { 14203 window.history.pushState({ 14204 value 14205 }, null, value); 14206 } 14207 }; 14208 const scrollToSlide = (speed, value, runCallbacks) => { 14209 if (value) { 14210 for (let i = 0, length = swiper.slides.length; i < length; i += 1) { 14211 const slide = swiper.slides[i]; 14212 const slideHistory = slugify(slide.getAttribute('data-history')); 14213 if (slideHistory === value) { 14214 const index = swiper.getSlideIndex(slide); 14215 swiper.slideTo(index, speed, runCallbacks); 14216 } 14217 } 14218 } else { 14219 swiper.slideTo(0, speed, runCallbacks); 14220 } 14221 }; 14222 const setHistoryPopState = () => { 14223 paths = getPathValues(swiper.params.url); 14224 scrollToSlide(swiper.params.speed, paths.value, false); 14225 }; 14226 const init = () => { 14227 const window = getWindow(); 14228 if (!swiper.params.history) return; 14229 if (!window.history || !window.history.pushState) { 14230 swiper.params.history.enabled = false; 14231 swiper.params.hashNavigation.enabled = true; 14232 return; 14233 } 14234 initialized = true; 14235 paths = getPathValues(swiper.params.url); 14236 if (!paths.key && !paths.value) { 14237 if (!swiper.params.history.replaceState) { 14238 window.addEventListener('popstate', setHistoryPopState); 14239 } 14240 return; 14241 } 14242 scrollToSlide(0, paths.value, swiper.params.runCallbacksOnInit); 14243 if (!swiper.params.history.replaceState) { 14244 window.addEventListener('popstate', setHistoryPopState); 14245 } 14246 }; 14247 const destroy = () => { 14248 const window = getWindow(); 14249 if (!swiper.params.history.replaceState) { 14250 window.removeEventListener('popstate', setHistoryPopState); 14251 } 14252 }; 14253 on('init', () => { 14254 if (swiper.params.history.enabled) { 14255 init(); 14256 } 14257 }); 14258 on('destroy', () => { 14259 if (swiper.params.history.enabled) { 14260 destroy(); 14261 } 14262 }); 14263 on('transitionEnd _freeModeNoMomentumRelease', () => { 14264 if (initialized) { 14265 setHistory(swiper.params.history.key, swiper.activeIndex); 14266 } 14267 }); 14268 on('slideChange', () => { 14269 if (initialized && swiper.params.cssMode) { 14270 setHistory(swiper.params.history.key, swiper.activeIndex); 14271 } 14272 }); 14273 } 14274 14275 function HashNavigation(_ref) { 14276 let { 14277 swiper, 14278 extendParams, 14279 emit, 14280 on 14281 } = _ref; 14282 let initialized = false; 14283 const document = getDocument(); 14284 const window = getWindow(); 14285 extendParams({ 14286 hashNavigation: { 14287 enabled: false, 14288 replaceState: false, 14289 watchState: false, 14290 getSlideIndex(_s, hash) { 14291 if (swiper.virtual && swiper.params.virtual.enabled) { 14292 const slideWithHash = swiper.slides.filter(slideEl => slideEl.getAttribute('data-hash') === hash)[0]; 14293 if (!slideWithHash) return 0; 14294 const index = parseInt(slideWithHash.getAttribute('data-swiper-slide-index'), 10); 14295 return index; 14296 } 14297 return swiper.getSlideIndex(elementChildren(swiper.slidesEl, `.${swiper.params.slideClass}[data-hash="${hash}"], swiper-slide[data-hash="${hash}"]`)[0]); 14298 } 14299 } 14300 }); 14301 const onHashChange = () => { 14302 emit('hashChange'); 14303 const newHash = document.location.hash.replace('#', ''); 14304 const activeSlideEl = swiper.virtual && swiper.params.virtual.enabled ? swiper.slidesEl.querySelector(`[data-swiper-slide-index="${swiper.activeIndex}"]`) : swiper.slides[swiper.activeIndex]; 14305 const activeSlideHash = activeSlideEl ? activeSlideEl.getAttribute('data-hash') : ''; 14306 if (newHash !== activeSlideHash) { 14307 const newIndex = swiper.params.hashNavigation.getSlideIndex(swiper, newHash); 14308 if (typeof newIndex === 'undefined' || Number.isNaN(newIndex)) return; 14309 swiper.slideTo(newIndex); 14310 } 14311 }; 14312 const setHash = () => { 14313 if (!initialized || !swiper.params.hashNavigation.enabled) return; 14314 const activeSlideEl = swiper.virtual && swiper.params.virtual.enabled ? swiper.slidesEl.querySelector(`[data-swiper-slide-index="${swiper.activeIndex}"]`) : swiper.slides[swiper.activeIndex]; 14315 const activeSlideHash = activeSlideEl ? activeSlideEl.getAttribute('data-hash') || activeSlideEl.getAttribute('data-history') : ''; 14316 if (swiper.params.hashNavigation.replaceState && window.history && window.history.replaceState) { 14317 window.history.replaceState(null, null, `#${activeSlideHash}` || ''); 14318 emit('hashSet'); 14319 } else { 14320 document.location.hash = activeSlideHash || ''; 14321 emit('hashSet'); 14322 } 14323 }; 14324 const init = () => { 14325 if (!swiper.params.hashNavigation.enabled || swiper.params.history && swiper.params.history.enabled) return; 14326 initialized = true; 14327 const hash = document.location.hash.replace('#', ''); 14328 if (hash) { 14329 const speed = 0; 14330 const index = swiper.params.hashNavigation.getSlideIndex(swiper, hash); 14331 swiper.slideTo(index || 0, speed, swiper.params.runCallbacksOnInit, true); 14332 } 14333 if (swiper.params.hashNavigation.watchState) { 14334 window.addEventListener('hashchange', onHashChange); 14335 } 14336 }; 14337 const destroy = () => { 14338 if (swiper.params.hashNavigation.watchState) { 14339 window.removeEventListener('hashchange', onHashChange); 14340 } 14341 }; 14342 on('init', () => { 14343 if (swiper.params.hashNavigation.enabled) { 14344 init(); 14345 } 14346 }); 14347 on('destroy', () => { 14348 if (swiper.params.hashNavigation.enabled) { 14349 destroy(); 14350 } 14351 }); 14352 on('transitionEnd _freeModeNoMomentumRelease', () => { 14353 if (initialized) { 14354 setHash(); 14355 } 14356 }); 14357 on('slideChange', () => { 14358 if (initialized && swiper.params.cssMode) { 14359 setHash(); 14360 } 14361 }); 14362 } 14363 14364 /* eslint no-underscore-dangle: "off" */ 14365 /* eslint no-use-before-define: "off" */ 14366 function Autoplay(_ref) { 14367 let { 14368 swiper, 14369 extendParams, 14370 on, 14371 emit, 14372 params 14373 } = _ref; 14374 swiper.autoplay = { 14375 running: false, 14376 paused: false, 14377 timeLeft: 0 14378 }; 14379 extendParams({ 14380 autoplay: { 14381 enabled: false, 14382 delay: 3000, 14383 waitForTransition: true, 14384 disableOnInteraction: false, 14385 stopOnLastSlide: false, 14386 reverseDirection: false, 14387 pauseOnMouseEnter: false 14388 } 14389 }); 14390 let timeout; 14391 let raf; 14392 let autoplayDelayTotal = params && params.autoplay ? params.autoplay.delay : 3000; 14393 let autoplayDelayCurrent = params && params.autoplay ? params.autoplay.delay : 3000; 14394 let autoplayTimeLeft; 14395 let autoplayStartTime = new Date().getTime(); 14396 let wasPaused; 14397 let isTouched; 14398 let pausedByTouch; 14399 let touchStartTimeout; 14400 let slideChanged; 14401 let pausedByInteraction; 14402 let pausedByPointerEnter; 14403 function onTransitionEnd(e) { 14404 if (!swiper || swiper.destroyed || !swiper.wrapperEl) return; 14405 if (e.target !== swiper.wrapperEl) return; 14406 swiper.wrapperEl.removeEventListener('transitionend', onTransitionEnd); 14407 if (pausedByPointerEnter || e.detail && e.detail.bySwiperTouchMove) { 14408 return; 14409 } 14410 resume(); 14411 } 14412 const calcTimeLeft = () => { 14413 if (swiper.destroyed || !swiper.autoplay.running) return; 14414 if (swiper.autoplay.paused) { 14415 wasPaused = true; 14416 } else if (wasPaused) { 14417 autoplayDelayCurrent = autoplayTimeLeft; 14418 wasPaused = false; 14419 } 14420 const timeLeft = swiper.autoplay.paused ? autoplayTimeLeft : autoplayStartTime + autoplayDelayCurrent - new Date().getTime(); 14421 swiper.autoplay.timeLeft = timeLeft; 14422 emit('autoplayTimeLeft', timeLeft, timeLeft / autoplayDelayTotal); 14423 raf = requestAnimationFrame(() => { 14424 calcTimeLeft(); 14425 }); 14426 }; 14427 const getSlideDelay = () => { 14428 let activeSlideEl; 14429 if (swiper.virtual && swiper.params.virtual.enabled) { 14430 activeSlideEl = swiper.slides.filter(slideEl => slideEl.classList.contains('swiper-slide-active'))[0]; 14431 } else { 14432 activeSlideEl = swiper.slides[swiper.activeIndex]; 14433 } 14434 if (!activeSlideEl) return undefined; 14435 const currentSlideDelay = parseInt(activeSlideEl.getAttribute('data-swiper-autoplay'), 10); 14436 return currentSlideDelay; 14437 }; 14438 const run = delayForce => { 14439 if (swiper.destroyed || !swiper.autoplay.running) return; 14440 cancelAnimationFrame(raf); 14441 calcTimeLeft(); 14442 let delay = typeof delayForce === 'undefined' ? swiper.params.autoplay.delay : delayForce; 14443 autoplayDelayTotal = swiper.params.autoplay.delay; 14444 autoplayDelayCurrent = swiper.params.autoplay.delay; 14445 const currentSlideDelay = getSlideDelay(); 14446 if (!Number.isNaN(currentSlideDelay) && currentSlideDelay > 0 && typeof delayForce === 'undefined') { 14447 delay = currentSlideDelay; 14448 autoplayDelayTotal = currentSlideDelay; 14449 autoplayDelayCurrent = currentSlideDelay; 14450 } 14451 autoplayTimeLeft = delay; 14452 const speed = swiper.params.speed; 14453 const proceed = () => { 14454 if (!swiper || swiper.destroyed) return; 14455 if (swiper.params.autoplay.reverseDirection) { 14456 if (!swiper.isBeginning || swiper.params.loop || swiper.params.rewind) { 14457 swiper.slidePrev(speed, true, true); 14458 emit('autoplay'); 14459 } else if (!swiper.params.autoplay.stopOnLastSlide) { 14460 swiper.slideTo(swiper.slides.length - 1, speed, true, true); 14461 emit('autoplay'); 14462 } 14463 } else { 14464 if (!swiper.isEnd || swiper.params.loop || swiper.params.rewind) { 14465 swiper.slideNext(speed, true, true); 14466 emit('autoplay'); 14467 } else if (!swiper.params.autoplay.stopOnLastSlide) { 14468 swiper.slideTo(0, speed, true, true); 14469 emit('autoplay'); 14470 } 14471 } 14472 if (swiper.params.cssMode) { 14473 autoplayStartTime = new Date().getTime(); 14474 requestAnimationFrame(() => { 14475 run(); 14476 }); 14477 } 14478 }; 14479 if (delay > 0) { 14480 clearTimeout(timeout); 14481 timeout = setTimeout(() => { 14482 proceed(); 14483 }, delay); 14484 } else { 14485 requestAnimationFrame(() => { 14486 proceed(); 14487 }); 14488 } 14489 14490 // eslint-disable-next-line 14491 return delay; 14492 }; 14493 const start = () => { 14494 autoplayStartTime = new Date().getTime(); 14495 swiper.autoplay.running = true; 14496 run(); 14497 emit('autoplayStart'); 14498 }; 14499 const stop = () => { 14500 swiper.autoplay.running = false; 14501 clearTimeout(timeout); 14502 cancelAnimationFrame(raf); 14503 emit('autoplayStop'); 14504 }; 14505 const pause = (internal, reset) => { 14506 if (swiper.destroyed || !swiper.autoplay.running) return; 14507 clearTimeout(timeout); 14508 if (!internal) { 14509 pausedByInteraction = true; 14510 } 14511 const proceed = () => { 14512 emit('autoplayPause'); 14513 if (swiper.params.autoplay.waitForTransition) { 14514 swiper.wrapperEl.addEventListener('transitionend', onTransitionEnd); 14515 } else { 14516 resume(); 14517 } 14518 }; 14519 swiper.autoplay.paused = true; 14520 if (reset) { 14521 if (slideChanged) { 14522 autoplayTimeLeft = swiper.params.autoplay.delay; 14523 } 14524 slideChanged = false; 14525 proceed(); 14526 return; 14527 } 14528 const delay = autoplayTimeLeft || swiper.params.autoplay.delay; 14529 autoplayTimeLeft = delay - (new Date().getTime() - autoplayStartTime); 14530 if (swiper.isEnd && autoplayTimeLeft < 0 && !swiper.params.loop) return; 14531 if (autoplayTimeLeft < 0) autoplayTimeLeft = 0; 14532 proceed(); 14533 }; 14534 const resume = () => { 14535 if (swiper.isEnd && autoplayTimeLeft < 0 && !swiper.params.loop || swiper.destroyed || !swiper.autoplay.running) return; 14536 autoplayStartTime = new Date().getTime(); 14537 if (pausedByInteraction) { 14538 pausedByInteraction = false; 14539 run(autoplayTimeLeft); 14540 } else { 14541 run(); 14542 } 14543 swiper.autoplay.paused = false; 14544 emit('autoplayResume'); 14545 }; 14546 const onVisibilityChange = () => { 14547 if (swiper.destroyed || !swiper.autoplay.running) return; 14548 const document = getDocument(); 14549 if (document.visibilityState === 'hidden') { 14550 pausedByInteraction = true; 14551 pause(true); 14552 } 14553 if (document.visibilityState === 'visible') { 14554 resume(); 14555 } 14556 }; 14557 const onPointerEnter = e => { 14558 if (e.pointerType !== 'mouse') return; 14559 pausedByInteraction = true; 14560 pausedByPointerEnter = true; 14561 if (swiper.animating || swiper.autoplay.paused) return; 14562 pause(true); 14563 }; 14564 const onPointerLeave = e => { 14565 if (e.pointerType !== 'mouse') return; 14566 pausedByPointerEnter = false; 14567 if (swiper.autoplay.paused) { 14568 resume(); 14569 } 14570 }; 14571 const attachMouseEvents = () => { 14572 if (swiper.params.autoplay.pauseOnMouseEnter) { 14573 swiper.el.addEventListener('pointerenter', onPointerEnter); 14574 swiper.el.addEventListener('pointerleave', onPointerLeave); 14575 } 14576 }; 14577 const detachMouseEvents = () => { 14578 if (swiper.el && typeof swiper.el !== 'string') { 14579 swiper.el.removeEventListener('pointerenter', onPointerEnter); 14580 swiper.el.removeEventListener('pointerleave', onPointerLeave); 14581 } 14582 }; 14583 const attachDocumentEvents = () => { 14584 const document = getDocument(); 14585 document.addEventListener('visibilitychange', onVisibilityChange); 14586 }; 14587 const detachDocumentEvents = () => { 14588 const document = getDocument(); 14589 document.removeEventListener('visibilitychange', onVisibilityChange); 14590 }; 14591 on('init', () => { 14592 if (swiper.params.autoplay.enabled) { 14593 attachMouseEvents(); 14594 attachDocumentEvents(); 14595 start(); 14596 } 14597 }); 14598 on('destroy', () => { 14599 detachMouseEvents(); 14600 detachDocumentEvents(); 14601 if (swiper.autoplay.running) { 14602 stop(); 14603 } 14604 }); 14605 on('_freeModeStaticRelease', () => { 14606 if (pausedByTouch || pausedByInteraction) { 14607 resume(); 14608 } 14609 }); 14610 on('_freeModeNoMomentumRelease', () => { 14611 if (!swiper.params.autoplay.disableOnInteraction) { 14612 pause(true, true); 14613 } else { 14614 stop(); 14615 } 14616 }); 14617 on('beforeTransitionStart', (_s, speed, internal) => { 14618 if (swiper.destroyed || !swiper.autoplay.running) return; 14619 if (internal || !swiper.params.autoplay.disableOnInteraction) { 14620 pause(true, true); 14621 } else { 14622 stop(); 14623 } 14624 }); 14625 on('sliderFirstMove', () => { 14626 if (swiper.destroyed || !swiper.autoplay.running) return; 14627 if (swiper.params.autoplay.disableOnInteraction) { 14628 stop(); 14629 return; 14630 } 14631 isTouched = true; 14632 pausedByTouch = false; 14633 pausedByInteraction = false; 14634 touchStartTimeout = setTimeout(() => { 14635 pausedByInteraction = true; 14636 pausedByTouch = true; 14637 pause(true); 14638 }, 200); 14639 }); 14640 on('touchEnd', () => { 14641 if (swiper.destroyed || !swiper.autoplay.running || !isTouched) return; 14642 clearTimeout(touchStartTimeout); 14643 clearTimeout(timeout); 14644 if (swiper.params.autoplay.disableOnInteraction) { 14645 pausedByTouch = false; 14646 isTouched = false; 14647 return; 14648 } 14649 if (pausedByTouch && swiper.params.cssMode) resume(); 14650 pausedByTouch = false; 14651 isTouched = false; 14652 }); 14653 on('slideChange', () => { 14654 if (swiper.destroyed || !swiper.autoplay.running) return; 14655 slideChanged = true; 14656 }); 14657 Object.assign(swiper.autoplay, { 14658 start, 14659 stop, 14660 pause, 14661 resume 14662 }); 14663 } 14664 14665 function Thumb(_ref) { 14666 let { 14667 swiper, 14668 extendParams, 14669 on 14670 } = _ref; 14671 extendParams({ 14672 thumbs: { 14673 swiper: null, 14674 multipleActiveThumbs: true, 14675 autoScrollOffset: 0, 14676 slideThumbActiveClass: 'swiper-slide-thumb-active', 14677 thumbsContainerClass: 'swiper-thumbs' 14678 } 14679 }); 14680 let initialized = false; 14681 let swiperCreated = false; 14682 swiper.thumbs = { 14683 swiper: null 14684 }; 14685 function onThumbClick() { 14686 const thumbsSwiper = swiper.thumbs.swiper; 14687 if (!thumbsSwiper || thumbsSwiper.destroyed) return; 14688 const clickedIndex = thumbsSwiper.clickedIndex; 14689 const clickedSlide = thumbsSwiper.clickedSlide; 14690 if (clickedSlide && clickedSlide.classList.contains(swiper.params.thumbs.slideThumbActiveClass)) return; 14691 if (typeof clickedIndex === 'undefined' || clickedIndex === null) return; 14692 let slideToIndex; 14693 if (thumbsSwiper.params.loop) { 14694 slideToIndex = parseInt(thumbsSwiper.clickedSlide.getAttribute('data-swiper-slide-index'), 10); 14695 } else { 14696 slideToIndex = clickedIndex; 14697 } 14698 if (swiper.params.loop) { 14699 swiper.slideToLoop(slideToIndex); 14700 } else { 14701 swiper.slideTo(slideToIndex); 14702 } 14703 } 14704 function init() { 14705 const { 14706 thumbs: thumbsParams 14707 } = swiper.params; 14708 if (initialized) return false; 14709 initialized = true; 14710 const SwiperClass = swiper.constructor; 14711 if (thumbsParams.swiper instanceof SwiperClass) { 14712 swiper.thumbs.swiper = thumbsParams.swiper; 14713 Object.assign(swiper.thumbs.swiper.originalParams, { 14714 watchSlidesProgress: true, 14715 slideToClickedSlide: false 14716 }); 14717 Object.assign(swiper.thumbs.swiper.params, { 14718 watchSlidesProgress: true, 14719 slideToClickedSlide: false 14720 }); 14721 swiper.thumbs.swiper.update(); 14722 } else if (isObject(thumbsParams.swiper)) { 14723 const thumbsSwiperParams = Object.assign({}, thumbsParams.swiper); 14724 Object.assign(thumbsSwiperParams, { 14725 watchSlidesProgress: true, 14726 slideToClickedSlide: false 14727 }); 14728 swiper.thumbs.swiper = new SwiperClass(thumbsSwiperParams); 14729 swiperCreated = true; 14730 } 14731 swiper.thumbs.swiper.el.classList.add(swiper.params.thumbs.thumbsContainerClass); 14732 swiper.thumbs.swiper.on('tap', onThumbClick); 14733 return true; 14734 } 14735 function update(initial) { 14736 const thumbsSwiper = swiper.thumbs.swiper; 14737 if (!thumbsSwiper || thumbsSwiper.destroyed) return; 14738 const slidesPerView = thumbsSwiper.params.slidesPerView === 'auto' ? thumbsSwiper.slidesPerViewDynamic() : thumbsSwiper.params.slidesPerView; 14739 14740 // Activate thumbs 14741 let thumbsToActivate = 1; 14742 const thumbActiveClass = swiper.params.thumbs.slideThumbActiveClass; 14743 if (swiper.params.slidesPerView > 1 && !swiper.params.centeredSlides) { 14744 thumbsToActivate = swiper.params.slidesPerView; 14745 } 14746 if (!swiper.params.thumbs.multipleActiveThumbs) { 14747 thumbsToActivate = 1; 14748 } 14749 thumbsToActivate = Math.floor(thumbsToActivate); 14750 thumbsSwiper.slides.forEach(slideEl => slideEl.classList.remove(thumbActiveClass)); 14751 if (thumbsSwiper.params.loop || thumbsSwiper.params.virtual && thumbsSwiper.params.virtual.enabled) { 14752 for (let i = 0; i < thumbsToActivate; i += 1) { 14753 elementChildren(thumbsSwiper.slidesEl, `[data-swiper-slide-index="${swiper.realIndex + i}"]`).forEach(slideEl => { 14754 slideEl.classList.add(thumbActiveClass); 14755 }); 14756 } 14757 } else { 14758 for (let i = 0; i < thumbsToActivate; i += 1) { 14759 if (thumbsSwiper.slides[swiper.realIndex + i]) { 14760 thumbsSwiper.slides[swiper.realIndex + i].classList.add(thumbActiveClass); 14761 } 14762 } 14763 } 14764 const autoScrollOffset = swiper.params.thumbs.autoScrollOffset; 14765 const useOffset = autoScrollOffset && !thumbsSwiper.params.loop; 14766 if (swiper.realIndex !== thumbsSwiper.realIndex || useOffset) { 14767 const currentThumbsIndex = thumbsSwiper.activeIndex; 14768 let newThumbsIndex; 14769 let direction; 14770 if (thumbsSwiper.params.loop) { 14771 const newThumbsSlide = thumbsSwiper.slides.filter(slideEl => slideEl.getAttribute('data-swiper-slide-index') === `${swiper.realIndex}`)[0]; 14772 newThumbsIndex = thumbsSwiper.slides.indexOf(newThumbsSlide); 14773 direction = swiper.activeIndex > swiper.previousIndex ? 'next' : 'prev'; 14774 } else { 14775 newThumbsIndex = swiper.realIndex; 14776 direction = newThumbsIndex > swiper.previousIndex ? 'next' : 'prev'; 14777 } 14778 if (useOffset) { 14779 newThumbsIndex += direction === 'next' ? autoScrollOffset : -1 * autoScrollOffset; 14780 } 14781 if (thumbsSwiper.visibleSlidesIndexes && thumbsSwiper.visibleSlidesIndexes.indexOf(newThumbsIndex) < 0) { 14782 if (thumbsSwiper.params.centeredSlides) { 14783 if (newThumbsIndex > currentThumbsIndex) { 14784 newThumbsIndex = newThumbsIndex - Math.floor(slidesPerView / 2) + 1; 14785 } else { 14786 newThumbsIndex = newThumbsIndex + Math.floor(slidesPerView / 2) - 1; 14787 } 14788 } else if (newThumbsIndex > currentThumbsIndex && thumbsSwiper.params.slidesPerGroup === 1) ; 14789 thumbsSwiper.slideTo(newThumbsIndex, initial ? 0 : undefined); 14790 } 14791 } 14792 } 14793 on('beforeInit', () => { 14794 const { 14795 thumbs 14796 } = swiper.params; 14797 if (!thumbs || !thumbs.swiper) return; 14798 if (typeof thumbs.swiper === 'string' || thumbs.swiper instanceof HTMLElement) { 14799 const document = getDocument(); 14800 const getThumbsElementAndInit = () => { 14801 const thumbsElement = typeof thumbs.swiper === 'string' ? document.querySelector(thumbs.swiper) : thumbs.swiper; 14802 if (thumbsElement && thumbsElement.swiper) { 14803 thumbs.swiper = thumbsElement.swiper; 14804 init(); 14805 update(true); 14806 } else if (thumbsElement) { 14807 const eventName = `${swiper.params.eventsPrefix}init`; 14808 const onThumbsSwiper = e => { 14809 thumbs.swiper = e.detail[0]; 14810 thumbsElement.removeEventListener(eventName, onThumbsSwiper); 14811 init(); 14812 update(true); 14813 thumbs.swiper.update(); 14814 swiper.update(); 14815 }; 14816 thumbsElement.addEventListener(eventName, onThumbsSwiper); 14817 } 14818 return thumbsElement; 14819 }; 14820 const watchForThumbsToAppear = () => { 14821 if (swiper.destroyed) return; 14822 const thumbsElement = getThumbsElementAndInit(); 14823 if (!thumbsElement) { 14824 requestAnimationFrame(watchForThumbsToAppear); 14825 } 14826 }; 14827 requestAnimationFrame(watchForThumbsToAppear); 14828 } else { 14829 init(); 14830 update(true); 14831 } 14832 }); 14833 on('slideChange update resize observerUpdate', () => { 14834 update(); 14835 }); 14836 on('setTransition', (_s, duration) => { 14837 const thumbsSwiper = swiper.thumbs.swiper; 14838 if (!thumbsSwiper || thumbsSwiper.destroyed) return; 14839 thumbsSwiper.setTransition(duration); 14840 }); 14841 on('beforeDestroy', () => { 14842 const thumbsSwiper = swiper.thumbs.swiper; 14843 if (!thumbsSwiper || thumbsSwiper.destroyed) return; 14844 if (swiperCreated) { 14845 thumbsSwiper.destroy(); 14846 } 14847 });
14848 Object.assign(swiper.thumbs, { 14849 init, 14850 update 14851 }); 14852 } 14853 14854 function freeMode(_ref) { 14855 let { 14856 swiper, 14857 extendParams, 14858 emit, 14859 once 14860 } = _ref; 14861 extendParams({ 14862 freeMode: { 14863 enabled: false, 14864 momentum: true, 14865 momentumRatio: 1, 14866 momentumBounce: true, 14867 momentumBounceRatio: 1, 14868 momentumVelocityRatio: 1, 14869 sticky: false, 14870 minimumVelocity: 0.02 14871 } 14872 }); 14873 function onTouchStart() { 14874 if (swiper.params.cssMode) return; 14875 const translate = swiper.getTranslate(); 14876 swiper.setTranslate(translate); 14877 swiper.setTransition(0); 14878 swiper.touchEventsData.velocities.length = 0; 14879 swiper.freeMode.onTouchEnd({ 14880 currentPos: swiper.rtl ? swiper.translate : -swiper.translate 14881 }); 14882 } 14883 function onTouchMove() { 14884 if (swiper.params.cssMode) return; 14885 const { 14886 touchEventsData: data, 14887 touches 14888 } = swiper; 14889 // Velocity 14890 if (data.velocities.length === 0) { 14891 data.velocities.push({ 14892 position: touches[swiper.isHorizontal() ? 'startX' : 'startY'], 14893 time: data.touchStartTime 14894 }); 14895 } 14896 data.velocities.push({ 14897 position: touches[swiper.isHorizontal() ? 'currentX' : 'currentY'], 14898 time: now() 14899 }); 14900 } 14901 function onTouchEnd(_ref2) { 14902 let { 14903 currentPos 14904 } = _ref2; 14905 if (swiper.params.cssMode) return; 14906 const { 14907 params, 14908 wrapperEl, 14909 rtlTranslate: rtl, 14910 snapGrid, 14911 touchEventsData: data 14912 } = swiper; 14913 // Time diff 14914 const touchEndTime = now(); 14915 const timeDiff = touchEndTime - data.touchStartTime;
vendor: 19,128 bytes, lines 14916-15466
14916 if (currentPos < -swiper.minTranslate()) { 14917 swiper.slideTo(swiper.activeIndex); 14918 return; 14919 } 14920 if (currentPos > -swiper.maxTranslate()) { 14921 if (swiper.slides.length < snapGrid.length) { 14922 swiper.slideTo(snapGrid.length - 1); 14923 } else { 14924 swiper.slideTo(swiper.slides.length - 1); 14925 } 14926 return; 14927 } 14928 if (params.freeMode.momentum) { 14929 if (data.velocities.length > 1) { 14930 const lastMoveEvent = data.velocities.pop(); 14931 const velocityEvent = data.velocities.pop(); 14932 const distance = lastMoveEvent.position - velocityEvent.position; 14933 const time = lastMoveEvent.time - velocityEvent.time; 14934 swiper.velocity = distance / time; 14935 swiper.velocity /= 2; 14936 if (Math.abs(swiper.velocity) < params.freeMode.minimumVelocity) { 14937 swiper.velocity = 0; 14938 } 14939 // this implies that the user stopped moving a finger then released. 14940 // There would be no events with distance zero, so the last event is stale. 14941 if (time > 150 || now() - lastMoveEvent.time > 300) { 14942 swiper.velocity = 0; 14943 } 14944 } else { 14945 swiper.velocity = 0; 14946 } 14947 swiper.velocity *= params.freeMode.momentumVelocityRatio; 14948 data.velocities.length = 0; 14949 let momentumDuration = 1000 * params.freeMode.momentumRatio; 14950 const momentumDistance = swiper.velocity * momentumDuration; 14951 let newPosition = swiper.translate + momentumDistance; 14952 if (rtl) newPosition = -newPosition; 14953 let doBounce = false; 14954 let afterBouncePosition; 14955 const bounceAmount = Math.abs(swiper.velocity) * 20 * params.freeMode.momentumBounceRatio; 14956 let needsLoopFix; 14957 if (newPosition < swiper.maxTranslate()) { 14958 if (params.freeMode.momentumBounce) { 14959 if (newPosition + swiper.maxTranslate() < -bounceAmount) { 14960 newPosition = swiper.maxTranslate() - bounceAmount; 14961 } 14962 afterBouncePosition = swiper.maxTranslate(); 14963 doBounce = true; 14964 data.allowMomentumBounce = true; 14965 } else { 14966 newPosition = swiper.maxTranslate(); 14967 } 14968 if (params.loop && params.centeredSlides) needsLoopFix = true; 14969 } else if (newPosition > swiper.minTranslate()) { 14970 if (params.freeMode.momentumBounce) { 14971 if (newPosition - swiper.minTranslate() > bounceAmount) { 14972 newPosition = swiper.minTranslate() + bounceAmount; 14973 } 14974 afterBouncePosition = swiper.minTranslate(); 14975 doBounce = true; 14976 data.allowMomentumBounce = true; 14977 } else { 14978 newPosition = swiper.minTranslate(); 14979 } 14980 if (params.loop && params.centeredSlides) needsLoopFix = true; 14981 } else if (params.freeMode.sticky) { 14982 let nextSlide; 14983 for (let j = 0; j < snapGrid.length; j += 1) { 14984 if (snapGrid[j] > -newPosition) { 14985 nextSlide = j; 14986 break; 14987 } 14988 } 14989 if (Math.abs(snapGrid[nextSlide] - newPosition) < Math.abs(snapGrid[nextSlide - 1] - newPosition) || swiper.swipeDirection === 'next') { 14990 newPosition = snapGrid[nextSlide]; 14991 } else { 14992 newPosition = snapGrid[nextSlide - 1]; 14993 } 14994 newPosition = -newPosition; 14995 } 14996 if (needsLoopFix) { 14997 once('transitionEnd', () => { 14998 swiper.loopFix(); 14999 }); 15000 } 15001 // Fix duration 15002 if (swiper.velocity !== 0) { 15003 if (rtl) { 15004 momentumDuration = Math.abs((-newPosition - swiper.translate) / swiper.velocity); 15005 } else { 15006 momentumDuration = Math.abs((newPosition - swiper.translate) / swiper.velocity); 15007 } 15008 if (params.freeMode.sticky) { 15009 // If freeMode.sticky is active and the user ends a swipe with a slow-velocity 15010 // event, then durations can be 20+ seconds to slide one (or zero!) slides. 15011 // It's easy to see this when simulating touch with mouse events. To fix this, 15012 // limit single-slide swipes to the default slide duration. This also has the 15013 // nice side effect of matching slide speed if the user stopped moving before 15014 // lifting finger or mouse vs. moving slowly before lifting the finger/mouse. 15015 // For faster swipes, also apply limits (albeit higher ones). 15016 const moveDistance = Math.abs((rtl ? -newPosition : newPosition) - swiper.translate); 15017 const currentSlideSize = swiper.slidesSizesGrid[swiper.activeIndex]; 15018 if (moveDistance < currentSlideSize) { 15019 momentumDuration = params.speed; 15020 } else if (moveDistance < 2 * currentSlideSize) { 15021 momentumDuration = params.speed * 1.5; 15022 } else { 15023 momentumDuration = params.speed * 2.5; 15024 } 15025 } 15026 } else if (params.freeMode.sticky) { 15027 swiper.slideToClosest(); 15028 return; 15029 } 15030 if (params.freeMode.momentumBounce && doBounce) { 15031 swiper.updateProgress(afterBouncePosition); 15032 swiper.setTransition(momentumDuration); 15033 swiper.setTranslate(newPosition); 15034 swiper.transitionStart(true, swiper.swipeDirection); 15035 swiper.animating = true; 15036 elementTransitionEnd(wrapperEl, () => { 15037 if (!swiper || swiper.destroyed || !data.allowMomentumBounce) return; 15038 emit('momentumBounce'); 15039 swiper.setTransition(params.speed); 15040 setTimeout(() => { 15041 swiper.setTranslate(afterBouncePosition); 15042 elementTransitionEnd(wrapperEl, () => { 15043 if (!swiper || swiper.destroyed) return; 15044 swiper.transitionEnd(); 15045 }); 15046 }, 0); 15047 }); 15048 } else if (swiper.velocity) { 15049 emit('_freeModeNoMomentumRelease'); 15050 swiper.updateProgress(newPosition); 15051 swiper.setTransition(momentumDuration); 15052 swiper.setTranslate(newPosition); 15053 swiper.transitionStart(true, swiper.swipeDirection); 15054 if (!swiper.animating) { 15055 swiper.animating = true; 15056 elementTransitionEnd(wrapperEl, () => { 15057 if (!swiper || swiper.destroyed) return; 15058 swiper.transitionEnd(); 15059 }); 15060 } 15061 } else { 15062 swiper.updateProgress(newPosition); 15063 } 15064 swiper.updateActiveIndex(); 15065 swiper.updateSlidesClasses(); 15066 } else if (params.freeMode.sticky) { 15067 swiper.slideToClosest(); 15068 return; 15069 } else if (params.freeMode) { 15070 emit('_freeModeNoMomentumRelease'); 15071 } 15072 if (!params.freeMode.momentum || timeDiff >= params.longSwipesMs) { 15073 emit('_freeModeStaticRelease'); 15074 swiper.updateProgress(); 15075 swiper.updateActiveIndex(); 15076 swiper.updateSlidesClasses(); 15077 } 15078 } 15079 Object.assign(swiper, { 15080 freeMode: { 15081 onTouchStart, 15082 onTouchMove, 15083 onTouchEnd 15084 } 15085 }); 15086 } 15087 15088 function Grid(_ref) { 15089 let { 15090 swiper, 15091 extendParams, 15092 on 15093 } = _ref; 15094 extendParams({ 15095 grid: { 15096 rows: 1, 15097 fill: 'column' 15098 } 15099 }); 15100 let slidesNumberEvenToRows; 15101 let slidesPerRow; 15102 let numFullColumns; 15103 let wasMultiRow; 15104 const getSpaceBetween = () => { 15105 let spaceBetween = swiper.params.spaceBetween; 15106 if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) { 15107 spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * swiper.size; 15108 } else if (typeof spaceBetween === 'string') { 15109 spaceBetween = parseFloat(spaceBetween); 15110 } 15111 return spaceBetween; 15112 }; 15113 const initSlides = slides => { 15114 const { 15115 slidesPerView 15116 } = swiper.params; 15117 const { 15118 rows, 15119 fill 15120 } = swiper.params.grid; 15121 const slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : slides.length; 15122 numFullColumns = Math.floor(slidesLength / rows); 15123 if (Math.floor(slidesLength / rows) === slidesLength / rows) { 15124 slidesNumberEvenToRows = slidesLength; 15125 } else { 15126 slidesNumberEvenToRows = Math.ceil(slidesLength / rows) * rows; 15127 } 15128 if (slidesPerView !== 'auto' && fill === 'row') { 15129 slidesNumberEvenToRows = Math.max(slidesNumberEvenToRows, slidesPerView * rows); 15130 } 15131 slidesPerRow = slidesNumberEvenToRows / rows; 15132 }; 15133 const unsetSlides = () => { 15134 if (swiper.slides) { 15135 swiper.slides.forEach(slide => { 15136 if (slide.swiperSlideGridSet) { 15137 slide.style.height = ''; 15138 slide.style[swiper.getDirectionLabel('margin-top')] = ''; 15139 } 15140 }); 15141 } 15142 }; 15143 const updateSlide = (i, slide, slides) => { 15144 const { 15145 slidesPerGroup 15146 } = swiper.params; 15147 const spaceBetween = getSpaceBetween(); 15148 const { 15149 rows, 15150 fill 15151 } = swiper.params.grid; 15152 const slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : slides.length; 15153 // Set slides order 15154 let newSlideOrderIndex; 15155 let column; 15156 let row; 15157 if (fill === 'row' && slidesPerGroup > 1) { 15158 const groupIndex = Math.floor(i / (slidesPerGroup * rows)); 15159 const slideIndexInGroup = i - rows * slidesPerGroup * groupIndex; 15160 const columnsInGroup = groupIndex === 0 ? slidesPerGroup : Math.min(Math.ceil((slidesLength - groupIndex * rows * slidesPerGroup) / rows), slidesPerGroup); 15161 row = Math.floor(slideIndexInGroup / columnsInGroup); 15162 column = slideIndexInGroup - row * columnsInGroup + groupIndex * slidesPerGroup; 15163 newSlideOrderIndex = column + row * slidesNumberEvenToRows / rows; 15164 slide.style.order = newSlideOrderIndex; 15165 } else if (fill === 'column') { 15166 column = Math.floor(i / rows); 15167 row = i - column * rows; 15168 if (column > numFullColumns || column === numFullColumns && row === rows - 1) { 15169 row += 1; 15170 if (row >= rows) { 15171 row = 0; 15172 column += 1; 15173 } 15174 } 15175 } else { 15176 row = Math.floor(i / slidesPerRow); 15177 column = i - row * slidesPerRow; 15178 } 15179 slide.row = row; 15180 slide.column = column; 15181 slide.style.height = `calc((100% - ${(rows - 1) * spaceBetween}px) / ${rows})`; 15182 slide.style[swiper.getDirectionLabel('margin-top')] = row !== 0 ? spaceBetween && `${spaceBetween}px` : ''; 15183 slide.swiperSlideGridSet = true; 15184 }; 15185 const updateWrapperSize = (slideSize, snapGrid) => { 15186 const { 15187 centeredSlides, 15188 roundLengths 15189 } = swiper.params; 15190 const spaceBetween = getSpaceBetween(); 15191 const { 15192 rows 15193 } = swiper.params.grid; 15194 swiper.virtualSize = (slideSize + spaceBetween) * slidesNumberEvenToRows; 15195 swiper.virtualSize = Math.ceil(swiper.virtualSize / rows) - spaceBetween; 15196 if (!swiper.params.cssMode) { 15197 swiper.wrapperEl.style[swiper.getDirectionLabel('width')] = `${swiper.virtualSize + spaceBetween}px`; 15198 } 15199 if (centeredSlides) { 15200 const newSlidesGrid = []; 15201 for (let i = 0; i < snapGrid.length; i += 1) { 15202 let slidesGridItem = snapGrid[i]; 15203 if (roundLengths) slidesGridItem = Math.floor(slidesGridItem); 15204 if (snapGrid[i] < swiper.virtualSize + snapGrid[0]) newSlidesGrid.push(slidesGridItem); 15205 } 15206 snapGrid.splice(0, snapGrid.length); 15207 snapGrid.push(...newSlidesGrid); 15208 } 15209 }; 15210 const onInit = () => { 15211 wasMultiRow = swiper.params.grid && swiper.params.grid.rows > 1; 15212 }; 15213 const onUpdate = () => { 15214 const { 15215 params, 15216 el 15217 } = swiper; 15218 const isMultiRow = params.grid && params.grid.rows > 1; 15219 if (wasMultiRow && !isMultiRow) { 15220 el.classList.remove(`${params.containerModifierClass}grid`, `${params.containerModifierClass}grid-column`); 15221 numFullColumns = 1; 15222 swiper.emitContainerClasses(); 15223 } else if (!wasMultiRow && isMultiRow) { 15224 el.classList.add(`${params.containerModifierClass}grid`); 15225 if (params.grid.fill === 'column') { 15226 el.classList.add(`${params.containerModifierClass}grid-column`); 15227 } 15228 swiper.emitContainerClasses(); 15229 } 15230 wasMultiRow = isMultiRow; 15231 }; 15232 on('init', onInit); 15233 on('update', onUpdate); 15234 swiper.grid = { 15235 initSlides, 15236 unsetSlides, 15237 updateSlide, 15238 updateWrapperSize 15239 }; 15240 } 15241 15242 function appendSlide(slides) { 15243 const swiper = this; 15244 const { 15245 params, 15246 slidesEl 15247 } = swiper; 15248 if (params.loop) { 15249 swiper.loopDestroy(); 15250 } 15251 const appendElement = slideEl => { 15252 if (typeof slideEl === 'string') { 15253 const tempDOM = document.createElement('div'); 15254 tempDOM.innerHTML = slideEl; 15255 slidesEl.append(tempDOM.children[0]); 15256 tempDOM.innerHTML = ''; 15257 } else { 15258 slidesEl.append(slideEl); 15259 } 15260 }; 15261 if (typeof slides === 'object' && 'length' in slides) { 15262 for (let i = 0; i < slides.length; i += 1) { 15263 if (slides[i]) appendElement(slides[i]); 15264 } 15265 } else { 15266 appendElement(slides); 15267 } 15268 swiper.recalcSlides(); 15269 if (params.loop) { 15270 swiper.loopCreate(); 15271 } 15272 if (!params.observer || swiper.isElement) { 15273 swiper.update(); 15274 } 15275 } 15276 15277 function prependSlide(slides) { 15278 const swiper = this; 15279 const { 15280 params, 15281 activeIndex, 15282 slidesEl 15283 } = swiper; 15284 if (params.loop) { 15285 swiper.loopDestroy(); 15286 } 15287 let newActiveIndex = activeIndex + 1; 15288 const prependElement = slideEl => { 15289 if (typeof slideEl === 'string') { 15290 const tempDOM = document.createElement('div'); 15291 tempDOM.innerHTML = slideEl; 15292 slidesEl.prepend(tempDOM.children[0]); 15293 tempDOM.innerHTML = ''; 15294 } else { 15295 slidesEl.prepend(slideEl); 15296 } 15297 }; 15298 if (typeof slides === 'object' && 'length' in slides) { 15299 for (let i = 0; i < slides.length; i += 1) { 15300 if (slides[i]) prependElement(slides[i]); 15301 } 15302 newActiveIndex = activeIndex + slides.length; 15303 } else { 15304 prependElement(slides); 15305 } 15306 swiper.recalcSlides(); 15307 if (params.loop) { 15308 swiper.loopCreate(); 15309 } 15310 if (!params.observer || swiper.isElement) { 15311 swiper.update(); 15312 } 15313 swiper.slideTo(newActiveIndex, 0, false); 15314 } 15315 15316 function addSlide(index, slides) { 15317 const swiper = this; 15318 const { 15319 params, 15320 activeIndex, 15321 slidesEl 15322 } = swiper; 15323 let activeIndexBuffer = activeIndex; 15324 if (params.loop) { 15325 activeIndexBuffer -= swiper.loopedSlides; 15326 swiper.loopDestroy(); 15327 swiper.recalcSlides(); 15328 } 15329 const baseLength = swiper.slides.length; 15330 if (index <= 0) { 15331 swiper.prependSlide(slides); 15332 return; 15333 } 15334 if (index >= baseLength) { 15335 swiper.appendSlide(slides); 15336 return; 15337 } 15338 let newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + 1 : activeIndexBuffer; 15339 const slidesBuffer = []; 15340 for (let i = baseLength - 1; i >= index; i -= 1) { 15341 const currentSlide = swiper.slides[i]; 15342 currentSlide.remove(); 15343 slidesBuffer.unshift(currentSlide); 15344 } 15345 if (typeof slides === 'object' && 'length' in slides) { 15346 for (let i = 0; i < slides.length; i += 1) { 15347 if (slides[i]) slidesEl.append(slides[i]); 15348 } 15349 newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + slides.length : activeIndexBuffer; 15350 } else { 15351 slidesEl.append(slides); 15352 } 15353 for (let i = 0; i < slidesBuffer.length; i += 1) { 15354 slidesEl.append(slidesBuffer[i]); 15355 } 15356 swiper.recalcSlides(); 15357 if (params.loop) { 15358 swiper.loopCreate(); 15359 } 15360 if (!params.observer || swiper.isElement) { 15361 swiper.update(); 15362 } 15363 if (params.loop) { 15364 swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false); 15365 } else { 15366 swiper.slideTo(newActiveIndex, 0, false); 15367 } 15368 } 15369 15370 function removeSlide(slidesIndexes) { 15371 const swiper = this; 15372 const { 15373 params, 15374 activeIndex 15375 } = swiper; 15376 let activeIndexBuffer = activeIndex; 15377 if (params.loop) { 15378 activeIndexBuffer -= swiper.loopedSlides; 15379 swiper.loopDestroy(); 15380 } 15381 let newActiveIndex = activeIndexBuffer; 15382 let indexToRemove; 15383 if (typeof slidesIndexes === 'object' && 'length' in slidesIndexes) { 15384 for (let i = 0; i < slidesIndexes.length; i += 1) { 15385 indexToRemove = slidesIndexes[i]; 15386 if (swiper.slides[indexToRemove]) swiper.slides[indexToRemove].remove(); 15387 if (indexToRemove < newActiveIndex) newActiveIndex -= 1; 15388 } 15389 newActiveIndex = Math.max(newActiveIndex, 0); 15390 } else { 15391 indexToRemove = slidesIndexes; 15392 if (swiper.slides[indexToRemove]) swiper.slides[indexToRemove].remove(); 15393 if (indexToRemove < newActiveIndex) newActiveIndex -= 1; 15394 newActiveIndex = Math.max(newActiveIndex, 0); 15395 } 15396 swiper.recalcSlides(); 15397 if (params.loop) { 15398 swiper.loopCreate(); 15399 } 15400 if (!params.observer || swiper.isElement) { 15401 swiper.update(); 15402 } 15403 if (params.loop) { 15404 swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false); 15405 } else { 15406 swiper.slideTo(newActiveIndex, 0, false); 15407 } 15408 } 15409 15410 function removeAllSlides() { 15411 const swiper = this; 15412 const slidesIndexes = []; 15413 for (let i = 0; i < swiper.slides.length; i += 1) { 15414 slidesIndexes.push(i); 15415 } 15416 swiper.removeSlide(slidesIndexes); 15417 } 15418 15419 function Manipulation(_ref) { 15420 let { 15421 swiper 15422 } = _ref; 15423 Object.assign(swiper, { 15424 appendSlide: appendSlide.bind(swiper), 15425 prependSlide: prependSlide.bind(swiper), 15426 addSlide: addSlide.bind(swiper), 15427 removeSlide: removeSlide.bind(swiper), 15428 removeAllSlides: removeAllSlides.bind(swiper) 15429 }); 15430 } 15431 15432 function effectInit(params) { 15433 const { 15434 effect, 15435 swiper, 15436 on, 15437 setTranslate, 15438 setTransition, 15439 overwriteParams, 15440 perspective, 15441 recreateShadows, 15442 getEffectParams 15443 } = params; 15444 on('beforeInit', () => { 15445 if (swiper.params.effect !== effect) return; 15446 swiper.classNames.push(`${swiper.params.containerModifierClass}${effect}`); 15447 if (perspective && perspective()) { 15448 swiper.classNames.push(`${swiper.params.containerModifierClass}3d`); 15449 } 15450 const overwriteParamsResult = overwriteParams ? overwriteParams() : {}; 15451 Object.assign(swiper.params, overwriteParamsResult); 15452 Object.assign(swiper.originalParams, overwriteParamsResult); 15453 }); 15454 on('setTranslate', () => { 15455 if (swiper.params.effect !== effect) return; 15456 setTranslate(); 15457 }); 15458 on('setTransition', (_s, duration) => { 15459 if (swiper.params.effect !== effect) return; 15460 setTransition(duration); 15461 }); 15462 on('transitionEnd', () => { 15463 if (swiper.params.effect !== effect) return; 15464 if (recreateShadows) { 15465 if (!getEffectParams || !getEffectParams().slideShadows) return; 15466 // remove shadows
15467 swiper.slides.forEach(slideEl => { 15468 slideEl.querySelectorAll('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').forEach(shadowEl => shadowEl.remove()); 15469 }); 15470 // create new one 15471 recreateShadows(); 15472 } 15473 }); 15474 let requireUpdateOnVirtual; 15475 on('virtualUpdate', () => { 15476 if (swiper.params.effect !== effect) return; 15477 if (!swiper.slides.length) { 15478 requireUpdateOnVirtual = true; 15479 } 15480 requestAnimationFrame(() => { 15481 if (requireUpdateOnVirtual && swiper.slides && swiper.slides.length) { 15482 setTranslate(); 15483 requireUpdateOnVirtual = false; 15484 } 15485 }); 15486 }); 15487 } 15488 15489 function effectTarget(effectParams, slideEl) { 15490 const transformEl = getSlideTransformEl(slideEl); 15491 if (transformEl !== slideEl) { 15492 transformEl.style.backfaceVisibility = 'hidden'; 15493 transformEl.style['-webkit-backface-visibility'] = 'hidden'; 15494 } 15495 return transformEl; 15496 } 15497 15498 function effectVirtualTransitionEnd(_ref) { 15499 let { 15500 swiper, 15501 duration, 15502 transformElements, 15503 allSlides 15504 } = _ref; 15505 const { 15506 activeIndex 15507 } = swiper; 15508 const getSlide = el => { 15509 if (!el.parentElement) { 15510 // assume shadow root 15511 const slide = swiper.slides.filter(slideEl => slideEl.shadowRoot && slideEl.shadowRoot === el.parentNode)[0]; 15512 return slide; 15513 } 15514 return el.parentElement; 15515 }; 15516 if (swiper.params.virtualTranslate && duration !== 0) { 15517 let eventTriggered = false; 15518 let transitionEndTarget; 15519 if (allSlides) { 15520 transitionEndTarget = transformElements; 15521 } else { 15522 transitionEndTarget = transformElements.filter(transformEl => { 15523 const el = transformEl.classList.contains('swiper-slide-transform') ? getSlide(transformEl) : transformEl; 15524 return swiper.getSlideIndex(el) === activeIndex; 15525 }); 15526 } 15527 transitionEndTarget.forEach(el => { 15528 elementTransitionEnd(el, () => { 15529 if (eventTriggered) return; 15530 if (!swiper || swiper.destroyed) return; 15531 eventTriggered = true; 15532 swiper.animating = false; 15533 const evt = new window.CustomEvent('transitionend', { 15534 bubbles: true, 15535 cancelable: true 15536 }); 15537 swiper.wrapperEl.dispatchEvent(evt); 15538 }); 15539 }); 15540 } 15541 } 15542 15543 function EffectFade(_ref) { 15544 let { 15545 swiper, 15546 extendParams, 15547 on 15548 } = _ref; 15549 extendParams({ 15550 fadeEffect: { 15551 crossFade: false 15552 } 15553 }); 15554 const setTranslate = () => { 15555 const { 15556 slides 15557 } = swiper; 15558 const params = swiper.params.fadeEffect; 15559 for (let i = 0; i < slides.length; i += 1) { 15560 const slideEl = swiper.slides[i]; 15561 const offset = slideEl.swiperSlideOffset; 15562 let tx = -offset; 15563 if (!swiper.params.virtualTranslate) tx -= swiper.translate; 15564 let ty = 0; 15565 if (!swiper.isHorizontal()) { 15566 ty = tx; 15567 tx = 0; 15568 } 15569 const slideOpacity = swiper.params.fadeEffect.crossFade ? Math.max(1 - Math.abs(slideEl.progress), 0) : 1 + Math.min(Math.max(slideEl.progress, -1), 0); 15570 const targetEl = effectTarget(params, slideEl); 15571 targetEl.style.opacity = slideOpacity; 15572 targetEl.style.transform = `translate3d(${tx}px, ${ty}px, 0px)`; 15573 } 15574 }; 15575 const setTransition = duration => { 15576 const transformElements = swiper.slides.map(slideEl => getSlideTransformEl(slideEl)); 15577 transformElements.forEach(el => { 15578 el.style.transitionDuration = `${duration}ms`; 15579 }); 15580 effectVirtualTransitionEnd({ 15581 swiper, 15582 duration, 15583 transformElements, 15584 allSlides: true 15585 }); 15586 }; 15587 effectInit({ 15588 effect: 'fade', 15589 swiper, 15590 on, 15591 setTranslate, 15592 setTransition, 15593 overwriteParams: () => ({ 15594 slidesPerView: 1, 15595 slidesPerGroup: 1, 15596 watchSlidesProgress: true, 15597 spaceBetween: 0, 15598 virtualTranslate: !swiper.params.cssMode 15599 }) 15600 }); 15601 } 15602 15603 function EffectCube(_ref) { 15604 let { 15605 swiper, 15606 extendParams, 15607 on 15608 } = _ref; 15609 extendParams({ 15610 cubeEffect: { 15611 slideShadows: true, 15612 shadow: true, 15613 shadowOffset: 20, 15614 shadowScale: 0.94 15615 } 15616 }); 15617 const createSlideShadows = (slideEl, progress, isHorizontal) => { 15618 let shadowBefore = isHorizontal ? slideEl.querySelector('.swiper-slide-shadow-left') : slideEl.querySelector('.swiper-slide-shadow-top'); 15619 let shadowAfter = isHorizontal ? slideEl.querySelector('.swiper-slide-shadow-right') : slideEl.querySelector('.swiper-slide-shadow-bottom'); 15620 if (!shadowBefore) { 15621 shadowBefore = createElement('div', `swiper-slide-shadow-cube swiper-slide-shadow-${isHorizontal ? 'left' : 'top'}`.split(' ')); 15622 slideEl.append(shadowBefore); 15623 } 15624 if (!shadowAfter) { 15625 shadowAfter = createElement('div', `swiper-slide-shadow-cube swiper-slide-shadow-${isHorizontal ? 'right' : 'bottom'}`.split(' ')); 15626 slideEl.append(shadowAfter); 15627 } 15628 if (shadowBefore) shadowBefore.style.opacity = Math.max(-progress, 0); 15629 if (shadowAfter) shadowAfter.style.opacity = Math.max(progress, 0); 15630 }; 15631 const recreateShadows = () => { 15632 // create new ones 15633 const isHorizontal = swiper.isHorizontal();
vendor: 4,465 bytes, lines 15634-15740
15634 swiper.slides.forEach(slideEl => { 15635 const progress = Math.max(Math.min(slideEl.progress, 1), -1); 15636 createSlideShadows(slideEl, progress, isHorizontal); 15637 }); 15638 }; 15639 const setTranslate = () => { 15640 const { 15641 el, 15642 wrapperEl, 15643 slides, 15644 width: swiperWidth, 15645 height: swiperHeight, 15646 rtlTranslate: rtl, 15647 size: swiperSize, 15648 browser 15649 } = swiper; 15650 const r = getRotateFix(swiper); 15651 const params = swiper.params.cubeEffect; 15652 const isHorizontal = swiper.isHorizontal(); 15653 const isVirtual = swiper.virtual && swiper.params.virtual.enabled; 15654 let wrapperRotate = 0; 15655 let cubeShadowEl; 15656 if (params.shadow) { 15657 if (isHorizontal) { 15658 cubeShadowEl = swiper.wrapperEl.querySelector('.swiper-cube-shadow'); 15659 if (!cubeShadowEl) { 15660 cubeShadowEl = createElement('div', 'swiper-cube-shadow'); 15661 swiper.wrapperEl.append(cubeShadowEl); 15662 } 15663 cubeShadowEl.style.height = `${swiperWidth}px`; 15664 } else { 15665 cubeShadowEl = el.querySelector('.swiper-cube-shadow'); 15666 if (!cubeShadowEl) { 15667 cubeShadowEl = createElement('div', 'swiper-cube-shadow'); 15668 el.append(cubeShadowEl); 15669 } 15670 } 15671 } 15672 for (let i = 0; i < slides.length; i += 1) { 15673 const slideEl = slides[i]; 15674 let slideIndex = i; 15675 if (isVirtual) { 15676 slideIndex = parseInt(slideEl.getAttribute('data-swiper-slide-index'), 10); 15677 } 15678 let slideAngle = slideIndex * 90; 15679 let round = Math.floor(slideAngle / 360); 15680 if (rtl) { 15681 slideAngle = -slideAngle; 15682 round = Math.floor(-slideAngle / 360); 15683 } 15684 const progress = Math.max(Math.min(slideEl.progress, 1), -1); 15685 let tx = 0; 15686 let ty = 0; 15687 let tz = 0; 15688 if (slideIndex % 4 === 0) { 15689 tx = -round * 4 * swiperSize; 15690 tz = 0; 15691 } else if ((slideIndex - 1) % 4 === 0) { 15692 tx = 0; 15693 tz = -round * 4 * swiperSize; 15694 } else if ((slideIndex - 2) % 4 === 0) { 15695 tx = swiperSize + round * 4 * swiperSize; 15696 tz = swiperSize; 15697 } else if ((slideIndex - 3) % 4 === 0) { 15698 tx = -swiperSize; 15699 tz = 3 * swiperSize + swiperSize * 4 * round; 15700 } 15701 if (rtl) { 15702 tx = -tx; 15703 } 15704 if (!isHorizontal) { 15705 ty = tx; 15706 tx = 0; 15707 } 15708 const transform = `rotateX(${r(isHorizontal ? 0 : -slideAngle)}deg) rotateY(${r(isHorizontal ? slideAngle : 0)}deg) translate3d(${tx}px, ${ty}px, ${tz}px)`; 15709 if (progress <= 1 && progress > -1) { 15710 wrapperRotate = slideIndex * 90 + progress * 90; 15711 if (rtl) wrapperRotate = -slideIndex * 90 - progress * 90; 15712 } 15713 slideEl.style.transform = transform; 15714 if (params.slideShadows) { 15715 createSlideShadows(slideEl, progress, isHorizontal); 15716 } 15717 } 15718 wrapperEl.style.transformOrigin = `50% 50% -${swiperSize / 2}px`; 15719 wrapperEl.style['-webkit-transform-origin'] = `50% 50% -${swiperSize / 2}px`; 15720 if (params.shadow) { 15721 if (isHorizontal) { 15722 cubeShadowEl.style.transform = `translate3d(0px, ${swiperWidth / 2 + params.shadowOffset}px, ${-swiperWidth / 2}px) rotateX(89.99deg) rotateZ(0deg) scale(${params.shadowScale})`; 15723 } else { 15724 const shadowAngle = Math.abs(wrapperRotate) - Math.floor(Math.abs(wrapperRotate) / 90) * 90; 15725 const multiplier = 1.5 - (Math.sin(shadowAngle * 2 * Math.PI / 360) / 2 + Math.cos(shadowAngle * 2 * Math.PI / 360) / 2); 15726 const scale1 = params.shadowScale; 15727 const scale2 = params.shadowScale / multiplier; 15728 const offset = params.shadowOffset; 15729 cubeShadowEl.style.transform = `scale3d(${scale1}, 1, ${scale2}) translate3d(0px, ${swiperHeight / 2 + offset}px, ${-swiperHeight / 2 / scale2}px) rotateX(-89.99deg)`; 15730 } 15731 } 15732 const zFactor = (browser.isSafari || browser.isWebView) && browser.needPerspectiveFix ? -swiperSize / 2 : 0; 15733 wrapperEl.style.transform = `translate3d(0px,0,${zFactor}px) rotateX(${r(swiper.isHorizontal() ? 0 : wrapperRotate)}deg) rotateY(${r(swiper.isHorizontal() ? -wrapperRotate : 0)}deg)`; 15734 wrapperEl.style.setProperty('--swiper-cube-translate-z', `${zFactor}px`); 15735 }; 15736 const setTransition = duration => { 15737 const { 15738 el, 15739 slides 15740 } = swiper;
15741 slides.forEach(slideEl => { 15742 slideEl.style.transitionDuration = `${duration}ms`; 15743 slideEl.querySelectorAll('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').forEach(subEl => { 15744 subEl.style.transitionDuration = `${duration}ms`; 15745 }); 15746 }); 15747 if (swiper.params.cubeEffect.shadow && !swiper.isHorizontal()) { 15748 const shadowEl = el.querySelector('.swiper-cube-shadow'); 15749 if (shadowEl) shadowEl.style.transitionDuration = `${duration}ms`; 15750 } 15751 }; 15752 effectInit({ 15753 effect: 'cube', 15754 swiper, 15755 on, 15756 setTranslate, 15757 setTransition, 15758 recreateShadows, 15759 getEffectParams: () => swiper.params.cubeEffect, 15760 perspective: () => true, 15761 overwriteParams: () => ({ 15762 slidesPerView: 1, 15763 slidesPerGroup: 1, 15764 watchSlidesProgress: true, 15765 resistanceRatio: 0, 15766 spaceBetween: 0, 15767 centeredSlides: false, 15768 virtualTranslate: true 15769 }) 15770 }); 15771 } 15772 15773 function createShadow(suffix, slideEl, side) { 15774 const shadowClass = `swiper-slide-shadow${side ? `-${side}` : ''}${suffix ? ` swiper-slide-shadow-${suffix}` : ''}`; 15775 const shadowContainer = getSlideTransformEl(slideEl); 15776 let shadowEl = shadowContainer.querySelector(`.${shadowClass.split(' ').join('.')}`); 15777 if (!shadowEl) { 15778 shadowEl = createElement('div', shadowClass.split(' ')); 15779 shadowContainer.append(shadowEl); 15780 } 15781 return shadowEl; 15782 } 15783 15784 function EffectFlip(_ref) { 15785 let { 15786 swiper, 15787 extendParams, 15788 on 15789 } = _ref; 15790 extendParams({ 15791 flipEffect: { 15792 slideShadows: true, 15793 limitRotation: true 15794 } 15795 }); 15796 const createSlideShadows = (slideEl, progress) => { 15797 let shadowBefore = swiper.isHorizontal() ? slideEl.querySelector('.swiper-slide-shadow-left') : slideEl.querySelector('.swiper-slide-shadow-top'); 15798 let shadowAfter = swiper.isHorizontal() ? slideEl.querySelector('.swiper-slide-shadow-right') : slideEl.querySelector('.swiper-slide-shadow-bottom'); 15799 if (!shadowBefore) { 15800 shadowBefore = createShadow('flip', slideEl, swiper.isHorizontal() ? 'left' : 'top'); 15801 } 15802 if (!shadowAfter) { 15803 shadowAfter = createShadow('flip', slideEl, swiper.isHorizontal() ? 'right' : 'bottom'); 15804 } 15805 if (shadowBefore) shadowBefore.style.opacity = Math.max(-progress, 0); 15806 if (shadowAfter) shadowAfter.style.opacity = Math.max(progress, 0); 15807 }; 15808 const recreateShadows = () => { 15809 // Set shadows 15810 swiper.params.flipEffect;
vendor: 15,264 bytes, lines 15811-16209
15811 swiper.slides.forEach(slideEl => { 15812 let progress = slideEl.progress; 15813 if (swiper.params.flipEffect.limitRotation) { 15814 progress = Math.max(Math.min(slideEl.progress, 1), -1); 15815 } 15816 createSlideShadows(slideEl, progress); 15817 }); 15818 }; 15819 const setTranslate = () => { 15820 const { 15821 slides, 15822 rtlTranslate: rtl 15823 } = swiper; 15824 const params = swiper.params.flipEffect; 15825 const rotateFix = getRotateFix(swiper); 15826 for (let i = 0; i < slides.length; i += 1) { 15827 const slideEl = slides[i]; 15828 let progress = slideEl.progress; 15829 if (swiper.params.flipEffect.limitRotation) { 15830 progress = Math.max(Math.min(slideEl.progress, 1), -1); 15831 } 15832 const offset = slideEl.swiperSlideOffset; 15833 const rotate = -180 * progress; 15834 let rotateY = rotate; 15835 let rotateX = 0; 15836 let tx = swiper.params.cssMode ? -offset - swiper.translate : -offset; 15837 let ty = 0; 15838 if (!swiper.isHorizontal()) { 15839 ty = tx; 15840 tx = 0; 15841 rotateX = -rotateY; 15842 rotateY = 0; 15843 } else if (rtl) { 15844 rotateY = -rotateY; 15845 } 15846 slideEl.style.zIndex = -Math.abs(Math.round(progress)) + slides.length; 15847 if (params.slideShadows) { 15848 createSlideShadows(slideEl, progress); 15849 } 15850 const transform = `translate3d(${tx}px, ${ty}px, 0px) rotateX(${rotateFix(rotateX)}deg) rotateY(${rotateFix(rotateY)}deg)`; 15851 const targetEl = effectTarget(params, slideEl); 15852 targetEl.style.transform = transform; 15853 } 15854 }; 15855 const setTransition = duration => { 15856 const transformElements = swiper.slides.map(slideEl => getSlideTransformEl(slideEl)); 15857 transformElements.forEach(el => { 15858 el.style.transitionDuration = `${duration}ms`; 15859 el.querySelectorAll('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').forEach(shadowEl => { 15860 shadowEl.style.transitionDuration = `${duration}ms`; 15861 }); 15862 }); 15863 effectVirtualTransitionEnd({ 15864 swiper, 15865 duration, 15866 transformElements 15867 }); 15868 }; 15869 effectInit({ 15870 effect: 'flip', 15871 swiper, 15872 on, 15873 setTranslate, 15874 setTransition, 15875 recreateShadows, 15876 getEffectParams: () => swiper.params.flipEffect, 15877 perspective: () => true, 15878 overwriteParams: () => ({ 15879 slidesPerView: 1, 15880 slidesPerGroup: 1, 15881 watchSlidesProgress: true, 15882 spaceBetween: 0, 15883 virtualTranslate: !swiper.params.cssMode 15884 }) 15885 }); 15886 } 15887 15888 function EffectCoverflow(_ref) { 15889 let { 15890 swiper, 15891 extendParams, 15892 on 15893 } = _ref; 15894 extendParams({ 15895 coverflowEffect: { 15896 rotate: 50, 15897 stretch: 0, 15898 depth: 100, 15899 scale: 1, 15900 modifier: 1, 15901 slideShadows: true 15902 } 15903 }); 15904 const setTranslate = () => { 15905 const { 15906 width: swiperWidth, 15907 height: swiperHeight, 15908 slides, 15909 slidesSizesGrid 15910 } = swiper; 15911 const params = swiper.params.coverflowEffect; 15912 const isHorizontal = swiper.isHorizontal(); 15913 const transform = swiper.translate; 15914 const center = isHorizontal ? -transform + swiperWidth / 2 : -transform + swiperHeight / 2; 15915 const rotate = isHorizontal ? params.rotate : -params.rotate; 15916 const translate = params.depth; 15917 const r = getRotateFix(swiper); 15918 // Each slide offset from center 15919 for (let i = 0, length = slides.length; i < length; i += 1) { 15920 const slideEl = slides[i]; 15921 const slideSize = slidesSizesGrid[i]; 15922 const slideOffset = slideEl.swiperSlideOffset; 15923 const centerOffset = (center - slideOffset - slideSize / 2) / slideSize; 15924 const offsetMultiplier = typeof params.modifier === 'function' ? params.modifier(centerOffset) : centerOffset * params.modifier; 15925 let rotateY = isHorizontal ? rotate * offsetMultiplier : 0; 15926 let rotateX = isHorizontal ? 0 : rotate * offsetMultiplier; 15927 // var rotateZ = 0 15928 let translateZ = -translate * Math.abs(offsetMultiplier); 15929 let stretch = params.stretch; 15930 // Allow percentage to make a relative stretch for responsive sliders 15931 if (typeof stretch === 'string' && stretch.indexOf('%') !== -1) { 15932 stretch = parseFloat(params.stretch) / 100 * slideSize; 15933 } 15934 let translateY = isHorizontal ? 0 : stretch * offsetMultiplier; 15935 let translateX = isHorizontal ? stretch * offsetMultiplier : 0; 15936 let scale = 1 - (1 - params.scale) * Math.abs(offsetMultiplier); 15937 15938 // Fix for ultra small values 15939 if (Math.abs(translateX) < 0.001) translateX = 0; 15940 if (Math.abs(translateY) < 0.001) translateY = 0; 15941 if (Math.abs(translateZ) < 0.001) translateZ = 0; 15942 if (Math.abs(rotateY) < 0.001) rotateY = 0; 15943 if (Math.abs(rotateX) < 0.001) rotateX = 0; 15944 if (Math.abs(scale) < 0.001) scale = 0; 15945 const slideTransform = `translate3d(${translateX}px,${translateY}px,${translateZ}px) rotateX(${r(rotateX)}deg) rotateY(${r(rotateY)}deg) scale(${scale})`; 15946 const targetEl = effectTarget(params, slideEl); 15947 targetEl.style.transform = slideTransform; 15948 slideEl.style.zIndex = -Math.abs(Math.round(offsetMultiplier)) + 1; 15949 if (params.slideShadows) { 15950 // Set shadows 15951 let shadowBeforeEl = isHorizontal ? slideEl.querySelector('.swiper-slide-shadow-left') : slideEl.querySelector('.swiper-slide-shadow-top'); 15952 let shadowAfterEl = isHorizontal ? slideEl.querySelector('.swiper-slide-shadow-right') : slideEl.querySelector('.swiper-slide-shadow-bottom'); 15953 if (!shadowBeforeEl) { 15954 shadowBeforeEl = createShadow('coverflow', slideEl, isHorizontal ? 'left' : 'top'); 15955 } 15956 if (!shadowAfterEl) { 15957 shadowAfterEl = createShadow('coverflow', slideEl, isHorizontal ? 'right' : 'bottom'); 15958 } 15959 if (shadowBeforeEl) shadowBeforeEl.style.opacity = offsetMultiplier > 0 ? offsetMultiplier : 0; 15960 if (shadowAfterEl) shadowAfterEl.style.opacity = -offsetMultiplier > 0 ? -offsetMultiplier : 0; 15961 } 15962 } 15963 }; 15964 const setTransition = duration => { 15965 const transformElements = swiper.slides.map(slideEl => getSlideTransformEl(slideEl)); 15966 transformElements.forEach(el => { 15967 el.style.transitionDuration = `${duration}ms`; 15968 el.querySelectorAll('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').forEach(shadowEl => { 15969 shadowEl.style.transitionDuration = `${duration}ms`; 15970 }); 15971 }); 15972 }; 15973 effectInit({ 15974 effect: 'coverflow', 15975 swiper, 15976 on, 15977 setTranslate, 15978 setTransition, 15979 perspective: () => true, 15980 overwriteParams: () => ({ 15981 watchSlidesProgress: true 15982 }) 15983 }); 15984 } 15985 15986 function EffectCreative(_ref) { 15987 let { 15988 swiper, 15989 extendParams, 15990 on 15991 } = _ref; 15992 extendParams({ 15993 creativeEffect: { 15994 limitProgress: 1, 15995 shadowPerProgress: false, 15996 progressMultiplier: 1, 15997 perspective: true, 15998 prev: { 15999 translate: [0, 0, 0], 16000 rotate: [0, 0, 0], 16001 opacity: 1, 16002 scale: 1 16003 }, 16004 next: { 16005 translate: [0, 0, 0], 16006 rotate: [0, 0, 0], 16007 opacity: 1, 16008 scale: 1 16009 } 16010 } 16011 }); 16012 const getTranslateValue = value => { 16013 if (typeof value === 'string') return value; 16014 return `${value}px`; 16015 }; 16016 const setTranslate = () => { 16017 const { 16018 slides, 16019 wrapperEl, 16020 slidesSizesGrid 16021 } = swiper; 16022 const params = swiper.params.creativeEffect; 16023 const { 16024 progressMultiplier: multiplier 16025 } = params; 16026 const isCenteredSlides = swiper.params.centeredSlides; 16027 const rotateFix = getRotateFix(swiper); 16028 if (isCenteredSlides) { 16029 const margin = slidesSizesGrid[0] / 2 - swiper.params.slidesOffsetBefore || 0; 16030 wrapperEl.style.transform = `translateX(calc(50% - ${margin}px))`; 16031 } 16032 for (let i = 0; i < slides.length; i += 1) { 16033 const slideEl = slides[i]; 16034 const slideProgress = slideEl.progress; 16035 const progress = Math.min(Math.max(slideEl.progress, -params.limitProgress), params.limitProgress); 16036 let originalProgress = progress; 16037 if (!isCenteredSlides) { 16038 originalProgress = Math.min(Math.max(slideEl.originalProgress, -params.limitProgress), params.limitProgress); 16039 } 16040 const offset = slideEl.swiperSlideOffset; 16041 const t = [swiper.params.cssMode ? -offset - swiper.translate : -offset, 0, 0]; 16042 const r = [0, 0, 0]; 16043 let custom = false; 16044 if (!swiper.isHorizontal()) { 16045 t[1] = t[0]; 16046 t[0] = 0; 16047 } 16048 let data = { 16049 translate: [0, 0, 0], 16050 rotate: [0, 0, 0], 16051 scale: 1, 16052 opacity: 1 16053 }; 16054 if (progress < 0) { 16055 data = params.next; 16056 custom = true; 16057 } else if (progress > 0) { 16058 data = params.prev; 16059 custom = true; 16060 } 16061 // set translate 16062 t.forEach((value, index) => { 16063 t[index] = `calc(${value}px + (${getTranslateValue(data.translate[index])} * ${Math.abs(progress * multiplier)}))`; 16064 }); 16065 // set rotates 16066 r.forEach((value, index) => { 16067 let val = data.rotate[index] * Math.abs(progress * multiplier); 16068 r[index] = val; 16069 }); 16070 slideEl.style.zIndex = -Math.abs(Math.round(slideProgress)) + slides.length; 16071 const translateString = t.join(', '); 16072 const rotateString = `rotateX(${rotateFix(r[0])}deg) rotateY(${rotateFix(r[1])}deg) rotateZ(${rotateFix(r[2])}deg)`; 16073 const scaleString = originalProgress < 0 ? `scale(${1 + (1 - data.scale) * originalProgress * multiplier})` : `scale(${1 - (1 - data.scale) * originalProgress * multiplier})`; 16074 const opacityString = originalProgress < 0 ? 1 + (1 - data.opacity) * originalProgress * multiplier : 1 - (1 - data.opacity) * originalProgress * multiplier; 16075 const transform = `translate3d(${translateString}) ${rotateString} ${scaleString}`; 16076 16077 // Set shadows 16078 if (custom && data.shadow || !custom) { 16079 let shadowEl = slideEl.querySelector('.swiper-slide-shadow'); 16080 if (!shadowEl && data.shadow) { 16081 shadowEl = createShadow('creative', slideEl); 16082 } 16083 if (shadowEl) { 16084 const shadowOpacity = params.shadowPerProgress ? progress * (1 / params.limitProgress) : progress; 16085 shadowEl.style.opacity = Math.min(Math.max(Math.abs(shadowOpacity), 0), 1); 16086 } 16087 } 16088 const targetEl = effectTarget(params, slideEl); 16089 targetEl.style.transform = transform; 16090 targetEl.style.opacity = opacityString; 16091 if (data.origin) { 16092 targetEl.style.transformOrigin = data.origin; 16093 } 16094 } 16095 }; 16096 const setTransition = duration => { 16097 const transformElements = swiper.slides.map(slideEl => getSlideTransformEl(slideEl)); 16098 transformElements.forEach(el => { 16099 el.style.transitionDuration = `${duration}ms`; 16100 el.querySelectorAll('.swiper-slide-shadow').forEach(shadowEl => { 16101 shadowEl.style.transitionDuration = `${duration}ms`; 16102 }); 16103 }); 16104 effectVirtualTransitionEnd({ 16105 swiper, 16106 duration, 16107 transformElements, 16108 allSlides: true 16109 }); 16110 }; 16111 effectInit({ 16112 effect: 'creative', 16113 swiper, 16114 on, 16115 setTranslate, 16116 setTransition, 16117 perspective: () => swiper.params.creativeEffect.perspective, 16118 overwriteParams: () => ({ 16119 watchSlidesProgress: true, 16120 virtualTranslate: !swiper.params.cssMode 16121 }) 16122 }); 16123 } 16124 16125 function EffectCards(_ref) { 16126 let { 16127 swiper, 16128 extendParams, 16129 on 16130 } = _ref; 16131 extendParams({ 16132 cardsEffect: { 16133 slideShadows: true, 16134 rotate: true, 16135 perSlideRotate: 2, 16136 perSlideOffset: 8 16137 } 16138 }); 16139 const setTranslate = () => { 16140 const { 16141 slides, 16142 activeIndex, 16143 rtlTranslate: rtl 16144 } = swiper; 16145 const params = swiper.params.cardsEffect; 16146 const { 16147 startTranslate, 16148 isTouched 16149 } = swiper.touchEventsData; 16150 const currentTranslate = rtl ? -swiper.translate : swiper.translate; 16151 for (let i = 0; i < slides.length; i += 1) { 16152 const slideEl = slides[i]; 16153 const slideProgress = slideEl.progress; 16154 const progress = Math.min(Math.max(slideProgress, -4), 4); 16155 let offset = slideEl.swiperSlideOffset; 16156 if (swiper.params.centeredSlides && !swiper.params.cssMode) { 16157 swiper.wrapperEl.style.transform = `translateX(${swiper.minTranslate()}px)`; 16158 } 16159 if (swiper.params.centeredSlides && swiper.params.cssMode) { 16160 offset -= slides[0].swiperSlideOffset; 16161 } 16162 let tX = swiper.params.cssMode ? -offset - swiper.translate : -offset; 16163 let tY = 0; 16164 const tZ = -100 * Math.abs(progress); 16165 let scale = 1; 16166 let rotate = -params.perSlideRotate * progress; 16167 let tXAdd = params.perSlideOffset - Math.abs(progress) * 0.75; 16168 const slideIndex = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.from + i : i; 16169 const isSwipeToNext = (slideIndex === activeIndex || slideIndex === activeIndex - 1) && progress > 0 && progress < 1 && (isTouched || swiper.params.cssMode) && currentTranslate < startTranslate; 16170 const isSwipeToPrev = (slideIndex === activeIndex || slideIndex === activeIndex + 1) && progress < 0 && progress > -1 && (isTouched || swiper.params.cssMode) && currentTranslate > startTranslate; 16171 if (isSwipeToNext || isSwipeToPrev) { 16172 const subProgress = (1 - Math.abs((Math.abs(progress) - 0.5) / 0.5)) ** 0.5; 16173 rotate += -28 * progress * subProgress; 16174 scale += -0.5 * subProgress; 16175 tXAdd += 96 * subProgress; 16176 tY = `${-25 * subProgress * Math.abs(progress)}%`; 16177 } 16178 if (progress < 0) { 16179 // next 16180 tX = `calc(${tX}px ${rtl ? '-' : '+'} (${tXAdd * Math.abs(progress)}%))`; 16181 } else if (progress > 0) { 16182 // prev 16183 tX = `calc(${tX}px ${rtl ? '-' : '+'} (-${tXAdd * Math.abs(progress)}%))`; 16184 } else { 16185 tX = `${tX}px`; 16186 } 16187 if (!swiper.isHorizontal()) { 16188 const prevY = tY; 16189 tY = tX; 16190 tX = prevY; 16191 } 16192 const scaleString = progress < 0 ? `${1 + (1 - scale) * progress}` : `${1 - (1 - scale) * progress}`; 16193 16194 /* eslint-disable */ 16195 const transform = ` 16196 translate3d(${tX}, ${tY}, ${tZ}px) 16197 rotateZ(${params.rotate ? rtl ? -rotate : rotate : 0}deg) 16198 scale(${scaleString}) 16199 `; 16200 /* eslint-enable */ 16201 16202 if (params.slideShadows) { 16203 // Set shadows 16204 let shadowEl = slideEl.querySelector('.swiper-slide-shadow'); 16205 if (!shadowEl) { 16206 shadowEl = createShadow('cards', slideEl); 16207 } 16208 if (shadowEl) shadowEl.style.opacity = Math.min(Math.max((Math.abs(progress) - 0.5) / 0.5, 0), 1); 16209 }
16210 slideEl.style.zIndex = -Math.abs(Math.round(slideProgress)) + slides.length; 16211 const targetEl = effectTarget(params, slideEl); 16212 targetEl.style.transform = transform; 16213 } 16214 }; 16215 const setTransition = duration => { 16216 const transformElements = swiper.slides.map(slideEl => getSlideTransformEl(slideEl)); 16217 transformElements.forEach(el => { 16218 el.style.transitionDuration = `${duration}ms`; 16219 el.querySelectorAll('.swiper-slide-shadow').forEach(shadowEl => { 16220 shadowEl.style.transitionDuration = `${duration}ms`; 16221 }); 16222 }); 16223 effectVirtualTransitionEnd({ 16224 swiper, 16225 duration, 16226 transformElements 16227 }); 16228 }; 16229 effectInit({ 16230 effect: 'cards', 16231 swiper, 16232 on, 16233 setTranslate, 16234 setTransition, 16235 perspective: () => true, 16236 overwriteParams: () => ({ 16237 watchSlidesProgress: true, 16238 virtualTranslate: !swiper.params.cssMode 16239 }) 16240 }); 16241 } 16242 16243 /** 16244 * Swiper 11.1.12 16245 * Most modern mobile touch slider and framework with hardware accelerated transitions 16246 * https://swiperjs.com 16247 * 16248 * Copyright 2014-2024 Vladimir Kharlampidi 16249 * 16250 * Released under the MIT License 16251 * 16252 * Released on: September 1, 2024 16253 */ 16254 16255 16256 // Swiper Class 16257 const modules = [Virtual, Keyboard, Mousewheel, Navigation, Pagination, Scrollbar, Parallax, Zoom, Controller, A11y, History, HashNavigation, Autoplay, Thumb, freeMode, Grid, Manipulation, EffectFade, EffectCube, EffectFlip, EffectCoverflow, EffectCreative, EffectCards]; 16258 Swiper.use(modules); 16259 16260 return Swiper; 16261 16262})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.